@ykdz/template 0.0.2 → 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 (102) hide show
  1. package/dist/src/cli.d.ts.map +1 -0
  2. package/dist/{cli.js → src/cli.js} +77 -56
  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/{devcontainer.d.ts → src/devcontainer.d.ts} +1 -0
  10. package/dist/src/devcontainer.d.ts.map +1 -0
  11. package/dist/{devcontainer.js → src/devcontainer.js} +1 -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/{generation-context.d.ts → src/generation-context.d.ts} +2 -2
  16. package/dist/src/generation-context.d.ts.map +1 -0
  17. package/dist/{module-graph.d.ts → src/module-graph.d.ts} +0 -14
  18. package/dist/src/module-graph.d.ts.map +1 -0
  19. package/dist/src/module-graph.js +48 -0
  20. package/dist/{next-step-instructions.d.ts → src/next-step-instructions.d.ts} +2 -3
  21. package/dist/src/next-step-instructions.d.ts.map +1 -0
  22. package/dist/{next-step-instructions.js → src/next-step-instructions.js} +14 -24
  23. package/dist/src/package-addition.d.ts.map +1 -0
  24. package/dist/src/package-addition.js +188 -0
  25. package/dist/src/preset-projection.d.ts +66 -0
  26. package/dist/src/preset-projection.d.ts.map +1 -0
  27. package/dist/src/preset-projection.js +7 -0
  28. package/dist/{project-github.d.ts → src/project-github.d.ts} +0 -7
  29. package/dist/src/project-github.d.ts.map +1 -0
  30. package/dist/{project-github.js → src/project-github.js} +3 -36
  31. package/dist/src/renderer.d.ts.map +1 -0
  32. package/dist/src/runtime-paths.d.ts +2 -0
  33. package/dist/src/runtime-paths.d.ts.map +1 -0
  34. package/dist/src/runtime-paths.js +11 -0
  35. package/dist/src/toolchain-resolution.d.ts.map +1 -0
  36. package/dist/{toolchain-resolution.js → src/toolchain-resolution.js} +1 -1
  37. package/dist/templates/hono-api/projection.d.ts +7 -0
  38. package/dist/templates/hono-api/projection.d.ts.map +1 -0
  39. package/dist/templates/hono-api/projection.js +377 -0
  40. package/dist/templates/projection-plans.d.ts +8 -0
  41. package/dist/templates/projection-plans.d.ts.map +1 -0
  42. package/dist/templates/projection-plans.js +94 -0
  43. package/dist/templates/registry.d.ts +8 -0
  44. package/dist/templates/registry.d.ts.map +1 -0
  45. package/dist/templates/registry.js +42 -0
  46. package/dist/templates/rust-bin/projection.d.ts +10 -0
  47. package/dist/templates/rust-bin/projection.d.ts.map +1 -0
  48. package/dist/templates/rust-bin/projection.js +282 -0
  49. package/dist/templates/ts-lib/projection.d.ts +7 -0
  50. package/dist/templates/ts-lib/projection.d.ts.map +1 -0
  51. package/dist/templates/ts-lib/projection.js +372 -0
  52. package/dist/templates/vue-app/projection.d.ts +7 -0
  53. package/dist/templates/vue-app/projection.d.ts.map +1 -0
  54. package/dist/templates/vue-app/projection.js +594 -0
  55. package/dist/templates/vue-hono-app/projection.d.ts +9 -0
  56. package/dist/templates/vue-hono-app/projection.d.ts.map +1 -0
  57. package/dist/{vue-hono-app.js → templates/vue-hono-app/projection.js} +250 -101
  58. package/package.json +29 -24
  59. package/pnpm-workspace.yaml +34 -0
  60. package/templates/hono-api/projection.ts +453 -0
  61. package/templates/projection-plans.ts +135 -0
  62. package/templates/registry.ts +59 -0
  63. package/templates/rust-bin/projection.ts +346 -0
  64. package/templates/ts-lib/projection.ts +454 -0
  65. package/templates/vue-app/projection.ts +687 -0
  66. package/templates/vue-app/test/e2e/app.spec.ts +4 -1
  67. package/templates/vue-hono-app/projection.ts +669 -0
  68. package/templates/vue-hono-app/web/test/e2e/app.spec.ts +4 -1
  69. package/dist/cli.d.ts.map +0 -1
  70. package/dist/declarations.d.ts.map +0 -1
  71. package/dist/devcontainer.d.ts.map +0 -1
  72. package/dist/generation-context.d.ts.map +0 -1
  73. package/dist/hono-api.d.ts +0 -3
  74. package/dist/hono-api.d.ts.map +0 -1
  75. package/dist/hono-api.js +0 -210
  76. package/dist/module-graph.d.ts.map +0 -1
  77. package/dist/module-graph.js +0 -187
  78. package/dist/next-step-instructions.d.ts.map +0 -1
  79. package/dist/package-addition.d.ts.map +0 -1
  80. package/dist/package-addition.js +0 -560
  81. package/dist/project-github.d.ts.map +0 -1
  82. package/dist/renderer.d.ts.map +0 -1
  83. package/dist/rust-bin.d.ts +0 -8
  84. package/dist/rust-bin.d.ts.map +0 -1
  85. package/dist/rust-bin.js +0 -208
  86. package/dist/toolchain-resolution.d.ts.map +0 -1
  87. package/dist/ts-lib.d.ts +0 -8
  88. package/dist/ts-lib.d.ts.map +0 -1
  89. package/dist/ts-lib.js +0 -214
  90. package/dist/vue-app.d.ts +0 -3
  91. package/dist/vue-app.d.ts.map +0 -1
  92. package/dist/vue-app.js +0 -301
  93. package/dist/vue-hono-app.d.ts +0 -7
  94. package/dist/vue-hono-app.d.ts.map +0 -1
  95. package/templates/shared/oxc/package.json +0 -18
  96. package/templates/shared/oxc/tsconfig.json +0 -11
  97. /package/dist/{cli.d.ts → src/cli.d.ts} +0 -0
  98. /package/dist/{generation-context.js → src/generation-context.js} +0 -0
  99. /package/dist/{package-addition.d.ts → src/package-addition.d.ts} +0 -0
  100. /package/dist/{renderer.d.ts → src/renderer.d.ts} +0 -0
  101. /package/dist/{renderer.js → src/renderer.js} +0 -0
  102. /package/dist/{toolchain-resolution.d.ts → src/toolchain-resolution.d.ts} +0 -0
