@kitschpatrol/create-project 1.2.6 → 1.2.8

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.
Files changed (29) hide show
  1. package/package.json +5 -5
  2. package/templates/cli/package.json +14 -6
  3. package/templates/cli/pnpm-workspace.yaml +0 -2
  4. package/templates/cli/test/cli.test.ts +39 -0
  5. package/templates/cli/test/index.test.ts +7 -0
  6. package/templates/cli/tsdown.config.ts +14 -0
  7. package/templates/cli+library/package.json +13 -6
  8. package/templates/cli+library/pnpm-workspace.yaml +0 -2
  9. package/templates/cli+library/test/cli.test.ts +39 -0
  10. package/templates/cli+library/test/index.test.ts +7 -0
  11. package/templates/cli+library/tsdown.config.ts +3 -1
  12. package/templates/electron/package.json +6 -5
  13. package/templates/electron/pnpm-workspace.yaml +0 -2
  14. package/templates/electron/test/index.test.ts +7 -0
  15. package/templates/library/package.json +13 -6
  16. package/templates/library/pnpm-workspace.yaml +0 -2
  17. package/templates/library/test/index.test.ts +7 -0
  18. package/templates/library/tsdown.config.ts +9 -11
  19. package/templates/minimal/package.json +1 -1
  20. package/templates/minimal/pnpm-workspace.yaml +0 -2
  21. package/templates/unplugin/package.json +4 -4
  22. package/templates/unplugin/pnpm-workspace.yaml +0 -2
  23. package/templates/unplugin/tsdown.config.ts +3 -1
  24. package/templates/web/package.json +4 -3
  25. package/templates/web/pnpm-workspace.yaml +0 -2
  26. package/templates/web/test/index.test.ts +7 -0
  27. /package/templates/unplugin/{tests → test}/__snapshots__/rollup.test.ts.snap +0 -0
  28. /package/templates/unplugin/{tests → test}/fixtures/basic.js +0 -0
  29. /package/templates/unplugin/{tests → test}/rollup.test.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/create-project",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "Kitschpatrol's TypeScript project templates.",
5
5
  "keywords": [
6
6
  "cli",
@@ -35,12 +35,12 @@
35
35
  "zod": "^3.25.76"
36
36
  },
37
37
  "devDependencies": {
38
- "@kitschpatrol/shared-config": "^6.0.1",
38
+ "@kitschpatrol/shared-config": "^6.0.2",
39
39
  "@types/node": "~20.19.35",
40
40
  "bumpp": "^10.4.1",
41
- "mdat": "^1.3.5",
42
- "taze": "^19.9.2",
43
- "tsdown": "^0.20.3",
41
+ "mdat": "^1.4.0",
42
+ "taze": "^19.10.0",
43
+ "tsdown": "^0.21.0",
44
44
  "typescript": "~5.9.3",
45
45
  "vitest": "^4.0.18"
46
46
  },
@@ -27,28 +27,36 @@
27
27
  "dist/*"
28
28
  ],
29
29
  "scripts": {
30
- "build": "tsdown --no-fixed-extension --dts false",
30
+ "build": "tsdown",
31
31
  "clean": "git rm -f pnpm-lock.yaml ; git clean -fdX",
32
32
  "fix": "ksc fix",
33
33
  "lint": "ksc lint",
34
34
  "release": "bumpp --commit 'Release: %s' && pnpm run build && NPM_AUTH_TOKEN=$({{{npm-auth-command}}}) && pnpm publish",
35
- "test": "echo \"Error: no test specified\" && exit 1"
35
+ "test": "vitest run"
36
36
  },
37
37
  "dependencies": {
38
38
  "@types/node": "~20.19.35",
39
39
  "@types/yargs": "^17.0.35",
40
- "lognow": "^0.4.1",
40
+ "lognow": "^0.5.2",
41
41
  "yargs": "^18.0.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@kitschpatrol/shared-config": "^6.0.1",
44
+ "@kitschpatrol/shared-config": "^6.0.2",
45
45
  "bumpp": "^10.4.1",
46
46
  "mdat-plugin-cli-help": "^1.0.7",
47
- "tsdown": "^0.20.3",
48
- "typescript": "~5.9.3"
47
+ "publint": "^0.3.18",
48
+ "tsdown": "^0.21.0",
49
+ "typescript": "~5.9.3",
50
+ "vitest": "^4.0.18"
49
51
  },
