@ykdz/template 0.0.13 → 0.0.14

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 (19) hide show
  1. package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.js +7 -34
  2. package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.js +5 -3
  3. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +5 -32
  4. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +8 -36
  5. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +27 -74
  6. package/node_modules/@ykdz/template-builtin-source/templates/hono-api/turbo.json +8 -0
  7. package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +16 -4
  8. package/node_modules/@ykdz/template-builtin-source/templates/rust-bin/turbo.json +3 -0
  9. package/node_modules/@ykdz/template-builtin-source/templates/ts-lib/turbo.json +3 -0
  10. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/turbo.json +11 -0
  11. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/api/turbo.json +8 -0
  12. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/playwright.config.ts +1 -1
  13. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/turbo.json +11 -0
  14. package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +4 -0
  15. package/node_modules/@ykdz/template-core/dist/module-graph.js +64 -4
  16. package/node_modules/@ykdz/template-core/dist/package-addition.js +23 -35
  17. package/node_modules/@ykdz/template-core/dist/package-linking.js +14 -8
  18. package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +156 -110
  19. package/package.json +3 -3
@@ -2,7 +2,6 @@ import { existsSync } from "node:fs";
2
2
  import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { builtInPresetProjectionSourceRoots, loadBuiltInPresetProjectionDeclaration, } from "@ykdz/template-builtin-source";
5
- import { renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
6
5
  import { packageManifestExposureFields, planPackageLinks, } from "@ykdz/template-core/package-linking";
7
6
  import { interpretPresetProjectionDeclaration } from "@ykdz/template-core/projection-capabilities";
8
7
  import { renderNewProject, } from "@ykdz/template-core/renderer";
@@ -26,30 +25,6 @@ export const honoApiPresetMetadata = {
26
25
  "dependabot",
27
26
  ],
28
27
  };
29
- const apiPackageBoundary = {
30
- kind: "package-boundary",
31
- path: ".",
32
- };
33
- function planHonoApiPackageChecks() {
34
- return {
35
- components: [
36
- { kind: "oxc-format-check", owner: apiPackageBoundary },
37
- { kind: "oxc-lint", owner: apiPackageBoundary },
38
- { kind: "typescript-typecheck", owner: apiPackageBoundary },
39
- { kind: "build", owner: apiPackageBoundary },
40
- { kind: "unit-test", owner: apiPackageBoundary },
41
- ],
42
- environmentNeeds: [],
43
- };
44
- }
45
- function planHonoApiPackageFixes() {
46
- return {
47
- components: [
48
- { kind: "oxc-format-write", owner: apiPackageBoundary },
49
- { kind: "oxc-lint-fix", owner: apiPackageBoundary },
50
- ],
51
- };
52
- }
53
28
  function projectNameFromDir(targetDir) {
54
29
  return path.basename(path.resolve(targetDir));
55
30
  }
@@ -72,16 +47,14 @@ export function honoApiBlueprint(options = { targetDir: process.cwd() }) {
72
47
  }
73
48
  export function projectHonoApiPackageScripts() {
74
49
  return {
75
- build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
76
- check: renderRootCheckCommand(planHonoApiPackageChecks()),
77
- fix: renderFixCommand(planHonoApiPackageFixes()),
78
- "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
79
- "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
80
- lint: "oxlint --config ../../oxlint.config.ts .",
81
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
50
+ "build:run": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
51
+ "format:check:run": "oxfmt --check --config ../../oxfmt.config.ts .",
52
+ "format:write:run": "oxfmt --write --config ../../oxfmt.config.ts .",
53
+ "lint:run": "oxlint --config ../../oxlint.config.ts .",
54
+ "lint:fix:run": "oxlint --config ../../oxlint.config.ts . --fix",
82
55
  start: "node dist/server.js",
83
- test: "vitest run",
84
- typecheck: "tsc -p tsconfig.json --noEmit",
56
+ "test:run": "vitest run",
57
+ "typecheck:run": "tsc -p tsconfig.json --noEmit",
85
58
  };
86
59
  }
87
60
  function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { builtInPresetProjectionSourceRoots, loadBuiltInPresetProjectionDeclaration, } from "@ykdz/template-builtin-source";