@@ -1,30 +1,63 @@
1
+ import { existsSync } from "node:fs";
1
2
  import path from "node:path";
2
3
  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
- ];
4
+ import { renderGeneratedPnpmWorkspaceYaml } from "../../src/dependency-catalog.js";
5
+ import { nodePnpmDevcontainer } from "../../src/devcontainer.js";
6
+ import { editorCustomizationForCapabilities } from "../../src/editor-customization.js";
7
+ import { renderFixCommand, renderRootCheckCommand, } from "../../src/module-graph.js";
8
+ import { projectCheckWorkflow, projectDependabotConfig, } from "../../src/project-github.js";
9
+ import { renderNewProject } from "../../src/renderer.js";
10
+ import { planNodeChecks, planNodeFixes } from "../projection-plans.js";
17
11
  const generatedBy = {
18
12
  packageName: "@ykdz/template",
19
13
  version: "0.0.0",
20
14
  command: "template init --preset vue-hono-app",
21
15
  };
16
+ export const vueHonoAppPresetMetadata = {
17
+ name: "vue-hono-app",
18
+ title: "Vue Hono app",
19
+ description: "Full-stack Vue and Hono workspace with Hono RPC typing.",
20
+ generation: "supported",
21
+ supportedPackageManagers: ["pnpm"],
22
+ supportedProjectKinds: ["multi-package"],
23
+ features: [
24
+ "pnpm-catalog",
25
+ "oxc-format-lint",
26
+ "strict-typescript",
27
+ "root-check",
28
+ "fix-command",
29
+ "devcontainer",
30
+ "github-actions",
31
+ "dependabot",
32
+ ],
33
+ };
34
+ const dependencyMaintenancePolicy = {
35
+ ecosystems: ["npm", "github-actions"],
36
+ interval: "weekly",
37
+ };
22
38
  function projectNameFromDir(targetDir) {
23
39
  return path.basename(path.resolve(targetDir));
24
40
  }
