@ykdz/template 0.0.5 → 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.
@@ -1,713 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import { collectGeneratedManifestCatalogReferences, renderGeneratedPnpmWorkspaceYaml, } from "../../src/dependency-catalog.js";
5
- import { browserTestToolLayer, 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 { PackageAdditionSupport } from "../../src/package-addition-support.js";
9
- import { packageManifestExposureFields, planPackageLinks, } from "../../src/package-linking.js";
10
- import { renderNewProject } from "../../src/renderer.js";
11
- const generatedBy = {
12
- packageName: "@ykdz/template",
13
- version: "0.0.0",
14
- command: "template init --preset vue-hono-app",
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
- packageAdditionSupport: PackageAdditionSupport.Unsupported,
24
- features: [
25
- "pnpm-catalog",
26
- "oxc-format-lint",
27
- "strict-typescript",
28
- "root-check",
29
- "fix-command",
30
- "devcontainer",
31
- "github-actions",
32
- "dependabot",
33
- ],
34
- };
35
- const dependencyMaintenancePolicy = {
36
- ecosystems: ["npm", "github-actions", "docker"],
37
- interval: "weekly",
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
- }
131
- function projectNameFromDir(targetDir) {
132
- return path.basename(path.resolve(targetDir));
133
- }
134
- function packageScopeFromOptions(options) {
135
- return options.scope ?? projectNameFromDir(options.targetDir);
136
- }
137
- function packageName(packageScope, leaf) {
138
- return `@${packageScope}/${leaf}`;
139
- }
140
- export function vueHonoAppBlueprint(options) {
141
- const packageScope = packageScopeFromOptions(options);
142
- return {
143
- schemaVersion: 1,
144
- preset: "vue-hono-app",
145
- packageManager: "pnpm",
146
- projectKind: "multi-package",
147
- features: [...vueHonoAppPresetMetadata.features],
148
- packages: [
149
- { name: packageName(packageScope, "web"), path: "apps/web" },
150
- { name: packageName(packageScope, "api"), path: "apps/api" },
151
- ],
152
- };
153
- }
154
- export function projectVueHonoRootPackageScripts() {
155
- return {
156
- check: renderRootCheckCommand(planVueHonoRootChecks()),
157
- dev: "turbo run dev --parallel",
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",
164
- };
165
- }
166
- export function projectVueHonoApiPackageScripts() {
167
- return {
168
- build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
169
- check: renderRootCheckCommand(planVueHonoApiChecks()),
170
- dev: "tsx watch src/server.ts",
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",
176
- start: "node dist/server.js",
177
- test: "vitest run",
178
- typecheck: "tsc -p tsconfig.json --noEmit",
179
- };
180
- }
181
- export function projectVueHonoWebPackageScripts() {
182
- return {
183
- build: "vite build",
184
- check: renderRootCheckCommand(planVueHonoWebChecks()),
185
- dev: "vite",
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",
191
- preview: "vite preview",
192
- test: "vitest run",
193
- "test:e2e": "pnpm run build && playwright test",
194
- typecheck: "vue-tsc --build",
195
- };
196
- }
197
- function rootPackageJson(context, packageScripts) {
198
- return {
199
- name: context.projectName.value,
200
- version: "0.0.0",
201
- private: true,
202
- type: "module",
203
- scripts: packageScripts,
204
- devDependencies: {
205
- oxfmt: "catalog:",
206
- oxlint: "catalog:",
207
- turbo: "catalog:",
208
- typescript: "catalog:",
209
- },
210
- engines: {
211
- node: context.toolchain.nodeLtsMajor.value,
212
- },
213
- packageManager: context.toolchain.packageManagerPin.value,
214
- };
215
- }
216
- function apiPackageJson(context, packageScope, exposure) {
217
- const exposureFields = packageManifestExposureFields(exposure);
218
- return {
219
- name: packageName(packageScope, "api"),
220
- version: "0.0.0",
221
- private: true,
222
- type: "module",
223
- types: exposureFields.types,
224
- exports: exposureFields.exports,
225
- imports: exposureFields.imports,
226
- scripts: projectVueHonoApiPackageScripts(),
227
- dependencies: {
228
- "@hono/node-server": "catalog:",
229
- hono: "catalog:",
230
- },
231
- devDependencies: {
232
- "@types/node": "catalog:",
233
- oxfmt: "catalog:",
234
- oxlint: "catalog:",
235
- "tsc-alias": "catalog:",
236
- tsx: "catalog:",
237
- typescript: "catalog:",
238
- vitest: "catalog:",
239
- },
240
- engines: {
241
- node: context.toolchain.nodeLtsMajor.value,
242
- },
243
- };
244
- }
245
- function webPackageJson(context, packageScope, packageLinkDependencies) {
246
- return {
247
- name: packageName(packageScope, "web"),
248
- version: "0.0.0",
249
- private: true,
250
- type: "module",
251
- imports: {
252
- "#/*": {
253
- default: "./src/*.ts",
254
- types: "./src/*.ts",
255
- },
256
- },
257
- scripts: projectVueHonoWebPackageScripts(),
258
- dependencies: {
259
- ...packageLinkDependencies,
260
- "@vueuse/core": "catalog:",
261
- hono: "catalog:",
262
- pinia: "catalog:",
263
- vue: "catalog:",
264
- },
265
- devDependencies: {
266
- "@playwright/test": "catalog:",
267
- "@tailwindcss/vite": "catalog:",
268
- "@types/node": "catalog:",
269
- "@types/web-bluetooth": "catalog:",
270
- "@vitejs/plugin-vue": "catalog:",
271
- "@vue/tsconfig": "catalog:",
272
- oxfmt: "catalog:",
273
- oxlint: "catalog:",
274
- tailwindcss: "catalog:",
275
- typescript: "catalog:",
276
- vite: "catalog:",
277
- vitest: "catalog:",
278
- "vue-tsc": "catalog:",
279
- },
280
- engines: {
281
- node: context.toolchain.nodeLtsMajor.value,
282
- },
283
- };
284
- }
285
- function generationRecord(context) {
286
- return {
287
- ...generatedBy,
288
- toolchain: {
289
- nodeLtsMajor: context.toolchain.nodeLtsMajor.value,
290
- packageManagerPin: context.toolchain.packageManagerPin.value,
291
- source: context.toolchain.source,
292
- },
293
- };
294
- }
295
- function packageScopeFromBlueprint(context) {
296
- const apiPackage = context.blueprint.packages?.find((pkg) => pkg.path === "apps/api");
297
- if (apiPackage?.name.startsWith("@") && apiPackage.name.endsWith("/api")) {
298
- return apiPackage.name.slice(1, -"/api".length);
299
- }
300
- return context.projectName.value;
301
- }
302
- function operationsForVueHonoApp(context, packageScripts, checkPlan) {
303
- const packageScope = packageScopeFromBlueprint(context);
304
- const apiName = packageName(packageScope, "api");
305
- const webName = packageName(packageScope, "web");
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,
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);
341
- return [
342
- {
343
- kind: "writeJson",
344
- to: "package.json",
345
- value: rootManifest,
346
- },
347
- {
348
- kind: "writeText",
349
- to: "pnpm-workspace.yaml",
350
- text: renderGeneratedPnpmWorkspaceYaml({
351
- packages: ["apps/*"],
352
- dependencies: collectGeneratedManifestCatalogReferences([
353
- rootManifest,
354
- apiManifest,
355
- webManifest,
356
- ]),
357
- allowBuilds: {
358
- esbuild: true,
359
- },
360
- }),
361
- },
362
- {
363
- kind: "writeJson",
364
- to: "turbo.json",
365
- value: {
366
- tasks: {
367
- build: {
368
- dependsOn: packageLinkPlan.turboTasks.build.dependsOn,
369
- outputs: ["dist/**"],
370
- },
371
- check: packageLinkPlan.turboTasks.check,
372
- typecheck: packageLinkPlan.turboTasks.typecheck,
373
- test: packageLinkPlan.turboTasks.test,
374
- "test:e2e": packageLinkPlan.turboTasks["test:e2e"],
375
- dev: {
376
- cache: false,
377
- persistent: true,
378
- },
379
- fix: {
380
- cache: false,
381
- },
382
- },
383
- },
384
- },
385
- {
386
- kind: "writeJson",
387
- to: "tsconfig.json",
388
- value: {
389
- files: [],
390
- references: [
391
- { path: "./apps/web/tsconfig.app.json" },
392
- { path: "./apps/web/tsconfig.test.json" },
393
- { path: "./apps/web/tsconfig.node.json" },
394
- ],
395
- },
396
- },
397
- {
398
- kind: "writeJson",
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",
427
- value: context.blueprint,
428
- },
429
- {
430
- kind: "writeJson",
431
- to: ".template/generated-by.json",
432
- value: generationRecord(context),
433
- },
434
- {
435
- kind: "writeJson",
436
- to: ".devcontainer/devcontainer.json",
437
- value: developmentContainer.devcontainer,
438
- },
439
- {
440
- ...developmentContainer.dockerfileOperation,
441
- },
442
- {
443
- kind: "writeJson",
444
- to: ".vscode/extensions.json",
445
- value: {
446
- recommendations: editorCustomization.extensions,
447
- },
448
- multilineArrays: ["recommendations"],
449
- },
450
- {
451
- kind: "writeJson",
452
- to: ".vscode/settings.json",
453
- value: editorCustomization.settings,
454
- },
455
- {
456
- kind: "writeText",
457
- to: ".gitignore",
458
- text: [
459
- "node_modules",
460
- "dist",
461
- "playwright-report",
462
- "test-results",
463
- ".env",
464
- ".template/",
465
- ".pnpm-store/",
466
- "",
467
- ].join("\n"),
468
- },
469
- {
470
- kind: "copyFile",
471
- from: ".github/workflows/check.yml",
472
- to: ".github/workflows/check.yml",
473
- },
474
- {
475
- kind: "copyFile",
476
- from: ".github/dependabot.yml",
477
- to: ".github/dependabot.yml",
478
- },
479
- {
480
- kind: "writeJson",
481
- to: "apps/api/package.json",
482
- value: apiManifest,
483
- },
484
- {
485
- kind: "writeJson",
486
- to: "apps/api/tsconfig.json",
487
- value: {
488
- compilerOptions: {
489
- composite: true,
490
- declaration: true,
491
- declarationMap: true,
492
- module: "NodeNext",
493
- moduleResolution: "NodeNext",
494
- noEmitOnError: true,
495
- skipLibCheck: false,
496
- strict: true,
497
- target: "ES2022",
498
- types: ["node", "vitest/globals"],
499
- },
500
- include: ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"],
501
- },
502
- },
503
- {
504
- kind: "writeJson",
505
- to: "apps/api/tsconfig.build.json",
506
- value: {
507
- extends: "./tsconfig.json",
508
- compilerOptions: {
509
- outDir: "dist",
510
- rootDir: "src",
511
- types: ["node"],
512
- },
513
- include: ["src/**/*.ts"],
514
- },
515
- },
516
- { kind: "copyFile", from: "api/src/index.ts", to: "apps/api/src/index.ts" },
517
- {
518
- kind: "copyFile",
519
- from: "api/src/runtime.ts",
520
- to: "apps/api/src/runtime.ts",
521
- },
522
- {
523
- kind: "copyFile",
524
- from: "api/src/server.ts",
525
- to: "apps/api/src/server.ts",
526
- },
527
- {
528
- kind: "copyFile",
529
- from: "api/test/app.test.ts",
530
- to: "apps/api/test/app.test.ts",
531
- },
532
- {
533
- kind: "copyFile",
534
- from: "api/vitest.config.ts",
535
- to: "apps/api/vitest.config.ts",
536
- },
537
- {
538
- kind: "writeJson",
539
- to: "apps/web/package.json",
540
- value: webManifest,
541
- },
542
- {
543
- kind: "writeJson",
544
- to: "apps/web/tsconfig.json",
545
- value: {
546
- files: [],
547
- references: [
548
- { path: "./tsconfig.app.json" },
549
- { path: "./tsconfig.test.json" },
550
- { path: "./tsconfig.node.json" },
551
- ],
552
- },
553
- },
554
- {
555
- kind: "writeJson",
556
- to: "apps/web/tsconfig.app.json",
557
- value: {
558
- extends: "@vue/tsconfig/tsconfig.dom.json",
559
- compilerOptions: {
560
- composite: true,
561
- module: "ESNext",
562
- moduleResolution: "Bundler",
563
- noEmitOnError: true,
564
- skipLibCheck: false,
565
- strict: true,
566
- target: "ES2022",
567
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
568
- types: ["web-bluetooth"],
569
- },
570
- include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
571
- },
572
- },
573
- {
574
- kind: "writeJson",
575
- to: "apps/web/tsconfig.test.json",
576
- value: {
577
- extends: "./tsconfig.app.json",
578
- compilerOptions: {
579
- lib: ["ESNext", "DOM", "DOM.Iterable"],
580
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.test.tsbuildinfo",
581
- types: ["node", "vitest/globals", "web-bluetooth"],
582
- },
583
- include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue", "test/**/*.ts"],
584
- },
585
- },
586
- {
587
- kind: "writeJson",
588
- to: "apps/web/tsconfig.node.json",
589
- value: {
590
- compilerOptions: {
591
- composite: true,
592
- module: "ESNext",
593
- moduleResolution: "Bundler",
594
- noEmitOnError: true,
595
- lib: ["ESNext", "DOM", "DOM.Iterable"],
596
- outDir: "./node_modules/.tmp/tsconfig.node",
597
- skipLibCheck: false,
598
- strict: true,
599
- target: "ES2022",
600
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
601
- types: ["node"],
602
- },
603
- include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
604
- },
605
- },
606
- { kind: "copyFile", from: "web/env.d.ts", to: "apps/web/env.d.ts" },
607
- { kind: "copyFile", from: "web/index.html", to: "apps/web/index.html" },
608
- {
609
- kind: "copyFile",
610
- from: "web/playwright.config.ts",
611
- to: "apps/web/playwright.config.ts",
612
- },
613
- {
614
- kind: "copyFile",
615
- from: "web/vite.config.ts",
616
- to: "apps/web/vite.config.ts",
617
- },
618
- {
619
- kind: "copyFile",
620
- from: "web/vitest.config.ts",
621
- to: "apps/web/vitest.config.ts",
622
- },
623
- { kind: "copyFile", from: "web/src/api.ts", to: "apps/web/src/api.ts" },
624
- {
625
- kind: "replaceAnchors",
626
- path: "apps/web/src/api.ts",
627
- language: "typescript",
628
- replacements: {
629
- "api-type-import-start": `import type { AppType } from "${apiName}";\nimport { hc } from "hono/client";\n/*`,
630
- "api-type-import-end": "*/",
631
- },
632
- },
633
- { kind: "copyFile", from: "web/src/App.vue", to: "apps/web/src/App.vue" },
634
- { kind: "copyFile", from: "web/src/main.ts", to: "apps/web/src/main.ts" },
635
- {
636
- kind: "copyFile",
637
- from: "web/src/style.css",
638
- to: "apps/web/src/style.css",
639
- },
640
- {
641
- kind: "copyFile",
642
- from: "web/src/stores/counter.ts",
643
- to: "apps/web/src/stores/counter.ts",
644
- },
645
- {
646
- kind: "copyFile",
647
- from: "web/test/app.test.ts",
648
- to: "apps/web/test/app.test.ts",
649
- },
650
- {
651
- kind: "copyFile",
652
- from: "web/test/e2e/app.spec.ts",
653
- to: "apps/web/test/e2e/app.spec.ts",
654
- },
655
- ];
656
- }
657
- function templateSourceRoot() {
658
- const projectionDir = path.dirname(fileURLToPath(import.meta.url));
659
- const publishedTemplateRoot = path.join(projectionDir, "..", "..", "..", "templates", "vue-hono-app");
660
- return existsSync(path.join(publishedTemplateRoot, "web", "src", "App.vue"))
661
- ? publishedTemplateRoot
662
- : projectionDir;
663
- }
664
- function sharedOxcSourceRoot() {
665
- const projectionDir = path.dirname(fileURLToPath(import.meta.url));
666
- const publishedSharedRoot = path.join(projectionDir, "..", "..", "..", "templates", "shared", "oxc");
667
- return existsSync(path.join(publishedSharedRoot, "oxfmt.config.ts"))
668
- ? publishedSharedRoot
669
- : path.join(projectionDir, "..", "shared", "oxc");
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
- }
678
- export const vueHonoAppPresetProjection = {
679
- metadata: vueHonoAppPresetMetadata,
680
- blueprint: vueHonoAppBlueprint,
681
- project(context) {
682
- const checkPlan = planVueHonoRootChecks();
683
- const fixPlan = planVueHonoRootFixes();
684
- const packageScripts = projectVueHonoRootPackageScripts();
685
- return {
686
- sourceRoot: templateSourceRoot(),
687
- sourceRoots: {
688
- sharedDevcontainer: sharedDevcontainerSourceRoot(),
689
- sharedOxc: sharedOxcSourceRoot(),
690
- },
691
- operations: operationsForVueHonoApp(context, packageScripts, checkPlan),
692
- checkPlan,
693
- fixPlan,
694
- dependencyMaintenancePolicy,
695
- packageScripts,
696
- capabilities: {
697
- rootCheck: true,
698
- fixCommand: true,
699
- githubActions: true,
700
- dependabot: true,
701
- devcontainer: true,
702
- },
703
- };
704
- },
705
- async render({ targetDir, plan }) {
706
- await renderNewProject({
707
- sourceRoot: plan.sourceRoot,
708
- sourceRoots: plan.sourceRoots,
709
- targetRoot: targetDir,
710
- operations: [...plan.operations],
711
- });
712
- },
713
- };