Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Bulmer authored Nov 12, 2023
0 parents commit 99083f0
Show file tree
Hide file tree
Showing 18 changed files with 3,832 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
lib
15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "jest"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"prettier"
],
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"]
}
}
16 changes: 16 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "CodeQL"

on:
push:
branches:
- main
pull_request:
branches:
- main
paths-ignore:
- "**/*.md"
- "**/*.txt"

jobs:
analyze:
uses: CodrJS/cicd/.github/workflows/codeql.yml@main
24 changes: 24 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build and Publish NPM Module

on:
workflow_dispatch:
push:
branches:
- "**"
pull_request:
branches:
- main
release:
types:
- created

jobs:
build:
uses: CodrJS/cicd/.github/workflows/node-build-artifact.yml@main
test:
uses: CodrJS/cicd/.github/workflows/node-test-artifact.yml@main
needs: build
publish:
uses: CodrJS/cicd/.github/workflows/node-publish-npm.yml@main
needs: test
secrets: inherit
132 changes: 132 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
# .env.development.local
# .env.test.local
# .env.production.local
# .env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

lib/
10 changes: 10 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# dirs
src/
.github/

# files
.eslintignore
.eslintrc.js
.prettierrc
jestconfig.json
tsconfig.json
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 80,
"trailingComma": "all",
"singleQuote": false,
"semi": true,
"arrowParens": "avoid"
}
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2023-present Dylan Bulmer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @codrjs/[template]

<!-- ![npm version](https://img.shields.io/npm/v/@codrjs/core) -->
<!-- [![CodeQL](https://github.com/CodrJS/Core/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/CodrJS/Core/actions/workflows/codeql.yml) -->

## Purpose

## Getting started

## TODO

- [ ]

15 changes: 15 additions & 0 deletions bin/post-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cp package.json README.md dist/
rm -rf ./dist/types/__tests__
rm -rf ./dist/esm/__tests__

cat >dist/cjs/package.json <<!EOF
{
"type": "commonjs"
}
!EOF

cat >dist/esm/package.json <<!EOF
{
"type": "module"
}
!EOF
7 changes: 7 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"transform": {
"^.+\\.(t|j)sx?$": "@swc/jest"
},
"testRegex": "/dist/cjs/__tests__/.*\\.(test|spec)\\.(jsx?|tsx?)$",
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
}
49 changes: 49 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "@codrjs/template",
"version": "1.0.0",
"description": "",
"main": "./cjs/index.js",
"module": "./esm/index.js",
"types": "./types/index.d.ts",
"repository": "[email protected]:CodrJS/ts-npm-template.git",
"author": "Dylan Bulmer <[email protected]>",
"license": "MIT",
"type": "module",
"private": false,
"exports": {
".": {
"require": "./cjs/index.js",
"import": "./esm/index.js",
"types": "./types/index.d.ts"
}
},
"scripts": {
"test": "jest --config jest.config.json --passWithNoTests --coverage",
"build:esm": "tsc --project tsconfig.esm.json",
"build:cjs": "tsc --project tsconfig.cjs.json",
"build": "yarn clean && yarn build:cjs && yarn build:esm && ./bin/post-build.sh",
"clean": "rm -rf ./dist",
"format": "prettier --write \"src/**/*.(ts|js)\"",
"lint": "eslint -c .eslintrc.json --ignore-path .eslintignore --ext .ts src",
"preversion": "yarn lint",
"version": "yarn format && git add -A src",
"postversion": "git push && git push --tags",
"convert": "taplo get -f src/examples/project.toml -o json > src/examples/project.json"
},
"devDependencies": {
"@swc/cli": "^0.1.57",
"@swc/core": "^1.3.22",
"@swc/jest": "^0.2.24",
"@types/jest": "^29.0.3",
"@types/node": "^18.7.21",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^27.0.4",
"jest": "^29.0.3",
"prettier": "^2.7.1",
"typescript": "^4.9.4"
},
"dependencies": {}
}
Empty file added src/__tests__/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Hello World");
Loading

0 comments on commit 99083f0

Please sign in to comment.