@kitschpatrol/create-project 1.2.9 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +14 -13
- package/readme.md +1 -2
- package/templates/cli/.gitattributes +2 -0
- package/templates/cli/.github/workflows/ci.yml +51 -0
- package/templates/cli/.github/workflows/github-release.yml +18 -6
- package/templates/cli/.github/workflows/set-github-metadata.yml +5 -2
- package/templates/cli/.prettierignore +1 -0
- package/templates/cli/.vscode/settings.json +1 -1
- package/templates/cli/mdat.config.ts +1 -3
- package/templates/cli/package.json +12 -9
- package/templates/cli/readme.md +0 -2
- package/templates/cli/test/cli.test.ts +2 -1
- package/templates/cli/test/index.bench.ts +7 -0
- package/templates/cli+library/.gitattributes +2 -0
- package/templates/cli+library/.github/workflows/ci.yml +51 -0
- package/templates/cli+library/.github/workflows/github-release.yml +18 -6
- package/templates/cli+library/.github/workflows/set-github-metadata.yml +5 -2
- package/templates/cli+library/.prettierignore +1 -0
- package/templates/cli+library/.vscode/settings.json +1 -1
- package/templates/cli+library/mdat.config.ts +1 -3
- package/templates/cli+library/package.json +12 -9
- package/templates/cli+library/readme.md +0 -2
- package/templates/cli+library/test/cli.test.ts +3 -1
- package/templates/cli+library/test/index.bench.ts +7 -0
- package/templates/electron/.gitattributes +2 -0
- package/templates/electron/.github/workflows/ci.yml +51 -0
- package/templates/electron/.github/workflows/github-release.yml +18 -6
- package/templates/electron/.github/workflows/set-github-metadata.yml +5 -2
- package/templates/electron/.prettierignore +1 -0
- package/templates/electron/.vscode/settings.json +1 -1
- package/templates/electron/knip.config.ts +1 -0
- package/templates/electron/package.json +12 -9
- package/templates/electron/readme.md +0 -2
- package/templates/electron/test/index.bench.ts +7 -0
- package/templates/library/.gitattributes +2 -0
- package/templates/library/.github/workflows/ci.yml +51 -0
- package/templates/library/.github/workflows/github-release.yml +18 -6
- package/templates/library/.github/workflows/set-github-metadata.yml +5 -2
- package/templates/library/.prettierignore +1 -0
- package/templates/library/.vscode/settings.json +1 -1
- package/templates/library/package.json +11 -8
- package/templates/library/readme.md +0 -2
- package/templates/library/test/index.bench.ts +7 -0
- package/templates/minimal/.gitattributes +2 -0
- package/templates/minimal/.github/workflows/ci.yml +51 -0
- package/templates/minimal/.github/workflows/github-release.yml +18 -6
- package/templates/minimal/.github/workflows/set-github-metadata.yml +5 -2
- package/templates/minimal/.vscode/settings.json +1 -1
- package/templates/minimal/package.json +11 -4
- package/templates/minimal/readme.md +0 -2
- package/templates/unplugin/.gitattributes +2 -0
- package/templates/unplugin/.github/workflows/ci.yml +51 -0
- package/templates/unplugin/.github/workflows/github-release.yml +18 -6
- package/templates/unplugin/.github/workflows/set-github-metadata.yml +5 -2
- package/templates/unplugin/.prettierignore +1 -0
- package/templates/unplugin/.vscode/settings.json +1 -1
- package/templates/unplugin/eslint.config.ts +24 -7
- package/templates/unplugin/knip.config.ts +13 -1
- package/templates/unplugin/package.json +49 -8
- package/templates/unplugin/playground/env.d.ts +4 -0
- package/templates/unplugin/playground/index.html +23 -0
- package/templates/unplugin/playground/main.ts +1 -0
- package/templates/unplugin/playground/package.json +16 -0
- package/templates/unplugin/playground/readme.md +11 -0
- package/templates/unplugin/playground/vite.config.ts +16 -0
- package/templates/unplugin/pnpm-workspace.yaml +5 -1
- package/templates/unplugin/readme.md +0 -2
- package/templates/unplugin/src/core/options.ts +5 -3
- package/templates/unplugin/src/index.ts +1 -1
- package/templates/unplugin/test/index.bench.ts +7 -0
- package/templates/web/.gitattributes +2 -0
- package/templates/web/.github/workflows/ci.yml +51 -0
- package/templates/web/.github/workflows/github-release.yml +18 -6
- package/templates/web/.github/workflows/set-github-metadata.yml +5 -2
- package/templates/web/.prettierignore +2 -0
- package/templates/web/.vscode/settings.json +1 -1
- package/templates/web/package.json +19 -10
- package/templates/web/readme.md +0 -2
- package/templates/web/test/index.bench.ts +7 -0
- package/templates/cli/.npmrc +0 -2
- package/templates/cli+library/.npmrc +0 -2
- package/templates/electron/.npmrc +0 -2
- package/templates/library/.npmrc +0 -2
- package/templates/minimal/.npmrc +0 -2
- package/templates/unplugin/.npmrc +0 -2
- package/templates/web/.npmrc +0 -2
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createTemplate as e,runTemplateCLI as t}from"bingo";import{intakeDirectory as n}from"bingo-fs";import{handlebars as r}from"bingo-handlebars";import i from"node:path";import{z as a}from"zod";
|
|
2
|
+
import{createTemplate as e,runTemplateCLI as t}from"bingo";import{intakeDirectory as n}from"bingo-fs";import{handlebars as r}from"bingo-handlebars";import i from"node:path";import{z as a}from"zod";const o=[`minimal`,`web`,`cli`,`library`,`cli+library`,`electron`,`unplugin`],s=/node_modules|pnpm-lock\.yaml/;var c=e({about:{description:`Create a new TypeScript library, CLI, or web project with Kitschpatrol's shared configuration.`,name:`Create Kitschpatrol Project`},options:{type:a.enum(o).default(`minimal`).describe(`The type of project to create`),"author-name":a.string().default(`Eric Mika`).describe(`The name of the author`),"author-email":a.string().default(`eric@ericmika.com`).describe(`The email of the author`),"author-url":a.string().default(`https://ericmika.com`).describe(`The URL of the author`),"cli-command-name":a.string().default(`new-project`).describe(`CLI command name (if applicable)`),"github-owner":a.string().default(`kitschpatrol`).describe(`The owner of the repository`),"github-repository":a.string().default(`new-project`).describe(`The name of the repository / package`),"npm-auth-command":a.string().default(`op read 'op://Personal/npm/token'`).describe(`A shell command that sets the NPM_AUTH_TOKEN env variable with a granular token for publishing to npm`)},async produce({options:e}){let t={...e,year:new Date().getFullYear()};async function a(...n){let a={};for(let o of n)a[o]=await r(i.join(import.meta.dirname,`../templates/${e.type}/${o}`),t);return a}return{files:{...await n(i.join(import.meta.dirname,`../templates/${e.type}`),{exclude:s}),...await a(`license.txt`,`package.json`,...e.type===`unplugin`?[`playground/package.json`,`src/bun.ts`,`src/esbuild.ts`,`src/farm.ts`,`src/index.ts`,`src/rolldown.ts`,`src/rollup.ts`,`src/rspack.ts`,`src/vite.ts`,`src/webpack.ts`,`test/__snapshots__/rollup.test.ts.snap`]:[])},scripts:[{commands:e.type===`electron`?[`pnpm install`,`pnpm run fix`]:[`pnpm install`,`pnpm run build`,`pnpm run fix`],phase:0,silent:!0}],suggestions:[`git commit --amend -m 'Initial commit.'`]}}});process.exitCode=await t(c);export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/create-project",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Kitschpatrol's TypeScript project templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dist",
|
|
27
27
|
"templates",
|
|
28
28
|
"templates/**/.gitignore",
|
|
29
|
-
"
|
|
29
|
+
"!**/node_modules"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"bingo": "^0.9.2",
|
|
@@ -35,14 +35,15 @@
|
|
|
35
35
|
"zod": "^3.25.76"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@kitschpatrol/shared-config": "^
|
|
39
|
-
"@types/node": "~20.19.
|
|
38
|
+
"@kitschpatrol/shared-config": "^7.2.0",
|
|
39
|
+
"@types/node": "~20.19.39",
|
|
40
40
|
"bumpp": "^11.0.1",
|
|
41
|
-
"mdat": "^
|
|
42
|
-
"
|
|
43
|
-
"
|
|
41
|
+
"mdat": "^2.2.1",
|
|
42
|
+
"shx": "^0.4.0",
|
|
43
|
+
"taze": "^19.11.0",
|
|
44
|
+
"tsdown": "^0.21.7",
|
|
44
45
|
"typescript": "~5.9.3",
|
|
45
|
-
"vitest": "^4.1.
|
|
46
|
+
"vitest": "^4.1.4"
|
|
46
47
|
},
|
|
47
48
|
"engines": {
|
|
48
49
|
"node": ">=20.19.0"
|
|
@@ -58,12 +59,12 @@
|
|
|
58
59
|
},
|
|
59
60
|
"scripts": {
|
|
60
61
|
"build": "tsdown",
|
|
61
|
-
"clean": "
|
|
62
|
-
"fix": "ksc fix",
|
|
63
|
-
"lint": "ksc
|
|
64
|
-
"release": "bumpp --commit 'Release: %s' && pnpm
|
|
62
|
+
"clean": "shx rm -f pnpm-lock.yaml && git clean -fdX -e !.claude/",
|
|
63
|
+
"fix": "ksc fix --skip mdat && mdat readme.md",
|
|
64
|
+
"lint": "ksc fix --skip mdat",
|
|
65
|
+
"release": "bumpp --commit 'Release: %s' && pnpm build && NPM_AUTH_TOKEN=$(op read 'op://Personal/npm/token') && pnpm publish",
|
|
65
66
|
"test": "vitest run",
|
|
66
67
|
"update-templates": "for dir in ./templates/*; do taze -w --cwd \"$dir\"; done",
|
|
67
|
-
"update-templates-major": "for dir in ./templates/*; do taze major -w --cwd \"$dir\" --exclude @types/node; done"
|
|
68
|
+
"update-templates-major": "for dir in ./templates/*; do taze major -w --cwd \"$dir\" --exclude @types/node,typescript,zod,vite; done"
|
|
68
69
|
}
|
|
69
70
|
}
|
package/readme.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
<!--+ Warning: Content inside HTML comment blocks was generated by mdat and may be overwritten. +-->
|
|
2
|
-
|
|
3
1
|
<!-- title -->
|
|
4
2
|
|
|
5
3
|
# @kitschpatrol/create-project
|
|
@@ -10,6 +8,7 @@
|
|
|
10
8
|
|
|
11
9
|
[](https://npmjs.com/package/@kitschpatrol/create-project)
|
|
12
10
|
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](https://github.com/kitschpatrol/create-project/actions/workflows/ci.yml)
|
|
13
12
|
|
|
14
13
|
<!-- /badges -->
|
|
15
14
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request: {}
|
|
7
|
+
workflow_dispatch: {}
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
|
|
14
|
+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
ci:
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
timeout-minutes: 20
|
|
20
|
+
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout
|
|
28
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
29
|
+
with:
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
|
|
32
|
+
- name: Install pnpm
|
|
33
|
+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
|
|
34
|
+
|
|
35
|
+
- name: Setup Node.js
|
|
36
|
+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
|
|
37
|
+
with:
|
|
38
|
+
node-version: 24
|
|
39
|
+
cache: 'pnpm'
|
|
40
|
+
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: pnpm install --frozen-lockfile
|
|
43
|
+
|
|
44
|
+
- name: Build
|
|
45
|
+
run: pnpm run build
|
|
46
|
+
|
|
47
|
+
- name: Lint
|
|
48
|
+
run: pnpm run lint
|
|
49
|
+
|
|
50
|
+
- name: Test
|
|
51
|
+
run: pnpm run test
|
|
@@ -4,6 +4,10 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
6
|
- 'v[0-9]*'
|
|
7
|
+
- '[0-9]*'
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
7
11
|
|
|
8
12
|
jobs:
|
|
9
13
|
build:
|
|
@@ -16,13 +20,17 @@ jobs:
|
|
|
16
20
|
|
|
17
21
|
steps:
|
|
18
22
|
- name: Checkout
|
|
19
|
-
uses: actions/checkout@v6
|
|
23
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
20
24
|
with:
|
|
21
25
|
fetch-depth: 0
|
|
26
|
+
persist-credentials: false
|
|
22
27
|
|
|
23
28
|
- name: Log Token Type
|
|
29
|
+
env:
|
|
30
|
+
TOKEN: ${{ env.ACCESS_TOKEN }}
|
|
31
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
24
32
|
run: |
|
|
25
|
-
if [ $
|
|
33
|
+
if [ "$TOKEN" = "$GH_TOKEN" ]; then
|
|
26
34
|
echo "🗝️ Authenticated with GitHub Token"
|
|
27
35
|
else
|
|
28
36
|
echo "🔑 Authenticated with Personal Access token"
|
|
@@ -31,7 +39,7 @@ jobs:
|
|
|
31
39
|
- name: Validate Tag and Branch
|
|
32
40
|
id: validation
|
|
33
41
|
run: |
|
|
34
|
-
TAG=$(git tag --contains HEAD | grep '^v[0-9]' | head -n 1)
|
|
42
|
+
TAG=$(git tag --contains HEAD | grep -E '^v?[0-9]' | head -n 1)
|
|
35
43
|
echo "🏷️ Tag for commit is: $TAG"
|
|
36
44
|
BRANCH=$(git branch -r --contains tags/${GITHUB_REF_NAME} | grep 'origin/main' | xargs)
|
|
37
45
|
if [[ -z "$BRANCH" ]]; then
|
|
@@ -75,7 +83,11 @@ jobs:
|
|
|
75
83
|
|
|
76
84
|
- name: Log Release Details
|
|
77
85
|
if: env.IS_VALID_COMMIT == 'true'
|
|
86
|
+
env:
|
|
87
|
+
TAG: ${{ env.TAG_NAME }}
|
|
88
|
+
RELEASE_URL: ${{ steps.release.outputs.url }}
|
|
89
|
+
RELEASE_ID: ${{ steps.release.outputs.id }}
|
|
78
90
|
run: |
|
|
79
|
-
echo "📦 Successfully released: $
|
|
80
|
-
echo "🔗 Release URL: $
|
|
81
|
-
echo "🪪 Release ID: $
|
|
91
|
+
echo "📦 Successfully released: $TAG"
|
|
92
|
+
echo "🔗 Release URL: $RELEASE_URL"
|
|
93
|
+
echo "🪪 Release ID: $RELEASE_ID"
|
|
@@ -4,6 +4,9 @@ on:
|
|
|
4
4
|
branches: [main]
|
|
5
5
|
workflow_dispatch: {}
|
|
6
6
|
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
7
10
|
jobs:
|
|
8
11
|
build:
|
|
9
12
|
name: Set GitHub Metadata
|
|
@@ -11,9 +14,9 @@ jobs:
|
|
|
11
14
|
|
|
12
15
|
steps:
|
|
13
16
|
- name: Checkout
|
|
14
|
-
uses: actions/checkout@v6
|
|
17
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
15
18
|
with:
|
|
16
|
-
|
|
19
|
+
persist-credentials: false
|
|
17
20
|
|
|
18
21
|
- name: Sync Package info to GitHub
|
|
19
22
|
uses: kitschpatrol/github-action-repo-sync@v5
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
".env": ".env.*, .template.env",
|
|
51
51
|
"*.js": "${basename}.ts.map, ${basename}.js.map, ${basename}.d.ts, ${basename}.d.ts.map, ${basename}.d.js.map",
|
|
52
52
|
"*.ts": "${basename}.ts.map, ${basename}.d.ts, ${basename}.d.ts.map",
|
|
53
|
-
"package.json": ".*.cjs, .*.cts, .*.js, .*.json, .*.json5, .*.jsonc, .*.mjs, .*.mts, .*.toml, .*.ts, .*.yaml, .*.yml, .*ignore, .*rc, .node-version, *config.cjs, *config.cts, *config.js, *config.json, *config.json5, *config.jsonc, *config.mjs, *config.mts, *config.toml, *config.ts, *config.yaml, *config.yml, tsconfig.*.json, lerna.json, netlify.toml, package-lock.json, pnpm*, skills-lock.json, turbo.json, vercel.json, workspace*, wrangler.toml, wrangler.json, wrangler.jsonc, yarn.lock, yarn*",
|
|
53
|
+
"package.json": ".*.cjs, .*.cts, .*.js, .*.json, .*.json5, .*.jsonc, .*.mjs, .*.mts, .*.toml, .*.ts, .*.yaml, .*.yml, .*attributes, .*ignore, .*rc, .node-version, *config.cjs, *config.cts, *config.js, *config.json, *config.json5, *config.jsonc, *config.mjs, *config.mts, *config.toml, *config.ts, *config.yaml, *config.yml, tsconfig.*.json, lerna.json, netlify.toml, package-lock.json, pnpm*, skills-lock.json, turbo.json, vercel.json, workspace*, wrangler.toml, wrangler.json, wrangler.jsonc, yarn.lock, yarn*",
|
|
54
54
|
"readme.md": "authors*, backers*, changelog*, citation*, code_of_conduct*, contributing*, contributors*, copying*, credits*, governance*, history*, license*, maintainers*, release_notes*, security*, sponsors*"
|
|
55
55
|
},
|
|
56
56
|
"prettier.documentSelectors": [
|
|
@@ -27,29 +27,32 @@
|
|
|
27
27
|
"dist/*"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
+
"bench": "vitest bench --run --compare test/benchmarks/baseline.json",
|
|
31
|
+
"bench:baseline": "vitest bench --run --outputJson test/benchmarks/baseline.json",
|
|
30
32
|
"build": "tsdown",
|
|
31
|
-
"clean": "
|
|
33
|
+
"clean": "shx rm -f pnpm-lock.yaml && git clean -fdX -e !.claude/",
|
|
32
34
|
"fix": "ksc fix",
|
|
33
35
|
"lint": "ksc lint",
|
|
34
|
-
"release": "bumpp --commit 'Release: %s' && pnpm
|
|
36
|
+
"release": "bumpp --commit 'Release: %s' && pnpm build && NPM_AUTH_TOKEN=$({{{npm-auth-command}}}) && pnpm publish",
|
|
35
37
|
"test": "vitest run"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"@types/node": "~20.19.
|
|
40
|
+
"@types/node": "~20.19.39",
|
|
39
41
|
"@types/yargs": "^17.0.35",
|
|
40
|
-
"lognow": "^0.
|
|
42
|
+
"lognow": "^0.6.1",
|
|
41
43
|
"yargs": "^18.0.0"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
|
-
"@kitschpatrol/shared-config": "^
|
|
46
|
+
"@kitschpatrol/shared-config": "^7.2.0",
|
|
45
47
|
"bumpp": "^11.0.1",
|
|
46
|
-
"mdat-plugin-cli-help": "^1.
|
|
48
|
+
"mdat-plugin-cli-help": "^2.1.2",
|
|
47
49
|
"publint": "^0.3.18",
|
|
48
|
-
"
|
|
50
|
+
"shx": "^0.4.0",
|
|
51
|
+
"tsdown": "^0.21.7",
|
|
49
52
|
"typescript": "~5.9.3",
|
|
50
|
-
"vitest": "^4.1.
|
|
53
|
+
"vitest": "^4.1.4"
|
|
51
54
|
},
|
|
52
|
-
"packageManager": "pnpm@10.
|
|
55
|
+
"packageManager": "pnpm@10.33.0",
|
|
53
56
|
"engines": {
|
|
54
57
|
"node": ">=20.19.0"
|
|
55
58
|
},
|
package/templates/cli/readme.md
CHANGED
|
@@ -18,11 +18,12 @@ async function run(...args: string[]): Promise<{ code: number; stderr: string; s
|
|
|
18
18
|
})
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
const VERSION_REGEX = /\d+\.\d+\.\d+/
|
|
21
22
|
describe('cli', () => {
|
|
22
23
|
it('should print version with --version', async () => {
|
|
23
24
|
const { code, stdout } = await run('--version')
|
|
24
25
|
expect(code).toBe(0)
|
|
25
|
-
expect(stdout.trim()).toMatch(
|
|
26
|
+
expect(stdout.trim()).toMatch(VERSION_REGEX)
|
|
26
27
|
})
|
|
27
28
|
|
|
28
29
|
it('should print help with --help', async () => {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request: {}
|
|
7
|
+
workflow_dispatch: {}
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
|
|
14
|
+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
ci:
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
timeout-minutes: 20
|
|
20
|
+
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout
|
|
28
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
29
|
+
with:
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
|
|
32
|
+
- name: Install pnpm
|
|
33
|
+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
|
|
34
|
+
|
|
35
|
+
- name: Setup Node.js
|
|
36
|
+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
|
|
37
|
+
with:
|
|
38
|
+
node-version: 24
|
|
39
|
+
cache: 'pnpm'
|
|
40
|
+
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: pnpm install --frozen-lockfile
|
|
43
|
+
|
|
44
|
+
- name: Build
|
|
45
|
+
run: pnpm run build
|
|
46
|
+
|
|
47
|
+
- name: Lint
|
|
48
|
+
run: pnpm run lint
|
|
49
|
+
|
|
50
|
+
- name: Test
|
|
51
|
+
run: pnpm run test
|
|
@@ -4,6 +4,10 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
6
|
- 'v[0-9]*'
|
|
7
|
+
- '[0-9]*'
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
7
11
|
|
|
8
12
|
jobs:
|
|
9
13
|
build:
|
|
@@ -16,13 +20,17 @@ jobs:
|
|
|
16
20
|
|
|
17
21
|
steps:
|
|
18
22
|
- name: Checkout
|
|
19
|
-
uses: actions/checkout@v6
|
|
23
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
20
24
|
with:
|
|
21
25
|
fetch-depth: 0
|
|
26
|
+
persist-credentials: false
|
|
22
27
|
|
|
23
28
|
- name: Log Token Type
|
|
29
|
+
env:
|
|
30
|
+
TOKEN: ${{ env.ACCESS_TOKEN }}
|
|
31
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
24
32
|
run: |
|
|
25
|
-
if [ $
|
|
33
|
+
if [ "$TOKEN" = "$GH_TOKEN" ]; then
|
|
26
34
|
echo "🗝️ Authenticated with GitHub Token"
|
|
27
35
|
else
|
|
28
36
|
echo "🔑 Authenticated with Personal Access token"
|
|
@@ -31,7 +39,7 @@ jobs:
|
|
|
31
39
|
- name: Validate Tag and Branch
|
|
32
40
|
id: validation
|
|
33
41
|
run: |
|
|
34
|
-
TAG=$(git tag --contains HEAD | grep '^v[0-9]' | head -n 1)
|
|
42
|
+
TAG=$(git tag --contains HEAD | grep -E '^v?[0-9]' | head -n 1)
|
|
35
43
|
echo "🏷️ Tag for commit is: $TAG"
|
|
36
44
|
BRANCH=$(git branch -r --contains tags/${GITHUB_REF_NAME} | grep 'origin/main' | xargs)
|
|
37
45
|
if [[ -z "$BRANCH" ]]; then
|
|
@@ -75,7 +83,11 @@ jobs:
|
|
|
75
83
|
|
|
76
84
|
- name: Log Release Details
|
|
77
85
|
if: env.IS_VALID_COMMIT == 'true'
|
|
86
|
+
env:
|
|
87
|
+
TAG: ${{ env.TAG_NAME }}
|
|
88
|
+
RELEASE_URL: ${{ steps.release.outputs.url }}
|
|
89
|
+
RELEASE_ID: ${{ steps.release.outputs.id }}
|
|
78
90
|
run: |
|
|
79
|
-
echo "📦 Successfully released: $
|
|
80
|
-
echo "🔗 Release URL: $
|
|
81
|
-
echo "🪪 Release ID: $
|
|
91
|
+
echo "📦 Successfully released: $TAG"
|
|
92
|
+
echo "🔗 Release URL: $RELEASE_URL"
|
|
93
|
+
echo "🪪 Release ID: $RELEASE_ID"
|
|
@@ -4,6 +4,9 @@ on:
|
|
|
4
4
|
branches: [main]
|
|
5
5
|
workflow_dispatch: {}
|
|
6
6
|
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
7
10
|
jobs:
|
|
8
11
|
build:
|
|
9
12
|
name: Set GitHub Metadata
|
|
@@ -11,9 +14,9 @@ jobs:
|
|
|
11
14
|
|
|
12
15
|
steps:
|
|
13
16
|
- name: Checkout
|
|
14
|
-
uses: actions/checkout@v6
|
|
17
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
15
18
|
with:
|
|
16
|
-
|
|
19
|
+
persist-credentials: false
|
|
17
20
|
|
|
18
21
|
- name: Sync Package info to GitHub
|
|
19
22
|
uses: kitschpatrol/github-action-repo-sync@v5
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
".env": ".env.*, .template.env",
|
|
51
51
|
"*.js": "${basename}.ts.map, ${basename}.js.map, ${basename}.d.ts, ${basename}.d.ts.map, ${basename}.d.js.map",
|
|
52
52
|
"*.ts": "${basename}.ts.map, ${basename}.d.ts, ${basename}.d.ts.map",
|
|
53
|
-
"package.json": ".*.cjs, .*.cts, .*.js, .*.json, .*.json5, .*.jsonc, .*.mjs, .*.mts, .*.toml, .*.ts, .*.yaml, .*.yml, .*ignore, .*rc, .node-version, *config.cjs, *config.cts, *config.js, *config.json, *config.json5, *config.jsonc, *config.mjs, *config.mts, *config.toml, *config.ts, *config.yaml, *config.yml, tsconfig.*.json, lerna.json, netlify.toml, package-lock.json, pnpm*, skills-lock.json, turbo.json, vercel.json, workspace*, wrangler.toml, wrangler.json, wrangler.jsonc, yarn.lock, yarn*",
|
|
53
|
+
"package.json": ".*.cjs, .*.cts, .*.js, .*.json, .*.json5, .*.jsonc, .*.mjs, .*.mts, .*.toml, .*.ts, .*.yaml, .*.yml, .*attributes, .*ignore, .*rc, .node-version, *config.cjs, *config.cts, *config.js, *config.json, *config.json5, *config.jsonc, *config.mjs, *config.mts, *config.toml, *config.ts, *config.yaml, *config.yml, tsconfig.*.json, lerna.json, netlify.toml, package-lock.json, pnpm*, skills-lock.json, turbo.json, vercel.json, workspace*, wrangler.toml, wrangler.json, wrangler.jsonc, yarn.lock, yarn*",
|
|
54
54
|
"readme.md": "authors*, backers*, changelog*, citation*, code_of_conduct*, contributing*, contributors*, copying*, credits*, governance*, history*, license*, maintainers*, release_notes*, security*, sponsors*"
|
|
55
55
|
},
|
|
56
56
|
"prettier.documentSelectors": [
|
|
@@ -36,30 +36,33 @@
|
|
|
36
36
|
"dist/*"
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
|
+
"bench": "vitest bench --run --compare test/benchmarks/baseline.json",
|
|
40
|
+
"bench:baseline": "vitest bench --run --outputJson test/benchmarks/baseline.json",
|
|
39
41
|
"build": "tsdown",
|
|
40
|
-
"clean": "
|
|
42
|
+
"clean": "shx rm -f pnpm-lock.yaml && git clean -fdX -e !.claude/",
|
|
41
43
|
"fix": "ksc fix",
|
|
42
44
|
"lint": "ksc lint",
|
|
43
|
-
"release": "bumpp --commit 'Release: %s' && pnpm
|
|
45
|
+
"release": "bumpp --commit 'Release: %s' && pnpm build && NPM_AUTH_TOKEN=$({{{npm-auth-command}}}) && pnpm publish",
|
|
44
46
|
"test": "vitest run"
|
|
45
47
|
},
|
|
46
48
|
"dependencies": {
|
|
47
|
-
"@types/node": "~20.19.
|
|
49
|
+
"@types/node": "~20.19.39",
|
|
48
50
|
"@types/yargs": "^17.0.35",
|
|
49
|
-
"lognow": "^0.
|
|
51
|
+
"lognow": "^0.6.1",
|
|
50
52
|
"yargs": "^18.0.0"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
55
|
"@arethetypeswrong/core": "^0.18.2",
|
|
54
|
-
"@kitschpatrol/shared-config": "^
|
|
56
|
+
"@kitschpatrol/shared-config": "^7.2.0",
|
|
55
57
|
"bumpp": "^11.0.1",
|
|
56
|
-
"mdat-plugin-cli-help": "^1.
|
|
58
|
+
"mdat-plugin-cli-help": "^2.1.2",
|
|
57
59
|
"publint": "^0.3.18",
|
|
58
|
-
"
|
|
60
|
+
"shx": "^0.4.0",
|
|
61
|
+
"tsdown": "^0.21.7",
|
|
59
62
|
"typescript": "~5.9.3",
|
|
60
|
-
"vitest": "^4.1.
|
|
63
|
+
"vitest": "^4.1.4"
|
|
61
64
|
},
|
|
62
|
-
"packageManager": "pnpm@10.
|
|
65
|
+
"packageManager": "pnpm@10.33.0",
|
|
63
66
|
"engines": {
|
|
64
67
|
"node": ">=20.19.0"
|
|
65
68
|
},
|
|
@@ -18,11 +18,13 @@ async function run(...args: string[]): Promise<{ code: number; stderr: string; s
|
|
|
18
18
|
})
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
const VERSION_REGEX = /\d+\.\d+\.\d+/
|
|
22
|
+
|
|
21
23
|
describe('cli', () => {
|
|
22
24
|
it('should print version with --version', async () => {
|
|
23
25
|
const { code, stdout } = await run('--version')
|
|
24
26
|
expect(code).toBe(0)
|
|
25
|
-
expect(stdout.trim()).toMatch(
|
|
27
|
+
expect(stdout.trim()).toMatch(VERSION_REGEX)
|
|
26
28
|
})
|
|
27
29
|
|
|
28
30
|
it('should print help with --help', async () => {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request: {}
|
|
7
|
+
workflow_dispatch: {}
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
|
|
14
|
+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
ci:
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
timeout-minutes: 20
|
|
20
|
+
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout
|
|
28
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
29
|
+
with:
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
|
|
32
|
+
- name: Install pnpm
|
|
33
|
+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
|
|
34
|
+
|
|
35
|
+
- name: Setup Node.js
|
|
36
|
+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
|
|
37
|
+
with:
|
|
38
|
+
node-version: 24
|
|
39
|
+
cache: 'pnpm'
|
|
40
|
+
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: pnpm install --frozen-lockfile
|
|
43
|
+
|
|
44
|
+
- name: Build
|
|
45
|
+
run: pnpm run build
|
|
46
|
+
|
|
47
|
+
- name: Lint
|
|
48
|
+
run: pnpm run lint
|
|
49
|
+
|
|
50
|
+
- name: Test
|
|
51
|
+
run: pnpm run test
|