@ykdz/template 0.0.2 → 0.0.4

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 (95) hide show
  1. package/README.md +1 -1
  2. package/dist/src/cli.d.ts +2 -0
  3. package/dist/{cli.js → src/cli.js} +91 -58
  4. package/dist/{declarations.d.ts → src/declarations.d.ts} +3 -5
  5. package/dist/{declarations.js → src/declarations.js} +48 -145
  6. package/dist/src/dependency-catalog.d.ts +18 -0
  7. package/dist/src/dependency-catalog.js +132 -0
  8. package/dist/src/devcontainer.d.ts +58 -0
  9. package/dist/src/devcontainer.js +202 -0
  10. package/dist/src/editor-customization.d.ts +12 -0
  11. package/dist/src/editor-customization.js +108 -0
  12. package/dist/{generation-context.d.ts → src/generation-context.d.ts} +2 -3
  13. package/dist/{generation-context.js → src/generation-context.js} +4 -1
  14. package/dist/src/module-graph.d.ts +34 -0
  15. package/dist/src/module-graph.js +58 -0
  16. package/dist/{next-step-instructions.d.ts → src/next-step-instructions.d.ts} +2 -4
  17. package/dist/{next-step-instructions.js → src/next-step-instructions.js} +49 -24
  18. package/dist/{package-addition.d.ts → src/package-addition.d.ts} +1 -1
  19. package/dist/src/package-addition.js +343 -0
  20. package/dist/src/preset-projection.d.ts +66 -0
  21. package/dist/src/preset-projection.js +7 -0
  22. package/dist/{project-github.d.ts → src/project-github.d.ts} +3 -9
  23. package/dist/{project-github.js → src/project-github.js} +27 -42
  24. package/dist/{renderer.d.ts → src/renderer.d.ts} +16 -2
  25. package/dist/{renderer.js → src/renderer.js} +95 -12
  26. package/dist/src/runtime-paths.d.ts +1 -0
  27. package/dist/src/runtime-paths.js +11 -0
  28. package/dist/src/template-boundary-check.d.ts +34 -0
  29. package/dist/src/template-boundary-check.js +448 -0
  30. package/dist/{toolchain-resolution.d.ts → src/toolchain-resolution.d.ts} +0 -1
  31. package/dist/{toolchain-resolution.js → src/toolchain-resolution.js} +1 -1
  32. package/dist/templates/hono-api/projection.d.ts +6 -0
  33. package/dist/templates/hono-api/projection.js +538 -0
  34. package/dist/templates/projection-plans.d.ts +7 -0
  35. package/dist/templates/projection-plans.js +94 -0
  36. package/dist/templates/registry.d.ts +7 -0
  37. package/dist/templates/registry.js +42 -0
  38. package/dist/templates/rust-bin/projection.d.ts +9 -0
  39. package/dist/templates/rust-bin/projection.js +390 -0
  40. package/dist/templates/ts-lib/projection.d.ts +6 -0
  41. package/dist/templates/ts-lib/projection.js +523 -0
  42. package/dist/templates/vue-app/projection.d.ts +6 -0
  43. package/dist/templates/vue-app/projection.js +757 -0
  44. package/dist/templates/vue-hono-app/projection.d.ts +8 -0
  45. package/dist/templates/vue-hono-app/projection.js +693 -0
  46. package/package.json +38 -28
  47. package/pnpm-workspace.yaml +35 -0
  48. package/templates/hono-api/.github/dependabot.yml +13 -0
  49. package/templates/rust-bin/.github/dependabot.yml +18 -1
  50. package/templates/rust-bin/rust-toolchain.toml +3 -0
  51. package/templates/rust-bin/rustfmt.toml +2 -0
  52. package/templates/shared/devcontainer/browser-test.Dockerfile +2 -0
  53. package/templates/shared/devcontainer/node-pnpm.Dockerfile +6 -0
  54. package/templates/shared/devcontainer/rust.Dockerfile +16 -0
  55. package/templates/shared/editor-customization/capabilities.json +56 -0
  56. package/templates/ts-lib/.github/dependabot.yml +13 -0
  57. package/templates/ts-lib/src/index.ts +5 -1
  58. package/templates/vue-app/.github/dependabot.yml +13 -0
  59. package/templates/vue-app/.github/workflows/check.yml +1 -1
  60. package/templates/vue-app/test/e2e/app.spec.ts +4 -1
  61. package/templates/vue-hono-app/.github/dependabot.yml +13 -0
  62. package/templates/vue-hono-app/web/test/e2e/app.spec.ts +4 -1
  63. package/dist/cli.d.ts +0 -3
  64. package/dist/cli.d.ts.map +0 -1
  65. package/dist/declarations.d.ts.map +0 -1
  66. package/dist/devcontainer.d.ts +0 -17
  67. package/dist/devcontainer.d.ts.map +0 -1
  68. package/dist/devcontainer.js +0 -23
  69. package/dist/generation-context.d.ts.map +0 -1
  70. package/dist/hono-api.d.ts +0 -3
  71. package/dist/hono-api.d.ts.map +0 -1
  72. package/dist/hono-api.js +0 -210
  73. package/dist/module-graph.d.ts +0 -45
  74. package/dist/module-graph.d.ts.map +0 -1
  75. package/dist/module-graph.js +0 -187
  76. package/dist/next-step-instructions.d.ts.map +0 -1
  77. package/dist/package-addition.d.ts.map +0 -1
  78. package/dist/package-addition.js +0 -560
  79. package/dist/project-github.d.ts.map +0 -1
  80. package/dist/renderer.d.ts.map +0 -1
  81. package/dist/rust-bin.d.ts +0 -8
  82. package/dist/rust-bin.d.ts.map +0 -1
  83. package/dist/rust-bin.js +0 -208
  84. package/dist/toolchain-resolution.d.ts.map +0 -1
  85. package/dist/ts-lib.d.ts +0 -8
  86. package/dist/ts-lib.d.ts.map +0 -1
  87. package/dist/ts-lib.js +0 -214
  88. package/dist/vue-app.d.ts +0 -3
  89. package/dist/vue-app.d.ts.map +0 -1
  90. package/dist/vue-app.js +0 -301
  91. package/dist/vue-hono-app.d.ts +0 -7
  92. package/dist/vue-hono-app.d.ts.map +0 -1
  93. package/dist/vue-hono-app.js +0 -440
  94. package/templates/shared/oxc/package.json +0 -18
  95. package/templates/shared/oxc/tsconfig.json +0 -11
