@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 { collectGeneratedManifestCatalogDependencies, renderGeneratedPnpmWorkspaceYaml, } from "../../src/dependency-catalog.js";
5
+ import { 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, packageTurboTasks, } 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",
@@ -16,10 +16,11 @@ const generatedBy = {
16
16
  export const honoApiPresetMetadata = {
17
17
  name: "hono-api",
18
18
  title: "Hono API",
19
- description: "Single-package Hono Node API with strict TypeScript tooling.",
19
+ description: "Hono Node API workspace with strict TypeScript tooling.",
20
20
  generation: "supported",
21
21
  supportedPackageManagers: ["pnpm"],
22
- supportedProjectKinds: ["single-package"],
22
+ supportedProjectKinds: ["multi-package"],
23
+ packageAdditionSupport: PackageAdditionSupport.Supported,
23
24
  features: [
24
25
  "pnpm-catalog",
25
26
  "oxc-format-lint",
@@ -32,39 +33,145 @@ export const honoApiPresetMetadata = {
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
  };
38
- export function honoApiBlueprint() {
39
+ const apiPackageBoundary = {
40
+ kind: "package-boundary",
41
+ path: ".",
42
+ };
43
+ const rootBoundary = {
44
+ kind: "workspace-orchestration",
45
+ path: ".",
46
+ };
47
+ const workspacePackageBoundary = {
48
+ kind: "package-boundary",
49
+ path: "apps/*",
50
+ };
51
+ function planHonoApiPackageChecks() {
52
+ return {
53
+ components: [
54
+ { kind: "oxc-format-check", owner: apiPackageBoundary },
55
+ { kind: "oxc-lint", owner: apiPackageBoundary },
56
+ { kind: "typescript-typecheck", owner: apiPackageBoundary },
57
+ { kind: "build", owner: apiPackageBoundary },
58
+ { kind: "unit-test", owner: apiPackageBoundary },
59
+ ],
60
+ environmentNeeds: [],
61
+ };
62
+ }
63
+ function planHonoApiRootChecks() {
64
+ return {
65
+ components: [
66
+ { kind: "oxc-format-check", owner: rootBoundary },
67
+ { kind: "oxc-lint", owner: rootBoundary },
68
+ { kind: "typescript-typecheck", owner: rootBoundary },
69
+ { kind: "turbo-package-typecheck", owner: workspacePackageBoundary },
70
+ { kind: "turbo-package-build", owner: workspacePackageBoundary },
71
+ { kind: "turbo-package-test", owner: workspacePackageBoundary },
72
+ { kind: "turbo-package-check", owner: workspacePackageBoundary },
73
+ ],
74
+ environmentNeeds: [],
75
+ };
76
+ }
77
+ function planHonoApiPackageFixes() {
78
+ return {
79
+ components: [
80
+ { kind: "oxc-format-write", owner: apiPackageBoundary },
81
+ { kind: "oxc-lint-fix", owner: apiPackageBoundary },
82
+ ],
83
+ };
84
+ }
85
+ function planHonoApiRootFixes() {
86
+ return {
87
+ components: [
88
+ { kind: "oxc-format-write", owner: rootBoundary },
89
+ { kind: "oxc-lint-fix", owner: rootBoundary },
90
+ { kind: "turbo-package-fix", owner: workspacePackageBoundary },
91
+ ],
92
+ };
93
+ }
94
+ function projectNameFromDir(targetDir) {
95
+ return path.basename(path.resolve(targetDir));
96
+ }
97
+ function packageScopeFromOptions(options) {
98
+ return options.scope ?? projectNameFromDir(options.targetDir);
99
+ }
100
+ function packageName(packageScope) {
101
+ return `@${packageScope}/api`;
102
+ }
103
+ export function honoApiBlueprint(options = { targetDir: process.cwd() }) {
104
+ const packageScope = packageScopeFromOptions(options);
39
105
  return {
40
106
  schemaVersion: 1,
41
107
  preset: "hono-api",
42
108
  packageManager: "pnpm",
43
- projectKind: "single-package",
109
+ projectKind: "multi-package",
44
110
  features: [...honoApiPresetMetadata.features],
111
+ packages: [{ name: packageName(packageScope), path: "apps/api" }],
112
+ };
113
+ }
114
+ function projectHonoApiRootPackageScripts() {
115
+ return {
116
+ check: renderRootCheckCommand(planHonoApiRootChecks()),
117
+ fix: renderFixCommand(planHonoApiRootFixes()),
118
+ "format:check": "oxfmt --check --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
119
+ "format:write": "oxfmt --write --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
120
+ lint: "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --deny-warnings",
121
+ "lint:fix": "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix --deny-warnings",
122
+ typecheck: "tsc -p tsconfig.config.json --noEmit",
45
123
  };
46
124
  }
47
125
  export function projectHonoApiPackageScripts() {
48
126
  return {
49
127
  build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
50
- check: renderRootCheckCommand(planNodeChecks("hono-api")),
51
- fix: renderFixCommand(planNodeFixes("hono-api")),
52
- "format:check": "oxfmt --check .",
53
- "format:write": "oxfmt --write .",
54
- lint: "oxlint . --deny-warnings",
55
- "lint:fix": "oxlint . --fix --deny-warnings",
128
+ check: renderRootCheckCommand(planHonoApiPackageChecks()),
129
+ fix: renderFixCommand(planHonoApiPackageFixes()),
130
+ "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
131
+ "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
132
+ lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
133
+ "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
56
134
  start: "node dist/server.js",
57
135
  test: "vitest run",
58
136
  typecheck: "tsc -p tsconfig.json --noEmit",
59
137
  };
60
138
  }
61
- function packageJson(context, packageScripts) {
139
+ function rootPackageJson(context, packageScripts) {
62
140
  return {
63
141
  name: context.projectName.value,
64
142
  version: "0.0.0",
65
143
  private: true,
66
144
  type: "module",
67
145
  scripts: packageScripts,
146
+ devDependencies: {
147
+ oxfmt: "catalog:",
148
+ oxlint: "catalog:",
149
+ turbo: "catalog:",
150
+ typescript: "catalog:",
151
+ },
152
+ engines: {
153
+ node: context.toolchain.nodeLtsMajor.value,
154
+ },
155
+ packageManager: context.toolchain.packageManagerPin.value,
156
+ };
157
+ }
158
+ function apiPackageName(context) {
159
+ const apiPackage = context.blueprint.packages?.find((pkg) => pkg.path === "apps/api");
160
+ return apiPackage?.name ?? packageName(context.projectName.value);
161
+ }
162
+ function apiPackageJson(context) {
163
+ return {
164
+ name: apiPackageName(context),
165
+ version: "0.0.0",
166
+ private: true,
167
+ type: "module",
168
+ imports: {
169
+ "#/*": {
170
+ default: "./dist/*.js",
171
+ types: "./src/*.ts",
172
+ },
173
+ },
174
+ scripts: projectHonoApiPackageScripts(),
68
175
  dependencies: {
69
176
  "@hono/node-server": "catalog:",
70
177
  hono: "catalog:",
@@ -80,7 +187,6 @@ function packageJson(context, packageScripts) {
80
187
  engines: {
81
188
  node: context.toolchain.nodeLtsMajor.value,
82
189
  },
83
- packageManager: context.toolchain.packageManagerPin.value,
84
190
  };
85
191
  }
86
192
  function generationRecord(context) {
@@ -98,39 +204,88 @@ function operationsForHonoApi(context, packageScripts, checkPlan) {
98
204
  "oxc-format-lint",
99
205
  "vitest",
100
206
  ]);
207
+ const developmentContainer = checkedDockerfileFirstNodePnpmDevcontainer({
208
+ name: context.projectName.value,
209
+ layer: nodePnpmToolLayer({
210
+ nodeVersion: context.toolchain.nodeLtsMajor.value,
211
+ packageManagerPin: context.toolchain.packageManagerPin.value,
212
+ }),
213
+ extensions: editorCustomization.extensions,
214
+ settings: editorCustomization.settings,
215
+ });
216
+ const rootManifest = rootPackageJson(context, packageScripts);
217
+ const apiManifest = apiPackageJson(context);
218
+ const turboTasks = packageTurboTasks({ dependencyBuildsRequired: false });
101
219
  return [
102
220
  {
103
221
  kind: "writeJson",
104
222
  to: "package.json",
105
- value: packageJson(context, packageScripts),
223
+ value: rootManifest,
106
224
  },
107
225
  {
108
226
  kind: "writeText",
109
227
  to: "pnpm-workspace.yaml",
110
228
  text: renderGeneratedPnpmWorkspaceYaml({
111
- dependencies: [
112
- "@hono/node-server",
113
- "@types/node",
114
- "hono",
115
- "oxfmt",
116
- "oxlint",
117
- "tsc-alias",
118
- "typescript",
119
- "vitest",
120
- ],
229
+ packages: ["apps/*"],
230
+ dependencies: collectGeneratedManifestCatalogDependencies([
231
+ rootManifest,
232
+ apiManifest,
233
+ ]),
121
234
  }),
122
235
  },
236
+ {
237
+ kind: "writeJson",
238
+ to: "turbo.json",
239
+ value: {
240
+ tasks: {
241
+ build: turboTasks.build,
242
+ check: turboTasks.check,
243
+ typecheck: turboTasks.typecheck,
244
+ test: turboTasks.test,
245
+ "test:e2e": turboTasks["test:e2e"],
246
+ fix: {
247
+ cache: false,
248
+ },
249
+ },
250
+ },
251
+ },
123
252
  {
124
253
  kind: "writeJson",
125
254
  to: "tsconfig.json",
255
+ value: {
256
+ files: [],
257
+ references: [{ path: "./apps/api/tsconfig.json" }],
258
+ },
259
+ },
260
+ {
261
+ kind: "writeJson",
262
+ to: "tsconfig.config.json",
126
263
  value: {
127
264
  compilerOptions: {
128
265
  module: "NodeNext",
129
266
  moduleResolution: "NodeNext",
130
267
  noEmitOnError: true,
131
- paths: {
132
- "@/*": ["./src/*"],
133
- },
268
+ skipLibCheck: false,
269
+ strict: true,
270
+ target: "ES2022",
271
+ },
272
+ include: ["oxlint.config.ts", "oxfmt.config.ts"],
273
+ },
274
+ },
275
+ {
276
+ kind: "writeJson",
277
+ to: "apps/api/package.json",
278
+ value: apiManifest,
279
+ },
280
+ {
281
+ kind: "writeJson",
282
+ to: "apps/api/tsconfig.json",
283
+ value: {
284
+ compilerOptions: {
285
+ composite: true,
286
+ module: "NodeNext",
287
+ moduleResolution: "NodeNext",
288
+ noEmitOnError: true,
134
289
  skipLibCheck: false,
135
290
  strict: true,
136
291
  target: "ES2022",
@@ -141,7 +296,7 @@ function operationsForHonoApi(context, packageScripts, checkPlan) {
141
296
  },
142
297
  {
143
298
  kind: "writeJson",
144
- to: "tsconfig.build.json",
299
+ to: "apps/api/tsconfig.build.json",
145
300
  value: {
146
301
  extends: "./tsconfig.json",
147
302
  compilerOptions: {
@@ -167,32 +322,48 @@ function operationsForHonoApi(context, packageScripts, checkPlan) {
167
322
  {
168
323
  kind: "writeText",
169
324
  to: ".gitignore",
170
- text: ["node_modules", "dist", ".env", ""].join("\n"),
325
+ text: [
326
+ "node_modules",
327
+ "dist",
328
+ ".env",
329
+ ".template/",
330
+ ".pnpm-store/",
331
+ "",
332
+ ].join("\n"),
333
+ },
334
+ { kind: "copyFile", from: "src/app.ts", to: "apps/api/src/app.ts" },
335
+ {
336
+ kind: "copyFile",
337
+ from: "src/server.ts",
338
+ to: "apps/api/src/server.ts",
339
+ },
340
+ {
341
+ kind: "copyFile",
342
+ from: "test/app.test.ts",
343
+ to: "apps/api/test/app.test.ts",
344
+ },
345
+ {
346
+ kind: "copyFile",
347
+ from: "vitest.config.ts",
348
+ to: "apps/api/vitest.config.ts",
171
349
  },
172
- { kind: "copyFile", from: "src/app.ts", to: "src/app.ts" },
173
- { kind: "copyFile", from: "src/server.ts", to: "src/server.ts" },
174
- { kind: "copyFile", from: "test/app.test.ts", to: "test/app.test.ts" },
175
- { kind: "copyFile", from: "vitest.config.ts", to: "vitest.config.ts" },
176
350
  {
177
351
  kind: "writeJson",
178
- to: ".project-kit/blueprint.json",
179
- value: honoApiBlueprint(),
352
+ to: ".template/blueprint.json",
353
+ value: context.blueprint,
180
354
  },
181
355
  {
182
356
  kind: "writeJson",
183
- to: ".project-kit/generated-by.json",
357
+ to: ".template/generated-by.json",
184
358
  value: generationRecord(context),
185
359
  },
186
360
  {
187
361
  kind: "writeJson",
188
362
  to: ".devcontainer/devcontainer.json",
189
- value: nodePnpmDevcontainer({
190
- name: `${context.projectName.value} API development`,
191
- nodeVersion: context.toolchain.nodeLtsMajor.value,
192
- packageManagerPin: context.toolchain.packageManagerPin.value,
193
- extensions: editorCustomization.extensions,
194
- settings: editorCustomization.settings,
195
- }),
363
+ value: developmentContainer.devcontainer,
364
+ },
365
+ {
366
+ ...developmentContainer.dockerfileOperation,
196
367
  },
197
368
  {
198
369
  kind: "writeJson",
@@ -208,18 +379,30 @@ function operationsForHonoApi(context, packageScripts, checkPlan) {
208
379
  value: editorCustomization.settings,
209
380
  },
210
381
  {
211
- kind: "writeText",
382
+ kind: "copyFile",
383
+ from: ".github/workflows/check.yml",
212
384
  to: ".github/workflows/check.yml",
213
- text: projectCheckWorkflow({ checkPlan }),
214
385
  },
215
386
  {
216
- kind: "writeText",
387
+ kind: "copyFile",
388
+ from: ".github/dependabot.yml",
217
389
  to: ".github/dependabot.yml",
218
- text: projectDependabotConfig(dependencyMaintenancePolicy),
219
390
  },
220
391
  ];
221
392
  }
222
393
  function packageAdditionOperations(packagePath, packageName, nodeVersion) {
394
+ const packageExposure = planPackageLinks([
395
+ {
396
+ name: packageName,
397
+ path: packagePath,
398
+ role: "runtime-service",
399
+ sourcePreset: "hono-api",
400
+ },
401
+ ]).exposuresByPackagePath.get(packagePath);
402
+ if (packageExposure === undefined) {
403
+ throw new Error(`Missing Package Exposure for ${packagePath}`);
404
+ }
405
+ const exposureFields = packageManifestExposureFields(packageExposure);
223
406
  return [
224
407
  {
225
408
  kind: "writeJson",
@@ -229,6 +412,9 @@ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
229
412
  version: "0.0.0",
230
413
  private: true,
231
414
  type: "module",
415
+ types: exposureFields.types,
416
+ exports: exposureFields.exports,
417
+ imports: exposureFields.imports,
232
418
  scripts: projectHonoApiPackageScripts(),
233
419
  dependencies: {
234
420
  "@hono/node-server": "catalog:",
@@ -256,9 +442,6 @@ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
256
442
  module: "NodeNext",
257
443
  moduleResolution: "NodeNext",
258
444
  noEmitOnError: true,
259
- paths: {
260
- "@/*": ["./src/*"],
261
- },
262
445
  skipLibCheck: false,
263
446
  strict: true,
264
447
  target: "ES2022",
@@ -280,18 +463,6 @@ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
280
463
  include: ["src/**/*.ts"],
281
464
  },
282
465
  },
283
- {
284
- kind: "copyFile",
285
- sourceRoot: "sharedOxc",
286
- from: "node/oxlint.config.ts",
287
- to: `${packagePath}/oxlint.config.ts`,
288
- },
289
- {
290
- kind: "copyFile",
291
- sourceRoot: "sharedOxc",
292
- from: "oxfmt.config.ts",
293
- to: `${packagePath}/oxfmt.config.ts`,
294
- },
295
466
  { kind: "copyFile", from: "src/app.ts", to: `${packagePath}/src/app.ts` },
296
467
  {
297
468
  kind: "copyFile",
@@ -310,12 +481,13 @@ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
310
481
  },
311
482
  ];
312
483
  }
313
- function packageAdditionPlan(packageLeafName, packageName, nodeVersion) {
314
- const packagePath = `apps/${packageLeafName}`;
484
+ function packageAdditionPlan(packageName, packagePath, nodeVersion) {
485
+ const [workspaceCollection] = packagePath.split("/");
315
486
  return {
316
487
  packagePath,
317
- workspacePackageGlob: "apps/*",
318
- rootTsconfigReferences: [`./${packagePath}/tsconfig.json`],
488
+ workspacePackageGlob: `${workspaceCollection}/*`,
489
+ packageRole: "runtime-service",
490
+ packageSourcePreset: "hono-api",
319
491
  sourceRoot: templateSourceRoot(),
320
492
  sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
321
493
  operations: packageAdditionOperations(packagePath, packageName, nodeVersion),
@@ -335,23 +507,33 @@ function sharedOxcSourceRoot() {
335
507
  ? publishedSharedRoot
336
508
  : path.join(projectionDir, "..", "shared", "oxc");
337
509
  }
510
+ function sharedDevcontainerSourceRoot() {
511
+ const projectionDir = path.dirname(fileURLToPath(import.meta.url));
512
+ const publishedSharedRoot = path.join(projectionDir, "..", "..", "..", "templates", "shared", "devcontainer");
513
+ return existsSync(path.join(publishedSharedRoot, "node-pnpm.Dockerfile"))
514
+ ? publishedSharedRoot
515
+ : path.join(projectionDir, "..", "shared", "devcontainer");
516
+ }
338
517
  export const honoApiPresetProjection = {
339
518
  metadata: honoApiPresetMetadata,
340
519
  capabilities: {
341
520
  packageAddition: {
342
- planPackageAddition({ packageLeafName, packageName, nodeVersion, }) {
343
- return packageAdditionPlan(packageLeafName, packageName, nodeVersion);
521
+ planPackageAddition({ packageName, packagePath, nodeVersion, }) {
522
+ return packageAdditionPlan(packageName, packagePath, nodeVersion);
344
523
  },
345
524
  },
346
525
  },
347
526
  blueprint: honoApiBlueprint,
348
527
  project(context) {
349
- const checkPlan = planNodeChecks("hono-api");
350
- const fixPlan = planNodeFixes("hono-api");
351
- const packageScripts = projectHonoApiPackageScripts();
528
+ const checkPlan = planHonoApiRootChecks();
529
+ const fixPlan = planHonoApiRootFixes();
530
+ const packageScripts = projectHonoApiRootPackageScripts();
352
531
  return {
353
532
  sourceRoot: templateSourceRoot(),
354
- sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
533
+ sourceRoots: {
534
+ sharedDevcontainer: sharedDevcontainerSourceRoot(),
535
+ sharedOxc: sharedOxcSourceRoot(),
536
+ },
355
537
  operations: operationsForHonoApi(context, packageScripts, checkPlan),
356
538
  checkPlan,
357
539
  fixPlan,
@@ -5,4 +5,3 @@ export declare function selectNodeCheckComponents(target: NodeCheckPlanTarget):
5
5
  export declare function selectNodeFixComponents(target: NodeFixPlanTarget): FixComponent[];
6
6
  export declare function planNodeChecks(target: NodeCheckPlanTarget): CheckPlan;
7
7
  export declare function planNodeFixes(target: NodeFixPlanTarget): FixPlan;
8
- //# sourceMappingURL=projection-plans.d.ts.map
@@ -5,4 +5,3 @@ export declare const builtInPresetProjections: readonly PresetProjection[];
5
5
  export declare const builtInPresetMetadata: readonly BuiltInPreset[];
6
6
  export declare function findBuiltInPresetProjection(name: string): PresetProjection | undefined;
7
7
  export declare function projectPresetThroughRegistry(context: GenerationContext): PresetProjectionPlan | undefined;
8
- //# sourceMappingURL=registry.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { PackageAdditionSupport } from "../src/package-addition-support.js";
1
2
  import { honoApiPresetProjection } from "./hono-api/projection.js";
2
3
  import { rustBinPresetProjection } from "./rust-bin/projection.js";
3
4
  import { tsLibPresetProjection } from "./ts-lib/projection.js";
@@ -10,7 +11,8 @@ const futurePresetMetadata = [
10
11
  description: "Future application preset metadata.",
11
12
  generation: "future",
12
13
  supportedPackageManagers: ["pnpm"],
13
- supportedProjectKinds: ["single-package"],
14
+ supportedProjectKinds: ["multi-package"],
15
+ packageAdditionSupport: PackageAdditionSupport.Unsupported,
14
16
  features: [],
15
17
  },
16
18
  {
@@ -19,7 +21,8 @@ const futurePresetMetadata = [
19
21
  description: "Future command-line preset metadata.",
20
22
  generation: "future",
21
23
  supportedPackageManagers: ["pnpm"],
22
- supportedProjectKinds: ["single-package"],
24
+ supportedProjectKinds: ["multi-package"],
25
+ packageAdditionSupport: PackageAdditionSupport.Unsupported,
23
26
  features: [],
24
27
  },
25
28
  ];
@@ -1,10 +1,9 @@
1
1
  import type { BuiltInPreset, ProjectBlueprint } from "../../src/declarations.js";
2
2
  import { type CheckPlan, type FixPlan } from "../../src/module-graph.js";
3
- import type { PresetProjection } from "../../src/preset-projection.js";
3
+ import type { PresetBlueprintOptions, PresetProjection } from "../../src/preset-projection.js";
4
4
  export declare const rustBinPresetMetadata: BuiltInPreset;
5
5
  export declare function planRustBinChecks(): CheckPlan;
6
6
  export declare function planRustBinFixes(): FixPlan;
7
- export declare function rustBinBlueprint(): ProjectBlueprint;
7
+ export declare function rustBinBlueprint(options?: PresetBlueprintOptions): ProjectBlueprint;
8
8
  export declare function projectRustBinPackageScripts(): Record<string, string>;
9
9
  export declare const rustBinPresetProjection: PresetProjection;
10
- //# sourceMappingURL=projection.d.ts.map