@ykdz/template 0.0.4 → 0.0.6

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 (46) hide show
  1. package/dist/src/cli.js +79 -34
  2. package/dist/src/declarations.d.ts +36 -0
  3. package/dist/src/declarations.js +31 -2
  4. package/dist/src/generated-scenarios.d.ts +62 -0
  5. package/dist/src/generated-scenarios.js +361 -0
  6. package/dist/src/module-graph.d.ts +1 -1
  7. package/dist/src/module-graph.js +10 -2
  8. package/dist/src/package-addition-support.d.ts +5 -0
  9. package/dist/src/package-addition-support.js +4 -0
  10. package/dist/src/package-addition.d.ts +1 -0
  11. package/dist/src/package-addition.js +409 -69
  12. package/dist/src/package-linking.d.ts +55 -0
  13. package/dist/src/package-linking.js +116 -0
  14. package/dist/src/preset-projection.d.ts +4 -1
  15. package/dist/src/preset-source.d.ts +430 -0
  16. package/dist/src/preset-source.js +940 -0
  17. package/dist/src/projection-capabilities.d.ts +67 -0
  18. package/dist/src/projection-capabilities.js +2207 -0
  19. package/dist/src/renderer.js +20 -1
  20. package/dist/src/template-boundary-check.d.ts +7 -3
  21. package/dist/src/template-boundary-check.js +104 -10
  22. package/package.json +3 -2
  23. package/templates/hono-api/src/server.ts +1 -1
  24. package/templates/hono-api/test/app.test.ts +1 -1
  25. package/templates/preset-source.json +499 -0
  26. package/templates/ts-lib/src/index.ts +2 -2
  27. package/templates/ts-lib/src/name-schema.ts +3 -0
  28. package/templates/vue-app/playwright.package-addition.config.ts +22 -0
  29. package/templates/vue-app/src/App.vue +1 -1
  30. package/templates/vue-app/test/app.test.ts +1 -1
  31. package/templates/vue-hono-app/web/src/App.vue +2 -2
  32. package/templates/vue-hono-app/web/test/app.test.ts +1 -1
  33. package/dist/templates/hono-api/projection.d.ts +0 -6
  34. package/dist/templates/hono-api/projection.js +0 -538
  35. package/dist/templates/projection-plans.d.ts +0 -7
  36. package/dist/templates/projection-plans.js +0 -94
  37. package/dist/templates/registry.d.ts +0 -7
  38. package/dist/templates/registry.js +0 -42
  39. package/dist/templates/rust-bin/projection.d.ts +0 -9
  40. package/dist/templates/rust-bin/projection.js +0 -390
  41. package/dist/templates/ts-lib/projection.d.ts +0 -6
  42. package/dist/templates/ts-lib/projection.js +0 -523
  43. package/dist/templates/vue-app/projection.d.ts +0 -6
  44. package/dist/templates/vue-app/projection.js +0 -757
  45. package/dist/templates/vue-hono-app/projection.d.ts +0 -8
  46. package/dist/templates/vue-hono-app/projection.js +0 -693
