@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
@@ -1,7 +1,10 @@
1
+ import { log } from './log'
2
+
1
3
  /**
2
4
  * Do something.
3
5
  */
4
6
  export function doSomething(): string {
7
+ log.info('Doing something...')
5
8
  return 'Something happened'
6
9
  }
7
10
 
@@ -9,5 +12,8 @@ export function doSomething(): string {
9
12
  * Do something else.
10
13
  */
11
14
  export function doSomethingElse(): string {
15
+ log.info('Doing something else...')
12
16
  return 'Something else happened'
13
17
  }
18
+
19
+ export { setLogger } from './log'
@@ -0,0 +1,16 @@
1
+ import type { ILogBasic, ILogLayer } from 'lognow'
2
+ import { createLogger, injectionHelper } from 'lognow'
3
+
4
+ /**
5
+ * The default logger instance for the library.
6
+ */
7
+ export let log = createLogger()
8
+
9
+ /**
10
+ * Set the logger instance for the module.
11
+ * Export this for library consumers to inject their own logger.
12
+ * @param logger - Accepts either a LogLayer instance or a Console- or Stream-like log target
13
+ */
14
+ export function setLogger(logger?: ILogBasic | ILogLayer) {
15
+ log = injectionHelper(logger)
16
+ }
@@ -1,8 +1,5 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "declarationMap": true
5
- },
6
3
  "include": ["**/*", "**/**.*"],
7
4
  "exclude": ["**/dist/", "**/bin/"]
8
5
  }
@@ -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*"
@@ -29,17 +29,15 @@
29
29
  "test": "echo \"Error: no test specified\" && exit 1"
30
30
  },
31
31
  "dependencies": {
32
- "@types/node": "^20.19.21",
33
- "@types/yargs": "^17.0.33",
34
- "yargs": "^17.7.2"
32
+ "@types/node": "^20.19.24"
35
33
  },
36
34
  "devDependencies": {
37
- "@kitschpatrol/shared-config": "^5.7.2",
35
+ "@kitschpatrol/shared-config": "^5.8.0",
38
36
  "bumpp": "^10.3.1",
39
37
  "tsx": "^4.20.6",
40
38
  "typescript": "~5.9.3"
41
39
  },
42
- "packageManager": "pnpm@10.18.3",
40
+ "packageManager": "pnpm@10.20.0",
43
41
  "engines": {
44
42
  "node": ">=20.19.0"
45
43
  }
@@ -1,8 +1,5 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "declarationMap": true
5
- },
6
3
  "include": ["**/*", "**/**.*"],
7
4
  "exclude": ["**/dist/", "**/bin/"]
8
5
  }
@@ -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,5 +1,21 @@
1
1
  import { eslintConfig } from '@kitschpatrol/eslint-config'
2
2
 
3
3
  export default eslintConfig({
4
+ ts: {
5
+ overrides: {
6
+ 'import/no-unresolved': [
7
+ 'error',
8
+ {
9
+ ignore: [
10
+ '^astro:',
11
+ '^@astrojs',
12
+ '^virtual:',
13
+ // Public Vite assets...
14
+ '^/',
15
+ ],
16
+ },
17
+ ],
18
+ },
19
+ },
4
20
  type: 'lib',
5
21
  })
@@ -20,33 +20,33 @@
20
20
  },
21
21
  "type": "module",
22
22
  "scripts": {
23
- "build": "tsc -p tsconfig.build.json && vite build",
23
+ "build": "vite build",
24
24
  "clean": "git rm -f pnpm-lock.yaml ; git clean -fdX",
25
- "dev": "vite",
25
+ "dev": "poptab ; vite",
26
26
  "fix": "ksc fix",
27
27
  "lint": "ksc lint",
28
- "preview": "vite preview",
28
+ "preview": "poptab ; vite preview",
29
29
  "release": "bumpp --commit 'Release: %s'",
30
30
  "test": "echo \"Error: no test specified\" && exit 1"
31
31
  },
32
32
  "dependencies": {
33
- "@types/node": "^20.19.21",
34
- "@types/yargs": "^17.0.33",
35
- "yargs": "^17.7.2"
33
+ "@types/node": "^20.19.24"
36
34
  },
37
35
  "devDependencies": {
38
- "@kitschpatrol/shared-config": "^5.7.2",
36
+ "@kitschpatrol/shared-config": "^5.8.0",
39
37
  "bumpp": "^10.3.1",
38
+ "poptab": "^1.0.1",
40
39
  "typescript": "~5.9.3",
41
- "vite": "npm:rolldown-vite@7.1.14"
40
+ "vite": "npm:rolldown-vite@7.1.17",
41
+ "vite-plugin-mkcert": "^1.17.9"
42
42
  },
43
- "packageManager": "pnpm@10.18.3",
43
+ "packageManager": "pnpm@10.20.0",
44
44
  "engines": {
45
45
  "node": ">=20.19.0"
46
46
  },
47
47
  "pnpm": {
48
48
  "overrides": {
49
- "vite": "npm:rolldown-vite@7.1.14"
49
+ "vite": "npm:rolldown-vite@7.1.17"
50
50
  }
51
51
  }
52
52
  }
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "extends": "@kitschpatrol/typescript-config",
3
-
3
+ "compilerOptions": {
4
+ "types": ["vite/client"]
5
+ },
4
6
  // Includes project dot-files files for typescript-eslint integration
5
7
  "include": ["**/*", "**/**.*"],
6
8
  "exclude": ["**/dist/", "**/bin/"]
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from 'vite'
2
+ import mkcert from 'vite-plugin-mkcert'
3
+
4
+ process.env.BROWSER = 'chromium'
5
+
6
+ export default defineConfig({
7
+ plugins: [mkcert()],
8
+ server: {
9
+ open: true,
10
+ },
11
+ })
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "declarationMap": true
5
- },
6
- "include": ["**/*", "**/**.*"],
7
- "exclude": ["**/dist/", "**/bin/"]
8
- }