50
52
  "packageManager": "pnpm@10.30.3",
51
53
  "engines": {
52
54
  "node": ">=20.19.0"
55
+ },
56
+ "devEngines": {
57
+ "runtime": {
58
+ "name": "node",
59
+ "version": ">=22.18.0"
60
+ }
53
61
  }
54
62
  }
@@ -1,5 +1,3 @@
1
- # Required by @kitschpatrol/shared-config
2
-
3
1
  onlyBuiltDependencies:
4
2
  - esbuild
5
3
  - puppeteer
@@ -0,0 +1,39 @@
1
+ import { execFile } from 'node:child_process'
2
+ import path from 'node:path'
3
+ import { describe, expect, it } from 'vitest'
4
+
5
+ // eslint-disable-next-line node/no-unsupported-features/node-builtins
6
+ const cliPath = path.resolve(import.meta.dirname, '../dist/index.js')
7
+
8
+ async function run(...args: string[]): Promise<{ code: number; stderr: string; stdout: string }> {
9
+ return new Promise((resolve, reject) => {
10
+ execFile('node', [cliPath, ...args], (error, stdout, stderr) => {
11
+ if (error && error.code === undefined) {
12
+ reject(new Error(error.message))
13
+ return
14
+ }
15
+
16
+ resolve({ code: typeof error?.code === 'number' ? error.code : 0, stderr, stdout })
17
+ })
18
+ })
19
+ }
20
+
21
+ describe('cli', () => {
22
+ it('should print version with --version', async () => {
23
+ const { code, stdout } = await run('--version')
24
+ expect(code).toBe(0)
25
+ expect(stdout.trim()).toMatch(/\d+\.\d+\.\d+/)
26
+ })
27
+
28
+ it('should print help with --help', async () => {
29
+ const { code, stdout } = await run('--help')
30
+ expect(code).toBe(0)
31
+ expect(stdout).toContain('--help')
32
+ })
33
+
34
+ it('should run the default command', async () => {
35
+ const { code, stdout } = await run()
36
+ expect(code).toBe(0)
37
+ expect(stdout.trim()).toBe('Did something!')
38
+ })
39
+ })
@@ -0,0 +1,7 @@
1
+ import { describe, expect, it } from 'vitest'
2
+
3
+ describe('placeholder', () => {
4
+ it('should pass', () => {
5
+ expect(true).toBe(true)
6
+ })
7
+ })
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from 'tsdown'
2
+
3
+ export default defineConfig({
4
+ deps: {
5
+ alwaysBundle: /.+/,
6
+ },
7
+ dts: false,
8
+ entry: 'src/bin/cli.ts',
9
+ fixedExtension: false,
10
+ minify: true,
11
+ outDir: 'dist/bin',
12
+ platform: 'node',
13
+ publint: true,
14
+ })
@@ -41,25 +41,32 @@
41
41
  "fix": "ksc fix",
42
42
  "lint": "ksc lint",
43
43
  "release": "bumpp --commit 'Release: %s' && pnpm run build && NPM_AUTH_TOKEN=$({{{npm-auth-command}}}) && pnpm publish",
44
- "test": "echo \"Error: no test specified\" && exit 1"
44
+ "test": "vitest run"
45
45
  },
