@ykdz/template 0.0.1 → 0.0.3

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 (101) hide show
  1. package/dist/src/cli.d.ts.map +1 -0
  2. package/dist/{cli.js → src/cli.js} +126 -128
  3. package/dist/{declarations.d.ts → src/declarations.d.ts} +1 -2
  4. package/dist/src/declarations.d.ts.map +1 -0
  5. package/dist/{declarations.js → src/declarations.js} +2 -109
  6. package/dist/src/dependency-catalog.d.ts +10 -0
  7. package/dist/src/dependency-catalog.d.ts.map +1 -0
  8. package/dist/src/dependency-catalog.js +63 -0
  9. package/dist/src/devcontainer.d.ts +18 -0
  10. package/dist/src/devcontainer.d.ts.map +1 -0
  11. package/dist/src/devcontainer.js +24 -0
  12. package/dist/src/editor-customization.d.ts +13 -0
  13. package/dist/src/editor-customization.d.ts.map +1 -0
  14. package/dist/src/editor-customization.js +101 -0
  15. package/dist/src/generation-context.d.ts +24 -0
  16. package/dist/src/generation-context.d.ts.map +1 -0
  17. package/dist/src/generation-context.js +12 -0
  18. package/dist/src/module-graph.d.ts +31 -0
  19. package/dist/src/module-graph.d.ts.map +1 -0
  20. package/dist/src/module-graph.js +48 -0
  21. package/dist/src/next-step-instructions.d.ts +21 -0
  22. package/dist/src/next-step-instructions.d.ts.map +1 -0
  23. package/dist/src/next-step-instructions.js +89 -0
  24. package/dist/src/package-addition.d.ts.map +1 -0
  25. package/dist/src/package-addition.js +188 -0
  26. package/dist/src/preset-projection.d.ts +66 -0
  27. package/dist/src/preset-projection.d.ts.map +1 -0
  28. package/dist/src/preset-projection.js +7 -0
  29. package/dist/src/project-github.d.ts +29 -0
  30. package/dist/src/project-github.d.ts.map +1 -0
  31. package/dist/src/project-github.js +63 -0
  32. package/dist/src/renderer.d.ts.map +1 -0
  33. package/dist/{renderer.js → src/renderer.js} +0 -3
  34. package/dist/src/runtime-paths.d.ts +2 -0
  35. package/dist/src/runtime-paths.d.ts.map +1 -0
  36. package/dist/src/runtime-paths.js +11 -0
  37. package/dist/src/toolchain-resolution.d.ts +35 -0
  38. package/dist/src/toolchain-resolution.d.ts.map +1 -0
  39. package/dist/src/toolchain-resolution.js +192 -0
  40. package/dist/templates/hono-api/projection.d.ts +7 -0
  41. package/dist/templates/hono-api/projection.d.ts.map +1 -0
  42. package/dist/templates/hono-api/projection.js +377 -0
  43. package/dist/templates/projection-plans.d.ts +8 -0
  44. package/dist/templates/projection-plans.d.ts.map +1 -0
  45. package/dist/templates/projection-plans.js +94 -0
  46. package/dist/templates/registry.d.ts +8 -0
  47. package/dist/templates/registry.d.ts.map +1 -0
  48. package/dist/templates/registry.js +42 -0
  49. package/dist/templates/rust-bin/projection.d.ts +10 -0
  50. package/dist/templates/rust-bin/projection.d.ts.map +1 -0
  51. package/dist/templates/rust-bin/projection.js +282 -0
  52. package/dist/templates/ts-lib/projection.d.ts +7 -0
  53. package/dist/templates/ts-lib/projection.d.ts.map +1 -0
  54. package/dist/templates/ts-lib/projection.js +372 -0
  55. package/dist/templates/vue-app/projection.d.ts +7 -0
  56. package/dist/templates/vue-app/projection.d.ts.map +1 -0
  57. package/dist/templates/vue-app/projection.js +594 -0
  58. package/dist/templates/vue-hono-app/projection.d.ts +9 -0
  59. package/dist/templates/vue-hono-app/projection.d.ts.map +1 -0
  60. package/dist/templates/vue-hono-app/projection.js +589 -0
  61. package/package.json +30 -24
  62. package/pnpm-workspace.yaml +34 -0
  63. package/templates/hono-api/projection.ts +453 -0
  64. package/templates/projection-plans.ts +135 -0
  65. package/templates/registry.ts +59 -0
  66. package/templates/rust-bin/.github/dependabot.yml +4 -0
  67. package/templates/rust-bin/.github/workflows/check.yml +6 -1
  68. package/templates/rust-bin/projection.ts +346 -0
  69. package/templates/ts-lib/projection.ts +454 -0
  70. package/templates/vue-app/projection.ts +687 -0
  71. package/templates/vue-app/test/e2e/app.spec.ts +4 -1
  72. package/templates/vue-hono-app/projection.ts +669 -0
  73. package/templates/vue-hono-app/web/test/e2e/app.spec.ts +4 -1
  74. package/dist/cli.d.ts.map +0 -1
  75. package/dist/declarations.d.ts.map +0 -1
  76. package/dist/hono-api.d.ts +0 -2
  77. package/dist/hono-api.d.ts.map +0 -1
  78. package/dist/hono-api.js +0 -208
  79. package/dist/package-addition.d.ts.map +0 -1
  80. package/dist/package-addition.js +0 -560
  81. package/dist/post-commands.d.ts +0 -40
  82. package/dist/post-commands.d.ts.map +0 -1
  83. package/dist/post-commands.js +0 -154
  84. package/dist/renderer.d.ts.map +0 -1
  85. package/dist/rust-bin.d.ts +0 -2
  86. package/dist/rust-bin.d.ts.map +0 -1
  87. package/dist/rust-bin.js +0 -174
  88. package/dist/ts-lib.d.ts +0 -2
  89. package/dist/ts-lib.d.ts.map +0 -1
  90. package/dist/ts-lib.js +0 -181
  91. package/dist/vue-app.d.ts +0 -2
  92. package/dist/vue-app.d.ts.map +0 -1
  93. package/dist/vue-app.js +0 -299
  94. package/dist/vue-hono-app.d.ts +0 -4
  95. package/dist/vue-hono-app.d.ts.map +0 -1
  96. package/dist/vue-hono-app.js +0 -436
  97. package/templates/shared/oxc/package.json +0 -18
  98. package/templates/shared/oxc/tsconfig.json +0 -11
  99. /package/dist/{cli.d.ts → src/cli.d.ts} +0 -0
  100. /package/dist/{package-addition.d.ts → src/package-addition.d.ts} +0 -0
  101. /package/dist/{renderer.d.ts → src/renderer.d.ts} +0 -0
