generated from webdeveric/dual-ts-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5f133fb
Showing
30 changed files
with
8,296 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
cache/ | ||
coverage/ | ||
dist/ | ||
node_modules/ | ||
private/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"root": true, | ||
"extends": ["@webdeveric/eslint-config-ts", "plugin:import/recommended", "plugin:import/typescript", "prettier"], | ||
"env": { | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"project": ["./tsconfig.json"], | ||
"EXPERIMENTAL_useProjectService": true | ||
}, | ||
"settings": { | ||
"import/extensions": [".ts", ".mts", ".cts", ".js", ".json"], | ||
"import/resolver": { | ||
"typescript": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"node": { | ||
"extensions": [".js", ".ts", ".mts", ".cts"] | ||
} | ||
}, | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts", ".mts", ".cts"] | ||
} | ||
}, | ||
"rules": { | ||
"import/first": "error", | ||
"import/no-absolute-path": "error", | ||
"import/no-cycle": "error", | ||
"import/no-deprecated": "error", | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"devDependencies": ["./vitest.config.mts", "./lint-staged.config.mjs", "./test/**/*"] | ||
} | ||
], | ||
"import/no-relative-packages": "error", | ||
"import/no-self-import": "error", | ||
"import/no-unresolved": "error", | ||
"import/no-useless-path-segments": [ | ||
"error", | ||
{ | ||
"noUselessIndex": false | ||
} | ||
], | ||
"import/order": [ | ||
"error", | ||
{ | ||
"alphabetize": { | ||
"order": "asc", | ||
"caseInsensitive": true | ||
}, | ||
"groups": ["builtin", "external", "internal", "parent", ["sibling", "index"], "type"], | ||
"newlines-between": "always" | ||
} | ||
], | ||
"sort-imports": "off" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["**/*.test.ts"], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "off" | ||
} | ||
} | ||
] | ||
} |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @webdeveric |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: [webdeveric] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Node.js CI | ||
|
||
on: [push] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ci: | ||
name: Continuous Integration | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'pnpm' | ||
- name: Installing dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Linting | ||
run: pnpm lint | ||
- name: Type checking | ||
run: pnpm typecheck | ||
- name: Testing | ||
run: pnpm coverage | ||
- name: Building | ||
run: pnpm build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read # for checkout | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
id-token: write # to enable use of OIDC for npm provenance | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'pnpm' | ||
|
||
- name: Installing dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
# https://github.com/pnpm/pnpm/issues/7909 | ||
# - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies | ||
# run: npm audit signatures | ||
|
||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Set this value in your repository secrets after you generate it at NPM. | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_CONFIG_PROVENANCE: true | ||
run: npx --no semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
cache/ | ||
coverage/ | ||
dist/ | ||
node_modules/ | ||
private/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx --no -- commitlint --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx --no lint-staged -- --relative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# https://pnpm.io/npmrc | ||
# node-linker=hoisted | ||
# symlink=false | ||
# shared-workspace-lockfile=false | ||
auto-install-peers=true | ||
enable-pre-post-scripts=true | ||
engine-strict=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.vscode/ | ||
cache/ | ||
coverage/ | ||
dist/ | ||
node_modules/ | ||
private/ | ||
.editorconfig | ||
.npmrc | ||
.nvmrc | ||
.prettierignore | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Eric King | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* @type {import('@commitlint/types').UserConfig} | ||
*/ | ||
export default { | ||
extends: ['@commitlint/config-conventional'], | ||
plugins: ['commitlint-plugin-cspell'], | ||
rules: { | ||
'cspell/type': [2, 'always'], | ||
'cspell/scope': [2, 'always'], | ||
'cspell/subject': [2, 'always'], | ||
'cspell/body': [2, 'always'], | ||
'cspell/footer': [2, 'always'], | ||
'scope-case': [2, 'always', ['lower-case', 'upper-case']], | ||
'subject-empty': [2, 'never'], | ||
'subject-case': [2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']], | ||
'type-case': [2, 'always', 'lower-case'], | ||
'type-empty': [2, 'never'], | ||
'type-enum': [ | ||
2, | ||
'always', | ||
['feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'build', 'ci', 'chore', 'revert'], | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"version": "0.2", | ||
"language": "en", | ||
"words": [ | ||
"CODEOWNERS", | ||
"commitlint", | ||
"conventionalcommits", | ||
"nvmrc", | ||
"postbuild", | ||
"tsbuildinfo", | ||
"typecheck", | ||
"vitest", | ||
"webdeveric" | ||
], | ||
"flagWords": [], | ||
"ignorePaths": ["pnpm-lock.yaml", "node_modules", ".vscode"], | ||
"languageSettings": [ | ||
{ | ||
"languageId": "commit-msg", | ||
"ignoreRegExpList": ["/^#.*/gm"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @type {Record<string, string | string[] | ((filenames: string[]) => string | string[] | Promise<string | string[]>)>} | ||
*/ | ||
export default { | ||
'*.{js,cjs,mjs,ts,cts,mts}': ['eslint --fix', 'prettier --write'], | ||
'*.{json,md}': 'prettier --write', | ||
'*': (files) => { | ||
return [ | ||
`cspell lint --no-progress --no-summary --no-must-find-files ${files.join(' ')}`, | ||
`sh -c 'echo "${files.join('\n')}" | cspell --show-context stdin'`, // Spell check file names. | ||
]; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"name": "@webdeveric/dual-ts-package-template", | ||
"description": "", | ||
"version": "0.0.0", | ||
"keywords": [], | ||
"author": "Eric King <eric@webdeveric.com> (https://webdeveric.com/)", | ||
"private": false, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/webdeveric/dual-ts-package-template.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/webdeveric/dual-ts-package-template/issues" | ||
}, | ||
"license": "MIT", | ||
"packageManager": "pnpm@9.14.3+sha512.c0f53ee99477ed969b82b289ad011a5d16bf1623c957e7f29eabe8d0c00b574c29b8c7f54f6c67ee710c73f285c8154d07ce44b46fe2c0eeb476a90441bac371", | ||
"sideEffects": false, | ||
"engines": { | ||
"node": ">=20.0.0" | ||
}, | ||
"type": "module", | ||
"main": "./dist/mjs/index.js", | ||
"types": "./dist/types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/types/index.d.ts", | ||
"require": "./dist/cjs/index.js", | ||
"import": "./dist/mjs/index.js" | ||
}, | ||
"./*": { | ||
"types": "./dist/types/*.d.ts", | ||
"require": "./dist/cjs/*.js", | ||
"import": "./dist/mjs/*.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"clean": "rimraf ./dist/", | ||
"prebuild": "pnpm clean", | ||
"build": "tsc --build tsconfig.cjs.json tsconfig.mjs.json --force", | ||
"validate": "validate-package-exports --check --verify --info", | ||
"postbuild": "echo '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json && echo '{\"type\":\"module\"}' > ./dist/mjs/package.json && pnpm validate", | ||
"typecheck": "tsc --build --verbose", | ||
"lint": "eslint ./*.{js,cjs,mjs,ts,cts,mts} ./src/ ./test/ --ext .ts,.mjs,.cjs", | ||
"test": "vitest", | ||
"coverage": "vitest --coverage", | ||
"spellcheck": "cspell './{.github,src,test}/**/*.{ts,json}' './*.{js,json,md,mjs,mts}' './package.json' --no-progress", | ||
"prepublishOnly": "pnpm typecheck && pnpm spellcheck && pnpm lint && pnpm coverage && pnpm build", | ||
"format": "prettier --write ./*.{js,json,md,mjs,mts} ./src/ ./test/", | ||
"prepare": "husky" | ||
}, | ||
"prettier": "@webdeveric/prettier-config", | ||
"devDependencies": { | ||
"@commitlint/config-conventional": "^19.6.0", | ||
"@commitlint/types": "^19.5.0", | ||
"@types/node": "^22.10.1", | ||
"@vitest/coverage-v8": "^2.1.6", | ||
"@webdeveric/eslint-config-ts": "^0.11.0", | ||
"@webdeveric/prettier-config": "^0.3.0", | ||
"commitlint": "^19.6.0", | ||
"commitlint-plugin-cspell": "^0.1.1", | ||
"conventional-changelog-conventionalcommits": "^8.0.0", | ||
"cspell": "^8.16.1", | ||
"eslint": "^8.57.1", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-import-resolver-typescript": "^3.6.3", | ||
"eslint-plugin-import": "^2.31.0", | ||
"husky": "^9.1.7", | ||
"lint-staged": "^15.2.10", | ||
"prettier": "^3.4.1", | ||
"rimraf": "^6.0.1", | ||
"semantic-release": "^24.2.0", | ||
"typescript": "^5.7.2", | ||
"validate-package-exports": "^0.8.0", | ||
"vitest": "^2.1.6" | ||
} | ||
} |
Oops, something went wrong.