@kitschpatrol/create-project 1.0.3 → 1.1.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.
Files changed (73) hide show
  1. package/dist/index.js +18 -15
  2. package/package.json +9 -4
  3. package/readme.md +6 -0
  4. package/templates/cli/.npmrc +3 -0
  5. package/templates/cli/.remarkrc.js +4 -2
  6. package/templates/cli/.vscode/settings.json +2 -2
  7. package/templates/cli/mdat.config.ts +6 -1
  8. package/templates/cli/package.json +8 -6
  9. package/templates/cli/pnpm-lock.yaml +1512 -0
  10. package/templates/cli/src/index.ts +27 -5
  11. package/templates/cli+library/.npmrc +3 -0
  12. package/templates/cli+library/.remarkrc.js +5 -2
  13. package/templates/cli+library/.vscode/settings.json +2 -2
  14. package/templates/cli+library/mdat.config.ts +6 -1
  15. package/templates/cli+library/package.json +10 -8
  16. package/templates/cli+library/src/bin/cli.ts +19 -7
  17. package/templates/cli+library/src/lib/index.ts +6 -0
  18. package/templates/cli+library/src/lib/log.ts +16 -0
  19. package/templates/cli+library/tsconfig.build.json +0 -3
  20. package/templates/electron/.github/workflows/github-release.yml +81 -0
  21. package/templates/electron/.github/workflows/set-github-metadata.yml +21 -0
  22. package/templates/electron/.gitignore +24 -0
  23. package/templates/electron/.npmrc +16 -0
  24. package/templates/electron/.prettierignore +8 -0
  25. package/templates/electron/.remarkrc.js +8 -0
  26. package/templates/electron/.vscode/extensions.json +9 -0
  27. package/templates/electron/.vscode/settings.json +68 -0
  28. package/templates/electron/cspell.config.js +5 -0
  29. package/templates/electron/electron/electron-env.d.ts +29 -0
  30. package/templates/electron/electron/main.ts +50 -0
  31. package/templates/electron/electron/preload.ts +130 -0
  32. package/templates/electron/electron/resources/icons/mac/icon.icns +0 -0
  33. package/templates/electron/electron/resources/icons/png/1024x1024.png +0 -0
  34. package/templates/electron/electron/resources/icons/win/icon.ico +0 -0
  35. package/templates/electron/electron/resources/mac/entitlements.mac.plist +11 -0
  36. package/templates/electron/electron-builder.ts +40 -0
  37. package/templates/electron/eslint.config.ts +22 -0
  38. package/templates/electron/index.html +13 -0
  39. package/templates/electron/knip.config.ts +3 -0
  40. package/templates/electron/license.txt +21 -0
  41. package/templates/electron/mdat.config.ts +3 -0
  42. package/templates/electron/package.json +61 -0
  43. package/templates/electron/pnpm-workspace.yaml +4 -0
  44. package/templates/electron/prettier.config.js +3 -0
  45. package/templates/electron/public/vite.svg +35 -0
  46. package/templates/electron/readme.md +29 -0
  47. package/templates/electron/src/counter.ts +15 -0
  48. package/templates/electron/src/main.ts +27 -0
  49. package/templates/electron/src/style.css +102 -0
  50. package/templates/electron/src/typescript.svg +14 -0
  51. package/templates/electron/stylelint.config.js +3 -0
  52. package/templates/electron/tsconfig.json +9 -0
  53. package/templates/electron/vite.config.ts +15 -0
  54. package/templates/library/.npmrc +3 -0
  55. package/templates/library/.remarkrc.js +4 -2
  56. package/templates/library/.vscode/settings.json +2 -2
  57. package/templates/library/package.json +10 -11
  58. package/templates/library/src/index.ts +6 -0
  59. package/templates/library/src/log.ts +16 -0
  60. package/templates/library/tsconfig.build.json +0 -3
  61. package/templates/minimal/.npmrc +3 -0
  62. package/templates/minimal/.remarkrc.js +4 -2
  63. package/templates/minimal/.vscode/settings.json +2 -2
  64. package/templates/minimal/package.json +3 -5
  65. package/templates/minimal/tsconfig.build.json +0 -3
  66. package/templates/web/.npmrc +3 -0
  67. package/templates/web/.remarkrc.js +4 -2
  68. package/templates/web/.vscode/settings.json +2 -2
  69. package/templates/web/eslint.config.ts +16 -0
  70. package/templates/web/package.json +10 -10
  71. package/templates/web/tsconfig.json +3 -1
  72. package/templates/web/vite.config.ts +11 -0
  73. package/templates/web/tsconfig.build.json +0 -8
package/dist/index.js CHANGED
@@ -3553,23 +3553,28 @@ const pipelineType = ZodPipeline.create;
3553
3553
 