46
46
  "dependencies": {
47
47
  "@types/node": "~20.19.35",
48
48
  "@types/yargs": "^17.0.35",
49
- "lognow": "^0.4.1",
49
+ "lognow": "^0.5.2",
50
50
  "yargs": "^18.0.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@arethetypeswrong/core": "^0.18.2",
54
- "@kitschpatrol/shared-config": "^6.0.1",
54
+ "@kitschpatrol/shared-config": "^6.0.2",
55
55
  "bumpp": "^10.4.1",
56
56
  "mdat-plugin-cli-help": "^1.0.7",
57
- "publint": "^0.3.17",
58
- "tsdown": "^0.20.3",
59
- "typescript": "~5.9.3"
57
+ "publint": "^0.3.18",
58
+ "tsdown": "^0.21.0",
59
+ "typescript": "~5.9.3",
60
+ "vitest": "^4.0.18"
60
61
  },
61
62
  "packageManager": "pnpm@10.30.3",
62
63
  "engines": {
63
64
  "node": ">=20.19.0"
65
+ },
66
+ "devEngines": {
67
+ "runtime": {
68
+ "name": "node",
69
+ "version": ">=22.18.0"
70
+ }
64
71
  }
65
72
  }
@@ -1,5 +1,3 @@
1
- # Required by @kitschpatrol/shared-config
2
-
3
1
  onlyBuiltDependencies:
4
2
  - esbuild
5
3
  - puppeteer
