@ykdz/template 0.0.3 → 0.0.5

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 +0 -1
  3. package/dist/src/cli.js +26 -2
  4. package/dist/src/declarations.d.ts +38 -3
  5. package/dist/src/declarations.js +75 -36
  6. package/dist/src/dependency-catalog.d.ts +9 -1
  7. package/dist/src/dependency-catalog.js +69 -0
  8. package/dist/src/devcontainer.d.ts +49 -9
  9. package/dist/src/devcontainer.js +192 -14
  10. package/dist/src/editor-customization.d.ts +0 -1
  11. package/dist/src/editor-customization.js +54 -47
  12. package/dist/src/generation-context.d.ts +0 -1
  13. package/dist/src/generation-context.js +4 -1
  14. package/dist/src/module-graph.d.ts +8 -5
  15. package/dist/src/module-graph.js +20 -2
  16. package/dist/src/next-step-instructions.d.ts +0 -1
  17. package/dist/src/next-step-instructions.js +35 -0
  18. package/dist/src/package-addition-support.d.ts +5 -0
  19. package/dist/src/package-addition-support.js +4 -0
  20. package/dist/src/package-addition.d.ts +2 -1
  21. package/dist/src/package-addition.js +557 -55
  22. package/dist/src/package-linking.d.ts +55 -0
  23. package/dist/src/package-linking.js +116 -0
  24. package/dist/src/preset-projection.d.ts +4 -2
  25. package/dist/src/project-github.d.ts +3 -2
  26. package/dist/src/project-github.js +24 -6
  27. package/dist/src/renderer.d.ts +16 -2
  28. package/dist/src/renderer.js +96 -12
  29. package/dist/src/runtime-paths.d.ts +0 -1
  30. package/dist/src/template-boundary-check.d.ts +34 -0
  31. package/dist/src/template-boundary-check.js +448 -0
  32. package/dist/src/toolchain-resolution.d.ts +0 -1
  33. package/dist/templates/hono-api/projection.d.ts +2 -3
  34. package/dist/templates/hono-api/projection.js +258 -76
  35. package/dist/templates/projection-plans.d.ts +0 -1
  36. package/dist/templates/registry.d.ts +0 -1
  37. package/dist/templates/registry.js +5 -2
  38. package/dist/templates/rust-bin/projection.d.ts +2 -3
  39. package/dist/templates/rust-bin/projection.js +171 -53
  40. package/dist/templates/ts-lib/projection.d.ts +2 -3
  41. package/dist/templates/ts-lib/projection.js +251 -87
  42. package/dist/templates/vue-app/projection.d.ts +2 -3
  43. package/dist/templates/vue-app/projection.js +266 -94
  44. package/dist/templates/vue-hono-app/projection.d.ts +0 -1
  45. package/dist/templates/vue-hono-app/projection.js +232 -108
  46. package/package.json +10 -5
  47. package/pnpm-workspace.yaml +1 -0
  48. package/templates/hono-api/.github/dependabot.yml +13 -0
  49. package/templates/hono-api/src/server.ts +1 -1
  50. package/templates/hono-api/test/app.test.ts +1 -1
  51. package/templates/rust-bin/.github/dependabot.yml +18 -1
  52. package/templates/rust-bin/rust-toolchain.toml +3 -0
  53. package/templates/rust-bin/rustfmt.toml +2 -0
  54. package/templates/shared/devcontainer/browser-test.Dockerfile +2 -0
  55. package/templates/shared/devcontainer/node-pnpm.Dockerfile +6 -0
  56. package/templates/shared/devcontainer/rust.Dockerfile +16 -0
  57. package/templates/shared/editor-customization/capabilities.json +56 -0
  58. package/templates/ts-lib/.github/dependabot.yml +13 -0
  59. package/templates/ts-lib/src/index.ts +5 -1
  60. package/templates/ts-lib/src/name-schema.ts +3 -0
  61. package/templates/vue-app/.github/dependabot.yml +13 -0
  62. package/templates/vue-app/.github/workflows/check.yml +1 -1
  63. package/templates/vue-app/src/App.vue +1 -1
  64. package/templates/vue-app/test/app.test.ts +1 -1
  65. package/templates/vue-hono-app/.github/dependabot.yml +13 -0
  66. package/templates/vue-hono-app/web/src/App.vue +2 -2
  67. package/templates/vue-hono-app/web/test/app.test.ts +1 -1
  68. package/dist/src/cli.d.ts.map +0 -1
  69. package/dist/src/declarations.d.ts.map +0 -1
  70. package/dist/src/dependency-catalog.d.ts.map +0 -1
  71. package/dist/src/devcontainer.d.ts.map +0 -1
  72. package/dist/src/editor-customization.d.ts.map +0 -1
  73. package/dist/src/generation-context.d.ts.map +0 -1
  74. package/dist/src/module-graph.d.ts.map +0 -1
  75. package/dist/src/next-step-instructions.d.ts.map +0 -1
  76. package/dist/src/package-addition.d.ts.map +0 -1
  77. package/dist/src/preset-projection.d.ts.map +0 -1
  78. package/dist/src/project-github.d.ts.map +0 -1
  79. package/dist/src/renderer.d.ts.map +0 -1
  80. package/dist/src/runtime-paths.d.ts.map +0 -1
  81. package/dist/src/toolchain-resolution.d.ts.map +0 -1
  82. package/dist/templates/hono-api/projection.d.ts.map +0 -1
  83. package/dist/templates/projection-plans.d.ts.map +0 -1
  84. package/dist/templates/registry.d.ts.map +0 -1
  85. package/dist/templates/rust-bin/projection.d.ts.map +0 -1
  86. package/dist/templates/ts-lib/projection.d.ts.map +0 -1
  87. package/dist/templates/vue-app/projection.d.ts.map +0 -1
  88. package/dist/templates/vue-hono-app/projection.d.ts.map +0 -1
  89. package/templates/hono-api/projection.ts +0 -453
  90. package/templates/projection-plans.ts +0 -135
  91. package/templates/registry.ts +0 -59
  92. package/templates/rust-bin/projection.ts +0 -346
  93. package/templates/ts-lib/projection.ts +0 -454
  94. package/templates/vue-app/projection.ts +0 -687
  95. package/templates/vue-hono-app/projection.ts +0 -669