3554
3554
  //#endregion
3555
3555
  //#region src/template.ts
3556
+ const TEMPLATE_TYPES = [
3557
+ "minimal",
3558
+ "web",
3559
+ "cli",
3560
+ "library",
3561
+ "cli+library",
3562
+ "electron"
3563
+ ];
3556
3564
  var template_default = createTemplate({
3557
- about: { name: "Kitschpatrol Create Project" },
3565
+ about: {
3566
+ description: "Create a new TypeScript library, CLI, or web project with Kitschpatrol's shared configuration.",
3567
+ name: "Create Kitschpatrol Project"
3568
+ },
3558
3569
  options: {
3559
- type: enumType([
3560
- "minimal",
3561
- "web",
3562
- "cli",
3563
- "library",
3564
- "cli+library"
3565
- ]).default("minimal").describe("The type of project to create"),
3570
+ type: enumType(TEMPLATE_TYPES).default("minimal").describe("The type of project to create"),
3566
3571
  "author-name": stringType().default("Eric Mika").describe("The name of the author"),
3567
3572
  "author-email": stringType().default("eric@ericmika.com").describe("The email of the author"),
3568
3573
  "author-url": stringType().default("https://ericmika.com").describe("The URL of the author"),
3569
3574
  "cli-command-name": stringType().default("new-project").describe("CLI command name (if applicable)"),
3570
3575
  "github-owner": stringType().default("kitschpatrol").describe("The owner of the future repository"),
3571
3576
  "github-repository": stringType().default(`new-project`).describe("The name of the future repository / package"),
3572
- "npm-otp-command": stringType().default("op read 'op://Personal/Npmjs/one-time password?attribute=otp'").describe("A shell command that returns your one-time password for publishing to npm")
3577
+ "npm-auth-command": stringType().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")
3573
3578
  },
3574
3579
  async produce(params) {
3575
3580
  const { options } = params;
@@ -3580,24 +3585,22 @@ var template_default = createTemplate({
3580
3585
  "package.json": await handlebars(path.join(import.meta.dirname, `../templates/${options.type}/package.json`), options)
3581
3586
  },
3582
3587
  scripts: [{
3583
- commands: [
3588
+ commands: options.type === "electron" ? ["pnpm install", "pnpm run fix"] : [
3584
3589
  "pnpm install",
3585
3590
  "pnpm run build",
3586
3591
  "pnpm run fix"
3587
3592
  ],
3588
3593
  phase: 0,
3589
3594
  silent: true
3590
- }]
3595
+ }],
3596
+ suggestions: ["git commit --amend -m 'Initial commit.'"]
3591
3597
  };
3592
3598
  }
3593
3599
  });
3594
3600
 
3595
3601
  //#endregion
3596
3602
  //#region src/index.ts
3597
- process.exitCode = await runTemplateCLI(template_default, {
3598
- name: "new-project",
3599
- version: "0.0.0"
3600
- });
3603
+ process.exitCode = await runTemplateCLI(template_default);
3601
3604
 
3602
3605
  //#endregion
3603
3606
  export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/create-project",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Kitschpatrol's TypeScript project templates.",
5
5
  "keywords": [
6
6
  "cli",
@@ -33,10 +33,13 @@
33
33
  "bingo-handlebars": "^0.1.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@kitschpatrol/shared-config": "^5.7.2",
36
+ "@kitschpatrol/shared-config": "^5.8.0",
37
+ "@types/node": "^20.19.24",
37
38
  "bumpp": "^10.3.1",
38
- "tsdown": "^0.15.7",
39
+ "taze": "^19.9.0",
40
+ "tsdown": "^0.15.12",
39
41
  "typescript": "~5.9.3",
42
+ "vitest": "^4.0.6",
40
43
  "zod": "^3.25.76"
41
44
  },
42
45
  "engines": {
@@ -50,6 +53,8 @@
50
53
  "clean": "git rm -f pnpm-lock.yaml ; git clean -fdX",
51
54
  "fix": "ksc fix",
52
55
  "lint": "ksc lint",
53
- "release": "bumpp --commit 'Release: %s' && pnpm run build && pnpm publish --otp $(op read 'op://Personal/Npmjs/one-time password?attribute=otp')"
56
+ "release": "bumpp --commit 'Release: %s' && pnpm run build && NPM_AUTH_TOKEN=$(op read 'op://Personal/npm/token') && pnpm publish",
57
+ "test": "vitest run",
58
+ "update-templates": "for dir in ./templates/*; do taze -w --cwd \"$dir\"; done"
54
59
  }
55
60
  }