@@ -0,0 +1,39 @@
1
+ import { execFile } from 'node:child_process'
2
+ import path from 'node:path'
3
+ import { describe, expect, it } from 'vitest'
4
+
5
+ // eslint-disable-next-line node/no-unsupported-features/node-builtins
6
+ const cliPath = path.resolve(import.meta.dirname, '../dist/bin/cli.js')
7
+
8
+ async function run(...args: string[]): Promise<{ code: number; stderr: string; stdout: string }> {
9
+ return new Promise((resolve, reject) => {
10
+ execFile('node', [cliPath, ...args], (error, stdout, stderr) => {
11
+ if (error && error.code === undefined) {
12
+ reject(new Error(error.message))
13
+ return
14
+ }
15
+
16
+ resolve({ code: typeof error?.code === 'number' ? error.code : 0, stderr, stdout })
17
+ })
18
+ })
19
+ }
20
+
21
+ describe('cli', () => {
22
+ it('should print version with --version', async () => {
23
+ const { code, stdout } = await run('--version')
24
+ expect(code).toBe(0)
25
+ expect(stdout.trim()).toMatch(/\d+\.\d+\.\d+/)
26
+ })
27
+
28
+ it('should print help with --help', async () => {
29
+ const { code, stdout } = await run('--help')
30
+ expect(code).toBe(0)
31
+ expect(stdout).toContain('--help')
32
+ })
33
+
34
+ it('should run the default command', async () => {
35
+ const { code, stdout } = await run()
36
+ expect(code).toBe(0)
37
+ expect(stdout.trim()).toBe('Did something!')
38
+ })
39
+ })
@@ -0,0 +1,7 @@
1
+ import { describe, expect, it } from 'vitest'
2
+
3
+ describe('placeholder', () => {
4
+ it('should pass', () => {
5
+ expect(true).toBe(true)
6
+ })
7
+ })
@@ -3,6 +3,9 @@ import { defineConfig } from 'tsdown'
3
3
  export default defineConfig([
4
4
  // CLI tool
5
5
  {
6
+ deps: {
7
+ alwaysBundle: /.+/,
8
+ },
6
9
  dts: false,
7
10
  entry: 'src/bin/cli.ts',
8
11
  fixedExtension: false,
@@ -17,7 +20,6 @@ export default defineConfig([
17
20
  },
18
21
  entry: 'src/lib/index.ts',
19
22
  fixedExtension: false,
20
- minify: true,
21
23
  outDir: 'dist/lib',
22
24
  platform: 'neutral',
23
25
  publint: true,
@@ -28,20 +28,21 @@
28
28
  "fix": "ksc fix",
29
29
  "lint": "ksc lint",
30
30
  "release": "bumpp --commit 'Release: %s' && pnpm run build && electron-builder build --publish always",
31
- "test": "echo \"Error: no test specified\" && exit 1"
31
+ "test": "vitest run"
32
32
  },
33
33
  "dependencies": {
34
34
  "@types/node": "~22.19.13",
35
- "lognow": "^0.4.1"
35
+ "lognow": "^0.5.2"
36
36
  },
37
37
  "devDependencies": {
38
- "@kitschpatrol/shared-config": "^6.0.1",
38
+ "@kitschpatrol/shared-config": "^6.0.2",
39
39
  "bumpp": "^10.4.1",
40
- "electron": "^40.6.1",
40
+ "electron": "^40.7.0",
41
41
  "electron-builder": "^26.8.1",
42
42
  "typescript": "~5.9.3",
43
43
  "vite": "npm:rolldown-vite@7.3.1",
44
- "vite-plugin-electron": "^0.29.0"
44
+ "vite-plugin-electron": "^0.29.0",
45
+ "vitest": "^4.0.18"
45
46
  },
46
47
  "packageManager": "pnpm@10.30.3",
47
48
  "engines": {
@@ -1,5 +1,3 @@
1
- # Required by @kitschpatrol/shared-config
2
-
3
1
  onlyBuiltDependencies:
4
2
  - electron
5
3
  - electron-winstaller
@@ -0,0 +1,7 @@
1
+ import { describe, expect, it } from 'vitest'
2
+
3
+ describe('placeholder', () => {
4
+ it('should pass', () => {
5
+ expect(true).toBe(true)
6
+ })
7
+ })
@@ -36,22 +36,29 @@
36
36
  "fix": "ksc fix",
37
37
  "lint": "ksc lint",
38
38
  "release": "bumpp --commit 'Release: %s' && pnpm run build && NPM_AUTH_TOKEN=$({{{npm-auth-command}}}) && pnpm publish",
39
- "test": "echo \"Error: no test specified\" && exit 1"
39
+ "test": "vitest run"
40
40
  },
41
41
  "dependencies": {
42
42
  "@types/node": "~20.19.35",
43
- "lognow": "^0.4.1"
43
+ "lognow": "^0.5.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@arethetypeswrong/core": "^0.18.2",
47
- "@kitschpatrol/shared-config": "^6.0.1",
47
+ "@kitschpatrol/shared-config": "^6.0.2",
48
48
  "bumpp": "^10.4.1",
49
- "publint": "^0.3.17",
50
- "tsdown": "^0.20.3",
51
- "typescript": "~5.9.3"
49
+ "publint": "^0.3.18",
50
+ "tsdown": "^0.21.0",
51
+ "typescript": "~5.9.3",
52
+ "vitest": "^4.0.18"
52
53
  },
53
54
  "packageManager": "pnpm@10.30.3",
54
55
  "engines": {
55
56
  "node": ">=20.19.0"
57
+ },
58
+ "devEngines": {
59
+ "runtime": {
60
+ "name": "node",
61
+ "version": ">=22.18.0"
62
+ }
56
63
  }
57
64
  }
@@ -1,5 +1,3 @@
1
- # Required by @kitschpatrol/shared-config
2
-
3
1
  onlyBuiltDependencies:
4
2
  - esbuild
5
3
  - unrs-resolver
@@ -0,0 +1,7 @@
1
+ import { describe, expect, it } from 'vitest'
2
+
3
+ describe('placeholder', () => {
4
+ it('should pass', () => {
5
+ expect(true).toBe(true)
6
+ })
7
+ })
@@ -1,14 +1,12 @@
1
1
  import { defineConfig } from 'tsdown'
2
2
 
3
- export default defineConfig([
4
- {
5
- attw: {
6
- profile: 'esm-only',
7
- },
8
- fixedExtension: false,
9
- minify: true,
10
- platform: 'neutral',
11
- publint: true,
12
- tsconfig: 'tsconfig.build.json',
3
+ export default defineConfig({
4
+ attw: {
5
+ profile: 'esm-only',
13
6
  },
14
- ])
7
+ dts: true,
8
+ fixedExtension: false,
9
+ platform: 'neutral',
10
+ publint: true,
11
+ tsconfig: 'tsconfig.build.json',
12
+ })
@@ -33,7 +33,7 @@
33
33
  "@types/node": "~20.19.35"
34
34
  },
35
35
  "devDependencies": {
36
- "@kitschpatrol/shared-config": "^6.0.1",
36
+ "@kitschpatrol/shared-config": "^6.0.2",
37
37
  "bumpp": "^10.4.1",
38
38
  "tsx": "^4.21.0",
39
39
  "typescript": "~5.9.3"
@@ -1,5 +1,3 @@
1
- # Required by @kitschpatrol/shared-config
2
-
3
1
  onlyBuiltDependencies:
4
2
  - esbuild
5
3
  - unrs-resolver
@@ -61,7 +61,7 @@
61
61
  "fix": "ksc fix",
62
62
  "lint": "ksc lint",
63
63
  "release": "bumpp --commit 'Release: %s' && pnpm run build && NPM_AUTH_TOKEN=$(op read 'op://Personal/npm/token') && pnpm publish",
64
- "test": "vitest"
64
+ "test": "vitest run"
65
65
  },
66
66
  "dependencies": {
67
67
  "@types/node": "~22.16.5",
@@ -69,15 +69,15 @@
69
69
  "unplugin-utils": "^0.3.1"
70
70
  },
71
71
  "devDependencies": {
72
- "@kitschpatrol/shared-config": "^6.0.1",
72
+ "@kitschpatrol/shared-config": "^6.0.2",
73
73
  "@sxzz/test-utils": "^0.5.15",
74
74
  "bumpp": "^10.4.1",
75
- "tsdown": "^0.20.3",
75
+ "tsdown": "^0.21.0",
76
76
  "typescript": "~5.9.3",
77
77
  "vitest": "^4.0.18"
78
78
  },
79
79
  "packageManager": "pnpm@10.30.3",
80
80
  "engines": {
81
- "node": ">=22.16.0"
81
+ "node": ">=22.18.0"
82
82
  }
83
83
  }
@@ -1,5 +1,3 @@
1
- # Required by @kitschpatrol/shared-config
2
-
3
1
  onlyBuiltDependencies:
4
2
  - esbuild
5
3
  - unrs-resolver
@@ -1,7 +1,9 @@
1
1
  import { defineConfig } from 'tsdown'
2
2
 
3
3
  export default defineConfig({
4
+ deps: {
5
+ onlyAllowBundle: [],
6
+ },
4
7
  entry: ['./src/*.ts'],
5
8
  fixedExtension: false,
6
- inlineOnly: [],
7
9
  })
@@ -28,18 +28,19 @@
28
28
  "lint": "ksc lint",
29
29
  "preview": "poptab ; vite preview",
30
30
  "release": "bumpp --commit 'Release: %s'",
31
- "test": "echo \"Error: no test specified\" && exit 1"
31
+ "test": "vitest run"
32
32
  },
33
33
  "dependencies": {
34
34
  "@types/node": "~20.19.35"
35
35
  },
36
36
  "devDependencies": {
37
- "@kitschpatrol/shared-config": "^6.0.1",
37
+ "@kitschpatrol/shared-config": "^6.0.2",
38
38
  "bumpp": "^10.4.1",
39
39
  "poptab": "^1.0.4",
40
40
  "typescript": "~5.9.3",
41
41
  "vite": "npm:rolldown-vite@7.1.17",
42
- "vite-plugin-mkcert": "^1.17.10"
42
+ "vite-plugin-mkcert": "^1.17.10",
43
+ "vitest": "^4.0.18"
43
44
  },
44
45
  "packageManager": "pnpm@10.30.3",
45
46
  "engines": {
@@ -1,5 +1,3 @@
1
- # Required by @kitschpatrol/shared-config
2
-
3
1
  onlyBuiltDependencies:
4
2
  - esbuild
5
3
  - unrs-resolver
@@ -0,0 +1,7 @@
1
+ import { describe, expect, it } from 'vitest'
2
+
3
+ describe('placeholder', () => {
4
+ it('should pass', () => {
5
+ expect(true).toBe(true)
6
+ })
7
+ })