@@ -1,13 +1,13 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
- import { renderGeneratedPnpmWorkspaceYaml } from "../../src/dependency-catalog.js";
5
- import { nodePnpmDevcontainer } from "../../src/devcontainer.js";
4
+ import { collectGeneratedManifestCatalogReferences, renderGeneratedPnpmWorkspaceYaml, } from "../../src/dependency-catalog.js";
5
+ import { browserTestToolLayer, checkedDockerfileFirstNodePnpmDevcontainer, nodePnpmToolLayer, } from "../../src/devcontainer.js";
6
6
  import { editorCustomizationForCapabilities } from "../../src/editor-customization.js";
7
7
  import { renderFixCommand, renderRootCheckCommand, } from "../../src/module-graph.js";
8
- import { projectCheckWorkflow, projectDependabotConfig, } from "../../src/project-github.js";
8
+ import { PackageAdditionSupport } from "../../src/package-addition-support.js";
9
+ import { packageManifestExposureFields, planPackageLinks, } from "../../src/package-linking.js";
9
10
  import { renderNewProject } from "../../src/renderer.js";
10
- import { planNodeChecks, planNodeFixes } from "../projection-plans.js";
11
11
  const generatedBy = {
12
12
  packageName: "@ykdz/template",
13
13
  version: "0.0.0",
@@ -20,6 +20,7 @@ export const vueHonoAppPresetMetadata = {
20
20
  generation: "supported",
21
21
  supportedPackageManagers: ["pnpm"],
22
22
  supportedProjectKinds: ["multi-package"],
23
+ packageAdditionSupport: PackageAdditionSupport.Unsupported,
23
24
  features: [
24
25
  "pnpm-catalog",
25
26
  "oxc-format-lint",
@@ -32,9 +33,101 @@ export const vueHonoAppPresetMetadata = {
32
33
  ],
33
34
  };
34
35
  const dependencyMaintenancePolicy = {
35
- ecosystems: ["npm", "github-actions"],
36
+ ecosystems: ["npm", "github-actions", "docker"],
36
37
  interval: "weekly",
37
38
  };
39
+ const rootBoundary = {
40
+ kind: "workspace-orchestration",
41
+ path: ".",
42
+ };
43
+ const apiPackageBoundary = {
44
+ kind: "package-boundary",
45
+ path: ".",
46
+ };
47
+ const webPackageBoundary = {
48
+ kind: "package-boundary",
49
+ path: ".",
50
+ };
51
+ const workspacePackageBoundary = {
52
+ kind: "package-boundary",
53
+ path: "apps/*",
54
+ };
55
+ const webWorkspaceBoundary = {
56
+ kind: "package-boundary",
57
+ path: "apps/web",
58
+ };
59
+ function honoApiCheckComponents(owner) {
60
+ return [
61
+ { kind: "oxc-format-check", owner },
62
+ { kind: "oxc-lint", owner },
63
+ { kind: "typescript-typecheck", owner },
64
+ { kind: "build", owner },
65
+ { kind: "unit-test", owner },
66
+ ];
67
+ }
68
+ function vueWebCheckComponents(owner) {
69
+ return [
70
+ { kind: "oxc-format-check", owner },
71
+ { kind: "oxc-lint", owner },
72
+ { kind: "typescript-typecheck", owner },
73
+ { kind: "build", owner },
74
+ { kind: "unit-test", owner },
75
+ { kind: "e2e-test", owner },
76
+ ];
77
+ }
78
+ function nodeFixComponents(owner) {
79
+ return [
80
+ { kind: "oxc-format-write", owner },
81
+ { kind: "oxc-lint-fix", owner },
82
+ ];
83
+ }
84
+ function planVueHonoRootChecks() {
85
+ return {
86
+ components: [
87
+ { kind: "oxc-format-check", owner: rootBoundary },
88
+ { kind: "oxc-lint", owner: rootBoundary },
89
+ { kind: "typescript-typecheck", owner: rootBoundary },
90
+ { kind: "turbo-package-typecheck", owner: workspacePackageBoundary },
91
+ { kind: "turbo-package-build", owner: workspacePackageBoundary },
92
+ { kind: "turbo-package-test", owner: workspacePackageBoundary },
93
+ { kind: "turbo-package-e2e-test", owner: workspacePackageBoundary },
94
+ { kind: "turbo-package-check", owner: workspacePackageBoundary },
95
+ ],
96
+ environmentNeeds: [
97
+ {
98
+ kind: "playwright-browser-assets",
99
+ browser: "chromium",
100
+ owner: webWorkspaceBoundary,
101
+ },
102
+ ],
103
+ };
104
+ }
105
+ function planVueHonoRootFixes() {
106
+ return {
107
+ components: [
108
+ { kind: "oxc-format-write", owner: rootBoundary },
109
+ { kind: "oxc-lint-fix", owner: rootBoundary },
110
+ { kind: "turbo-package-fix", owner: workspacePackageBoundary },
111
+ ],
112
+ };
113
+ }
114
+ function planVueHonoApiChecks() {
115
+ return {
116
+ components: [...honoApiCheckComponents(apiPackageBoundary)],
117
+ environmentNeeds: [],
118
+ };
119
+ }
120
+ function planVueHonoWebChecks() {
121
+ return {
122
+ components: [...vueWebCheckComponents(webPackageBoundary)],
123
+ environmentNeeds: [],
124
+ };
125
+ }
126
+ function planVueHonoPackageFixes(owner) {
127
+ return {
128
+ components: [...nodeFixComponents(owner)],
129
+ };
130
+ }
38
131
  function projectNameFromDir(targetDir) {
39
132
  return path.basename(path.resolve(targetDir));
40
133
  }
@@ -60,21 +153,26 @@ export function vueHonoAppBlueprint(options) {
60
153
  }
61
154
  export function projectVueHonoRootPackageScripts() {
62
155
  return {
63
- check: renderRootCheckCommand(planNodeChecks("vue-hono-root")),
156
+ check: renderRootCheckCommand(planVueHonoRootChecks()),
64
157
  dev: "turbo run dev --parallel",
65
- fix: renderFixCommand(planNodeFixes("vue-hono-root")),
158
+ fix: renderFixCommand(planVueHonoRootFixes()),
159
+ "format:check": "oxfmt --check --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
160
+ "format:write": "oxfmt --write --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
161
+ lint: "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --deny-warnings",
162
+ "lint:fix": "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix --deny-warnings",
163
+ typecheck: "tsc -p tsconfig.config.json --noEmit",
66
164
  };
67
165
  }
68
166
  export function projectVueHonoApiPackageScripts() {
69
167
  return {
70
168
  build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
71
- check: renderRootCheckCommand(planNodeChecks("vue-hono-api")),
169
+ check: renderRootCheckCommand(planVueHonoApiChecks()),
72
170
  dev: "tsx watch src/server.ts",
73
- fix: renderFixCommand(planNodeFixes("vue-hono-api")),
74
- "format:check": "oxfmt --check .",
75
- "format:write": "oxfmt --write .",
76
- lint: "oxlint . --deny-warnings",
77
- "lint:fix": "oxlint . --fix --deny-warnings",
171
+ fix: renderFixCommand(planVueHonoPackageFixes(apiPackageBoundary)),
172
+ "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
173
+ "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
174
+ lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
175
+ "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
78
176
  start: "node dist/server.js",
79
177
  test: "vitest run",
80
178
  typecheck: "tsc -p tsconfig.json --noEmit",
@@ -83,13 +181,13 @@ export function projectVueHonoApiPackageScripts() {
83
181
  export function projectVueHonoWebPackageScripts() {
84
182
  return {
85
183
  build: "vite build",
86
- check: renderRootCheckCommand(planNodeChecks("vue-hono-web")),
184
+ check: renderRootCheckCommand(planVueHonoWebChecks()),
87
185
  dev: "vite",
88
- fix: renderFixCommand(planNodeFixes("vue-hono-web")),
89
- "format:check": "oxfmt --check .",
90
- "format:write": "oxfmt --write .",
91
- lint: "oxlint . --deny-warnings",
92
- "lint:fix": "oxlint . --fix --deny-warnings",
186
+ fix: renderFixCommand(planVueHonoPackageFixes(webPackageBoundary)),
187
+ "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
188
+ "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
189
+ lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
190
+ "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
93
191
  preview: "vite preview",
94
192
  test: "vitest run",
95
193
  "test:e2e": "pnpm run build && playwright test",
@@ -104,7 +202,10 @@ function rootPackageJson(context, packageScripts) {
104
202
  type: "module",
105
203
  scripts: packageScripts,
106
204
  devDependencies: {
205
+ oxfmt: "catalog:",
206
+ oxlint: "catalog:",
107
207
  turbo: "catalog:",
208
+ typescript: "catalog:",
108
209
  },
109
210
  engines: {
110
211
  node: context.toolchain.nodeLtsMajor.value,
@@ -112,16 +213,16 @@ function rootPackageJson(context, packageScripts) {
112
213
  packageManager: context.toolchain.packageManagerPin.value,
113
214
  };
114
215
  }
115
- function apiPackageJson(context, packageScope) {
216
+ function apiPackageJson(context, packageScope, exposure) {
217
+ const exposureFields = packageManifestExposureFields(exposure);
116
218
  return {
117
219
  name: packageName(packageScope, "api"),
118
220
  version: "0.0.0",
119
221
  private: true,
120
222
  type: "module",
121
- types: "./dist/index.d.ts",
122
- exports: {
123
- ".": "./dist/index.js",
124
- },
223
+ types: exposureFields.types,
224
+ exports: exposureFields.exports,
225
+ imports: exposureFields.imports,
125
226
  scripts: projectVueHonoApiPackageScripts(),
126
227
  dependencies: {
127
228
  "@hono/node-server": "catalog:",
@@ -141,15 +242,21 @@ function apiPackageJson(context, packageScope) {
141
242
  },
142
243
  };
143
244
  }
144
- function webPackageJson(context, packageScope) {
245
+ function webPackageJson(context, packageScope, packageLinkDependencies) {
145
246
  return {
146
247
  name: packageName(packageScope, "web"),
147
248
  version: "0.0.0",
148
249
  private: true,
149
250
  type: "module",
251
+ imports: {
252
+ "#/*": {
253
+ default: "./src/*.ts",
254
+ types: "./src/*.ts",
255
+ },
256
+ },
150
257
  scripts: projectVueHonoWebPackageScripts(),
151
258
  dependencies: {
152
- [packageName(packageScope, "api")]: "workspace:*",
259
+ ...packageLinkDependencies,
153
260
  "@vueuse/core": "catalog:",
154
261
  hono: "catalog:",
155
262
  pinia: "catalog:",
@@ -196,43 +303,57 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
196
303
  const packageScope = packageScopeFromBlueprint(context);
197
304
  const apiName = packageName(packageScope, "api");
198
305
  const webName = packageName(packageScope, "web");
199
- const editorCustomization = editorCustomizationForCapabilities(["oxc-format-lint", "vue", "tailwind", "vitest"], {
200
- oxcConfigPaths: "nested",
306
+ const editorCustomization = editorCustomizationForCapabilities([
307
+ "oxc-format-lint",
308
+ "vue",
309
+ "tailwind",
310
+ "vitest",
311
+ ]);
312
+ const developmentContainer = checkedDockerfileFirstNodePnpmDevcontainer({
313
+ name: context.projectName.value,
314
+ layer: nodePnpmToolLayer({
315
+ nodeVersion: context.toolchain.nodeLtsMajor.value,
316
+ packageManagerPin: context.toolchain.packageManagerPin.value,
317
+ }),
318
+ additionalLayers: [browserTestToolLayer()],
319
+ extensions: editorCustomization.extensions,
320
+ settings: editorCustomization.settings,
201
321
  });
322
+ const rootManifest = rootPackageJson(context, packageScripts);
323
+ const packageLinkPlan = planPackageLinks([
324
+ {
325
+ name: apiName,
326
+ path: "apps/api",
327
+ role: "runtime-service",
328
+ sourcePreset: "hono-api",
329
+ },
330
+ ], [{ consumerPackagePath: "apps/web", providerPackagePath: "apps/api" }]);
331
+ const apiExposure = packageLinkPlan.exposuresByPackagePath.get("apps/api");
332
+ const webPackageLinkDependencies = packageLinkPlan.manifestDependenciesByPackagePath.get("apps/web");
333
+ if (apiExposure === undefined) {
334
+ throw new Error("Missing Package Exposure for apps/api");
335
+ }
336
+ if (webPackageLinkDependencies === undefined) {
337
+ throw new Error("Missing Package Link Dependencies for apps/web");
338
+ }
339
+ const apiManifest = apiPackageJson(context, packageScope, apiExposure);
340
+ const webManifest = webPackageJson(context, packageScope, webPackageLinkDependencies);
202
341
  return [
203
342
  {
204
343
  kind: "writeJson",
205
344
  to: "package.json",
206
- value: rootPackageJson(context, packageScripts),
345
+ value: rootManifest,
207
346
  },
208
347
  {
209
348
  kind: "writeText",
210
349
  to: "pnpm-workspace.yaml",
211
350
  text: renderGeneratedPnpmWorkspaceYaml({
212
351
  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
- ],
352
+ dependencies: collectGeneratedManifestCatalogReferences([
353
+ rootManifest,
354
+ apiManifest,
355
+ webManifest,
356
+ ]),
236
357
  allowBuilds: {
237
358
  esbuild: true,
238
359
  },
@@ -244,12 +365,13 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
244
365
  value: {
245
366
  tasks: {
246
367
  build: {
247
- dependsOn: ["^build"],
368
+ dependsOn: packageLinkPlan.turboTasks.build.dependsOn,
248
369
  outputs: ["dist/**"],
249
370
  },
250
- check: {
251
- dependsOn: ["^build"],
252
- },
371
+ check: packageLinkPlan.turboTasks.check,
372
+ typecheck: packageLinkPlan.turboTasks.typecheck,
373
+ test: packageLinkPlan.turboTasks.test,
374
+ "test:e2e": packageLinkPlan.turboTasks["test:e2e"],
253
375
  dev: {
254
376
  cache: false,
255
377
  persistent: true,
@@ -266,7 +388,6 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
266
388
  value: {
267
389
  files: [],
268
390
  references: [
269
- { path: "./apps/api/tsconfig.json" },
270
391
  { path: "./apps/web/tsconfig.app.json" },
271
392
  { path: "./apps/web/tsconfig.test.json" },
272
393
  { path: "./apps/web/tsconfig.node.json" },
@@ -275,24 +396,48 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
275
396
  },
276
397
  {
277
398
  kind: "writeJson",
278
- to: ".project-kit/blueprint.json",
399
+ to: "tsconfig.config.json",
400
+ value: {
401
+ compilerOptions: {
402
+ module: "NodeNext",
403
+ moduleResolution: "NodeNext",
404
+ noEmitOnError: true,
405
+ skipLibCheck: false,
406
+ strict: true,
407
+ target: "ES2022",
408
+ },
409
+ include: ["oxlint.config.ts", "oxfmt.config.ts"],
410
+ },
411
+ },
412
+ {
413
+ kind: "copyFile",
414
+ sourceRoot: "sharedOxc",
415
+ from: "vue/oxlint.config.ts",
416
+ to: "oxlint.config.ts",
417
+ },
418
+ {
419
+ kind: "copyFile",
420
+ sourceRoot: "sharedOxc",
421
+ from: "oxfmt.config.ts",
422
+ to: "oxfmt.config.ts",
423
+ },
424
+ {
425
+ kind: "writeJson",
426
+ to: ".template/blueprint.json",
279
427
  value: context.blueprint,
280
428
  },
281
429
  {
282
430
  kind: "writeJson",
283
- to: ".project-kit/generated-by.json",
431
+ to: ".template/generated-by.json",
284
432
  value: generationRecord(context),
285
433
  },
286
434
  {
287
435
  kind: "writeJson",
288
436
  to: ".devcontainer/devcontainer.json",
289
- value: nodePnpmDevcontainer({
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,
295
- }),
437
+ value: developmentContainer.devcontainer,
438
+ },
439
+ {
440
+ ...developmentContainer.dockerfileOperation,
296
441
  },
297
442
  {
298
443
  kind: "writeJson",
@@ -316,23 +461,25 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
316
461
  "playwright-report",
317
462
  "test-results",
318
463
  ".env",
464
+ ".template/",
465
+ ".pnpm-store/",
319
466
  "",
320
467
  ].join("\n"),
321
468
  },
322
469
  {
323
- kind: "writeText",
470
+ kind: "copyFile",
471
+ from: ".github/workflows/check.yml",
324
472
  to: ".github/workflows/check.yml",
325
- text: projectCheckWorkflow({ checkPlan }),
326
473
  },
327
474
  {
328
- kind: "writeText",
475
+ kind: "copyFile",
476
+ from: ".github/dependabot.yml",
329
477
  to: ".github/dependabot.yml",
330
- text: projectDependabotConfig(dependencyMaintenancePolicy),
331
478
  },
332
479
  {
333
480
  kind: "writeJson",
334
481
  to: "apps/api/package.json",
335
- value: apiPackageJson(context, packageScope),
482
+ value: apiManifest,
336
483
  },
337
484
  {
338
485
  kind: "writeJson",
@@ -345,9 +492,6 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
345
492
  module: "NodeNext",
346
493
  moduleResolution: "NodeNext",
347
494
  noEmitOnError: true,
348
- paths: {
349
- "@/*": ["./src/*"],
350
- },
351
495
  skipLibCheck: false,
352
496
  strict: true,
353
497
  target: "ES2022",
@@ -369,18 +513,6 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
369
513
  include: ["src/**/*.ts"],
370
514
  },
371
515
  },
372
- {
373
- kind: "copyFile",
374
- sourceRoot: "sharedOxc",
375
- from: "node/oxlint.config.ts",
376
- to: "apps/api/oxlint.config.ts",
377
- },
378
- {
379
- kind: "copyFile",
380
- sourceRoot: "sharedOxc",
381
- from: "oxfmt.config.ts",
382
- to: "apps/api/oxfmt.config.ts",
383
- },
384
516
  { kind: "copyFile", from: "api/src/index.ts", to: "apps/api/src/index.ts" },
385
517
  {
386
518
  kind: "copyFile",
@@ -405,7 +537,7 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
405
537
  {
406
538
  kind: "writeJson",
407
539
  to: "apps/web/package.json",
408
- value: webPackageJson(context, packageScope),
540
+ value: webManifest,
409
541
  },
410
542
  {
411
543
  kind: "writeJson",
@@ -429,10 +561,6 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
429
561
  module: "ESNext",
430
562
  moduleResolution: "Bundler",
431
563
  noEmitOnError: true,
432
- paths: {
433
- "@/*": ["./src/*"],
434
- [apiName]: ["../api/src/index.ts"],
435
- },
436
564
  skipLibCheck: false,
437
565
  strict: true,
438
566
  target: "ES2022",
@@ -440,7 +568,6 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
440
568
  types: ["web-bluetooth"],
441
569
  },
442
570
  include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
443
- references: [{ path: "../api/tsconfig.build.json" }],
444
571
  },
445
572
  },
446
573
  {
@@ -454,7 +581,6 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
454
581
  types: ["node", "vitest/globals", "web-bluetooth"],
455
582
  },
456
583
  include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue", "test/**/*.ts"],
457
- references: [{ path: "../api/tsconfig.build.json" }],
458
584
  },
459
585
  },
460
586
  {
@@ -477,18 +603,6 @@ function operationsForVueHonoApp(context, packageScripts, checkPlan) {
477
603
  include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
478
604
  },
479
605
  },
480
- {
481
- kind: "copyFile",
482
- sourceRoot: "sharedOxc",
483
- from: "vue/oxlint.config.ts",
484
- to: "apps/web/oxlint.config.ts",
485
- },
486
- {
487
- kind: "copyFile",
488
- sourceRoot: "sharedOxc",
489
- from: "oxfmt.config.ts",
490
- to: "apps/web/oxfmt.config.ts",
491
- },
492
606
  { kind: "copyFile", from: "web/env.d.ts", to: "apps/web/env.d.ts" },
493
607
  { kind: "copyFile", from: "web/index.html", to: "apps/web/index.html" },
494
608
  {
@@ -554,16 +668,26 @@ function sharedOxcSourceRoot() {
554
668
  ? publishedSharedRoot
555
669
  : path.join(projectionDir, "..", "shared", "oxc");
556
670
  }
671
+ function sharedDevcontainerSourceRoot() {
672
+ const projectionDir = path.dirname(fileURLToPath(import.meta.url));
673
+ const publishedSharedRoot = path.join(projectionDir, "..", "..", "..", "templates", "shared", "devcontainer");
674
+ return existsSync(path.join(publishedSharedRoot, "node-pnpm.Dockerfile"))
675
+ ? publishedSharedRoot
676
+ : path.join(projectionDir, "..", "shared", "devcontainer");
677
+ }
557
678
  export const vueHonoAppPresetProjection = {
558
679
  metadata: vueHonoAppPresetMetadata,
559
680
  blueprint: vueHonoAppBlueprint,
560
681
  project(context) {
561
- const checkPlan = planNodeChecks("vue-hono-root");
562
- const fixPlan = planNodeFixes("vue-hono-root");
682
+ const checkPlan = planVueHonoRootChecks();
683
+ const fixPlan = planVueHonoRootFixes();
563
684
  const packageScripts = projectVueHonoRootPackageScripts();
564
685
  return {
565
686
  sourceRoot: templateSourceRoot(),
566
- sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
687
+ sourceRoots: {
688
+ sharedDevcontainer: sharedDevcontainerSourceRoot(),
689
+ sharedOxc: sharedOxcSourceRoot(),
690
+ },
567
691
  operations: operationsForVueHonoApp(context, packageScripts, checkPlan),
568
692
  checkPlan,
569
693
  fixPlan,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "private": false,
5
5
  "description": "Project template generator for YKDZ starter projects.",
6
6
  "keywords": [
@@ -24,6 +24,9 @@
24
24
  "dist",
25
25
  "pnpm-workspace.yaml",
26
26
  "templates",
27
+ "!templates/registry.ts",
28
+ "!templates/projection-plans.ts",
29
+ "!templates/*/projection.ts",
27
30
  "!templates/shared/oxc/tsconfig.json",
28
31
  "!templates/**/node_modules"
29
32
  ],
@@ -49,17 +52,19 @@
49
52
  "node": ">=24.0.0"
50
53
  },
51
54
  "scripts": {
52
- "build": "tsc -p tsconfig.build.json",
53
- "check": "pnpm run typecheck && pnpm run test && pnpm run check:templates && pnpm run check:fixtures",
55
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
56
+ "check": "pnpm run check:format && pnpm run typecheck && pnpm run test && pnpm run check:templates",
57
+ "check:format": "oxfmt --check --config templates/shared/oxc/oxfmt.config.ts --ignore-path .oxfmtignore .",
54
58
  "check:fixtures": "tsx scripts/check-fixtures.ts",
55
- "check:templates": "pnpm run check:templates:shared-oxc && pnpm run check:templates:github-yaml && pnpm run check:templates:static-source",
59
+ "check:templates": "pnpm run check:templates:shared-oxc && pnpm run check:templates:github-yaml && pnpm run check:templates:boundary && pnpm run check:templates:static-source",
56
60
  "check:toolchain:online": "tsx scripts/check-online-toolchain-resolution-contract.ts",
61
+ "check:templates:boundary": "tsx scripts/check-template-boundary.ts",
57
62
  "check:templates:github-yaml": "tsx scripts/check-template-github-yaml.ts",
58
63
  "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
64
  "check:templates:shared-oxc:format": "oxfmt --check templates/shared/oxc",
60
65
  "check:templates:shared-oxc:lint": "oxlint templates/shared/oxc --deny-warnings",
61
66
  "check:templates:shared-oxc:typecheck": "tsc -p templates/shared/oxc/tsconfig.json --noEmit",
62
- "check:templates:static-source": "oxfmt --check --config templates/shared/oxc/oxfmt.config.ts templates && rustfmt --check templates/rust-bin/src/main.rs",
67
+ "check:templates:static-source": "rustfmt --check templates/rust-bin/src/main.rs",
63
68
  "fix": "pnpm run build",
64
69
  "typecheck": "tsc -p tsconfig.json --noEmit",
65
70
  "test": "vitest run"
@@ -19,6 +19,7 @@ catalog:
19
19
  tsx: ^4.22.4
20
20
  turbo: ^2.10.2
21
21
  typescript: ^6.0.3
22
+ valibot: ^1.4.2
22
23
  vite: ^8.1.2
23
24
  vitest: ^4.1.9
24
25
  vue: ^3.5.39
@@ -1,10 +1,23 @@
1
1
  version: 2
2
+
2
3
  updates:
3
4
  - package-ecosystem: npm
4
5
  directory: /
5
6
  schedule:
6
7
  interval: weekly
8
+ ignore:
9
+ - dependency-name: "@types/node"
10
+ update-types:
11
+ - version-update:semver-major
7
12
  - package-ecosystem: github-actions
8
13
  directory: /
9
14
  schedule:
10
15
  interval: weekly
16
+ - package-ecosystem: docker
17
+ directory: /.devcontainer
18
+ schedule:
19
+ interval: weekly
20
+ ignore:
21
+ - dependency-name: mcr.microsoft.com/devcontainers/typescript-node
22
+ update-types:
23
+ - version-update:semver-major
@@ -1,6 +1,6 @@
1
1
  import { serve } from "@hono/node-server";
2
2
 
3
- import { app } from "@/app.js";
3
+ import { app } from "#/app";
4
4
 
5
5
  const port = Number.parseInt(process.env.PORT ?? "3000", 10);
6
6
 
@@ -1,4 +1,4 @@
1
- import { app } from "@/app.js";
1
+ import { app } from "#/app";
2
2
 
3
3
  describe("Hono API", () => {
4
4
  it("responds to the health route", async () => {
@@ -1,14 +1,31 @@
1
1
  version: 2
2
+
2
3
  updates:
3
4
  - package-ecosystem: npm
4
5
  directory: /
5
6
  schedule:
6
7
  interval: weekly
8
+ ignore:
9
+ - dependency-name: "@types/node"
10
+ update-types:
11
+ - version-update:semver-major
7
12
  - package-ecosystem: cargo
8
- directory: /
13
+ directory: "{{CARGO_PACKAGE_DIRECTORY}}"
9
14
  schedule:
10
15
  interval: weekly
11
16
  - package-ecosystem: github-actions
12
17
  directory: /
13
18
  schedule:
14
19
  interval: weekly
20
+ - package-ecosystem: docker
21
+ directory: /.devcontainer
22
+ schedule:
23
+ interval: weekly
24
+ ignore:
25
+ - dependency-name: mcr.microsoft.com/devcontainers/typescript-node
26
+ update-types:
27
+ - version-update:semver-major
28
+ - package-ecosystem: rust-toolchain
29
+ directory: /
30
+ schedule:
31
+ interval: weekly
@@ -0,0 +1,3 @@
1
+ [toolchain]
2
+ channel = "{{RUST_TOOLCHAIN}}"
3
+ components = ["rustfmt", "clippy"]