41
+ function packageScopeFromOptions(options) {
42
+ return options.scope ?? projectNameFromDir(options.targetDir);
43
+ }
25
44
  function packageName(packageScope, leaf) {
26
45
  return `@${packageScope}/${leaf}`;
27
46
  }
47
+ export function vueHonoAppBlueprint(options) {
48
+ const packageScope = packageScopeFromOptions(options);
49
+ return {
50
+ schemaVersion: 1,
51
+ preset: "vue-hono-app",
52
+ packageManager: "pnpm",
53
+ projectKind: "multi-package",
54
+ features: [...vueHonoAppPresetMetadata.features],
55
+ packages: [
56
+ { name: packageName(packageScope, "web"), path: "apps/web" },
57
+ { name: packageName(packageScope, "api"), path: "apps/api" },
58
+ ],
59
+ };
60
+ }
28
61
  export function projectVueHonoRootPackageScripts() {
29
62
  return {
30
63
  check: renderRootCheckCommand(planNodeChecks("vue-hono-root")),
@@ -63,23 +96,23 @@ export function projectVueHonoWebPackageScripts() {
63
96
  typecheck: "vue-tsc --build",
64
97
  };
65
98
  }
66
- function rootPackageJson(projectName) {
99
+ function rootPackageJson(context, packageScripts) {
67
100
  return {
68
- name: projectName,
101
+ name: context.projectName.value,
69
102
  version: "0.0.0",
70
103
  private: true,
71
104
  type: "module",
72
- scripts: projectVueHonoRootPackageScripts(),
105
+ scripts: packageScripts,
73
106
  devDependencies: {
74
107
  turbo: "catalog:",
75
108
  },
76
109
  engines: {
77
- node: "22",
110
+ node: context.toolchain.nodeLtsMajor.value,
78
111
  },
79
- packageManager: "pnpm@10.0.0",
112
+ packageManager: context.toolchain.packageManagerPin.value,
80
113
  };
81
114
  }
82
- function apiPackageJson(packageScope) {
115
+ function apiPackageJson(context, packageScope) {
83
116
  return {
84
117
  name: packageName(packageScope, "api"),
85
118
  version: "0.0.0",
@@ -104,11 +137,11 @@ function apiPackageJson(packageScope) {
104
137
  vitest: "catalog:",
105
138
  },
106
139
  engines: {
107
- node: "22",
140
+ node: context.toolchain.nodeLtsMajor.value,
108
141
  },
109
142
  };
110
143
  }
111
- function webPackageJson(packageScope) {
144
+ function webPackageJson(context, packageScope) {
112
145
  return {
113
146
  name: packageName(packageScope, "web"),
114
147
  version: "0.0.0",
@@ -138,49 +171,72 @@ function webPackageJson(packageScope) {
138
171
  "vue-tsc": "catalog:",
139
172
  },
140
173
  engines: {
141
- node: "22",
174
+ node: context.toolchain.nodeLtsMajor.value,
175
+ },
176
+ };
177
+ }
178
+ function generationRecord(context) {
179
+ return {
180
+ ...generatedBy,
181
+ toolchain: {
182
+ nodeLtsMajor: context.toolchain.nodeLtsMajor.value,
183
+ packageManagerPin: context.toolchain.packageManagerPin.value,
184
+ source: context.toolchain.source,
142
185
  },
143
186
  };
144
187
  }
145
- function operationsForVueHonoApp(projectName, packageScope) {
188
+ function packageScopeFromBlueprint(context) {
189
+ const apiPackage = context.blueprint.packages?.find((pkg) => pkg.path === "apps/api");
190
+ if (apiPackage?.name.startsWith("@") && apiPackage.name.endsWith("/api")) {
191
+ return apiPackage.name.slice(1, -"/api".length);
192
+ }
193
+ return context.projectName.value;
194
+ }
195
+ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
196
+ const packageScope = packageScopeFromBlueprint(context);
146
197
  const apiName = packageName(packageScope, "api");
147
198
  const webName = packageName(packageScope, "web");
199
+ const editorCustomization = editorCustomizationForCapabilities(["oxc-format-lint", "vue", "tailwind", "vitest"], {
200
+ oxcConfigPaths: "nested",
201
+ });
148
202
  return [
149
- { kind: "writeJson", to: "package.json", value: rootPackageJson(projectName) },
203
+ {
204
+ kind: "writeJson",
205
+ to: "package.json",
206
+ value: rootPackageJson(context, packageScripts),
207
+ },
150
208
  {
151
209
  kind: "writeText",
152
210
  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"),
211
+ text: renderGeneratedPnpmWorkspaceYaml({
212
+ packages: ["apps/*"],
213
+ dependencies: [
214
+ "@hono/node-server",
215
+ "@playwright/test",
216
+ "@tailwindcss/vite",
217
+ "@types/node",
218
+ "@types/web-bluetooth",
219
+ "@vitejs/plugin-vue",
220
+ "@vue/tsconfig",
221
+ "@vueuse/core",
222
+ "hono",
223
+ "oxfmt",
224
+ "oxlint",
225
+ "pinia",
226
+ "tailwindcss",
227
+ "tsc-alias",
228
+ "tsx",
229
+ "turbo",
230
+ "typescript",
231
+ "vite",
232
+ "vitest",
233
+ "vue",
234
+ "vue-tsc",
235
+ ],
236
+ allowBuilds: {
237
+ esbuild: true,
238
+ },
239
+ }),
184
240
  },
185
241
  {
186
242
  kind: "writeJson",
@@ -220,49 +276,64 @@ function operationsForVueHonoApp(projectName, packageScope) {
220
276
  {
221
277
  kind: "writeJson",
222
278
  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
- },
279
+ value: context.blueprint,
234
280
  },
235
281
  {
236
282
  kind: "writeJson",
237
283
  to: ".project-kit/generated-by.json",
238
- value: generatedBy,
284
+ value: generationRecord(context),
239
285
  },
240
286
  {
241
287
  kind: "writeJson",
242
288
  to: ".devcontainer/devcontainer.json",
243
289
  value: nodePnpmDevcontainer({
244
- name: `${projectName} full-stack development`,
245
- nodeVersion: "22",
246
- packageManagerPin: "pnpm@10.0.0",
247
- extensions: ["Vue.volar", "oxc.oxc-vscode"],
290
+ name: `${context.projectName.value} full-stack development`,
291
+ nodeVersion: context.toolchain.nodeLtsMajor.value,
292
+ packageManagerPin: context.toolchain.packageManagerPin.value,
293
+ extensions: editorCustomization.extensions,
294
+ settings: editorCustomization.settings,
248
295
  }),
249
296
  },
297
+ {
298
+ kind: "writeJson",
299
+ to: ".vscode/extensions.json",
300
+ value: {
301
+ recommendations: editorCustomization.extensions,
302
+ },
303
+ multilineArrays: ["recommendations"],
304
+ },
305
+ {
306
+ kind: "writeJson",
307
+ to: ".vscode/settings.json",
308
+ value: editorCustomization.settings,
309
+ },
250
310
  {
251
311
  kind: "writeText",
252
312
  to: ".gitignore",
253
- text: ["node_modules", "dist", "playwright-report", "test-results", ".env", ""].join("\n"),
313
+ text: [
314
+ "node_modules",
315
+ "dist",
316
+ "playwright-report",
317
+ "test-results",
318
+ ".env",
319
+ "",
320
+ ].join("\n"),
254
321
  },
255
322
  {
256
323
  kind: "writeText",
257
324
  to: ".github/workflows/check.yml",
258
- text: projectPresetGithubCheckWorkflow("vue-hono-app"),
325
+ text: projectCheckWorkflow({ checkPlan }),
259
326
  },
260
327
  {
261
328
  kind: "writeText",
262
329
  to: ".github/dependabot.yml",
263
- text: projectPresetDependabotConfig("vue-hono-app"),
330
+ text: projectDependabotConfig(dependencyMaintenancePolicy),
331
+ },
332
+ {
333
+ kind: "writeJson",
334
+ to: "apps/api/package.json",
335
+ value: apiPackageJson(context, packageScope),
264
336
  },
265
- { kind: "writeJson", to: "apps/api/package.json", value: apiPackageJson(packageScope) },
266
337
  {
267
338
  kind: "writeJson",
268
339
  to: "apps/api/tsconfig.json",
@@ -311,11 +382,31 @@ function operationsForVueHonoApp(projectName, packageScope) {
311
382
  to: "apps/api/oxfmt.config.ts",
312
383
  },
313
384
  { 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) },
385
+ {
386
+ kind: "copyFile",
387
+ from: "api/src/runtime.ts",
388
+ to: "apps/api/src/runtime.ts",
389
+ },
390
+ {
391
+ kind: "copyFile",
392
+ from: "api/src/server.ts",
393
+ to: "apps/api/src/server.ts",
394
+ },
395
+ {
396
+ kind: "copyFile",
397
+ from: "api/test/app.test.ts",
398
+ to: "apps/api/test/app.test.ts",
399
+ },
400
+ {
401
+ kind: "copyFile",
402
+ from: "api/vitest.config.ts",
403
+ to: "apps/api/vitest.config.ts",
404
+ },
405
+ {
406
+ kind: "writeJson",
407
+ to: "apps/web/package.json",
408
+ value: webPackageJson(context, packageScope),
409
+ },
319
410
  {
320
411
  kind: "writeJson",
321
412
  to: "apps/web/tsconfig.json",
@@ -334,7 +425,6 @@ function operationsForVueHonoApp(projectName, packageScope) {
334
425
  value: {
335
426
  extends: "@vue/tsconfig/tsconfig.dom.json",
336
427
  compilerOptions: {
337
- baseUrl: ".",
338
428
  composite: true,
339
429
  module: "ESNext",
340
430
  moduleResolution: "Bundler",
@@ -401,9 +491,21 @@ function operationsForVueHonoApp(projectName, packageScope) {
401
491
  },
402
492
  { kind: "copyFile", from: "web/env.d.ts", to: "apps/web/env.d.ts" },
403
493
  { 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" },
494
+ {
495
+ kind: "copyFile",
496
+ from: "web/playwright.config.ts",
497
+ to: "apps/web/playwright.config.ts",
498
+ },
499
+ {
500
+ kind: "copyFile",
501
+ from: "web/vite.config.ts",
502
+ to: "apps/web/vite.config.ts",
503
+ },
504
+ {
505
+ kind: "copyFile",
506
+ from: "web/vitest.config.ts",
507
+ to: "apps/web/vitest.config.ts",
508
+ },
407
509
  { kind: "copyFile", from: "web/src/api.ts", to: "apps/web/src/api.ts" },
408
510
  {
409
511
  kind: "replaceAnchors",
@@ -416,25 +518,72 @@ function operationsForVueHonoApp(projectName, packageScope) {
416
518
  },
417
519
  { kind: "copyFile", from: "web/src/App.vue", to: "apps/web/src/App.vue" },
418
520
  { 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" },
521
+ {
522
+ kind: "copyFile",
523
+ from: "web/src/style.css",
524
+ to: "apps/web/src/style.css",
525
+ },
526
+ {
527
+ kind: "copyFile",
528
+ from: "web/src/stores/counter.ts",
529
+ to: "apps/web/src/stores/counter.ts",
530
+ },
531
+ {
532
+ kind: "copyFile",
533
+ from: "web/test/app.test.ts",
534
+ to: "apps/web/test/app.test.ts",
535
+ },
536
+ {
537
+ kind: "copyFile",
538
+ from: "web/test/e2e/app.spec.ts",
539
+ to: "apps/web/test/e2e/app.spec.ts",
540
+ },
423
541
  ];
424
542
  }
425
543
  function templateSourceRoot() {
426
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "vue-hono-app");
544
+ const projectionDir = path.dirname(fileURLToPath(import.meta.url));
545
+ const publishedTemplateRoot = path.join(projectionDir, "..", "..", "..", "templates", "vue-hono-app");
546
+ return existsSync(path.join(publishedTemplateRoot, "web", "src", "App.vue"))
547
+ ? publishedTemplateRoot
548
+ : projectionDir;
427
549
  }
428
550
  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
- });
551
+ const projectionDir = path.dirname(fileURLToPath(import.meta.url));
552
+ const publishedSharedRoot = path.join(projectionDir, "..", "..", "..", "templates", "shared", "oxc");
553
+ return existsSync(path.join(publishedSharedRoot, "oxfmt.config.ts"))
554
+ ? publishedSharedRoot
555
+ : path.join(projectionDir, "..", "shared", "oxc");
440
556
  }
557
+ export const vueHonoAppPresetProjection = {
558
+ metadata: vueHonoAppPresetMetadata,
559
+ blueprint: vueHonoAppBlueprint,
560
+ project(context) {
561
+ const checkPlan = planNodeChecks("vue-hono-root");
562
+ const fixPlan = planNodeFixes("vue-hono-root");
563
+ const packageScripts = projectVueHonoRootPackageScripts();
564
+ return {
565
+ sourceRoot: templateSourceRoot(),
566
+ sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
567
+ operations: operationsForVueHonoApp(context, packageScripts, checkPlan),
568
+ checkPlan,
569
+ fixPlan,
570
+ dependencyMaintenancePolicy,
571
+ packageScripts,
572
+ capabilities: {
573
+ rootCheck: true,
574
+ fixCommand: true,
575
+ githubActions: true,
576
+ dependabot: true,
577
+ devcontainer: true,
578
+ },
579
+ };
580
+ },
581
+ async render({ targetDir, plan }) {
582
+ await renderNewProject({
583
+ sourceRoot: plan.sourceRoot,
584
+ sourceRoots: plan.sourceRoots,
585
+ targetRoot: targetDir,
586
+ operations: [...plan.operations],
587
+ });
588
+ },
589
+ };
package/package.json CHANGED
@@ -1,50 +1,52 @@
1
1
  {
2
2
  "name": "@ykdz/template",
3
- "version": "0.0.2",
4
- "description": "Project template generator for YKDZ starter projects.",
5
- "license": "MIT",
3
+ "version": "0.0.3",
6
4
  "private": false,
7
- "type": "module",
8
- "bin": {
9
- "template": "dist/cli.js"
10
- },
11
- "publishConfig": {
12
- "access": "public"
5
+ "description": "Project template generator for YKDZ starter projects.",
6
+ "keywords": [
7
+ "cli",
8
+ "project-template",
9
+ "starter"
10
+ ],
11
+ "homepage": "https://github.com/YKDZ/template#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/YKDZ/template/issues"
13
14
  },
15
+ "license": "MIT",
14
16
  "repository": {
15
17
  "type": "git",
16
18
  "url": "git+https://github.com/YKDZ/template.git"
17
19
  },
18
- "bugs": {
19
- "url": "https://github.com/YKDZ/template/issues"
20
+ "bin": {
21
+ "template": "dist/src/cli.js"
20
22
  },
21
- "homepage": "https://github.com/YKDZ/template#readme",
22
- "keywords": [
23
- "cli",
24
- "project-template",
25
- "starter"
26
- ],
27
23
  "files": [
28
24
  "dist",
25
+ "pnpm-workspace.yaml",
29
26
  "templates",
27
+ "!templates/shared/oxc/tsconfig.json",
30
28
  "!templates/**/node_modules"
31
29
  ],
30
+ "type": "module",
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
32
34
  "dependencies": {
33
35
  "typescript": "^6.0.3",
34
36
  "valibot": "^1.4.2"
35
37
  },
36
38
  "devDependencies": {
37
39
  "@types/node": "^24.0.0",
38
- "execa": "^9.6.0",
39
- "oxfmt": "^0.56.0",
40
- "oxlint": "^1.71.0",
41
- "oxlint-tsgolint": "^0.23.0",
42
- "tsx": "^4.20.0",
40
+ "execa": "^9.6.1",
41
+ "oxfmt": "^0.57.0",
42
+ "oxlint": "^1.72.0",
43
+ "oxlint-tsgolint": "^0.24.0",
44
+ "tsx": "^4.22.4",
43
45
  "vitest": "^4.1.9",
44
46
  "yaml": "^2.9.0"
45
47
  },
46
48
  "engines": {
47
- "node": ">=22.0.0"
49
+ "node": ">=24.0.0"
48
50
  },
49
51
  "scripts": {
50
52
  "build": "tsc -p tsconfig.build.json",
@@ -53,7 +55,10 @@
53
55
  "check:templates": "pnpm run check:templates:shared-oxc && pnpm run check:templates:github-yaml && pnpm run check:templates:static-source",
54
56
  "check:toolchain:online": "tsx scripts/check-online-toolchain-resolution-contract.ts",
55
57
  "check:templates:github-yaml": "tsx scripts/check-template-github-yaml.ts",
56
- "check:templates:shared-oxc": "pnpm --dir templates/shared/oxc run check",
58
+ "check:templates:shared-oxc": "pnpm run check:templates:shared-oxc:format && pnpm run check:templates:shared-oxc:lint && pnpm run check:templates:shared-oxc:typecheck",
59
+ "check:templates:shared-oxc:format": "oxfmt --check templates/shared/oxc",
60
+ "check:templates:shared-oxc:lint": "oxlint templates/shared/oxc --deny-warnings",
61
+ "check:templates:shared-oxc:typecheck": "tsc -p templates/shared/oxc/tsconfig.json --noEmit",
57
62
  "check:templates:static-source": "oxfmt --check --config templates/shared/oxc/oxfmt.config.ts templates && rustfmt --check templates/rust-bin/src/main.rs",
58
63
  "fix": "pnpm run build",
59
64
  "typecheck": "tsc -p tsconfig.json --noEmit",
@@ -0,0 +1,34 @@
1
+ packages:
2
+ - .
3
+
4
+ catalog:
5
+ "@hono/node-server": ^2.0.6
6
+ "@playwright/test": ^1.61.1
7
+ "@tailwindcss/vite": ^4.3.2
8
+ "@types/node": ^24.0.0
9
+ "@types/web-bluetooth": ^0.0.21
10
+ "@vitejs/plugin-vue": ^6.0.7
11
+ "@vue/tsconfig": ^0.9.1
12
+ "@vueuse/core": ^14.3.0
13
+ hono: ^4.12.27
14
+ oxfmt: ^0.57.0
15
+ oxlint: ^1.72.0
16
+ pinia: ^3.0.4
17
+ tailwindcss: ^4.3.2
18
+ tsc-alias: ^1.8.17
19
+ tsx: ^4.22.4
20
+ turbo: ^2.10.2
21
+ typescript: ^6.0.3
22
+ vite: ^8.1.2
23
+ vitest: ^4.1.9
24
+ vue: ^3.5.39
25
+ vue-tsc: ^3.3.6
26
+
27
+ allowBuilds:
28
+ esbuild: true
29
+
30
+ minimumReleaseAgeExclude:
31
+ - valibot@1.4.2
32
+
33
+ onlyBuiltDependencies:
34
+ - esbuild