package/readme.md CHANGED
@@ -73,6 +73,12 @@ Kitschpatrol Create Project options:
73
73
  --github-repository (string): The name of the future repository / package.
74
74
  ```
75
75
 
76
+ ## Development Notes
77
+
78
+ ```sh
79
+ ./dist/index.js --directory ~/Desktop/test
80
+ ```
81
+
76
82
  ## Maintainers
77
83
 
78
84
  [@kitschpatrol](https://github.com/kitschpatrol)
@@ -11,3 +11,6 @@ public-hoist-pattern[]=*mdat*
11
11
  public-hoist-pattern[]=*prettier*
12
12
  public-hoist-pattern[]=*remark*
13
13
  public-hoist-pattern[]=*stylelint*
14
+
15
+ # Required for automated local publishing
16
+ //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
@@ -1,6 +1,8 @@
1
1
  import { remarkConfig } from '@kitschpatrol/remark-config'
2
2
 
3
3
  export default remarkConfig({
4
- // Useful if the repository is not yet pushed to a remote.
5
- rules: [['remarkValidateLinks', { repository: false }]],
4
+ rules: [
5
+ // Useful if the repository is not yet pushed to a remote.
6
+ ['remarkValidateLinks', { repository: false }],
7
+ ],
6
8
  })
@@ -2,8 +2,8 @@
2
2
  "explorer.fileNesting.enabled": true,
3
3
  "explorer.fileNesting.expand": false,
4
4
  "explorer.fileNesting.patterns": {
5
- "*.js": "*.ts.map, *.js.map, *.d.ts, *.d.ts.map, *.d.js.map",
6
- "*.ts": "*.ts.map, *.d.ts, *.d.ts.map",
5
+ "*.js": "${basename}.ts.map, ${basename}.js.map, ${basename}.d.ts, ${basename}.d.ts.map, ${basename}.d.js.map",
6
+ "*.ts": "${basename}.ts.map, ${basename}.d.ts, ${basename}.d.ts.map",
7
7
  ".env": ".env.*",
8
8
  "package.json": ".*ignore, .*rc, .*.js, .*.mjs, .*.cjs, .*.ts, .*.mts, .*.cts, .*.json, .*.jsonc, .*.json5, .*.yml, .*.yaml, *config.js, *config.mjs, *config.cjs, *config.ts, *config.mts, *config.cts, *config.json, *config.jsonc, *config.json5, *config.yml, *config.yaml, pnpm*, workspace*, yarn*, lerna.json, netlify.toml, package-lock.json, turbo.json, vercel.json, wrangler.toml, yarn.lock",
9
9
  "readme.md": "authors*, backers*, changelog*, citation*, code_of_conduct*, contributing*, contributors*, copying*, credits*, governance*, history*, license*, maintainers*, release_notes*, security*, sponsors*"
@@ -1,3 +1,8 @@
1
1
  import { mdatConfig } from '@kitschpatrol/mdat-config'
2
+ import cliHelpPlugin from 'mdat-plugin-cli-help'
2
3
 
3
- export default mdatConfig()
4
+ export default mdatConfig({
5
+ rules: {
6
+ ...cliHelpPlugin,
7
+ },
8
+ })
@@ -30,21 +30,23 @@
30
30
  "clean": "git rm -f pnpm-lock.yaml ; git clean -fdX",
31
31
  "fix": "ksc fix",
32
32
  "lint": "ksc lint",
33
- "release": "bumpp --commit 'Release: %s' && pnpm run build && pnpm publish --otp $({{npm-otp-command}})",
33
+ "release": "bumpp --commit 'Release: %s' && pnpm run build && NPM_AUTH_TOKEN=$({{npm-auth-command}}) && pnpm publish",
34
34
  "test": "echo \"Error: no test specified\" && exit 1"
35
35
  },
36
36
  "dependencies": {
37
- "@types/node": "^20.19.21",
38
- "@types/yargs": "^17.0.33",
37
+ "@types/node": "^20.19.24",
38
+ "@types/yargs": "^17.0.34",
39
+ "lognow": "^0.2.1",
39
40
  "yargs": "^17.7.2"
40
41
  },
41
42
  "devDependencies": {
42
- "@kitschpatrol/shared-config": "^5.7.2",
43
+ "@kitschpatrol/shared-config": "^5.8.0",
43
44
  "bumpp": "^10.3.1",
44
- "tsdown": "^0.15.7",
45
+ "mdat-plugin-cli-help": "^1.0.1",
46
+ "tsdown": "^0.15.12",
45
47
  "typescript": "~5.9.3"
46
48
  },
47
- "packageManager": "pnpm@10.18.3",
49
+ "packageManager": "pnpm@10.20.0",
48
50
  "engines": {
49
51
  "node": ">=20.19.0"
50
52
  },