@ykdz/template 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/src/cli.d.ts.map +1 -0
  2. package/dist/{cli.js → src/cli.js} +126 -128
  3. package/dist/{declarations.d.ts → src/declarations.d.ts} +1 -2
  4. package/dist/src/declarations.d.ts.map +1 -0
  5. package/dist/{declarations.js → src/declarations.js} +2 -109
  6. package/dist/src/dependency-catalog.d.ts +10 -0
  7. package/dist/src/dependency-catalog.d.ts.map +1 -0
  8. package/dist/src/dependency-catalog.js +63 -0
  9. package/dist/src/devcontainer.d.ts +18 -0
  10. package/dist/src/devcontainer.d.ts.map +1 -0
  11. package/dist/src/devcontainer.js +24 -0
  12. package/dist/src/editor-customization.d.ts +13 -0
  13. package/dist/src/editor-customization.d.ts.map +1 -0
  14. package/dist/src/editor-customization.js +101 -0
  15. package/dist/src/generation-context.d.ts +24 -0
  16. package/dist/src/generation-context.d.ts.map +1 -0
  17. package/dist/src/generation-context.js +12 -0
  18. package/dist/src/module-graph.d.ts +31 -0
  19. package/dist/src/module-graph.d.ts.map +1 -0
  20. package/dist/src/module-graph.js +48 -0
  21. package/dist/src/next-step-instructions.d.ts +21 -0
  22. package/dist/src/next-step-instructions.d.ts.map +1 -0
  23. package/dist/src/next-step-instructions.js +89 -0
  24. package/dist/src/package-addition.d.ts.map +1 -0
  25. package/dist/src/package-addition.js +188 -0
  26. package/dist/src/preset-projection.d.ts +66 -0
  27. package/dist/src/preset-projection.d.ts.map +1 -0
  28. package/dist/src/preset-projection.js +7 -0
  29. package/dist/src/project-github.d.ts +29 -0
  30. package/dist/src/project-github.d.ts.map +1 -0
  31. package/dist/src/project-github.js +63 -0
  32. package/dist/src/renderer.d.ts.map +1 -0
  33. package/dist/{renderer.js → src/renderer.js} +0 -3
  34. package/dist/src/runtime-paths.d.ts +2 -0
  35. package/dist/src/runtime-paths.d.ts.map +1 -0
  36. package/dist/src/runtime-paths.js +11 -0
  37. package/dist/src/toolchain-resolution.d.ts +35 -0
  38. package/dist/src/toolchain-resolution.d.ts.map +1 -0
  39. package/dist/src/toolchain-resolution.js +192 -0
  40. package/dist/templates/hono-api/projection.d.ts +7 -0
  41. package/dist/templates/hono-api/projection.d.ts.map +1 -0
  42. package/dist/templates/hono-api/projection.js +377 -0
  43. package/dist/templates/projection-plans.d.ts +8 -0
  44. package/dist/templates/projection-plans.d.ts.map +1 -0
  45. package/dist/templates/projection-plans.js +94 -0
  46. package/dist/templates/registry.d.ts +8 -0
  47. package/dist/templates/registry.d.ts.map +1 -0
  48. package/dist/templates/registry.js +42 -0
  49. package/dist/templates/rust-bin/projection.d.ts +10 -0
  50. package/dist/templates/rust-bin/projection.d.ts.map +1 -0
  51. package/dist/templates/rust-bin/projection.js +282 -0
  52. package/dist/templates/ts-lib/projection.d.ts +7 -0
  53. package/dist/templates/ts-lib/projection.d.ts.map +1 -0
  54. package/dist/templates/ts-lib/projection.js +372 -0
  55. package/dist/templates/vue-app/projection.d.ts +7 -0
  56. package/dist/templates/vue-app/projection.d.ts.map +1 -0
  57. package/dist/templates/vue-app/projection.js +594 -0
  58. package/dist/templates/vue-hono-app/projection.d.ts +9 -0
  59. package/dist/templates/vue-hono-app/projection.d.ts.map +1 -0
  60. package/dist/templates/vue-hono-app/projection.js +589 -0
  61. package/package.json +30 -24
  62. package/pnpm-workspace.yaml +34 -0
  63. package/templates/hono-api/projection.ts +453 -0
  64. package/templates/projection-plans.ts +135 -0
  65. package/templates/registry.ts +59 -0
  66. package/templates/rust-bin/.github/dependabot.yml +4 -0
  67. package/templates/rust-bin/.github/workflows/check.yml +6 -1
  68. package/templates/rust-bin/projection.ts +346 -0
  69. package/templates/ts-lib/projection.ts +454 -0
  70. package/templates/vue-app/projection.ts +687 -0
  71. package/templates/vue-app/test/e2e/app.spec.ts +4 -1
  72. package/templates/vue-hono-app/projection.ts +669 -0
  73. package/templates/vue-hono-app/web/test/e2e/app.spec.ts +4 -1
  74. package/dist/cli.d.ts.map +0 -1
  75. package/dist/declarations.d.ts.map +0 -1
  76. package/dist/hono-api.d.ts +0 -2
  77. package/dist/hono-api.d.ts.map +0 -1
  78. package/dist/hono-api.js +0 -208
  79. package/dist/package-addition.d.ts.map +0 -1
  80. package/dist/package-addition.js +0 -560
  81. package/dist/post-commands.d.ts +0 -40
  82. package/dist/post-commands.d.ts.map +0 -1
  83. package/dist/post-commands.js +0 -154
  84. package/dist/renderer.d.ts.map +0 -1
  85. package/dist/rust-bin.d.ts +0 -2
  86. package/dist/rust-bin.d.ts.map +0 -1
  87. package/dist/rust-bin.js +0 -174
  88. package/dist/ts-lib.d.ts +0 -2
  89. package/dist/ts-lib.d.ts.map +0 -1
  90. package/dist/ts-lib.js +0 -181
  91. package/dist/vue-app.d.ts +0 -2
  92. package/dist/vue-app.d.ts.map +0 -1
  93. package/dist/vue-app.js +0 -299
  94. package/dist/vue-hono-app.d.ts +0 -4
  95. package/dist/vue-hono-app.d.ts.map +0 -1
  96. package/dist/vue-hono-app.js +0 -436
  97. package/templates/shared/oxc/package.json +0 -18
  98. package/templates/shared/oxc/tsconfig.json +0 -11
  99. /package/dist/{cli.d.ts → src/cli.d.ts} +0 -0
  100. /package/dist/{package-addition.d.ts → src/package-addition.d.ts} +0 -0
  101. /package/dist/{renderer.d.ts → src/renderer.d.ts} +0 -0