@@ -1,440 +0,0 @@
1
- import path from "node:path";
2
- import { fileURLToPath } from "node:url";
3
- import { nodePnpmDevcontainer } from "./devcontainer.js";
4
- import { planNodeChecks, planNodeFixes, renderFixCommand, renderRootCheckCommand, } from "./module-graph.js";
5
- import { projectPresetDependabotConfig, projectPresetGithubCheckWorkflow } from "./project-github.js";
6
- import { renderNewProject } from "./renderer.js";
7
- const features = [
8
- "pnpm-catalog",
9
- "oxc-format-lint",
10
- "strict-typescript",
11
- "root-check",
12
- "fix-command",
13
- "devcontainer",
14
- "github-actions",
15
- "dependabot",
16
- ];
17
- const generatedBy = {
18
- packageName: "@ykdz/template",
19
- version: "0.0.0",
20
- command: "template init --preset vue-hono-app",
21
- };
22
- function projectNameFromDir(targetDir) {
23
- return path.basename(path.resolve(targetDir));
24
- }
25
- function packageName(packageScope, leaf) {
26
- return `@${packageScope}/${leaf}`;
27
- }
28
- export function projectVueHonoRootPackageScripts() {
29
- return {
30
- check: renderRootCheckCommand(planNodeChecks("vue-hono-root")),
31
- dev: "turbo run dev --parallel",
32
- fix: renderFixCommand(planNodeFixes("vue-hono-root")),
33
- };
34
- }
35
- export function projectVueHonoApiPackageScripts() {
36
- return {
37
- build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
38
- check: renderRootCheckCommand(planNodeChecks("vue-hono-api")),
39
- dev: "tsx watch src/server.ts",
40
- fix: renderFixCommand(planNodeFixes("vue-hono-api")),
41
- "format:check": "oxfmt --check .",
42
- "format:write": "oxfmt --write .",
43
- lint: "oxlint . --deny-warnings",
44
- "lint:fix": "oxlint . --fix --deny-warnings",
45
- start: "node dist/server.js",
46
- test: "vitest run",
47
- typecheck: "tsc -p tsconfig.json --noEmit",
48
- };
49
- }
50
- export function projectVueHonoWebPackageScripts() {
51
- return {
52
- build: "vite build",
53
- check: renderRootCheckCommand(planNodeChecks("vue-hono-web")),
54
- dev: "vite",
55
- fix: renderFixCommand(planNodeFixes("vue-hono-web")),
56
- "format:check": "oxfmt --check .",
57
- "format:write": "oxfmt --write .",
58
- lint: "oxlint . --deny-warnings",
59
- "lint:fix": "oxlint . --fix --deny-warnings",
60
- preview: "vite preview",
61
- test: "vitest run",
62
- "test:e2e": "pnpm run build && playwright test",
63
- typecheck: "vue-tsc --build",
64
- };
65
- }
66
- function rootPackageJson(projectName) {
67
- return {
68
- name: projectName,
69
- version: "0.0.0",
70
- private: true,
71
- type: "module",
72
- scripts: projectVueHonoRootPackageScripts(),
73
- devDependencies: {
74
- turbo: "catalog:",
75
- },
76
- engines: {
77
- node: "22",
78
- },
79
- packageManager: "pnpm@10.0.0",
80
- };
81
- }
82
- function apiPackageJson(packageScope) {
83
- return {
84
- name: packageName(packageScope, "api"),
85
- version: "0.0.0",
86
- private: true,
87
- type: "module",
88
- types: "./dist/index.d.ts",
89
- exports: {
90
- ".": "./dist/index.js",
91
- },
92
- scripts: projectVueHonoApiPackageScripts(),
93
- dependencies: {
94
- "@hono/node-server": "catalog:",
95
- hono: "catalog:",
96
- },
97
- devDependencies: {
98
- "@types/node": "catalog:",
99
- oxfmt: "catalog:",
100
- oxlint: "catalog:",
101
- "tsc-alias": "catalog:",
102
- tsx: "catalog:",
103
- typescript: "catalog:",
104
- vitest: "catalog:",
105
- },
106
- engines: {
107
- node: "22",
108
- },
109
- };
110
- }
111
- function webPackageJson(packageScope) {
112
- return {
113
- name: packageName(packageScope, "web"),
114
- version: "0.0.0",
115
- private: true,
116
- type: "module",
117
- scripts: projectVueHonoWebPackageScripts(),
118
- dependencies: {
119
- [packageName(packageScope, "api")]: "workspace:*",
120
- "@vueuse/core": "catalog:",
121
- hono: "catalog:",
122
- pinia: "catalog:",
123
- vue: "catalog:",
124
- },
125
- devDependencies: {
126
- "@playwright/test": "catalog:",
127
- "@tailwindcss/vite": "catalog:",
128
- "@types/node": "catalog:",
129
- "@types/web-bluetooth": "catalog:",
130
- "@vitejs/plugin-vue": "catalog:",
131
- "@vue/tsconfig": "catalog:",
132
- oxfmt: "catalog:",
133
- oxlint: "catalog:",
134
- tailwindcss: "catalog:",
135
- typescript: "catalog:",
136
- vite: "catalog:",
137
- vitest: "catalog:",
138
- "vue-tsc": "catalog:",
139
- },
140
- engines: {
141
- node: "22",
142
- },
143
- };
144
- }
145
- function operationsForVueHonoApp(projectName, packageScope) {
146
- const apiName = packageName(packageScope, "api");
147
- const webName = packageName(packageScope, "web");
148
- return [
149
- { kind: "writeJson", to: "package.json", value: rootPackageJson(projectName) },
150
- {
151
- kind: "writeText",
152
- to: "pnpm-workspace.yaml",
153
- text: [
154
- "packages:",
155
- " - apps/*",
156
- "",
157
- "allowBuilds:",
158
- " esbuild: true",
159
- "",
160
- "catalog:",
161
- ' "@hono/node-server": ^2.0.6',
162
- ' "@playwright/test": ^1.57.0',
163
- ' "@tailwindcss/vite": ^4.1.18',
164
- ' "@types/node": ^24.0.0',
165
- ' "@types/web-bluetooth": ^0.0.21',
166
- ' "@vitejs/plugin-vue": ^6.0.2',
167
- ' "@vue/tsconfig": ^0.8.1',
168
- ' "@vueuse/core": ^14.1.0',
169
- " hono: ^4.12.27",
170
- " oxfmt: ^0.56.0",
171
- " oxlint: ^1.71.0",
172
- " pinia: ^3.0.4",
173
- " tailwindcss: ^4.1.18",
174
- " tsc-alias: ^1.8.17",
175
- " tsx: ^4.20.0",
176
- " turbo: ^2.7.0",
177
- " typescript: ^5.8.0",
178
- " vite: ^7.3.0",
179
- " vitest: ^4.1.9",
180
- " vue: ^3.5.26",
181
- " vue-tsc: ^3.1.8",
182
- "",
183
- ].join("\n"),
184
- },
185
- {
186
- kind: "writeJson",
187
- to: "turbo.json",
188
- value: {
189
- tasks: {
190
- build: {
191
- dependsOn: ["^build"],
192
- outputs: ["dist/**"],
193
- },
194
- check: {
195
- dependsOn: ["^build"],
196
- },
197
- dev: {
198
- cache: false,
199
- persistent: true,
200
- },
201
- fix: {
202
- cache: false,
203
- },
204
- },
205
- },
206
- },
207
- {
208
- kind: "writeJson",
209
- to: "tsconfig.json",
210
- value: {
211
- files: [],
212
- references: [
213
- { path: "./apps/api/tsconfig.json" },
214
- { path: "./apps/web/tsconfig.app.json" },
215
- { path: "./apps/web/tsconfig.test.json" },
216
- { path: "./apps/web/tsconfig.node.json" },
217
- ],
218
- },
219
- },
220
- {
221
- kind: "writeJson",
222
- to: ".project-kit/blueprint.json",
223
- value: {
224
- schemaVersion: 1,
225
- preset: "vue-hono-app",
226
- packageManager: "pnpm",
227
- projectKind: "multi-package",
228
- features,
229
- packages: [
230
- { name: webName, path: "apps/web" },
231
- { name: apiName, path: "apps/api" },
232
- ],
233
- },
234
- },
235
- {
236
- kind: "writeJson",
237
- to: ".project-kit/generated-by.json",
238
- value: generatedBy,
239
- },
240
- {
241
- kind: "writeJson",
242
- to: ".devcontainer/devcontainer.json",
243
- value: nodePnpmDevcontainer({
244
- name: `${projectName} full-stack development`,
245
- nodeVersion: "22",
246
- packageManagerPin: "pnpm@10.0.0",
247
- extensions: ["Vue.volar", "oxc.oxc-vscode"],
248
- }),
249
- },
250
- {
251
- kind: "writeText",
252
- to: ".gitignore",
253
- text: ["node_modules", "dist", "playwright-report", "test-results", ".env", ""].join("\n"),
254
- },
255
- {
256
- kind: "writeText",
257
- to: ".github/workflows/check.yml",
258
- text: projectPresetGithubCheckWorkflow("vue-hono-app"),
259
- },
260
- {
261
- kind: "writeText",
262
- to: ".github/dependabot.yml",
263
- text: projectPresetDependabotConfig("vue-hono-app"),
264
- },
265
- { kind: "writeJson", to: "apps/api/package.json", value: apiPackageJson(packageScope) },
266
- {
267
- kind: "writeJson",
268
- to: "apps/api/tsconfig.json",
269
- value: {
270
- compilerOptions: {
271
- composite: true,
272
- declaration: true,
273
- declarationMap: true,
274
- module: "NodeNext",
275
- moduleResolution: "NodeNext",
276
- noEmitOnError: true,
277
- paths: {
278
- "@/*": ["./src/*"],
279
- },
280
- skipLibCheck: false,
281
- strict: true,
282
- target: "ES2022",
283
- types: ["node", "vitest/globals"],
284
- },
285
- include: ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"],
286
- },
287
- },
288
- {
289
- kind: "writeJson",
290
- to: "apps/api/tsconfig.build.json",
291
- value: {
292
- extends: "./tsconfig.json",
293
- compilerOptions: {
294
- outDir: "dist",
295
- rootDir: "src",
296
- types: ["node"],
297
- },
298
- include: ["src/**/*.ts"],
299
- },
300
- },
301
- {
302
- kind: "copyFile",
303
- sourceRoot: "sharedOxc",
304
- from: "node/oxlint.config.ts",
305
- to: "apps/api/oxlint.config.ts",
306
- },
307
- {
308
- kind: "copyFile",
309
- sourceRoot: "sharedOxc",
310
- from: "oxfmt.config.ts",
311
- to: "apps/api/oxfmt.config.ts",
312
- },
313
- { kind: "copyFile", from: "api/src/index.ts", to: "apps/api/src/index.ts" },
314
- { kind: "copyFile", from: "api/src/runtime.ts", to: "apps/api/src/runtime.ts" },
315
- { kind: "copyFile", from: "api/src/server.ts", to: "apps/api/src/server.ts" },
316
- { kind: "copyFile", from: "api/test/app.test.ts", to: "apps/api/test/app.test.ts" },
317
- { kind: "copyFile", from: "api/vitest.config.ts", to: "apps/api/vitest.config.ts" },
318
- { kind: "writeJson", to: "apps/web/package.json", value: webPackageJson(packageScope) },
319
- {
320
- kind: "writeJson",
321
- to: "apps/web/tsconfig.json",
322
- value: {
323
- files: [],
324
- references: [
325
- { path: "./tsconfig.app.json" },
326
- { path: "./tsconfig.test.json" },
327
- { path: "./tsconfig.node.json" },
328
- ],
329
- },
330
- },
331
- {
332
- kind: "writeJson",
333
- to: "apps/web/tsconfig.app.json",
334
- value: {
335
- extends: "@vue/tsconfig/tsconfig.dom.json",
336
- compilerOptions: {
337
- baseUrl: ".",
338
- composite: true,
339
- module: "ESNext",
340
- moduleResolution: "Bundler",
341
- noEmitOnError: true,
342
- paths: {
343
- "@/*": ["./src/*"],
344
- [apiName]: ["../api/src/index.ts"],
345
- },
346
- skipLibCheck: false,
347
- strict: true,
348
- target: "ES2022",
349
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
350
- types: ["web-bluetooth"],
351
- },
352
- include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
353
- references: [{ path: "../api/tsconfig.build.json" }],
354
- },
355
- },
356
- {
357
- kind: "writeJson",
358
- to: "apps/web/tsconfig.test.json",
359
- value: {
360
- extends: "./tsconfig.app.json",
361
- compilerOptions: {
362
- lib: ["ESNext", "DOM", "DOM.Iterable"],
363
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.test.tsbuildinfo",
364
- types: ["node", "vitest/globals", "web-bluetooth"],
365
- },
366
- include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue", "test/**/*.ts"],
367
- references: [{ path: "../api/tsconfig.build.json" }],
368
- },
369
- },
370
- {
371
- kind: "writeJson",
372
- to: "apps/web/tsconfig.node.json",
373
- value: {
374
- compilerOptions: {
375
- composite: true,
376
- module: "ESNext",
377
- moduleResolution: "Bundler",
378
- noEmitOnError: true,
379
- lib: ["ESNext", "DOM", "DOM.Iterable"],
380
- outDir: "./node_modules/.tmp/tsconfig.node",
381
- skipLibCheck: false,
382
- strict: true,
383
- target: "ES2022",
384
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
385
- types: ["node"],
386
- },
387
- include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
388
- },
389
- },
390
- {
391
- kind: "copyFile",
392
- sourceRoot: "sharedOxc",
393
- from: "vue/oxlint.config.ts",
394
- to: "apps/web/oxlint.config.ts",
395
- },
396
- {
397
- kind: "copyFile",
398
- sourceRoot: "sharedOxc",
399
- from: "oxfmt.config.ts",
400
- to: "apps/web/oxfmt.config.ts",
401
- },
402
- { kind: "copyFile", from: "web/env.d.ts", to: "apps/web/env.d.ts" },
403
- { kind: "copyFile", from: "web/index.html", to: "apps/web/index.html" },
404
- { kind: "copyFile", from: "web/playwright.config.ts", to: "apps/web/playwright.config.ts" },
405
- { kind: "copyFile", from: "web/vite.config.ts", to: "apps/web/vite.config.ts" },
406
- { kind: "copyFile", from: "web/vitest.config.ts", to: "apps/web/vitest.config.ts" },
407
- { kind: "copyFile", from: "web/src/api.ts", to: "apps/web/src/api.ts" },
408
- {
409
- kind: "replaceAnchors",
410
- path: "apps/web/src/api.ts",
411
- language: "typescript",
412
- replacements: {
413
- "api-type-import-start": `import type { AppType } from "${apiName}";\nimport { hc } from "hono/client";\n/*`,
414
- "api-type-import-end": "*/",
415
- },
416
- },
417
- { kind: "copyFile", from: "web/src/App.vue", to: "apps/web/src/App.vue" },
418
- { kind: "copyFile", from: "web/src/main.ts", to: "apps/web/src/main.ts" },
419
- { kind: "copyFile", from: "web/src/style.css", to: "apps/web/src/style.css" },
420
- { kind: "copyFile", from: "web/src/stores/counter.ts", to: "apps/web/src/stores/counter.ts" },
421
- { kind: "copyFile", from: "web/test/app.test.ts", to: "apps/web/test/app.test.ts" },
422
- { kind: "copyFile", from: "web/test/e2e/app.spec.ts", to: "apps/web/test/e2e/app.spec.ts" },
423
- ];
424
- }
425
- function templateSourceRoot() {
426
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "vue-hono-app");
427
- }
428
- function sharedOxcSourceRoot() {
429
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "shared", "oxc");
430
- }
431
- export async function initVueHonoAppProject(targetDir, options = {}) {
432
- const projectName = projectNameFromDir(targetDir);
433
- const packageScope = options.scope ?? projectName;
434
- await renderNewProject({
435
- sourceRoot: templateSourceRoot(),
436
- sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
437
- targetRoot: targetDir,
438
- operations: operationsForVueHonoApp(projectName, packageScope),
439
- });
440
- }
@@ -1,18 +0,0 @@
1
- {
2
- "name": "@ykdz/template-shared-oxc",
3
- "private": true,
4
- "type": "module",
5
- "scripts": {
6
- "check": "pnpm run format:check && pnpm run lint && pnpm run typecheck",
7
- "format:check": "oxfmt --check .",
8
- "format:write": "oxfmt --write .",
9
- "lint": "oxlint . --deny-warnings",
10
- "lint:fix": "oxlint . --fix --deny-warnings",
11
- "typecheck": "tsc -p tsconfig.json --noEmit"
12
- },
13
- "devDependencies": {
14
- "oxfmt": "^0.56.0",
15
- "oxlint": "^1.71.0",
16
- "typescript": "^6.0.3"
17
- }
18
- }
@@ -1,11 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "NodeNext",
4
- "moduleResolution": "NodeNext",
5
- "noEmitOnError": true,
6
- "skipLibCheck": false,
7
- "strict": true,
8
- "target": "ES2022"
9
- },
10
- "include": ["**/*.ts"]
11
- }