package/dist/hono-api.js DELETED
@@ -1,208 +0,0 @@
1
- import path from "node:path";
2
- import { fileURLToPath } from "node:url";
3
- import { renderNewProject } from "./renderer.js";
4
- const features = [
5
- "pnpm-catalog",
6
- "oxc-format-lint",
7
- "strict-typescript",
8
- "root-check",
9
- "fix-command",
10
- "devcontainer",
11
- "github-actions",
12
- "dependabot"
13
- ];
14
- const generatedBy = {
15
- packageName: "@ykdz/template",
16
- version: "0.0.0",
17
- command: "template init --preset hono-api"
18
- };
19
- function projectNameFromDir(targetDir) {
20
- return path.basename(path.resolve(targetDir));
21
- }
22
- function packageJson(projectName) {
23
- return {
24
- name: projectName,
25
- version: "0.0.0",
26
- private: true,
27
- type: "module",
28
- scripts: {
29
- build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
30
- check: "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run build && pnpm run test",
31
- fix: "pnpm run format:write && pnpm run lint:fix",
32
- "format:check": "oxfmt --check .",
33
- "format:write": "oxfmt --write .",
34
- lint: "oxlint . --deny-warnings",
35
- "lint:fix": "oxlint . --fix --deny-warnings",
36
- start: "node dist/server.js",
37
- test: "vitest run",
38
- typecheck: "tsc -p tsconfig.json --noEmit"
39
- },
40
- dependencies: {
41
- "@hono/node-server": "catalog:",
42
- hono: "catalog:"
43
- },
44
- devDependencies: {
45
- "@types/node": "catalog:",
46
- oxfmt: "catalog:",
47
- oxlint: "catalog:",
48
- "tsc-alias": "catalog:",
49
- typescript: "catalog:",
50
- vitest: "catalog:"
51
- },
52
- engines: {
53
- node: "22"
54
- },
55
- packageManager: "pnpm@10.0.0"
56
- };
57
- }
58
- function operationsForHonoApi(projectName) {
59
- return [
60
- {
61
- kind: "writeJson",
62
- to: "package.json",
63
- value: packageJson(projectName)
64
- },
65
- {
66
- kind: "writeText",
67
- to: "pnpm-workspace.yaml",
68
- text: [
69
- "packages:",
70
- " - .",
71
- "",
72
- "catalog:",
73
- ' "@hono/node-server": ^2.0.6',
74
- ' "@types/node": ^24.0.0',
75
- " hono: ^4.12.27",
76
- " oxfmt: ^0.56.0",
77
- " oxlint: ^1.71.0",
78
- " tsc-alias: ^1.8.17",
79
- " typescript: ^5.8.0",
80
- " vitest: ^4.1.9",
81
- ""
82
- ].join("\n")
83
- },
84
- {
85
- kind: "writeJson",
86
- to: "tsconfig.json",
87
- value: {
88
- compilerOptions: {
89
- module: "NodeNext",
90
- moduleResolution: "NodeNext",
91
- noEmitOnError: true,
92
- paths: {
93
- "@/*": ["./src/*"]
94
- },
95
- skipLibCheck: false,
96
- strict: true,
97
- target: "ES2022",
98
- types: ["node", "vitest/globals"]
99
- },
100
- include: ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"]
101
- }
102
- },
103
- {
104
- kind: "writeJson",
105
- to: "tsconfig.build.json",
106
- value: {
107
- extends: "./tsconfig.json",
108
- compilerOptions: {
109
- outDir: "dist",
110
- rootDir: "src",
111
- types: ["node"]
112
- },
113
- include: ["src/**/*.ts"]
114
- }
115
- },
116
- {
117
- kind: "copyFile",
118
- sourceRoot: "sharedOxc",
119
- from: "node/oxlint.config.ts",
120
- to: "oxlint.config.ts"
121
- },
122
- {
123
- kind: "copyFile",
124
- sourceRoot: "sharedOxc",
125
- from: "oxfmt.config.ts",
126
- to: "oxfmt.config.ts"
127
- },
128
- {
129
- kind: "writeText",
130
- to: ".gitignore",
131
- text: ["node_modules", "dist", ".env", ""].join("\n")
132
- },
133
- {
134
- kind: "copyFile",
135
- from: "src/app.ts",
136
- to: "src/app.ts"
137
- },
138
- {
139
- kind: "copyFile",
140
- from: "src/server.ts",
141
- to: "src/server.ts"
142
- },
143
- {
144
- kind: "copyFile",
145
- from: "test/app.test.ts",
146
- to: "test/app.test.ts"
147
- },
148
- {
149
- kind: "copyFile",
150
- from: "vitest.config.ts",
151
- to: "vitest.config.ts"
152
- },
153
- {
154
- kind: "writeJson",
155
- to: ".project-kit/blueprint.json",
156
- value: {
157
- schemaVersion: 1,
158
- preset: "hono-api",
159
- packageManager: "pnpm",
160
- projectKind: "single-package",
161
- features
162
- }
163
- },
164
- {
165
- kind: "writeJson",
166
- to: ".project-kit/generated-by.json",
167
- value: generatedBy
168
- },
169
- {
170
- kind: "writeJson",
171
- to: ".devcontainer/devcontainer.json",
172
- value: {
173
- name: `${projectName} API development`,
174
- image: "mcr.microsoft.com/devcontainers/typescript-node:22",
175
- postCreateCommand: "corepack enable && pnpm install",
176
- customizations: {
177
- vscode: {
178
- extensions: ["oxc.oxc-vscode"]
179
- }
180
- }
181
- }
182
- },
183
- {
184
- kind: "copyFile",
185
- from: ".github/workflows/check.yml",
186
- to: ".github/workflows/check.yml",
187
- },
188
- {
189
- kind: "copyFile",
190
- from: ".github/dependabot.yml",
191
- to: ".github/dependabot.yml",
192
- }
193
- ];
194
- }
195
- function templateSourceRoot() {
196
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "hono-api");
197
- }
198
- function sharedOxcSourceRoot() {
199
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "shared", "oxc");
200
- }
201
- export async function initHonoApiProject(targetDir) {
202
- await renderNewProject({
203
- sourceRoot: templateSourceRoot(),
204
- sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
205
- targetRoot: targetDir,
206
- operations: operationsForHonoApi(projectNameFromDir(targetDir))
207
- });
208
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-addition.d.ts","sourceRoot":"","sources":["../src/package-addition.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAqnBF,wBAAsB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2C1E"}