3
- import { renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
3
+ import {} from "@ykdz/template-core/module-graph";
4
4
  import { interpretPresetProjectionDeclaration } from "@ykdz/template-core/projection-capabilities";
5
5
  import { renderNewProject } from "@ykdz/template-core/renderer";
6
6
  import { PackageAdditionSupport, } from "@ykdz/template-shared";
@@ -77,8 +77,10 @@ export function rustBinBlueprint(options = { targetDir: process.cwd() }) {
77
77
  }
78
78
  export function projectRustBinPackageScripts() {
79
79
  return {
80
- check: renderRootCheckCommand(planRustBinChecks()),
81
- fix: renderFixCommand(planRustBinFixes()),
80
+ "format:check:run": "cargo fmt --all -- --check",
81
+ "format:write:run": "cargo fmt --all",
82
+ "lint:run": "cargo clippy --workspace --all-targets -- -D warnings",
83
+ "test:run": "cargo test --workspace",
82
84
  };
83
85
  }
84
86
  export const rustBinPresetProjection = {
@@ -2,7 +2,6 @@ import { existsSync } from "node:fs";
2
2
  import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { builtInPresetProjectionSourceRoots, loadBuiltInPresetProjectionDeclaration, } from "@ykdz/template-builtin-source";
5
- import { renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
6
5
  import { packageManifestExposureFields, planPackageLinks, } from "@ykdz/template-core/package-linking";
7
6
  import { interpretPresetProjectionDeclaration } from "@ykdz/template-core/projection-capabilities";
8
7
  import { renderNewProject, } from "@ykdz/template-core/renderer";
@@ -26,28 +25,6 @@ export const tsLibPresetMetadata = {
26
25
  "dependabot",
27
26
  ],
28
27
  };
29
- const tsLibPackageBoundary = {
30
- kind: "package-boundary",
31
- path: ".",
32
- };
33
- function planTsLibPackageChecks() {
34
- return {
35
- components: [
36
- { kind: "typescript-typecheck", owner: tsLibPackageBoundary },
37
- { kind: "oxc-lint", owner: tsLibPackageBoundary },
38
- { kind: "oxc-format-check", owner: tsLibPackageBoundary },
39
- ],
40
- environmentNeeds: [],
41
- };
42
- }
43
- function planTsLibPackageFixes() {
44
- return {
45
- components: [
46
- { kind: "oxc-format-write", owner: tsLibPackageBoundary },
47
- { kind: "oxc-lint-fix", owner: tsLibPackageBoundary },
48
- ],
49
- };
50
- }
51
28
  function projectNameFromDir(targetDir) {
52
29
  return path.basename(path.resolve(targetDir));
53
30
  }
@@ -75,16 +52,12 @@ export function tsLibBlueprint(options = { targetDir: process.cwd() }) {
75
52
  };
76
53
  }
77
54
  export function projectTsLibPackageScripts() {
78
- const checkPlan = planTsLibPackageChecks();
79
- const fixPlan = planTsLibPackageFixes();
80
55
  return {
81
- check: renderRootCheckCommand(checkPlan),
82
- fix: renderFixCommand(fixPlan),
83
- "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
84
- "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
85
- lint: "oxlint --config ../../oxlint.config.ts .",
86
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
87
- typecheck: "tsc -p tsconfig.json --noEmit",
56
+ "format:check:run": "oxfmt --check --config ../../oxfmt.config.ts .",
57
+ "format:write:run": "oxfmt --write --config ../../oxfmt.config.ts .",
58
+ "lint:run": "oxlint --config ../../oxlint.config.ts .",
59
+ "lint:fix:run": "oxlint --config ../../oxlint.config.ts . --fix",
60
+ "typecheck:run": "tsc -p tsconfig.json --noEmit",
88
61
  };
89
62
  }
90
63
  function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
@@ -3,7 +3,6 @@ import { readFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { builtInPresetProjectionSourceRoots, loadBuiltInPresetProjectionDeclaration, } from "@ykdz/template-builtin-source";
6
- import { renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
7
6
  import { interpretPresetProjectionDeclaration } from "@ykdz/template-core/projection-capabilities";
8
7
  import { renderNewProject, } from "@ykdz/template-core/renderer";
9
8
  import { PackageAdditionSupport, } from "@ykdz/template-shared";
@@ -26,31 +25,6 @@ export const vueAppPresetMetadata = {
26
25
  "dependabot",
27
26
  ],
28
27
  };
29
- const webPackageBoundary = {
30
- kind: "package-boundary",
31
- path: ".",
32
- };
33
- function planVueAppPackageChecks() {
34
- return {
35
- components: [
36
- { kind: "oxc-format-check", owner: webPackageBoundary },
37
- { kind: "oxc-lint", owner: webPackageBoundary },
38
- { kind: "typescript-typecheck", owner: webPackageBoundary },
39
- { kind: "build", owner: webPackageBoundary },
40
- { kind: "unit-test", owner: webPackageBoundary },
41
- { kind: "e2e-test", owner: webPackageBoundary },
42
- ],
43
- environmentNeeds: [],
44
- };
45
- }
46
- function planVueAppPackageFixes() {
47
- return {
48
- components: [
49
- { kind: "oxc-format-write", owner: webPackageBoundary },
50
- { kind: "oxc-lint-fix", owner: webPackageBoundary },
51
- ],
52
- };
53
- }
54
28
  function projectNameFromDir(targetDir) {
55
29
  return path.basename(path.resolve(targetDir));
56
30
  }
@@ -73,18 +47,16 @@ export function vueAppBlueprint(options = { targetDir: process.cwd() }) {
73
47
  }
74
48
  export function projectVueAppPackageScripts() {
75
49
  return {
76
- build: "vite build",
77
- check: renderRootCheckCommand(planVueAppPackageChecks()),
50
+ "build:run": "vite build",
78
51
  dev: "vite",
79
- fix: renderFixCommand(planVueAppPackageFixes()),
80
- "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
81
- "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
82
- lint: "oxlint --config ../../oxlint.config.ts .",
83
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
52
+ "format:check:run": "oxfmt --check --config ../../oxfmt.config.ts .",
53
+ "format:write:run": "oxfmt --write --config ../../oxfmt.config.ts .",
54
+ "lint:run": "oxlint --config ../../oxlint.config.ts .",
55
+ "lint:fix:run": "oxlint --config ../../oxlint.config.ts . --fix",
84
56
  preview: "vite preview",
85
- test: "vitest run",
86
- "test:e2e": "pnpm run build && node --experimental-strip-types scripts/run-playwright.ts",
87
- typecheck: "vue-tsc --build --noEmit",
57
+ "test:run": "vitest run",
58
+ "test:e2e:run": "node --experimental-strip-types scripts/run-playwright.ts",
59
+ "typecheck:run": "vue-tsc --build --noEmit",
88
60
  };
89
61
  }
90
62
  function isNodeError(error) {
@@ -27,14 +27,6 @@ const rootBoundary = {
27
27
  kind: "workspace-orchestration",
28
28
  path: ".",
29
29
  };
30
- const apiPackageBoundary = {
31
- kind: "package-boundary",
32
- path: ".",
33
- };
34
- const webPackageBoundary = {
35
- kind: "package-boundary",
36
- path: ".",
37
- };
38
30
  const workspacePackageBoundary = {
39
31
  kind: "package-boundary",
40
32
  path: "apps/*",
@@ -43,31 +35,6 @@ const webWorkspaceBoundary = {
43
35
  kind: "package-boundary",
44
36
  path: "apps/web",
45
37
  };
46
- function honoApiCheckComponents(owner) {
47
- return [
48
- { kind: "oxc-format-check", owner },
49
- { kind: "oxc-lint", owner },
50
- { kind: "typescript-typecheck", owner },
51
- { kind: "build", owner },
52
- { kind: "unit-test", owner },
53
- ];
54
- }
55
- function vueWebCheckComponents(owner) {
56
- return [
57
- { kind: "oxc-format-check", owner },
58
- { kind: "oxc-lint", owner },
59
- { kind: "typescript-typecheck", owner },
60
- { kind: "build", owner },
61
- { kind: "unit-test", owner },
62
- { kind: "e2e-test", owner },
63
- ];
64
- }
65
- function nodeFixComponents(owner) {
66
- return [
67
- { kind: "oxc-format-write", owner },
68
- { kind: "oxc-lint-fix", owner },
69
- ];
70
- }
71
38
  function planVueHonoRootChecks() {
72
39
  return {
73
40
  components: [
@@ -95,23 +62,6 @@ function planVueHonoRootFixes() {
95
62
  ],
96
63
  };
97
64
  }
98
- function planVueHonoApiChecks() {
99
- return {
100
- components: [...honoApiCheckComponents(apiPackageBoundary)],
101
- environmentNeeds: [],
102
- };
103
- }
104
- function planVueHonoWebChecks() {
105
- return {
106
- components: [...vueWebCheckComponents(webPackageBoundary)],
107
- environmentNeeds: [],
108
- };
109
- }
110
- function planVueHonoPackageFixes(owner) {
111
- return {
112
- components: [...nodeFixComponents(owner)],
113
- };
114
- }
115
65
  function projectNameFromDir(targetDir) {
116
66
  return path.basename(path.resolve(targetDir));
117
67
  }
@@ -138,44 +88,47 @@ export function vueHonoAppBlueprint(options) {
138
88
  export function projectVueHonoRootPackageScripts() {
139
89
  return {
140
90
  check: renderRootCheckCommand(planVueHonoRootChecks()),
91
+ "check:run": 'node -e ""',
141
92
  dev: "turbo run dev --parallel",
142
93
  fix: renderFixCommand(planVueHonoRootFixes()),
143
- "format:check": "oxfmt --check oxlint.config.ts oxfmt.config.ts",
144
- "format:write": "oxfmt --write oxlint.config.ts oxfmt.config.ts",
145
- lint: "oxlint oxlint.config.ts oxfmt.config.ts",
146
- "lint:fix": "oxlint oxlint.config.ts oxfmt.config.ts --fix",
147
- typecheck: "tsc -p tsconfig.config.json --noEmit",
94
+ "fix:run": 'node -e ""',
95
+ "format:check": "turbo run format:check:run",
96
+ "format:check:run": "oxfmt --check oxlint.config.ts oxfmt.config.ts",
97
+ "format:write": "turbo run format:write:run",
98
+ "format:write:run": "oxfmt --write oxlint.config.ts oxfmt.config.ts",
99
+ lint: "turbo run lint:run",
100
+ "lint:fix": "turbo run lint:fix:run",
101
+ "lint:fix:run": "oxlint oxlint.config.ts oxfmt.config.ts --fix",
102
+ "lint:run": "oxlint oxlint.config.ts oxfmt.config.ts",
103
+ typecheck: "turbo run typecheck:run",
104
+ "typecheck:run": "tsc -p tsconfig.config.json --noEmit",
148
105
  };
149
106
  }
150
107
  export function projectVueHonoApiPackageScripts() {
151
108
  return {
152
- build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
153
- check: renderRootCheckCommand(planVueHonoApiChecks()),
109
+ "build:run": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
154
110
  dev: "tsx watch src/server.ts",
155
- fix: renderFixCommand(planVueHonoPackageFixes(apiPackageBoundary)),
156
- "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
157
- "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
158
- lint: "oxlint --config ../../oxlint.config.ts .",
159
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
111
+ "format:check:run": "oxfmt --check --config ../../oxfmt.config.ts .",
112
+ "format:write:run": "oxfmt --write --config ../../oxfmt.config.ts .",
113
+ "lint:run": "oxlint --config ../../oxlint.config.ts .",
114
+ "lint:fix:run": "oxlint --config ../../oxlint.config.ts . --fix",
160
115
  start: "node dist/server.js",
161
- test: "vitest run",
162
- typecheck: "tsc -p tsconfig.json --noEmit",
116
+ "test:run": "vitest run",
117
+ "typecheck:run": "tsc -p tsconfig.json --noEmit",
163
118
  };
164
119
  }
165
120
  export function projectVueHonoWebPackageScripts() {
166
121
  return {
167
- build: "vite build",
168
- check: renderRootCheckCommand(planVueHonoWebChecks()),
122
+ "build:run": "vite build",
169
123
  dev: "vite",
170
- fix: renderFixCommand(planVueHonoPackageFixes(webPackageBoundary)),
171
- "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
172
- "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
173
- lint: "oxlint --config ../../oxlint.config.ts .",
174
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
124
+ "format:check:run": "oxfmt --check --config ../../oxfmt.config.ts .",
125
+ "format:write:run": "oxfmt --write --config ../../oxfmt.config.ts .",
126
+ "lint:run": "oxlint --config ../../oxlint.config.ts .",
127
+ "lint:fix:run": "oxlint --config ../../oxlint.config.ts . --fix",
175
128
  preview: "vite preview",
176
- test: "vitest run",
177
- "test:e2e": "pnpm run build && node --experimental-strip-types scripts/run-playwright.ts",
178
- typecheck: "vue-tsc --build",
129
+ "test:run": "vitest run",
130
+ "test:e2e:run": "node --experimental-strip-types scripts/run-playwright.ts",
131
+ "typecheck:run": "vue-tsc --build",
179
132
  };
180
133
  }
181
134
  export const vueHonoAppPresetProjection = {
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": ["//"],
3
+ "tasks": {
4
+ "build:run": {
5
+ "outputs": ["dist/**"]
6
+ }
7
+ }
8
+ }
@@ -217,7 +217,7 @@
217
217
  "workspacePackageGlob": "packages/*",
218
218
  "packageRole": "shared-library",
219
219
  "packageSourcePreset": "ts-lib",
220
- "sourceFiles": ["src/index.ts", "src/name-schema.ts"]
220
+ "sourceFiles": ["turbo.json", "src/index.ts", "src/name-schema.ts"]
221
221
  },
222
222
  { "kind": "strict-typescript-root" },
223
223
  {
@@ -233,6 +233,7 @@
233
233
  },
234
234
  "source": {
235
235
  "roots": ["ts-lib/.github", "ts-lib/src"],
236
+ "files": ["ts-lib/turbo.json"],
236
237
  "sharedResources": [
237
238
  "shared-devcontainer",
238
239
  "shared-editor-customization",
@@ -282,6 +283,7 @@
282
283
  "kind": "hono-api",
283
284
  "path": "apps/api",
284
285
  "sourceFiles": [
286
+ "turbo.json",
285
287
  "src/app.ts",
286
288
  "src/server.ts",
287
289
  "test/app.test.ts",
@@ -304,7 +306,7 @@
304
306
  },
305
307
  "source": {
306
308
  "roots": ["hono-api/.github", "hono-api/src", "hono-api/test"],
307
- "files": ["hono-api/vitest.config.ts"],
309
+ "files": ["hono-api/turbo.json", "hono-api/vitest.config.ts"],
308
310
  "sharedResources": [
309
311
  "shared-devcontainer",
310
312
  "shared-editor-customization",
@@ -361,6 +363,7 @@
361
363
  "kind": "vue-app",
362
364
  "path": "apps/web",
363
365
  "sourceFiles": [
366
+ "turbo.json",
364
367
  "env.d.ts",
365
368
  "index.html",
366
369
  "playwright.config.ts",
@@ -397,6 +400,7 @@
397
400
  "vue-app/playwright.package-addition.config.ts",
398
401
  "vue-app/playwright.config.ts",
399
402
  "vue-app/scripts/run-playwright.ts",
403
+ "vue-app/turbo.json",
400
404
  "vue-app/vite.config.ts",
401
405
  "vue-app/vitest.config.ts"
402
406
  ],
@@ -580,6 +584,7 @@
580
584
  "kind": "vue-app",
581
585
  "path": "apps/web",
582
586
  "sourceFiles": [
587
+ "web/turbo.json",
583
588
  "web/env.d.ts",
584
589
  "web/index.html",
585
590
  "web/playwright.config.ts",
@@ -599,6 +604,7 @@
599
604
  "kind": "hono-api",
600
605
  "path": "apps/api",
601
606
  "sourceFiles": [
607
+ "api/turbo.json",
602
608
  "api/src/index.ts",
603
609
  "api/src/runtime.ts",
604
610
  "api/src/server.ts",
@@ -636,10 +642,12 @@
636
642
  ],
637
643
  "files": [
638
644
  "vue-hono-app/api/vitest.config.ts",
645
+ "vue-hono-app/api/turbo.json",
639
646
  "vue-hono-app/web/env.d.ts",
640
647
  "vue-hono-app/web/index.html",
641
648
  "vue-hono-app/web/playwright.config.ts",
642
649
  "vue-hono-app/web/scripts/run-playwright.ts",
650
+ "vue-hono-app/web/turbo.json",
643
651
  "vue-hono-app/web/vite.config.ts",
644
652
  "vue-hono-app/web/vitest.config.ts"
645
653
  ],
@@ -676,7 +684,7 @@
676
684
  {
677
685
  "kind": "rust-binary-workspace",
678
686
  "workspacePackageGlob": "packages/*",
679
- "sourceFiles": ["src/main.rs"],
687
+ "sourceFiles": ["turbo.json", "src/main.rs"],
680
688
  "devcontainerResourceId": "shared-devcontainer",
681
689
  "editorCustomizationResourceId": "shared-editor-customization"
682
690
  }
@@ -684,7 +692,11 @@
684
692
  },
685
693
  "source": {
686
694
  "roots": ["rust-bin/.github", "rust-bin/src"],
687
- "files": ["rust-bin/rust-toolchain.toml", "rust-bin/rustfmt.toml"],
695
+ "files": [
696
+ "rust-bin/rust-toolchain.toml",
697
+ "rust-bin/rustfmt.toml",
698
+ "rust-bin/turbo.json"
699
+ ],
688
700
  "sharedResources": [
689
701
  "shared-devcontainer",
690
702
  "shared-editor-customization"
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": ["//"],
3
+ "tasks": {
4
+ "build:run": {
5
+ "outputs": ["dist/**"]
6
+ },
7
+ "test:e2e:run": {
8
+ "cache": false
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": ["//"],
3
+ "tasks": {
4
+ "build:run": {
5
+ "outputs": ["dist/**"]
6
+ }
7
+ }
8
+ }
@@ -26,7 +26,7 @@ export default defineConfig({
26
26
  },
27
27
  webServer: [
28
28
  {
29
- command: `pnpm --dir ../api run build && PORT=${apiPort} pnpm --dir ../api run start`,
29
+ command: `pnpm --dir ../api run build:run && PORT=${apiPort} pnpm --dir ../api run start`,
30
30
  url: apiHealthUrl,
31
31
  reuseExistingServer: false,
32
32
  },
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": ["//"],
3
+ "tasks": {
4
+ "build:run": {
5
+ "outputs": ["dist/**"]
6
+ },
7
+ "test:e2e:run": {
8
+ "cache": false
9
+ }
10
+ }
11
+ }
@@ -37,6 +37,10 @@ export type CheckPlan = {
37
37
  export type FixPlan = {
38
38
  readonly components: FixComponent[];
39
39
  };
40
+ export declare function checkComponentTaskName(component: CheckComponent): string;
41
+ export declare function fixComponentTaskName(component: FixComponent): string;
42
+ export declare function renderCheckLeafCommand(component: CheckComponent): string;
43
+ export declare function renderFixLeafCommand(component: FixComponent): string;
40
44
  export declare function renderRootCheckCommand(plan: CheckPlan): string;
41
45
  export declare function renderFixCommand(plan: FixPlan): string;
42
46
  export declare function renderPlaywrightBrowserInstallCommand(need: CheckEnvironmentNeed, options?: {
@@ -4,7 +4,61 @@ function renderTurboPackageFilter(owner) {
4
4
  }
5
5
  return `--filter './${owner.path}'`;
6
6
  }
7
- function renderCheckComponentCommand(component) {
7
+ export function checkComponentTaskName(component) {
8
+ return checkComponentTaskNames(component)[0] ?? "check:run";
9
+ }
10
+ function checkComponentTaskNames(component) {
11
+ switch (component.kind) {
12
+ case "typescript-typecheck":
13
+ case "turbo-package-typecheck":
14
+ return ["typecheck:run"];
15
+ case "oxc-lint":
16
+ case "cargo-clippy":
17
+ return ["lint:run"];
18
+ case "oxc-format-check":
19
+ case "rustfmt-check":
20
+ return ["format:check:run"];
21
+ case "build":
22
+ case "turbo-package-build":
23
+ return ["build:run"];
24
+ case "unit-test":
25
+ case "cargo-test":
26
+ case "turbo-package-test":
27
+ return ["test:run"];
28
+ case "e2e-test":
29
+ case "turbo-package-e2e-test":
30
+ return ["test:e2e:run"];
31
+ case "turbo-check":
32
+ case "turbo-package-check":
33
+ return [
34
+ "format:check:run",
35
+ "lint:run",
36
+ "typecheck:run",
37
+ "build:run",
38
+ "test:run",
39
+ "test:e2e:run",
40
+ ];
41
+ }
42
+ }
43
+ export function fixComponentTaskName(component) {
44
+ return fixComponentTaskNames(component)[0] ?? "fix:run";
45
+ }
46
+ function fixComponentTaskNames(component) {
47
+ switch (component.kind) {
48
+ case "oxc-format-write":
49
+ case "rustfmt-write":
50
+ return ["format:write:run"];
51
+ case "oxc-lint-fix":
52
+ return ["lint:fix:run"];
53
+ case "turbo-fix":
54
+ case "turbo-package-fix":
55
+ return ["format:write:run", "lint:fix:run"];
56
+ }
57
+ }
58
+ function uniqueTaskNames(taskNames) {
59
+ return [...new Set(taskNames)];
60
+ }
61
+ export function renderCheckLeafCommand(component) {
8
62
  switch (component.kind) {
9
63
  case "typescript-typecheck":
10
64
  return "pnpm run typecheck";
@@ -38,7 +92,7 @@ function renderCheckComponentCommand(component) {
38
92
  return "cargo test --workspace";
39
93
  }
40
94
  }
41
- function renderFixComponentCommand(component) {
95
+ export function renderFixLeafCommand(component) {
42
96
  switch (component.kind) {
43
97
  case "oxc-format-write":
44
98
  return "pnpm run format:write";
@@ -53,10 +107,16 @@ function renderFixComponentCommand(component) {
53
107
  }
54
108
  }
55
109
  export function renderRootCheckCommand(plan) {
56
- return plan.components.map(renderCheckComponentCommand).join(" && ");
110
+ return `turbo run ${uniqueTaskNames([
111
+ ...plan.components.flatMap(checkComponentTaskNames),
112
+ "check:run",
113
+ ]).join(" ")}`;
57
114
  }
58
115
  export function renderFixCommand(plan) {
59
- return plan.components.map(renderFixComponentCommand).join(" && ");
116
+ return `turbo run ${uniqueTaskNames([
117
+ ...plan.components.flatMap(fixComponentTaskNames),
118
+ "fix:run",
119
+ ]).join(" ")}`;
60
120
  }
61
121
  function playwrightBrowserInstallArgs(need, options = {}) {
62
122
  const installArgs = [
@@ -155,7 +155,8 @@ async function assertPackageLinkIntentConsumersAreTypeScriptBoundaries(options)
155
155
  const hasTypeScriptPackageShape = isRecord(manifest) &&
156
156
  manifest.type === "module" &&
157
157
  isRecord(scripts) &&
158
- typeof scripts.typecheck === "string";
158
+ (typeof scripts.typecheck === "string" ||
159
+ typeof scripts["typecheck:run"] === "string");
159
160
  if (hasTypeScriptPackageShape) {
160
161
  continue;
161
162
  }
@@ -380,44 +381,20 @@ async function consumerManifestUpdatesForPackageLinkIntents(options) {
380
381
  }
381
382
  return updates;
382
383
  }
383
- function workspacePackageGlobsFromBlueprint(blueprint) {
384
- const globs = [];
385
- for (const packageDefinition of blueprint.packages ?? []) {
386
- const [workspaceDir] = packageDefinition.path.split("/");
387
- if (!workspaceDir) {
388
- throw new Error(`Cannot update root Package Addition scripts: invalid package path ${packageDefinition.path}`);
389
- }
390
- const glob = `${workspaceDir}/*`;
391
- if (!globs.includes(glob)) {
392
- globs.push(glob);
393
- }
394
- }
395
- return globs;
396
- }
397
- function turboPackageTaskCommand(task, workspacePackageGlobs) {
398
- const filters = workspacePackageGlobs.map((glob) => `--filter './${glob}'`);
399
- const concurrency = task === "check" ? ["--concurrency=1"] : [];
400
- return [`turbo run ${task}`, ...concurrency, ...filters].join(" ");
401
- }
402
- function rootScriptWithTurboPackageTask(script, task, workspacePackageGlobs) {
403
- const commands = script.split(" && ");
404
- const turboCommandIndex = commands.findIndex((command) => command.startsWith(`turbo run ${task}`));
405
- if (turboCommandIndex === -1) {
406
- throw new Error(`Cannot update root Package Addition scripts: scripts.${task} must run Turbo package tasks`);
407
- }
408
- commands[turboCommandIndex] = turboPackageTaskCommand(task, workspacePackageGlobs);
409
- return commands.join(" && ");
410
- }
411
384
  function rootScriptWithTurboPackageTasks(options) {
412
385
  const rootCommands = options.script
413
386
  .split(" && ")
414
387
  .filter((command) => !command.startsWith("turbo run "));
415
- const turboCommands = options.taskNames.map((taskName) => turboPackageTaskCommand(taskName, options.workspacePackageGlobs));
416
- return [...rootCommands, ...turboCommands].join(" && ");
388
+ const turboCommand = [
389
+ "turbo run",
390
+ ...options.taskNames,
391
+ ...(options.concurrency === undefined ? [] : ["--concurrency=1"]),
392
+ ].join(" ");
393
+ return [...rootCommands, turboCommand].join(" && ");
417
394
  }
418
395
  function rootPackageJsonWithPackageTaskFilters(input, blueprint) {
396
+ void blueprint;
419
397
  assertRootPackageJson(input);
420
- const workspacePackageGlobs = workspacePackageGlobsFromBlueprint(blueprint);
421
398
  const checkScript = input.scripts.check;
422
399
  const fixScript = input.scripts.fix;
423
400
  if (checkScript === undefined || fixScript === undefined) {
@@ -429,10 +406,21 @@ function rootPackageJsonWithPackageTaskFilters(input, blueprint) {
429
406
  ...input.scripts,
430
407
  check: rootScriptWithTurboPackageTasks({
431
408
  script: checkScript,
432
- taskNames: ["check"],
433
- workspacePackageGlobs,
409
+ taskNames: [
410
+ "format:check:run",
411
+ "lint:run",
412
+ "typecheck:run",
413
+ "build:run",
414
+ "test:run",
415
+ "test:e2e:run",
416
+ "check:run",
417
+ ],
418
+ concurrency: 1,
419
+ }),
420
+ fix: rootScriptWithTurboPackageTasks({
421
+ script: fixScript,
422
+ taskNames: ["format:write:run", "lint:fix:run", "fix:run"],
434
423
  }),
435
- fix: rootScriptWithTurboPackageTask(fixScript, "fix", workspacePackageGlobs),
436
424
  },
437
425
  };
438
426
  }
@@ -67,16 +67,22 @@ export function planPackageLinks(definitions, intents = []) {
67
67
  }
68
68
  export function packageTurboTasks({ dependencyBuildsRequired, }) {
69
69
  return {
70
- typecheck: { dependsOn: ["^typecheck"] },
71
- build: dependencyBuildsRequired
72
- ? { dependsOn: ["^build"], outputs: ["dist/**"] }
70
+ "format:check:run": {},
71
+ "format:write:run": { cache: false },
72
+ "lint:run": {},
73
+ "lint:fix:run": { cache: false },
74
+ "typecheck:run": { dependsOn: ["^typecheck:run"] },
75
+ "build:run": dependencyBuildsRequired
76
+ ? { dependsOn: ["^build:run"], outputs: ["dist/**"] }
73
77
  : { outputs: ["dist/**"] },
74
- test: { dependsOn: ["^typecheck"] },
75
- "test:e2e": {
76
- dependsOn: dependencyBuildsRequired ? ["build", "^build"] : ["build"],
78
+ "test:run": { dependsOn: ["^typecheck:run"] },
79
+ "test:e2e:run": {
80
+ dependsOn: dependencyBuildsRequired
81
+ ? ["build:run", "^build:run"]
82
+ : ["build:run"],
77
83
  },
78
- check: { dependsOn: ["typecheck", "build", "test"] },
79
- fix: { cache: false },
84
+ "check:run": { cache: false },
85
+ "fix:run": { cache: false },
80
86
  };
81
87
  }
82
88
  export function packageManifestExposureFields(exposure) {
@@ -5,8 +5,8 @@ import { normalizePresetProjectionDeclaration, projectionCapabilityIssues, valid
5
5
  import { collectGeneratedManifestCatalogDependencies, collectGeneratedManifestCatalogReferences, renderGeneratedPnpmWorkspaceYaml, } from "./dependency-catalog.js";
6
6
  import { browserTestToolLayer, checkedDockerfileFirstNodePnpmDevcontainer, dockerfileFirstRustPnpmDevcontainer, nodePnpmToolLayer, rustToolLayer, } from "./devcontainer.js";
7
7
  import { editorCustomizationForCapabilities, loadEditorCustomizationDeclarations, } from "./editor-customization.js";
8
- import { playwrightBrowserAssetsEnvironmentNeed, renderFixCommand, renderRootCheckCommand, } from "./module-graph.js";
9
- import { packageManifestExposureFields, planPackageLinks, } from "./package-linking.js";
8
+ import { playwrightBrowserAssetsEnvironmentNeed, renderCheckLeafCommand, renderFixCommand, renderFixLeafCommand, renderRootCheckCommand, } from "./module-graph.js";
9
+ import { packageManifestExposureFields, packageTurboTasks, planPackageLinks, } from "./package-linking.js";
10
10
  export { normalizePresetProjectionDeclaration, projectionCapabilityIssues, validateProjectionCapabilities, };
11
11
  const strictTypescriptRootBoundary = {
12
12
  kind: "workspace-orchestration",
@@ -812,19 +812,106 @@ function sourceRootPreset(capability) {
812
812
  return "vue-hono-app";
813
813
  }
814
814
  function projectRootPackageScripts(checkPlan, fixPlan, fragments) {
815
+ const leafFragments = leafScriptFragments(fragments);
816
+ const directFragments = directScriptFragments(fragments);
815
817
  return {
816
818
  check: renderRootCheckCommand(checkPlan),
817
819
  fix: renderFixCommand(fixPlan),
818
- ...fragments,
820
+ ...rootTaskEntrypoints(checkPlan, fixPlan),
821
+ ...directFragments,
822
+ ...leafFragments,
823
+ "check:run": noopTaskCommand(),
824
+ "fix:run": noopTaskCommand(),
819
825
  };
820
826
  }
821
827
  function projectPackageScripts(checkPlan, fixPlan, fragments) {
828
+ void checkPlan;
829
+ void fixPlan;
822
830
  return {
823
- check: renderRootCheckCommand(checkPlan),
824
- fix: renderFixCommand(fixPlan),
825
- ...fragments,
831
+ ...directScriptFragments(fragments),
832
+ ...leafScriptFragments(fragments),
826
833
  };
827
834
  }
835
+ const leafEntrypointNames = new Set([
836
+ "format:check",
837
+ "format:write",
838
+ "lint",
839
+ "lint:fix",
840
+ "typecheck",
841
+ "build",
842
+ "test",
843
+ "test:e2e",
844
+ ]);
845
+ function leafScriptName(scriptName) {
846
+ return leafEntrypointNames.has(scriptName) ? `${scriptName}:run` : scriptName;
847
+ }
848
+ function leafScriptFragments(fragments) {
849
+ return Object.fromEntries(Object.entries(fragments)
850
+ .filter(([scriptName]) => leafEntrypointNames.has(scriptName))
851
+ .map(([scriptName, command]) => [leafScriptName(scriptName), command]));
852
+ }
853
+ function directScriptFragments(fragments) {
854
+ return Object.fromEntries(Object.entries(fragments).filter(([scriptName]) => !leafEntrypointNames.has(scriptName)));
855
+ }
856
+ function rootEntrypointScriptsFromRootPackageScripts(scripts) {
857
+ return Object.fromEntries(Object.entries(scripts).filter(([scriptName]) => !scriptName.endsWith(":run") ||
858
+ scriptName === "check:run" ||
859
+ scriptName === "fix:run"));
860
+ }
861
+ function rootTaskEntrypoints(checkPlan, fixPlan) {
862
+ const taskNames = new Set([
863
+ ...checkPlan.components.map((component) => renderCheckLeafCommand(component).startsWith("turbo run ")
864
+ ? undefined
865
+ : leafEntrypointFromRunTask(component.kind)),
866
+ ...fixPlan.components.map((component) => renderFixLeafCommand(component).startsWith("turbo run ")
867
+ ? undefined
868
+ : leafEntrypointFromRunTask(component.kind)),
869
+ ]);
870
+ const entries = [];
871
+ for (const taskName of taskNames) {
872
+ if (taskName === undefined) {
873
+ continue;
874
+ }
875
+ entries.push([taskName, `turbo run ${taskName}:run`]);
876
+ }
877
+ return Object.fromEntries(entries);
878
+ }
879
+ function leafEntrypointFromRunTask(kind) {
880
+ switch (kind) {
881
+ case "oxc-format-check":
882
+ case "rustfmt-check":
883
+ return "format:check";
884
+ case "oxc-format-write":
885
+ case "rustfmt-write":
886
+ return "format:write";
887
+ case "oxc-lint":
888
+ case "cargo-clippy":
889
+ return "lint";
890
+ case "oxc-lint-fix":
891
+ return "lint:fix";
892
+ case "typescript-typecheck":
893
+ return "typecheck";
894
+ case "build":
895
+ return "build";
896
+ case "unit-test":
897
+ case "cargo-test":
898
+ return "test";
899
+ case "e2e-test":
900
+ return "test:e2e";
901
+ case "turbo-check":
902
+ case "turbo-package-typecheck":
903
+ case "turbo-package-build":
904
+ case "turbo-package-test":
905
+ case "turbo-package-e2e-test":
906
+ case "turbo-package-check":
907
+ case "turbo-fix":
908
+ case "turbo-package-fix":
909
+ return undefined;
910
+ }
911
+ }
912
+ function noopTaskCommand() {
913
+ return 'node -e ""';
914
+ }
828
915
  function packageCollection(workspacePackageGlob) {
829
916
  if (workspacePackageGlob === ".") {
830
917
  return ".";
@@ -1049,6 +1136,7 @@ function vikePackageJson(context, packageName, scripts) {
1049
1136
  oxlint: "catalog:",
1050
1137
  "oxlint-tsgolint": "catalog:",
1051
1138
  tailwindcss: "catalog:",
1139
+ turbo: "catalog:",
1052
1140
  typescript: "catalog:",
1053
1141
  vite: "catalog:",
1054
1142
  vitest: "catalog:",
@@ -1131,17 +1219,25 @@ function rustRootPackageJson(context, packageScripts, state) {
1131
1219
  packageManager: context.toolchain.packageManagerPin.value,
1132
1220
  };
1133
1221
  }
1134
- function rustWorkspacePackageJson(context, scripts) {
1222
+ function rustWorkspacePackageJson(context) {
1135
1223
  return {
1136
1224
  name: rustWorkspacePackageName(context),
1137
1225
  version: "0.0.0",
1138
1226
  private: true,
1139
- scripts,
1227
+ scripts: rustWorkspacePackageScripts(),
1140
1228
  engines: {
1141
1229
  node: context.toolchain.nodeLtsMajor.value,
1142
1230
  },
1143
1231
  };
1144
1232
  }
1233
+ function rustWorkspacePackageScripts() {
1234
+ return {
1235
+ "format:check:run": "cargo fmt --all -- --check",
1236
+ "format:write:run": "cargo fmt --all",
1237
+ "lint:run": "cargo clippy --workspace --all-targets -- -D warnings",
1238
+ "test:run": "cargo test --workspace",
1239
+ };
1240
+ }
1145
1241
  function workspaceLibraryPackageOperations({ context, state, packageScripts, packageScriptsByPath, }) {
1146
1242
  if (state.package === undefined) {
1147
1243
  throw new Error("workspace-library-package capability state is missing");
@@ -1177,14 +1273,7 @@ function workspaceLibraryPackageOperations({ context, state, packageScripts, pac
1177
1273
  to: "turbo.json",
1178
1274
  value: {
1179
1275
  tasks: {
1180
- build: packageLinkPlan.turboTasks.build,
1181
- check: packageLinkPlan.turboTasks.check,
1182
- typecheck: packageLinkPlan.turboTasks.typecheck,
1183
- test: packageLinkPlan.turboTasks.test,
1184
- "test:e2e": packageLinkPlan.turboTasks["test:e2e"],
1185
- fix: {
1186
- cache: false,
1187
- },
1276
+ ...packageLinkPlan.turboTasks,
1188
1277
  },
1189
1278
  },
1190
1279
  },
@@ -1223,18 +1312,14 @@ function workspaceLibraryPackageOperations({ context, state, packageScripts, pac
1223
1312
  },
1224
1313
  ];
1225
1314
  }
1226
- function rustBinaryWorkspaceOperations({ context, state, packageScripts, packageScriptsByPath, }) {
1315
+ function rustBinaryWorkspaceOperations({ context, state, packageScripts, }) {
1227
1316
  if (state.rustWorkspace === undefined) {
1228
1317
  throw new Error("rust-binary-workspace capability state is missing");
1229
1318
  }
1230
1319
  const capability = state.rustWorkspace;
1231
1320
  const packagePath = rustWorkspacePackagePath(context);
1232
- const workspacePackageScripts = packageScriptsByPath.get(capability.workspacePackageGlob);
1233
- if (workspacePackageScripts === undefined) {
1234
- throw new Error(`Missing package scripts for ${capability.workspacePackageGlob}`);
1235
- }
1236
1321
  const rootManifest = rustRootPackageJson(context, packageScripts, state);
1237
- const packageManifest = rustWorkspacePackageJson(context, workspacePackageScripts);
1322
+ const packageManifest = rustWorkspacePackageJson(context);
1238
1323
  const rustLayer = rustToolLayer();
1239
1324
  const dockerfileFragments = readDevelopmentContainerDockerfileFragments(state, ["rust"]);
1240
1325
  const editorCustomization = editorCustomizationForCapabilities(state.editorCustomizationCapabilities, editorCustomizationDeclarationsForState(state));
@@ -1270,12 +1355,7 @@ function rustBinaryWorkspaceOperations({ context, state, packageScripts, package
1270
1355
  kind: "writeJson",
1271
1356
  to: "turbo.json",
1272
1357
  value: {
1273
- tasks: {
1274
- check: {},
1275
- fix: {
1276
- cache: false,
1277
- },
1278
- },
1358
+ tasks: packageTurboTasks({ dependencyBuildsRequired: false }),
1279
1359
  },
1280
1360
  },
1281
1361
  {
@@ -1338,6 +1418,7 @@ function rustBinaryWorkspaceOperations({ context, state, packageScripts, package
1338
1418
  kind: "writeJson",
1339
1419
  to: ".devcontainer/devcontainer.json",
1340
1420
  value: developmentContainer.devcontainer,
1421
+ multilineArrays: ["customizations.vscode.extensions"],
1341
1422
  },
1342
1423
  {
1343
1424
  ...developmentContainer.dockerfileOperation,
@@ -1390,7 +1471,7 @@ function workspaceNodePackagesOperations({ context, state, packageScripts, }) {
1390
1471
  return vuePackageJson(context, packageName, scripts, packageLinkPlan.manifestDependenciesByPackagePath.get(nodePackage.path));
1391
1472
  });
1392
1473
  const rootManifest = isRootNodeWorkspace(capability)
1393
- ? packageManifests[0]
1474
+ ? rootNodePackageManifest(packageManifests[0], packageScripts)
1394
1475
  : rootPackageJson(context, packageScripts, state);
1395
1476
  if (rootManifest === undefined) {
1396
1477
  throw new Error("workspace-node-packages rendered no package manifests");
@@ -1429,11 +1510,7 @@ function workspaceNodePackagesOperations({ context, state, packageScripts, }) {
1429
1510
  to: "turbo.json",
1430
1511
  value: {
1431
1512
  tasks: {
1432
- build: packageLinkPlan.turboTasks.build,
1433
- check: packageLinkPlan.turboTasks.check,
1434
- typecheck: packageLinkPlan.turboTasks.typecheck,
1435
- test: packageLinkPlan.turboTasks.test,
1436
- "test:e2e": packageLinkPlan.turboTasks["test:e2e"],
1513
+ ...packageLinkPlan.turboTasks,
1437
1514
  ...(hasVuePackage(capability)
1438
1515
  ? {
1439
1516
  dev: {
@@ -1442,9 +1519,6 @@ function workspaceNodePackagesOperations({ context, state, packageScripts, }) {
1442
1519
  },
1443
1520
  }
1444
1521
  : {}),
1445
- fix: {
1446
- cache: false,
1447
- },
1448
1522
  },
1449
1523
  },
1450
1524
  },
@@ -1483,6 +1557,33 @@ function workspaceNodePackagesOperations({ context, state, packageScripts, }) {
1483
1557
  },
1484
1558
  ];
1485
1559
  }
1560
+ function rootNodePackageManifest(packageManifest, rootPackageScripts) {
1561
+ if (packageManifest === undefined) {
1562
+ return undefined;
1563
+ }
1564
+ const packageScripts = packageManifest.scripts;
1565
+ if (packageScripts === undefined ||
1566
+ typeof packageScripts !== "object" ||
1567
+ packageScripts === null ||
1568
+ Array.isArray(packageScripts)) {
1569
+ throw new Error("Root node package manifest rendered invalid scripts");
1570
+ }
1571
+ const checkedPackageScripts = {};
1572
+ for (const scriptName of Object.keys(packageScripts)) {
1573
+ const command = Reflect.get(packageScripts, scriptName);
1574
+ if (typeof command !== "string") {
1575
+ throw new Error("Root node package manifest rendered non-string scripts");
1576
+ }
1577
+ checkedPackageScripts[scriptName] = command;
1578
+ }
1579
+ return {
1580
+ ...packageManifest,
1581
+ scripts: {
1582
+ ...rootEntrypointScriptsFromRootPackageScripts(rootPackageScripts),
1583
+ ...checkedPackageScripts,
1584
+ },
1585
+ };
1586
+ }
1486
1587
  function nodePackageScripts(nodePackage, workspace) {
1487
1588
  const oxcScripts = {
1488
1589
  "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
@@ -1491,99 +1592,43 @@ function nodePackageScripts(nodePackage, workspace) {
1491
1592
  "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
1492
1593
  };
1493
1594
  if (nodePackage.kind === "hono-api") {
1494
- const checks = {
1495
- components: [
1496
- { kind: "oxc-format-check", owner: workspacePackageBoundary },
1497
- { kind: "oxc-lint", owner: workspacePackageBoundary },
1498
- { kind: "typescript-typecheck", owner: workspacePackageBoundary },
1499
- { kind: "build", owner: workspacePackageBoundary },
1500
- { kind: "unit-test", owner: workspacePackageBoundary },
1501
- ],
1502
- environmentNeeds: [],
1503
- };
1504
- const fixes = {
1505
- components: [
1506
- { kind: "oxc-format-write", owner: workspacePackageBoundary },
1507
- { kind: "oxc-lint-fix", owner: workspacePackageBoundary },
1508
- ],
1509
- };
1510
1595
  return {
1511
- build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
1512
- check: renderRootCheckCommand(checks),
1596
+ "build:run": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
1513
1597
  ...(workspace.packages.length > 1
1514
1598
  ? { dev: "tsx watch src/server.ts" }
1515
1599
  : {}),
1516
- fix: renderFixCommand(fixes),
1517
- ...oxcScripts,
1600
+ ...leafScriptFragments(oxcScripts),
1518
1601
  start: "node dist/server.js",
1519
- test: "vitest run",
1520
- typecheck: "tsc -p tsconfig.json --noEmit",
1602
+ "test:run": "vitest run",
1603
+ "typecheck:run": "tsc -p tsconfig.json --noEmit",
1521
1604
  };
1522
1605
  }
1523
1606
  if (nodePackage.kind === "vike-app") {
1524
- const checks = {
1525
- components: [
1526
- { kind: "oxc-format-check", owner: workspacePackageBoundary },
1527
- { kind: "oxc-lint", owner: workspacePackageBoundary },
1528
- { kind: "typescript-typecheck", owner: workspacePackageBoundary },
1529
- { kind: "build", owner: workspacePackageBoundary },
1530
- { kind: "unit-test", owner: workspacePackageBoundary },
1531
- { kind: "e2e-test", owner: workspacePackageBoundary },
1532
- ],
1533
- environmentNeeds: [],
1534
- };
1535
- const fixes = {
1536
- components: [
1537
- { kind: "oxc-format-write", owner: workspacePackageBoundary },
1538
- { kind: "oxc-lint-fix", owner: workspacePackageBoundary },
1539
- ],
1540
- };
1541
1607
  return {
1542
- build: "vike build",
1543
- check: renderRootCheckCommand(checks),
1608
+ "build:run": "vike build",
1544
1609
  dev: "vike dev",
1545
1610
  "drizzle:generate": "drizzle-kit generate",
1546
1611
  "drizzle:migrate": "drizzle-kit migrate",
1547
1612
  "drizzle:studio": "drizzle-kit studio",
1548
- fix: renderFixCommand(fixes),
1549
- "format:check": "oxfmt --check --config oxfmt.config.ts .",
1550
- "format:write": "oxfmt --write --config oxfmt.config.ts .",
1551
- lint: "oxlint --type-aware --config oxlint.config.ts .",
1552
- "lint:fix": "oxlint --type-aware --config oxlint.config.ts . --fix",
1613
+ "format:check:run": "oxfmt --check --config oxfmt.config.ts .",
1614
+ "format:write:run": "oxfmt --write --config oxfmt.config.ts .",
1615
+ "lint:run": "oxlint --type-aware --config oxlint.config.ts .",
1616
+ "lint:fix:run": "oxlint --type-aware --config oxlint.config.ts . --fix",
1553
1617
  preview: "vike preview",
1554
1618
  start: "node ./dist/server/index.mjs",
1555
- test: "vitest run",
1556
- "test:e2e": "playwright test --config playwright.config.ts",
1557
- typecheck: "vue-tsc --build --noEmit",
1619
+ "test:run": "vitest run",
1620
+ "test:e2e:run": "playwright test --config playwright.config.ts",
1621
+ "typecheck:run": "vue-tsc --build --noEmit",
1558
1622
  };
1559
1623
  }
1560
- const checks = {
1561
- components: [
1562
- { kind: "oxc-format-check", owner: workspacePackageBoundary },
1563
- { kind: "oxc-lint", owner: workspacePackageBoundary },
1564
- { kind: "typescript-typecheck", owner: workspacePackageBoundary },
1565
- { kind: "build", owner: workspacePackageBoundary },
1566
- { kind: "unit-test", owner: workspacePackageBoundary },
1567
- { kind: "e2e-test", owner: workspacePackageBoundary },
1568
- ],
1569
- environmentNeeds: [],
1570
- };
1571
- const fixes = {
1572
- components: [
1573
- { kind: "oxc-format-write", owner: workspacePackageBoundary },
1574
- { kind: "oxc-lint-fix", owner: workspacePackageBoundary },
1575
- ],
1576
- };
1577
1624
  return {
1578
- build: "vite build",
1579
- check: renderRootCheckCommand(checks),
1625
+ "build:run": "vite build",
1580
1626
  dev: "vite",
1581
- fix: renderFixCommand(fixes),
1582
- ...oxcScripts,
1627
+ ...leafScriptFragments(oxcScripts),
1583
1628
  preview: "vite preview",
1584
- test: "vitest run",
1585
- "test:e2e": "pnpm run build && node --experimental-strip-types scripts/run-playwright.ts",
1586
- typecheck: workspace.packages.length > 1
1629
+ "test:run": "vitest run",
1630
+ "test:e2e:run": "node --experimental-strip-types scripts/run-playwright.ts",
1631
+ "typecheck:run": workspace.packages.length > 1
1587
1632
  ? "vue-tsc --build"
1588
1633
  : "vue-tsc --build --noEmit",
1589
1634
  };
@@ -1966,6 +2011,7 @@ function nodePnpmDevcontainerOperations({ context, state, }) {
1966
2011
  kind: "writeJson",
1967
2012
  to: ".devcontainer/devcontainer.json",
1968
2013
  value: developmentContainer.devcontainer,
2014
+ multilineArrays: ["customizations.vscode.extensions"],
1969
2015
  },
1970
2016
  {
1971
2017
  ...developmentContainer.dockerfileOperation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "private": false,
5
5
  "description": "Project template generator for YKDZ starter projects.",
6
6
  "keywords": [
@@ -34,9 +34,9 @@
34
34
  "dependencies": {
35
35
  "typescript": "^6.0.3",
36
36
  "valibot": "^1.4.2",
37
- "@ykdz/template-builtin-source": "0.0.0",
38
37
  "@ykdz/template-core": "0.0.0",
39
- "@ykdz/template-shared": "0.0.0"
38
+ "@ykdz/template-shared": "0.0.0",
39
+ "@ykdz/template-builtin-source": "0.0.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^24.0.0",