@@ -0,0 +1,594 @@
1
+ import { existsSync } from "node:fs";
2
+ import { readFile } from "node:fs/promises";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { renderGeneratedPnpmWorkspaceYaml } from "../../src/dependency-catalog.js";
6
+ import { nodePnpmDevcontainer } from "../../src/devcontainer.js";
7
+ import { editorCustomizationForCapabilities } from "../../src/editor-customization.js";
8
+ import { renderFixCommand, renderRootCheckCommand, } from "../../src/module-graph.js";
9
+ import { projectCheckWorkflow, projectDependabotConfig, } from "../../src/project-github.js";
10
+ import { renderNewProject } from "../../src/renderer.js";
11
+ import { planNodeChecks, planNodeFixes } from "../projection-plans.js";
12
+ const generatedBy = {
13
+ packageName: "@ykdz/template",
14
+ version: "0.0.0",
15
+ command: "template init --preset vue-app",
16
+ };
17
+ export const vueAppPresetMetadata = {
18
+ name: "vue-app",
19
+ title: "Vue app",
20
+ description: "Single-package Vue app with Vite, Tailwind, Pinia, and test tooling.",
21
+ generation: "supported",
22
+ supportedPackageManagers: ["pnpm"],
23
+ supportedProjectKinds: ["single-package"],
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"],
37
+ interval: "weekly",
38
+ };
39
+ export function vueAppBlueprint() {
40
+ return {
41
+ schemaVersion: 1,
42
+ preset: "vue-app",
43
+ packageManager: "pnpm",
44
+ projectKind: "single-package",
45
+ features: [...vueAppPresetMetadata.features],
46
+ };
47
+ }
48
+ export function projectVueAppPackageScripts() {
49
+ return {
50
+ build: "vite build",
51
+ check: renderRootCheckCommand(planNodeChecks("vue-app")),
52
+ dev: "vite",
53
+ fix: renderFixCommand(planNodeFixes("vue-app")),
54
+ "format:check": "oxfmt --check .",
55
+ "format:write": "oxfmt --write .",
56
+ lint: "oxlint . --deny-warnings",
57
+ "lint:fix": "oxlint . --fix --deny-warnings",
58
+ preview: "vite preview",
59
+ test: "vitest run",
60
+ "test:e2e": "pnpm run build && playwright test",
61
+ typecheck: "vue-tsc --build --noEmit",
62
+ };
63
+ }
64
+ function packageJson(context, packageScripts) {
65
+ return {
66
+ name: context.projectName.value,
67
+ version: "0.0.0",
68
+ private: true,
69
+ type: "module",
70
+ scripts: packageScripts,
71
+ dependencies: {
72
+ "@vueuse/core": "catalog:",
73
+ pinia: "catalog:",
74
+ vue: "catalog:",
75
+ },
76
+ devDependencies: {
77
+ "@playwright/test": "catalog:",
78
+ "@tailwindcss/vite": "catalog:",
79
+ "@types/node": "catalog:",
80
+ "@types/web-bluetooth": "catalog:",
81
+ "@vitejs/plugin-vue": "catalog:",
82
+ "@vue/tsconfig": "catalog:",
83
+ oxfmt: "catalog:",
84
+ oxlint: "catalog:",
85
+ tailwindcss: "catalog:",
86
+ typescript: "catalog:",
87
+ vite: "catalog:",
88
+ vitest: "catalog:",
89
+ "vue-tsc": "catalog:",
90
+ },
91
+ engines: {
92
+ node: context.toolchain.nodeLtsMajor.value,
93
+ },
94
+ packageManager: context.toolchain.packageManagerPin.value,
95
+ };
96
+ }
97
+ function generationRecord(context) {
98
+ return {
99
+ ...generatedBy,
100
+ toolchain: {
101
+ nodeLtsMajor: context.toolchain.nodeLtsMajor.value,
102
+ packageManagerPin: context.toolchain.packageManagerPin.value,
103
+ source: context.toolchain.source,
104
+ },
105
+ };
106
+ }
107
+ function operationsForVueApp(context, packageScripts, checkPlan) {
108
+ const editorCustomization = editorCustomizationForCapabilities([
109
+ "oxc-format-lint",
110
+ "vue",
111
+ "tailwind",
112
+ "vitest",
113
+ ]);
114
+ return [
115
+ {
116
+ kind: "writeJson",
117
+ to: "package.json",
118
+ value: packageJson(context, packageScripts),
119
+ },
120
+ {
121
+ kind: "writeText",
122
+ to: "pnpm-workspace.yaml",
123
+ text: renderGeneratedPnpmWorkspaceYaml({
124
+ dependencies: [
125
+ "@playwright/test",
126
+ "@tailwindcss/vite",
127
+ "@types/node",
128
+ "@types/web-bluetooth",
129
+ "@vitejs/plugin-vue",
130
+ "@vue/tsconfig",
131
+ "@vueuse/core",
132
+ "oxfmt",
133
+ "oxlint",
134
+ "pinia",
135
+ "tailwindcss",
136
+ "typescript",
137
+ "vite",
138
+ "vitest",
139
+ "vue",
140
+ "vue-tsc",
141
+ ],
142
+ allowBuilds: {
143
+ esbuild: true,
144
+ },
145
+ }),
146
+ },
147
+ {
148
+ kind: "writeJson",
149
+ to: "tsconfig.json",
150
+ value: {
151
+ files: [],
152
+ references: [
153
+ { path: "./tsconfig.app.json" },
154
+ { path: "./tsconfig.test.json" },
155
+ { path: "./tsconfig.node.json" },
156
+ ],
157
+ },
158
+ },
159
+ {
160
+ kind: "writeJson",
161
+ to: "tsconfig.app.json",
162
+ value: {
163
+ extends: "@vue/tsconfig/tsconfig.dom.json",
164
+ compilerOptions: {
165
+ composite: true,
166
+ module: "ESNext",
167
+ moduleResolution: "Bundler",
168
+ noEmitOnError: true,
169
+ paths: {
170
+ "@/*": ["./src/*"],
171
+ },
172
+ skipLibCheck: false,
173
+ strict: true,
174
+ target: "ES2022",
175
+ tsBuildInfoFile: "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
176
+ types: ["web-bluetooth"],
177
+ },
178
+ include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
179
+ },
180
+ },
181
+ {
182
+ kind: "writeJson",
183
+ to: "tsconfig.test.json",
184
+ value: {
185
+ extends: "./tsconfig.app.json",
186
+ compilerOptions: {
187
+ lib: ["ESNext", "DOM", "DOM.Iterable"],
188
+ tsBuildInfoFile: "./node_modules/.tmp/tsconfig.test.tsbuildinfo",
189
+ types: ["node", "vitest/globals", "web-bluetooth"],
190
+ },
191
+ include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue", "test/**/*.ts"],
192
+ },
193
+ },
194
+ {
195
+ kind: "writeJson",
196
+ to: "tsconfig.node.json",
197
+ value: {
198
+ compilerOptions: {
199
+ composite: true,
200
+ module: "ESNext",
201
+ moduleResolution: "Bundler",
202
+ noEmitOnError: true,
203
+ lib: ["ESNext", "DOM", "DOM.Iterable"],
204
+ skipLibCheck: false,
205
+ strict: true,
206
+ target: "ES2022",
207
+ tsBuildInfoFile: "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
208
+ types: ["node"],
209
+ },
210
+ include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
211
+ },
212
+ },
213
+ {
214
+ kind: "copyFile",
215
+ sourceRoot: "sharedOxc",
216
+ from: "vue/oxlint.config.ts",
217
+ to: "oxlint.config.ts",
218
+ },
219
+ {
220
+ kind: "copyFile",
221
+ sourceRoot: "sharedOxc",
222
+ from: "oxfmt.config.ts",
223
+ to: "oxfmt.config.ts",
224
+ },
225
+ {
226
+ kind: "writeText",
227
+ to: ".gitignore",
228
+ text: [
229
+ "node_modules",
230
+ "dist",
231
+ "playwright-report",
232
+ "test-results",
233
+ ".env",
234
+ "",
235
+ ].join("\n"),
236
+ },
237
+ { kind: "copyFile", from: "env.d.ts", to: "env.d.ts" },
238
+ { kind: "copyFile", from: "index.html", to: "index.html" },
239
+ {
240
+ kind: "copyFile",
241
+ from: "playwright.config.ts",
242
+ to: "playwright.config.ts",
243
+ },
244
+ { kind: "copyFile", from: "vite.config.ts", to: "vite.config.ts" },
245
+ { kind: "copyFile", from: "vitest.config.ts", to: "vitest.config.ts" },
246
+ { kind: "copyFile", from: "src/App.vue", to: "src/App.vue" },
247
+ { kind: "copyFile", from: "src/main.ts", to: "src/main.ts" },
248
+ { kind: "copyFile", from: "src/style.css", to: "src/style.css" },
249
+ {
250
+ kind: "copyFile",
251
+ from: "src/stores/counter.ts",
252
+ to: "src/stores/counter.ts",
253
+ },
254
+ { kind: "copyFile", from: "test/app.test.ts", to: "test/app.test.ts" },
255
+ {
256
+ kind: "copyFile",
257
+ from: "test/e2e/app.spec.ts",
258
+ to: "test/e2e/app.spec.ts",
259
+ },
260
+ {
261
+ kind: "writeJson",
262
+ to: ".project-kit/blueprint.json",
263
+ value: vueAppBlueprint(),
264
+ },
265
+ {
266
+ kind: "writeJson",
267
+ to: ".project-kit/generated-by.json",
268
+ value: generationRecord(context),
269
+ },
270
+ {
271
+ kind: "writeJson",
272
+ to: ".devcontainer/devcontainer.json",
273
+ value: nodePnpmDevcontainer({
274
+ name: `${context.projectName.value} Vue development`,
275
+ nodeVersion: context.toolchain.nodeLtsMajor.value,
276
+ packageManagerPin: context.toolchain.packageManagerPin.value,
277
+ extensions: editorCustomization.extensions,
278
+ settings: editorCustomization.settings,
279
+ }),
280
+ },
281
+ {
282
+ kind: "writeJson",
283
+ to: ".vscode/extensions.json",
284
+ value: {
285
+ recommendations: editorCustomization.extensions,
286
+ },
287
+ multilineArrays: ["recommendations"],
288
+ },
289
+ {
290
+ kind: "writeJson",
291
+ to: ".vscode/settings.json",
292
+ value: editorCustomization.settings,
293
+ },
294
+ {
295
+ kind: "writeText",
296
+ to: ".github/workflows/check.yml",
297
+ text: projectCheckWorkflow({ checkPlan }),
298
+ },
299
+ {
300
+ kind: "writeText",
301
+ to: ".github/dependabot.yml",
302
+ text: projectDependabotConfig(dependencyMaintenancePolicy),
303
+ },
304
+ ];
305
+ }
306
+ function isNodeError(error) {
307
+ return error instanceof Error && "code" in error;
308
+ }
309
+ function localPortsFromText(text) {
310
+ return [
311
+ ...text.matchAll(/port:\s*(\d+)/g),
312
+ ...text.matchAll(/--port\s+(\d+)/g),
313
+ ...text.matchAll(/https?:\/\/(?:localhost|127\.0\.0\.1):(\d+)/g),
314
+ ].map((match) => Number(match[1]));
315
+ }
316
+ async function usedPlaywrightPorts(root, blueprint) {
317
+ const ports = new Set();
318
+ for (const projectPackage of blueprint.packages ?? []) {
319
+ try {
320
+ const configText = await readFile(path.join(root, projectPackage.path, "playwright.config.ts"), "utf8");
321
+ for (const port of localPortsFromText(configText)) {
322
+ ports.add(port);
323
+ }
324
+ }
325
+ catch (error) {
326
+ if (!isNodeError(error) || error.code !== "ENOENT") {
327
+ throw error;
328
+ }
329
+ }
330
+ }
331
+ return ports;
332
+ }
333
+ async function nextVuePreviewPort(root, blueprint) {
334
+ const usedPorts = await usedPlaywrightPorts(root, blueprint);
335
+ let port = 4173;
336
+ while (usedPorts.has(port)) {
337
+ port += 1;
338
+ }
339
+ return port;
340
+ }
341
+ function vueAppPlaywrightConfig(previewPort) {
342
+ return `import { defineConfig, devices } from "@playwright/test";
343
+
344
+ const previewUrl = "http://127.0.0.1:${previewPort}";
345
+
346
+ export default defineConfig({
347
+ testDir: "./test/e2e",
348
+ use: {
349
+ baseURL: previewUrl,
350
+ trace: "on-first-retry"
351
+ },
352
+ webServer: {
353
+ command: "pnpm run preview --host 127.0.0.1 --port ${previewPort}",
354
+ reuseExistingServer: !process.env.CI,
355
+ url: previewUrl
356
+ },
357
+ projects: [
358
+ {
359
+ name: "chromium",
360
+ use: { ...devices["Desktop Chrome"] }
361
+ }
362
+ ]
363
+ });
364
+ `;
365
+ }
366
+ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
367
+ return [
368
+ {
369
+ kind: "writeJson",
370
+ to: `${packagePath}/package.json`,
371
+ value: {
372
+ name: packageName,
373
+ version: "0.0.0",
374
+ private: true,
375
+ type: "module",
376
+ scripts: projectVueAppPackageScripts(),
377
+ dependencies: {
378
+ "@vueuse/core": "catalog:",
379
+ pinia: "catalog:",
380
+ vue: "catalog:",
381
+ },
382
+ devDependencies: {
383
+ "@playwright/test": "catalog:",
384
+ "@tailwindcss/vite": "catalog:",
385
+ "@types/node": "catalog:",
386
+ "@types/web-bluetooth": "catalog:",
387
+ "@vitejs/plugin-vue": "catalog:",
388
+ "@vue/tsconfig": "catalog:",
389
+ oxfmt: "catalog:",
390
+ oxlint: "catalog:",
391
+ tailwindcss: "catalog:",
392
+ typescript: "catalog:",
393
+ vite: "catalog:",
394
+ vitest: "catalog:",
395
+ "vue-tsc": "catalog:",
396
+ },
397
+ engines: {
398
+ node: nodeVersion,
399
+ },
400
+ },
401
+ },
402
+ {
403
+ kind: "writeJson",
404
+ to: `${packagePath}/tsconfig.json`,
405
+ value: {
406
+ files: [],
407
+ references: [
408
+ { path: "./tsconfig.app.json" },
409
+ { path: "./tsconfig.test.json" },
410
+ { path: "./tsconfig.node.json" },
411
+ ],
412
+ },
413
+ },
414
+ {
415
+ kind: "writeJson",
416
+ to: `${packagePath}/tsconfig.app.json`,
417
+ value: {
418
+ extends: "@vue/tsconfig/tsconfig.dom.json",
419
+ compilerOptions: {
420
+ composite: true,
421
+ module: "ESNext",
422
+ moduleResolution: "Bundler",
423
+ noEmitOnError: true,
424
+ paths: {
425
+ "@/*": ["./src/*"],
426
+ },
427
+ skipLibCheck: false,
428
+ strict: true,
429
+ target: "ES2022",
430
+ tsBuildInfoFile: "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
431
+ types: ["web-bluetooth"],
432
+ },
433
+ include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
434
+ },
435
+ },
436
+ {
437
+ kind: "writeJson",
438
+ to: `${packagePath}/tsconfig.test.json`,
439
+ value: {
440
+ extends: "./tsconfig.app.json",
441
+ compilerOptions: {
442
+ lib: ["ESNext", "DOM", "DOM.Iterable"],
443
+ tsBuildInfoFile: "./node_modules/.tmp/tsconfig.test.tsbuildinfo",
444
+ types: ["node", "vitest/globals", "web-bluetooth"],
445
+ },
446
+ include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue", "test/**/*.ts"],
447
+ },
448
+ },
449
+ {
450
+ kind: "writeJson",
451
+ to: `${packagePath}/tsconfig.node.json`,
452
+ value: {
453
+ compilerOptions: {
454
+ composite: true,
455
+ module: "ESNext",
456
+ moduleResolution: "Bundler",
457
+ noEmitOnError: true,
458
+ lib: ["ESNext", "DOM", "DOM.Iterable"],
459
+ skipLibCheck: false,
460
+ strict: true,
461
+ target: "ES2022",
462
+ tsBuildInfoFile: "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
463
+ types: ["node"],
464
+ },
465
+ include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
466
+ },
467
+ },
468
+ {
469
+ kind: "copyFile",
470
+ sourceRoot: "sharedOxc",
471
+ from: "vue/oxlint.config.ts",
472
+ to: `${packagePath}/oxlint.config.ts`,
473
+ },
474
+ {
475
+ kind: "copyFile",
476
+ sourceRoot: "sharedOxc",
477
+ from: "oxfmt.config.ts",
478
+ to: `${packagePath}/oxfmt.config.ts`,
479
+ },
480
+ { kind: "copyFile", from: "env.d.ts", to: `${packagePath}/env.d.ts` },
481
+ { kind: "copyFile", from: "index.html", to: `${packagePath}/index.html` },
482
+ {
483
+ kind: "copyFile",
484
+ from: "playwright.config.ts",
485
+ to: `${packagePath}/playwright.config.ts`,
486
+ },
487
+ {
488
+ kind: "copyFile",
489
+ from: "vite.config.ts",
490
+ to: `${packagePath}/vite.config.ts`,
491
+ },
492
+ {
493
+ kind: "copyFile",
494
+ from: "vitest.config.ts",
495
+ to: `${packagePath}/vitest.config.ts`,
496
+ },
497
+ { kind: "copyFile", from: "src/App.vue", to: `${packagePath}/src/App.vue` },
498
+ { kind: "copyFile", from: "src/main.ts", to: `${packagePath}/src/main.ts` },
499
+ {
500
+ kind: "copyFile",
501
+ from: "src/style.css",
502
+ to: `${packagePath}/src/style.css`,
503
+ },
504
+ {
505
+ kind: "copyFile",
506
+ from: "src/stores/counter.ts",
507
+ to: `${packagePath}/src/stores/counter.ts`,
508
+ },
509
+ {
510
+ kind: "copyFile",
511
+ from: "test/app.test.ts",
512
+ to: `${packagePath}/test/app.test.ts`,
513
+ },
514
+ {
515
+ kind: "copyFile",
516
+ from: "test/e2e/app.spec.ts",
517
+ to: `${packagePath}/test/e2e/app.spec.ts`,
518
+ },
519
+ ];
520
+ }
521
+ async function packageAdditionPlan({ root, blueprint, packageLeafName, packageName, nodeVersion, }) {
522
+ const packagePath = `apps/${packageLeafName}`;
523
+ const previewPort = await nextVuePreviewPort(root, blueprint);
524
+ return {
525
+ packagePath,
526
+ workspacePackageGlob: "apps/*",
527
+ rootTsconfigReferences: [
528
+ `./${packagePath}/tsconfig.app.json`,
529
+ `./${packagePath}/tsconfig.test.json`,
530
+ `./${packagePath}/tsconfig.node.json`,
531
+ ],
532
+ sourceRoot: templateSourceRoot(),
533
+ sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
534
+ operations: packageAdditionOperations(packagePath, packageName, nodeVersion),
535
+ textFiles: [
536
+ {
537
+ path: `${packagePath}/playwright.config.ts`,
538
+ text: vueAppPlaywrightConfig(previewPort),
539
+ },
540
+ ],
541
+ };
542
+ }
543
+ function templateSourceRoot() {
544
+ const projectionDir = path.dirname(fileURLToPath(import.meta.url));
545
+ const publishedTemplateRoot = path.join(projectionDir, "..", "..", "..", "templates", "vue-app");
546
+ return existsSync(path.join(publishedTemplateRoot, "src", "App.vue"))
547
+ ? publishedTemplateRoot
548
+ : projectionDir;
549
+ }
550
+ function sharedOxcSourceRoot() {
551
+ const projectionDir = path.dirname(fileURLToPath(import.meta.url));
552
+ const publishedSharedRoot = path.join(projectionDir, "..", "..", "..", "templates", "shared", "oxc");
553
+ return existsSync(path.join(publishedSharedRoot, "oxfmt.config.ts"))
554
+ ? publishedSharedRoot
555
+ : path.join(projectionDir, "..", "shared", "oxc");
556
+ }
557
+ export const vueAppPresetProjection = {
558
+ metadata: vueAppPresetMetadata,
559
+ capabilities: {
560
+ packageAddition: {
561
+ planPackageAddition: packageAdditionPlan,
562
+ },
563
+ },
564
+ blueprint: vueAppBlueprint,
565
+ project(context) {
566
+ const checkPlan = planNodeChecks("vue-app");
567
+ const fixPlan = planNodeFixes("vue-app");
568
+ const packageScripts = projectVueAppPackageScripts();
569
+ return {
570
+ sourceRoot: templateSourceRoot(),
571
+ sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
572
+ operations: operationsForVueApp(context, packageScripts, checkPlan),
573
+ checkPlan,
574
+ fixPlan,
575
+ dependencyMaintenancePolicy,
576
+ packageScripts,
577
+ capabilities: {
578
+ rootCheck: true,
579
+ fixCommand: true,
580
+ githubActions: true,
581
+ dependabot: true,
582
+ devcontainer: true,
583
+ },
584
+ };
585
+ },
586
+ async render({ targetDir, plan }) {
587
+ await renderNewProject({
588
+ sourceRoot: plan.sourceRoot,
589
+ sourceRoots: plan.sourceRoots,
590
+ targetRoot: targetDir,
591
+ operations: [...plan.operations],
592
+ });
593
+ },
594
+ };
@@ -0,0 +1,9 @@
1
+ import type { BuiltInPreset, ProjectBlueprint } from "../../src/declarations.js";
2
+ import type { PresetBlueprintOptions, PresetProjection } from "../../src/preset-projection.js";
3
+ export declare const vueHonoAppPresetMetadata: BuiltInPreset;
4
+ export declare function vueHonoAppBlueprint(options: PresetBlueprintOptions): ProjectBlueprint;
5
+ export declare function projectVueHonoRootPackageScripts(): Record<string, string>;
6
+ export declare function projectVueHonoApiPackageScripts(): Record<string, string>;
7
+ export declare function projectVueHonoWebPackageScripts(): Record<string, string>;
8
+ export declare const vueHonoAppPresetProjection: PresetProjection;
9
+ //# sourceMappingURL=projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../../templates/vue-hono-app/projection.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAUnC,OAAO,KAAK,EACV,sBAAsB,EACtB,gBAAgB,EAEjB,MAAM,gCAAgC,CAAC;AAexC,eAAO,MAAM,wBAAwB,EAAE,aAiBtC,CAAC;AAmBF,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,sBAAsB,GAC9B,gBAAgB,CAclB;AAED,wBAAgB,gCAAgC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMzE;AAED,wBAAgB,+BAA+B,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcxE;AAED,wBAAgB,+BAA+B,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexE;AA0fD,eAAO,MAAM,0BAA0B,EAAE,gBAiCxC,CAAC"}