@@ -1,538 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import { collectGeneratedManifestCatalogDependencies, renderGeneratedPnpmWorkspaceYaml, } from "../../src/dependency-catalog.js";
5
- import { checkedDockerfileFirstNodePnpmDevcontainer, nodePnpmToolLayer, } from "../../src/devcontainer.js";
6
- import { editorCustomizationForCapabilities } from "../../src/editor-customization.js";
7
- import { renderFixCommand, renderRootCheckCommand, } from "../../src/module-graph.js";
8
- import { renderNewProject } from "../../src/renderer.js";
9
- const generatedBy = {
10
- packageName: "@ykdz/template",
11
- version: "0.0.0",
12
- command: "template init --preset hono-api",
13
- };
14
- export const honoApiPresetMetadata = {
15
- name: "hono-api",
16
- title: "Hono API",
17
- description: "Hono Node API workspace with strict TypeScript tooling.",
18
- generation: "supported",
19
- supportedPackageManagers: ["pnpm"],
20
- supportedProjectKinds: ["multi-package"],
21
- features: [
22
- "pnpm-catalog",
23
- "oxc-format-lint",
24
- "strict-typescript",
25
- "root-check",
26
- "fix-command",
27
- "devcontainer",
28
- "github-actions",
29
- "dependabot",
30
- ],
31
- };
32
- const dependencyMaintenancePolicy = {
33
- ecosystems: ["npm", "github-actions", "docker"],
34
- interval: "weekly",
35
- };
36
- const apiPackageBoundary = {
37
- kind: "package-boundary",
38
- path: ".",
39
- };
40
- const rootBoundary = {
41
- kind: "workspace-orchestration",
42
- path: ".",
43
- };
44
- const workspacePackageBoundary = {
45
- kind: "package-boundary",
46
- path: "apps/*",
47
- };
48
- function planHonoApiPackageChecks() {
49
- return {
50
- components: [
51
- { kind: "oxc-format-check", owner: apiPackageBoundary },
52
- { kind: "oxc-lint", owner: apiPackageBoundary },
53
- { kind: "typescript-typecheck", owner: apiPackageBoundary },
54
- { kind: "build", owner: apiPackageBoundary },
55
- { kind: "unit-test", owner: apiPackageBoundary },
56
- ],
57
- environmentNeeds: [],
58
- };
59
- }
60
- function planHonoApiRootChecks() {
61
- return {
62
- components: [
63
- { kind: "oxc-format-check", owner: rootBoundary },
64
- { kind: "oxc-lint", owner: rootBoundary },
65
- { kind: "typescript-typecheck", owner: rootBoundary },
66
- { kind: "turbo-package-check", owner: workspacePackageBoundary },
67
- ],
68
- environmentNeeds: [],
69
- };
70
- }
71
- function planHonoApiPackageFixes() {
72
- return {
73
- components: [
74
- { kind: "oxc-format-write", owner: apiPackageBoundary },
75
- { kind: "oxc-lint-fix", owner: apiPackageBoundary },
76
- ],
77
- };
78
- }
79
- function planHonoApiRootFixes() {
80
- return {
81
- components: [
82
- { kind: "oxc-format-write", owner: rootBoundary },
83
- { kind: "oxc-lint-fix", owner: rootBoundary },
84
- { kind: "turbo-package-fix", owner: workspacePackageBoundary },
85
- ],
86
- };
87
- }
88
- function projectNameFromDir(targetDir) {
89
- return path.basename(path.resolve(targetDir));
90
- }
91
- function packageScopeFromOptions(options) {
92
- return options.scope ?? projectNameFromDir(options.targetDir);
93
- }
94
- function packageName(packageScope) {
95
- return `@${packageScope}/api`;
96
- }
97
- export function honoApiBlueprint(options = { targetDir: process.cwd() }) {
98
- const packageScope = packageScopeFromOptions(options);
99
- return {
100
- schemaVersion: 1,
101
- preset: "hono-api",
102
- packageManager: "pnpm",
103
- projectKind: "multi-package",
104
- features: [...honoApiPresetMetadata.features],
105
- packages: [{ name: packageName(packageScope), path: "apps/api" }],
106
- };
107
- }
108
- function projectHonoApiRootPackageScripts() {
109
- return {
110
- check: renderRootCheckCommand(planHonoApiRootChecks()),
111
- fix: renderFixCommand(planHonoApiRootFixes()),
112
- "format:check": "oxfmt --check --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
113
- "format:write": "oxfmt --write --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
114
- lint: "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --deny-warnings",
115
- "lint:fix": "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix --deny-warnings",
116
- typecheck: "tsc -p tsconfig.config.json --noEmit",
117
- };
118
- }
119
- export function projectHonoApiPackageScripts() {
120
- return {
121
- build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
122
- check: renderRootCheckCommand(planHonoApiPackageChecks()),
123
- fix: renderFixCommand(planHonoApiPackageFixes()),
124
- "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
125
- "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
126
- lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
127
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
128
- start: "node dist/server.js",
129
- test: "vitest run",
130
- typecheck: "tsc -p tsconfig.json --noEmit",
131
- };
132
- }
133
- function rootPackageJson(context, packageScripts) {
134
- return {
135
- name: context.projectName.value,
136
- version: "0.0.0",
137
- private: true,
138
- type: "module",
139
- scripts: packageScripts,
140
- devDependencies: {
141
- oxfmt: "catalog:",
142
- oxlint: "catalog:",
143
- turbo: "catalog:",
144
- typescript: "catalog:",
145
- },
146
- engines: {
147
- node: context.toolchain.nodeLtsMajor.value,
148
- },
149
- packageManager: context.toolchain.packageManagerPin.value,
150
- };
151
- }
152
- function apiPackageName(context) {
153
- const apiPackage = context.blueprint.packages?.find((pkg) => pkg.path === "apps/api");
154
- return apiPackage?.name ?? packageName(context.projectName.value);
155
- }
156
- function apiPackageJson(context) {
157
- return {
158
- name: apiPackageName(context),
159
- version: "0.0.0",
160
- private: true,
161
- type: "module",
162
- scripts: projectHonoApiPackageScripts(),
163
- dependencies: {
164
- "@hono/node-server": "catalog:",
165
- hono: "catalog:",
166
- },
167
- devDependencies: {
168
- "@types/node": "catalog:",
169
- oxfmt: "catalog:",
170
- oxlint: "catalog:",
171
- "tsc-alias": "catalog:",
172
- typescript: "catalog:",
173
- vitest: "catalog:",
174
- },
175
- engines: {
176
- node: context.toolchain.nodeLtsMajor.value,
177
- },
178
- };
179
- }
180
- function generationRecord(context) {
181
- return {
182
- ...generatedBy,
183
- toolchain: {
184
- nodeLtsMajor: context.toolchain.nodeLtsMajor.value,
185
- packageManagerPin: context.toolchain.packageManagerPin.value,
186
- source: context.toolchain.source,
187
- },
188
- };
189
- }
190
- function operationsForHonoApi(context, packageScripts, checkPlan) {
191
- const editorCustomization = editorCustomizationForCapabilities([
192
- "oxc-format-lint",
193
- "vitest",
194
- ]);
195
- const developmentContainer = checkedDockerfileFirstNodePnpmDevcontainer({
196
- name: context.projectName.value,
197
- layer: nodePnpmToolLayer({
198
- nodeVersion: context.toolchain.nodeLtsMajor.value,
199
- packageManagerPin: context.toolchain.packageManagerPin.value,
200
- }),
201
- extensions: editorCustomization.extensions,
202
- settings: editorCustomization.settings,
203
- });
204
- const rootManifest = rootPackageJson(context, packageScripts);
205
- const apiManifest = apiPackageJson(context);
206
- return [
207
- {
208
- kind: "writeJson",
209
- to: "package.json",
210
- value: rootManifest,
211
- },
212
- {
213
- kind: "writeText",
214
- to: "pnpm-workspace.yaml",
215
- text: renderGeneratedPnpmWorkspaceYaml({
216
- packages: ["apps/*"],
217
- dependencies: collectGeneratedManifestCatalogDependencies([
218
- rootManifest,
219
- apiManifest,
220
- ]),
221
- }),
222
- },
223
- {
224
- kind: "writeJson",
225
- to: "turbo.json",
226
- value: {
227
- tasks: {
228
- build: {
229
- dependsOn: ["^build"],
230
- outputs: ["dist/**"],
231
- },
232
- check: {
233
- dependsOn: ["^build"],
234
- },
235
- fix: {
236
- cache: false,
237
- },
238
- },
239
- },
240
- },
241
- {
242
- kind: "writeJson",
243
- to: "tsconfig.json",
244
- value: {
245
- files: [],
246
- references: [{ path: "./apps/api/tsconfig.json" }],
247
- },
248
- },
249
- {
250
- kind: "writeJson",
251
- to: "tsconfig.config.json",
252
- value: {
253
- compilerOptions: {
254
- module: "NodeNext",
255
- moduleResolution: "NodeNext",
256
- noEmitOnError: true,
257
- skipLibCheck: false,
258
- strict: true,
259
- target: "ES2022",
260
- },
261
- include: ["oxlint.config.ts", "oxfmt.config.ts"],
262
- },
263
- },
264
- {
265
- kind: "writeJson",
266
- to: "apps/api/package.json",
267
- value: apiManifest,
268
- },
269
- {
270
- kind: "writeJson",
271
- to: "apps/api/tsconfig.json",
272
- value: {
273
- compilerOptions: {
274
- composite: true,
275
- module: "NodeNext",
276
- moduleResolution: "NodeNext",
277
- noEmitOnError: true,
278
- paths: {
279
- "@/*": ["./src/*"],
280
- },
281
- skipLibCheck: false,
282
- strict: true,
283
- target: "ES2022",
284
- types: ["node", "vitest/globals"],
285
- },
286
- include: ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"],
287
- },
288
- },
289
- {
290
- kind: "writeJson",
291
- to: "apps/api/tsconfig.build.json",
292
- value: {
293
- extends: "./tsconfig.json",
294
- compilerOptions: {
295
- outDir: "dist",
296
- rootDir: "src",
297
- types: ["node"],
298
- },
299
- include: ["src/**/*.ts"],
300
- },
301
- },
302
- {
303
- kind: "copyFile",
304
- sourceRoot: "sharedOxc",
305
- from: "node/oxlint.config.ts",
306
- to: "oxlint.config.ts",
307
- },
308
- {
309
- kind: "copyFile",
310
- sourceRoot: "sharedOxc",
311
- from: "oxfmt.config.ts",
312
- to: "oxfmt.config.ts",
313
- },
314
- {
315
- kind: "writeText",
316
- to: ".gitignore",
317
- text: [
318
- "node_modules",
319
- "dist",
320
- ".env",
321
- ".template/",
322
- ".pnpm-store/",
323
- "",
324
- ].join("\n"),
325
- },
326
- { kind: "copyFile", from: "src/app.ts", to: "apps/api/src/app.ts" },
327
- {
328
- kind: "copyFile",
329
- from: "src/server.ts",
330
- to: "apps/api/src/server.ts",
331
- },
332
- {
333
- kind: "copyFile",
334
- from: "test/app.test.ts",
335
- to: "apps/api/test/app.test.ts",
336
- },
337
- {
338
- kind: "copyFile",
339
- from: "vitest.config.ts",
340
- to: "apps/api/vitest.config.ts",
341
- },
342
- {
343
- kind: "writeJson",
344
- to: ".template/blueprint.json",
345
- value: context.blueprint,
346
- },
347
- {
348
- kind: "writeJson",
349
- to: ".template/generated-by.json",
350
- value: generationRecord(context),
351
- },
352
- {
353
- kind: "writeJson",
354
- to: ".devcontainer/devcontainer.json",
355
- value: developmentContainer.devcontainer,
356
- },
357
- {
358
- ...developmentContainer.dockerfileOperation,
359
- },
360
- {
361
- kind: "writeJson",
362
- to: ".vscode/extensions.json",
363
- value: {
364
- recommendations: editorCustomization.extensions,
365
- },
366
- multilineArrays: ["recommendations"],
367
- },
368
- {
369
- kind: "writeJson",
370
- to: ".vscode/settings.json",
371
- value: editorCustomization.settings,
372
- },
373
- {
374
- kind: "copyFile",
375
- from: ".github/workflows/check.yml",
376
- to: ".github/workflows/check.yml",
377
- },
378
- {
379
- kind: "copyFile",
380
- from: ".github/dependabot.yml",
381
- to: ".github/dependabot.yml",
382
- },
383
- ];
384
- }
385
- function packageAdditionOperations(packagePath, packageName, nodeVersion) {
386
- return [
387
- {
388
- kind: "writeJson",
389
- to: `${packagePath}/package.json`,
390
- value: {
391
- name: packageName,
392
- version: "0.0.0",
393
- private: true,
394
- type: "module",
395
- scripts: projectHonoApiPackageScripts(),
396
- dependencies: {
397
- "@hono/node-server": "catalog:",
398
- hono: "catalog:",
399
- },
400
- devDependencies: {
401
- "@types/node": "catalog:",
402
- oxfmt: "catalog:",
403
- oxlint: "catalog:",
404
- "tsc-alias": "catalog:",
405
- typescript: "catalog:",
406
- vitest: "catalog:",
407
- },
408
- engines: {
409
- node: nodeVersion,
410
- },
411
- },
412
- },
413
- {
414
- kind: "writeJson",
415
- to: `${packagePath}/tsconfig.json`,
416
- value: {
417
- compilerOptions: {
418
- composite: true,
419
- module: "NodeNext",
420
- moduleResolution: "NodeNext",
421
- noEmitOnError: true,
422
- paths: {
423
- "@/*": ["./src/*"],
424
- },
425
- skipLibCheck: false,
426
- strict: true,
427
- target: "ES2022",
428
- types: ["node", "vitest/globals"],
429
- },
430
- include: ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"],
431
- },
432
- },
433
- {
434
- kind: "writeJson",
435
- to: `${packagePath}/tsconfig.build.json`,
436
- value: {
437
- extends: "./tsconfig.json",
438
- compilerOptions: {
439
- outDir: "dist",
440
- rootDir: "src",
441
- types: ["node"],
442
- },
443
- include: ["src/**/*.ts"],
444
- },
445
- },
446
- { kind: "copyFile", from: "src/app.ts", to: `${packagePath}/src/app.ts` },
447
- {
448
- kind: "copyFile",
449
- from: "src/server.ts",
450
- to: `${packagePath}/src/server.ts`,
451
- },
452
- {
453
- kind: "copyFile",
454
- from: "test/app.test.ts",
455
- to: `${packagePath}/test/app.test.ts`,
456
- },
457
- {
458
- kind: "copyFile",
459
- from: "vitest.config.ts",
460
- to: `${packagePath}/vitest.config.ts`,
461
- },
462
- ];
463
- }
464
- function packageAdditionPlan(packageName, packagePath, nodeVersion) {
465
- const [workspaceCollection] = packagePath.split("/");
466
- return {
467
- packagePath,
468
- workspacePackageGlob: `${workspaceCollection}/*`,
469
- rootTsconfigReferences: [`./${packagePath}/tsconfig.json`],
470
- sourceRoot: templateSourceRoot(),
471
- sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
472
- operations: packageAdditionOperations(packagePath, packageName, nodeVersion),
473
- };
474
- }
475
- function templateSourceRoot() {
476
- const projectionDir = path.dirname(fileURLToPath(import.meta.url));
477
- const publishedTemplateRoot = path.join(projectionDir, "..", "..", "..", "templates", "hono-api");
478
- return existsSync(path.join(publishedTemplateRoot, "src", "app.ts"))
479
- ? publishedTemplateRoot
480
- : projectionDir;
481
- }
482
- function sharedOxcSourceRoot() {
483
- const projectionDir = path.dirname(fileURLToPath(import.meta.url));
484
- const publishedSharedRoot = path.join(projectionDir, "..", "..", "..", "templates", "shared", "oxc");
485
- return existsSync(path.join(publishedSharedRoot, "oxfmt.config.ts"))
486
- ? publishedSharedRoot
487
- : path.join(projectionDir, "..", "shared", "oxc");
488
- }
489
- function sharedDevcontainerSourceRoot() {
490
- const projectionDir = path.dirname(fileURLToPath(import.meta.url));
491
- const publishedSharedRoot = path.join(projectionDir, "..", "..", "..", "templates", "shared", "devcontainer");
492
- return existsSync(path.join(publishedSharedRoot, "node-pnpm.Dockerfile"))
493
- ? publishedSharedRoot
494
- : path.join(projectionDir, "..", "shared", "devcontainer");
495
- }
496
- export const honoApiPresetProjection = {
497
- metadata: honoApiPresetMetadata,
498
- capabilities: {
499
- packageAddition: {
500
- planPackageAddition({ packageName, packagePath, nodeVersion, }) {
501
- return packageAdditionPlan(packageName, packagePath, nodeVersion);
502
- },
503
- },
504
- },
505
- blueprint: honoApiBlueprint,
506
- project(context) {
507
- const checkPlan = planHonoApiRootChecks();
508
- const fixPlan = planHonoApiRootFixes();
509
- const packageScripts = projectHonoApiRootPackageScripts();
510
- return {
511
- sourceRoot: templateSourceRoot(),
512
- sourceRoots: {
513
- sharedDevcontainer: sharedDevcontainerSourceRoot(),
514
- sharedOxc: sharedOxcSourceRoot(),
515
- },
516
- operations: operationsForHonoApi(context, packageScripts, checkPlan),
517
- checkPlan,
518
- fixPlan,
519
- dependencyMaintenancePolicy,
520
- packageScripts,
521
- capabilities: {
522
- rootCheck: true,
523
- fixCommand: true,
524
- githubActions: true,
525
- dependabot: true,
526
- devcontainer: true,
527
- },
528
- };
529
- },
530
- async render({ targetDir, plan }) {
531
- await renderNewProject({
532
- sourceRoot: plan.sourceRoot,
533
- sourceRoots: plan.sourceRoots,
534
- targetRoot: targetDir,
535
- operations: [...plan.operations],
536
- });
537
- },
538
- };
@@ -1,7 +0,0 @@
1
- import type { CheckComponent, CheckPlan, FixComponent, FixPlan } from "../src/module-graph.js";
2
- export type NodeCheckPlanTarget = "hono-api" | "vue-app" | "vue-hono-root" | "vue-hono-api" | "vue-hono-web";
3
- export type NodeFixPlanTarget = "hono-api" | "vue-app" | "vue-hono-root" | "vue-hono-api" | "vue-hono-web";
4
- export declare function selectNodeCheckComponents(target: NodeCheckPlanTarget): CheckComponent[];
5
- export declare function selectNodeFixComponents(target: NodeFixPlanTarget): FixComponent[];
6
- export declare function planNodeChecks(target: NodeCheckPlanTarget): CheckPlan;
7
- export declare function planNodeFixes(target: NodeFixPlanTarget): FixPlan;
@@ -1,94 +0,0 @@
1
- const rootPackageBoundary = {
2
- kind: "package-boundary",
3
- path: ".",
4
- };
5
- const apiPackageBoundary = {
6
- kind: "package-boundary",
7
- path: "apps/api",
8
- };
9
- const webPackageBoundary = {
10
- kind: "package-boundary",
11
- path: "apps/web",
12
- };
13
- function honoApiCheckComponents(owner) {
14
- return [
15
- { kind: "oxc-format-check", owner },
16
- { kind: "oxc-lint", owner },
17
- { kind: "typescript-typecheck", owner },
18
- { kind: "build", owner },
19
- { kind: "unit-test", owner },
20
- ];
21
- }
22
- function vueAppCheckComponents(owner) {
23
- return [
24
- { kind: "oxc-format-check", owner },
25
- { kind: "oxc-lint", owner },
26
- { kind: "typescript-typecheck", owner },
27
- { kind: "build", owner },
28
- { kind: "unit-test", owner },
29
- { kind: "e2e-test", owner },
30
- ];
31
- }
32
- function nodeFixComponents(owner) {
33
- return [
34
- { kind: "oxc-format-write", owner },
35
- { kind: "oxc-lint-fix", owner },
36
- ];
37
- }
38
- export function selectNodeCheckComponents(target) {
39
- switch (target) {
40
- case "hono-api":
41
- return honoApiCheckComponents(rootPackageBoundary);
42
- case "vue-app":
43
- return vueAppCheckComponents(rootPackageBoundary);
44
- case "vue-hono-root":
45
- return [{ kind: "turbo-check", owner: rootPackageBoundary }];
46
- case "vue-hono-api":
47
- return honoApiCheckComponents(apiPackageBoundary);
48
- case "vue-hono-web":
49
- return vueAppCheckComponents(webPackageBoundary);
50
- }
51
- }
52
- export function selectNodeFixComponents(target) {
53
- switch (target) {
54
- case "hono-api":
55
- case "vue-app":
56
- return nodeFixComponents(rootPackageBoundary);
57
- case "vue-hono-root":
58
- return [{ kind: "turbo-fix", owner: rootPackageBoundary }];
59
- case "vue-hono-api":
60
- return nodeFixComponents(apiPackageBoundary);
61
- case "vue-hono-web":
62
- return nodeFixComponents(webPackageBoundary);
63
- }
64
- }
65
- function checkEnvironmentNeeds(target) {
66
- if (target === "vue-app") {
67
- return [
68
- {
69
- kind: "playwright-browser-assets",
70
- browser: "chromium",
71
- owner: rootPackageBoundary,
72
- },
73
- ];
74
- }
75
- if (target === "vue-hono-root" || target === "vue-hono-web") {
76
- return [
77
- {
78
- kind: "playwright-browser-assets",
79
- browser: "chromium",
80
- owner: webPackageBoundary,
81
- },
82
- ];
83
- }
84
- return [];
85
- }
86
- export function planNodeChecks(target) {
87
- return {
88
- components: selectNodeCheckComponents(target),
89
- environmentNeeds: checkEnvironmentNeeds(target),
90
- };
91
- }
92
- export function planNodeFixes(target) {
93
- return { components: selectNodeFixComponents(target) };
94
- }
@@ -1,7 +0,0 @@
1
- import type { BuiltInPreset } from "../src/declarations.js";
2
- import type { GenerationContext } from "../src/generation-context.js";
3
- import type { PresetProjection, PresetProjectionPlan } from "../src/preset-projection.js";
4
- export declare const builtInPresetProjections: readonly PresetProjection[];
5
- export declare const builtInPresetMetadata: readonly BuiltInPreset[];
6
- export declare function findBuiltInPresetProjection(name: string): PresetProjection | undefined;
7
- export declare function projectPresetThroughRegistry(context: GenerationContext): PresetProjectionPlan | undefined;
@@ -1,42 +0,0 @@
1
- import { honoApiPresetProjection } from "./hono-api/projection.js";
2
- import { rustBinPresetProjection } from "./rust-bin/projection.js";
3
- import { tsLibPresetProjection } from "./ts-lib/projection.js";
4
- import { vueAppPresetProjection } from "./vue-app/projection.js";
5
- import { vueHonoAppPresetProjection } from "./vue-hono-app/projection.js";
6
- const futurePresetMetadata = [
7
- {
8
- name: "ts-app",
9
- title: "TypeScript application",
10
- description: "Future application preset metadata.",
11
- generation: "future",
12
- supportedPackageManagers: ["pnpm"],
13
- supportedProjectKinds: ["multi-package"],
14
- features: [],
15
- },
16
- {
17
- name: "node-cli",
18
- title: "Node.js CLI",
19
- description: "Future command-line preset metadata.",
20
- generation: "future",
21
- supportedPackageManagers: ["pnpm"],
22
- supportedProjectKinds: ["multi-package"],
23
- features: [],
24
- },
25
- ];
26
- export const builtInPresetProjections = [
27
- tsLibPresetProjection,
28
- honoApiPresetProjection,
29
- vueAppPresetProjection,
30
- vueHonoAppPresetProjection,
31
- rustBinPresetProjection,
32
- ];
33
- export const builtInPresetMetadata = [
34
- ...builtInPresetProjections.map((projection) => projection.metadata),
35
- ...futurePresetMetadata,
36
- ];
37
- export function findBuiltInPresetProjection(name) {
38
- return builtInPresetProjections.find((projection) => projection.metadata.name === name);
39
- }
40
- export function projectPresetThroughRegistry(context) {
41
- return findBuiltInPresetProjection(context.preset)?.project(context);
42
- }