@ykdz/template 0.0.24 → 0.0.25

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 (37) hide show
  1. package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.d.ts +3 -5
  2. package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +172 -165
  3. package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.js +4 -24
  4. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.d.ts +0 -3
  5. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +8 -26
  6. package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.js +5 -29
  7. package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.js +24 -50
  8. package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.js +2 -4
  9. package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.js +9 -26
  10. package/node_modules/@ykdz/template-builtin-presets/package.json +2 -1
  11. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.dynamic.txt +1 -5
  12. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +1 -2
  13. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/check-boundaries.ts +12 -0
  14. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/run-root-owned-task.ts +69 -0
  15. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/tsconfig.json +6 -1
  16. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo.json +15 -8
  17. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/turbo.json +1 -1
  18. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/turbo.json +2 -2
  19. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/Dockerfile +3 -4
  20. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/check-standalone-deployment.ts +1 -1
  21. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/turbo.json +3 -3
  22. package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/turbo.json +3 -3
  23. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/turbo.json +1 -1
  24. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/playwright.config.ts +1 -1
  25. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/turbo.json +2 -2
  26. package/node_modules/@ykdz/template-core/dist/dependency-catalog.d.ts +0 -1
  27. package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +2 -8
  28. package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +39 -37
  29. package/node_modules/@ykdz/template-core/dist/module-graph.js +84 -142
  30. package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +3 -5
  31. package/node_modules/@ykdz/template-core/dist/package-contribution.js +7 -7
  32. package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +0 -2
  33. package/node_modules/@ykdz/template-core/dist/project-github.d.ts +11 -3
  34. package/node_modules/@ykdz/template-core/dist/project-github.js +30 -35
  35. package/node_modules/@ykdz/template-core/dist/project-linking-v2.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.pnpmfile.cts +0 -14
@@ -7,8 +7,6 @@ export type WorkspaceOrchestrationOwner = {
7
7
  readonly path: ".";
8
8
  };
9
9
  export type ComponentOwner = PackageBoundaryOwner | WorkspaceOrchestrationOwner;
10
- export type CheckComponentKind = "typescript-typecheck" | "oxc-lint" | "oxc-format-check" | "build" | "unit-test" | "e2e-test" | "turbo-check" | "turbo-package-typecheck" | "turbo-package-build" | "turbo-package-test" | "turbo-package-e2e-test" | "turbo-package-check" | "rustfmt-check" | "cargo-clippy" | "cargo-test";
11
- export type FixComponentKind = "oxc-format-write" | "oxc-lint-fix" | "turbo-fix" | "turbo-package-fix" | "rustfmt-write";
12
10
  export type PlaywrightBrowserAssetsEnvironmentNeed = {
13
11
  readonly kind: "playwright-browser-assets";
14
12
  readonly browser: "chromium";
@@ -34,7 +32,7 @@ export type ShellCheckEnvironmentNeed = {
34
32
  readonly machineVerifiable: false;
35
33
  };
36
34
  };
37
- /** Rust check components require the maintained toolchain in local and CI plans. */
35
+ /** Rust task leaves require the maintained toolchain in local and CI plans. */
38
36
  export type RustToolchainEnvironmentNeed = {
39
37
  readonly kind: "rust-toolchain";
40
38
  readonly owner: ComponentOwner;
@@ -48,42 +46,46 @@ export type RustToolchainEnvironmentNeed = {
48
46
  readonly machineVerifiable: boolean;
49
47
  };
50
48
  };
51
- export type CheckEnvironmentNeed = PlaywrightBrowserAssetsEnvironmentNeed | ShellCheckEnvironmentNeed | RustToolchainEnvironmentNeed;
52
- export declare function rustToolchainEnvironmentNeed(owner: ComponentOwner): RustToolchainEnvironmentNeed;
53
- export type CheckComponent = {
54
- readonly kind: CheckComponentKind;
55
- readonly owner: ComponentOwner;
56
- };
57
- export type DeploymentCheckComponent = {
58
- readonly kind: "deployment-image";
59
- readonly owner: PackageBoundaryOwner;
60
- };
61
- export type DeploymentCheckEnvironmentNeed = {
49
+ /**
50
+ * Docker is needed only by the focused deployment mode. It is deliberately
51
+ * outside ordinary Check Environment Needs, whose preparation and next steps
52
+ * apply to every generated-check scenario.
53
+ */
54
+ export type DockerEngineEnvironmentNeed = {
62
55
  readonly kind: "docker-engine";
56
+ readonly preparation: {
57
+ readonly id: "verify-docker-engine";
58
+ readonly label: "Verify Docker engine";
59
+ readonly command: "docker";
60
+ readonly args: readonly ["version", "--format", "{{.Server.Version}}"];
61
+ readonly display: "docker version --format {{.Server.Version}}";
62
+ readonly machineVerifiable: true;
63
+ };
63
64
  };
64
- export type FixComponent = {
65
- readonly kind: FixComponentKind;
66
- readonly owner: ComponentOwner;
67
- };
68
- export type CheckPlan = {
69
- readonly components: CheckComponent[];
70
- readonly environmentNeeds: CheckEnvironmentNeed[];
71
- readonly deploymentChecks?: DeploymentCheckComponent[] | undefined;
72
- };
73
- export type FixPlan = {
74
- readonly components: FixComponent[];
75
- };
76
- export declare function renderTurboRunCommand(taskNames: readonly string[], args?: readonly string[]): string;
77
- export declare function checkComponentTaskName(component: CheckComponent): string;
78
- export declare function fixComponentTaskName(component: FixComponent): string;
79
- export declare function renderCheckLeafCommand(component: CheckComponent): string;
80
- export declare function renderFixLeafCommand(component: FixComponent): string;
81
- export declare function renderRootCheckCommand(plan: CheckPlan): string;
82
- export declare function deploymentCheckEnvironmentNeeds(check: DeploymentCheckComponent): DeploymentCheckEnvironmentNeed[];
83
- export declare function deploymentCheckTaskName(check: DeploymentCheckComponent): "check:deployment";
84
- export declare function renderDeploymentCheckLeafCommand(check: DeploymentCheckComponent): string;
85
- export declare function renderDeploymentCheckCommand(plan: Pick<CheckPlan, "deploymentChecks">): string;
86
- export declare function renderFixCommand(plan: FixPlan): string;
65
+ export type CheckEnvironmentNeed = PlaywrightBrowserAssetsEnvironmentNeed | ShellCheckEnvironmentNeed | RustToolchainEnvironmentNeed;
66
+ export type DeploymentEnvironmentNeed = DockerEngineEnvironmentNeed;
67
+ /**
68
+ * The durable form of a Check Environment Need. It deliberately retains only
69
+ * the explicit preparation fact, never a task name or package execution list.
70
+ */
71
+ export type CheckEnvironmentNeedFact = Pick<PlaywrightBrowserAssetsEnvironmentNeed, "kind" | "browser" | "owner"> | Pick<ShellCheckEnvironmentNeed, "kind" | "owner"> | Pick<RustToolchainEnvironmentNeed, "kind" | "owner" | "toolchain">;
72
+ /** Deployment preparation is likewise durable without selecting an executing package. */
73
+ export type DeploymentEnvironmentNeedFact = Pick<DockerEngineEnvironmentNeed, "kind">;
74
+ export declare function checkEnvironmentNeedFact(need: CheckEnvironmentNeed): CheckEnvironmentNeedFact;
75
+ export declare function checkEnvironmentNeedFromFact(fact: CheckEnvironmentNeedFact): CheckEnvironmentNeed;
76
+ export declare function deploymentEnvironmentNeedFact(need: DeploymentEnvironmentNeed): DeploymentEnvironmentNeedFact;
77
+ export declare function deploymentEnvironmentNeedFromFact(fact: DeploymentEnvironmentNeedFact): DeploymentEnvironmentNeed;
78
+ export declare function rustToolchainEnvironmentNeed(owner: ComponentOwner): RustToolchainEnvironmentNeed;
79
+ export declare function dockerEngineEnvironmentNeed(): DockerEngineEnvironmentNeed;
80
+ export declare const qualityTaskVocabulary: readonly ["boundaries", "format:check", "lint", "typecheck", "build", "test", "test:e2e"];
81
+ export declare function renderTurboRunCommand(taskNames: readonly string[], args?: readonly string[], options?: {
82
+ readonly outputLogs?: "errors-only" | "full";
83
+ readonly continueAfterFailure?: boolean;
84
+ readonly taskPrefix?: boolean;
85
+ }): string;
86
+ export declare function renderRootCheckCommand(): string;
87
+ export declare function renderDeploymentCheckCommand(): string;
88
+ export declare function renderFixCommand(): string;
87
89
  export declare function renderPlaywrightBrowserInstallCommand(need: CheckEnvironmentNeed, options?: {
88
90
  readonly withDeps?: boolean;
89
91
  }): string;
@@ -1,3 +1,39 @@
1
+ export function checkEnvironmentNeedFact(need) {
2
+ switch (need.kind) {
3
+ case "playwright-browser-assets":
4
+ return { kind: need.kind, browser: need.browser, owner: need.owner };
5
+ case "shellcheck-command":
6
+ return { kind: need.kind, owner: need.owner };
7
+ case "rust-toolchain":
8
+ return {
9
+ kind: need.kind,
10
+ owner: need.owner,
11
+ toolchain: need.toolchain,
12
+ };
13
+ }
14
+ }
15
+ export function checkEnvironmentNeedFromFact(fact) {
16
+ switch (fact.kind) {
17
+ case "playwright-browser-assets":
18
+ return playwrightBrowserAssetsEnvironmentNeed({
19
+ browser: fact.browser,
20
+ owner: fact.owner,
21
+ });
22
+ case "shellcheck-command":
23
+ return shellCheckEnvironmentNeed(fact.owner);
24
+ case "rust-toolchain":
25
+ return rustToolchainEnvironmentNeed(fact.owner);
26
+ }
27
+ }
28
+ export function deploymentEnvironmentNeedFact(need) {
29
+ return { kind: need.kind };
30
+ }
31
+ export function deploymentEnvironmentNeedFromFact(fact) {
32
+ if (fact.kind !== "docker-engine") {
33
+ throw new Error("Unsupported Deployment Environment Need fact.");
34
+ }
35
+ return dockerEngineEnvironmentNeed();
36
+ }
1
37
  export function rustToolchainEnvironmentNeed(owner) {
2
38
  return {
3
39
  kind: "rust-toolchain",
@@ -21,150 +57,56 @@ export function rustToolchainEnvironmentNeed(owner) {
21
57
  },
22
58
  };
23
59
  }
24
- function renderTurboPackageFilter(owner) {
25
- if (owner.kind !== "package-boundary") {
26
- throw new Error("Turbo package tasks require a Package Boundary owner.");
27
- }
28
- return `--filter './${owner.path}'`;
60
+ export function dockerEngineEnvironmentNeed() {
61
+ return {
62
+ kind: "docker-engine",
63
+ preparation: {
64
+ id: "verify-docker-engine",
65
+ label: "Verify Docker engine",
66
+ command: "docker",
67
+ args: ["version", "--format", "{{.Server.Version}}"],
68
+ display: "docker version --format {{.Server.Version}}",
69
+ machineVerifiable: true,
70
+ },
71
+ };
29
72
  }
30
- const turboAgentOutputArgs = [
31
- "--output-logs=errors-only",
32
- "--log-order=grouped",
73
+ export const qualityTaskVocabulary = [
74
+ "boundaries",
75
+ "format:check",
76
+ "lint",
77
+ "typecheck",
78
+ "build",
79
+ "test",
80
+ "test:e2e",
33
81
  ];
34
- export function renderTurboRunCommand(taskNames, args = []) {
35
- return ["turbo run", ...taskNames, ...args, ...turboAgentOutputArgs].join(" ");
36
- }
37
- export function checkComponentTaskName(component) {
38
- return checkComponentTaskNames(component)[0] ?? "check:run";
39
- }
40
- function checkComponentTaskNames(component) {
41
- switch (component.kind) {
42
- case "typescript-typecheck":
43
- case "turbo-package-typecheck":
44
- return ["typecheck:run"];
45
- case "oxc-lint":
46
- case "cargo-clippy":
47
- return ["lint:run"];
48
- case "oxc-format-check":
49
- case "rustfmt-check":
50
- return ["format:check:run"];
51
- case "build":
52
- case "turbo-package-build":
53
- return ["build:run"];
54
- case "unit-test":
55
- case "cargo-test":
56
- case "turbo-package-test":
57
- return ["test:run"];
58
- case "e2e-test":
59
- case "turbo-package-e2e-test":
60
- return ["test:e2e:run"];
61
- case "turbo-check":
62
- case "turbo-package-check":
63
- return [
64
- "format:check:run",
65
- "lint:run",
66
- "typecheck:run",
67
- "build:run",
68
- "test:run",
69
- "test:e2e:run",
70
- ];
71
- }
72
- }
73
- export function fixComponentTaskName(component) {
74
- return fixComponentTaskNames(component)[0] ?? "fix:run";
75
- }
76
- function fixComponentTaskNames(component) {
77
- switch (component.kind) {
78
- case "oxc-format-write":
79
- case "rustfmt-write":
80
- return ["format:write:run"];
81
- case "oxc-lint-fix":
82
- return ["lint:fix:run"];
83
- case "turbo-fix":
84
- case "turbo-package-fix":
85
- return ["format:write:run", "lint:fix:run"];
86
- }
87
- }
88
- function uniqueTaskNames(taskNames) {
89
- return [...new Set(taskNames)];
90
- }
91
- export function renderCheckLeafCommand(component) {
92
- switch (component.kind) {
93
- case "typescript-typecheck":
94
- return "pnpm run typecheck";
95
- case "oxc-lint":
96
- return "pnpm run lint";
97
- case "oxc-format-check":
98
- return "pnpm run format:check";
99
- case "build":
100
- return "pnpm run build";
101
- case "unit-test":
102
- return "pnpm run test";
103
- case "e2e-test":
104
- return "pnpm run test:e2e";
105
- case "turbo-check":
106
- return renderTurboRunCommand(["check"]);
107
- case "turbo-package-typecheck":
108
- return renderTurboRunCommand(["typecheck"], [renderTurboPackageFilter(component.owner)]);
109
- case "turbo-package-build":
110
- return renderTurboRunCommand(["build"], [renderTurboPackageFilter(component.owner)]);
111
- case "turbo-package-test":
112
- return renderTurboRunCommand(["test"], [renderTurboPackageFilter(component.owner)]);
113
- case "turbo-package-e2e-test":
114
- return renderTurboRunCommand(["test:e2e"], [renderTurboPackageFilter(component.owner)]);
115
- case "turbo-package-check":
116
- return renderTurboRunCommand(["check"], [renderTurboPackageFilter(component.owner)]);
117
- case "rustfmt-check":
118
- return "cargo fmt --all -- --check";
119
- case "cargo-clippy":
120
- return "cargo clippy --workspace --all-targets -- -D warnings";
121
- case "cargo-test":
122
- return "cargo test --workspace";
123
- }
124
- }
125
- export function renderFixLeafCommand(component) {
126
- switch (component.kind) {
127
- case "oxc-format-write":
128
- return "pnpm run format:write";
129
- case "oxc-lint-fix":
130
- return "pnpm run lint:fix";
131
- case "turbo-fix":
132
- return renderTurboRunCommand(["fix"]);
133
- case "turbo-package-fix":
134
- return renderTurboRunCommand(["fix"], [renderTurboPackageFilter(component.owner)]);
135
- case "rustfmt-write":
136
- return "cargo fmt --all";
137
- }
138
- }
139
- export function renderRootCheckCommand(plan) {
140
- return renderTurboRunCommand(uniqueTaskNames([
141
- ...plan.components.flatMap(checkComponentTaskNames),
142
- "check:run",
143
- ]));
144
- }
145
- export function deploymentCheckEnvironmentNeeds(check) {
146
- switch (check.kind) {
147
- case "deployment-image":
148
- return [{ kind: "docker-engine" }];
149
- }
150
- }
151
- export function deploymentCheckTaskName(check) {
152
- switch (check.kind) {
153
- case "deployment-image":
154
- return "check:deployment";
155
- }
156
- }
157
- export function renderDeploymentCheckLeafCommand(check) {
158
- return `pnpm --filter './${check.owner.path}' run ${deploymentCheckTaskName(check)}`;
159
- }
160
- export function renderDeploymentCheckCommand(plan) {
161
- return uniqueTaskNames((plan.deploymentChecks ?? []).map(renderDeploymentCheckLeafCommand)).join(" && ");
162
- }
163
- export function renderFixCommand(plan) {
164
- return renderTurboRunCommand(uniqueTaskNames([
165
- ...plan.components.flatMap(fixComponentTaskNames),
166
- "fix:run",
167
- ]));
82
+ export function renderTurboRunCommand(taskNames, args = [], options = {}) {
83
+ return [
84
+ "turbo run",
85
+ ...taskNames,
86
+ ...args,
87
+ ...(options.continueAfterFailure
88
+ ? ["--continue=dependencies-successful"]
89
+ : []),
90
+ `--output-logs=${options.outputLogs ?? "errors-only"}`,
91
+ "--log-order=grouped",
92
+ ...(options.taskPrefix ? ["--log-prefix=task"] : []),
93
+ ].join(" ");
94
+ }
95
+ export function renderRootCheckCommand() {
96
+ return renderTurboRunCommand(qualityTaskVocabulary, [], {
97
+ continueAfterFailure: true,
98
+ taskPrefix: true,
99
+ });
100
+ }
101
+ export function renderDeploymentCheckCommand() {
102
+ return renderTurboRunCommand(["deployment"], [], { taskPrefix: true });
103
+ }
104
+ export function renderFixCommand() {
105
+ return renderTurboRunCommand(["lint:fix", "format:write"], [], {
106
+ continueAfterFailure: true,
107
+ outputLogs: "full",
108
+ taskPrefix: true,
109
+ });
168
110
  }
169
111
  function playwrightBrowserInstallArgs(need, options = {}) {
170
112
  const installArgs = [
@@ -1,5 +1,5 @@
1
1
  import type { EditorCustomizationCapability } from "./editor-customization.ts";
2
- import type { CheckComponent, CheckEnvironmentNeed, DeploymentCheckComponent, FixComponent } from "./module-graph.ts";
2
+ import type { CheckEnvironmentNeed, DeploymentEnvironmentNeed } from "./module-graph.ts";
3
3
  import type { PackageDefinition } from "./project-blueprint-v2.ts";
4
4
  import type { DependencyMaintenancePolicy } from "./project-github.ts";
5
5
  import type { RenderOperation } from "./renderer.ts";
@@ -31,11 +31,9 @@ export type PackageContribution = {
31
31
  readonly operations: readonly RenderOperation[];
32
32
  /** Typed requirements consumed by the Foundation for coordinated root outputs. */
33
33
  readonly foundation: FoundationContribution;
34
- readonly checks: readonly CheckComponent[];
35
- readonly fixes: readonly FixComponent[];
36
34
  readonly environmentNeeds: readonly CheckEnvironmentNeed[];
37
- /** Deployment checks are package-owned and composed by the Foundation. */
38
- readonly deploymentChecks?: readonly DeploymentCheckComponent[];
35
+ /** Requirements prepared only by a focused deployment entrypoint. */
36
+ readonly deploymentEnvironmentNeeds?: readonly DeploymentEnvironmentNeed[];
39
37
  };
40
38
  export declare function assertPackageContribution(contribution: PackageContribution, provenance?: {
41
39
  readonly definitionName?: string;
@@ -1,14 +1,14 @@
1
+ const operationPath = (operation) => {
2
+ if ("to" in operation)
3
+ return operation.to;
4
+ if ("path" in operation)
5
+ return operation.path;
6
+ return "";
7
+ };
1
8
  export function assertPackageContribution(contribution, provenance = {}) {
2
9
  if (contribution.definition.name !== contribution.manifest.name) {
3
10
  throw new Error("Package Contribution manifest name must match its Package Definition");
4
11
  }
5
- const operationPath = (operation) => {
6
- if ("to" in operation)
7
- return operation.to;
8
- if ("path" in operation)
9
- return operation.path;
10
- return "";
11
- };
12
12
  const outsideOperation = contribution.operations.find((operation) => !operationPath(operation).startsWith(`${contribution.definition.path}/`));
13
13
  if (outsideOperation) {
14
14
  const target = operationPath(outsideOperation);
@@ -11,7 +11,6 @@ dedupeInjectedDeps: false
11
11
 
12
12
  syncInjectedDepsAfterScripts:
13
13
  - build
14
- - build:run
15
14
 
16
15
  minimumReleaseAge: 1440
17
16
 
@@ -19,7 +18,6 @@ minimumReleaseAgeStrict: true
19
18
 
20
19
  overrides:
21
20
  "pinia>typescript": "-"
22
- "valibot>typescript": "-"
23
21
  "vue>typescript": "-"
24
22
 
25
23
  catalog:
@@ -1,4 +1,4 @@
1
- import { type CheckPlan } from "./module-graph.ts";
1
+ import { type CheckEnvironmentNeed, type DeploymentEnvironmentNeed } from "./module-graph.ts";
2
2
  export type CiCapability = {
3
3
  readonly workflowName: "Check";
4
4
  readonly jobName: "check";
@@ -21,7 +21,11 @@ export type DependencyMaintenancePolicy = {
21
21
  readonly interval: "weekly";
22
22
  };
23
23
  type ProjectCheckWorkflowOptions = {
24
- readonly checkPlan: CheckPlan;
24
+ readonly environment: {
25
+ readonly needs: readonly CheckEnvironmentNeed[];
26
+ };
27
+ readonly deploymentEnvironmentNeeds?: readonly DeploymentEnvironmentNeed[];
28
+ readonly hasDeploymentTask?: boolean | undefined;
25
29
  readonly capability?: CiCapability | undefined;
26
30
  readonly environmentPreparation?: Partial<CiEnvironmentPreparation> | undefined;
27
31
  readonly taskLayer?: PnpmTaskLayer | undefined;
@@ -29,7 +33,11 @@ type ProjectCheckWorkflowOptions = {
29
33
  export declare function projectCheckWorkflow(options: ProjectCheckWorkflowOptions): string;
30
34
  /** Limited substitutions for the Foundation-owned workflow Template Source. */
31
35
  export declare function projectCheckWorkflowTemplateReplacements(options: {
32
- readonly checkPlan: CheckPlan;
36
+ readonly environment: {
37
+ readonly needs: readonly CheckEnvironmentNeed[];
38
+ };
39
+ readonly deploymentEnvironmentNeeds?: readonly DeploymentEnvironmentNeed[];
40
+ readonly hasDeploymentTask?: boolean | undefined;
33
41
  readonly environmentPreparation?: Partial<CiEnvironmentPreparation>;
34
42
  }): Record<string, string>;
35
43
  export declare function projectDependabotConfig(policy: DependencyMaintenancePolicy): string;
@@ -1,4 +1,4 @@
1
- import { deploymentCheckEnvironmentNeeds, deploymentCheckTaskName, renderPlaywrightBrowserInstallCommand, } from "./module-graph.js";
1
+ import { renderPlaywrightBrowserInstallCommand, } from "./module-graph.js";
2
2
  const defaultCiCapability = {
3
3
  workflowName: "Check",
4
4
  jobName: "check",
@@ -16,10 +16,10 @@ export function projectCheckWorkflow(options) {
16
16
  ...options.environmentPreparation,
17
17
  };
18
18
  const requiresRustToolchain = environmentPreparation.rustToolchain ||
19
- options.checkPlan.environmentNeeds.some((need) => need.kind === "rust-toolchain");
19
+ options.environment.needs.some((need) => need.kind === "rust-toolchain");
20
20
  const taskLayer = options.taskLayer ?? pnpmTaskLayer;
21
- const deploymentChecks = options.checkPlan.deploymentChecks ?? [];
22
- const needsDocker = deploymentChecks.some((check) => deploymentCheckEnvironmentNeeds(check).some((need) => need.kind === "docker-engine"));
21
+ const hasDeploymentTask = options.hasDeploymentTask === true;
22
+ const needsDocker = (options.deploymentEnvironmentNeeds ?? []).some((need) => need.kind === "docker-engine");
23
23
  const lines = [
24
24
  `name: ${capability.workflowName}`,
25
25
  "",
@@ -32,42 +32,38 @@ export function projectCheckWorkflow(options) {
32
32
  "jobs:",
33
33
  ` ${capability.jobName}:`,
34
34
  ` runs-on: ${capability.runner}`,
35
- ...(deploymentChecks.length === 0
36
- ? []
37
- : [
38
- " strategy:",
39
- " matrix:",
40
- " check: [root, deployment]",
41
- ]),
35
+ ...(hasDeploymentTask
36
+ ? [" strategy:", " matrix:", " check: [root, deployment]"]
37
+ : []),
42
38
  " steps:",
43
39
  " - uses: actions/checkout@v7",
44
40
  ];
45
41
  if (environmentPreparation.nodeFromPackageMetadata) {
46
42
  lines.push(" - uses: actions/setup-node@v6", " with:", " node-version-file: package.json", " - run: corepack enable");
47
43
  }
48
- if (needsDocker) {
44
+ if (hasDeploymentTask && needsDocker) {
49
45
  lines.push(" - uses: docker/setup-buildx-action@v3", " if: matrix.check == 'deployment'");
50
46
  }
51
47
  if (requiresRustToolchain)
52
48
  lines.push(...rustCiPreparationLines());
53
49
  lines.push(` - run: ${taskLayer.installCommand}`);
54
50
  const checkEnvironmentLines = [];
55
- for (const need of options.checkPlan.environmentNeeds) {
56
- if (need.kind === "rust-toolchain")
51
+ for (const need of options.environment.needs) {
52
+ if (need.kind === "rust-toolchain") {
57
53
  continue;
54
+ }
58
55
  checkEnvironmentLines.push(` - run: ${renderCiEnvironmentNeedCommand(need)}`);
59
- if (deploymentChecks.length > 0 && need.kind === "shellcheck-command") {
56
+ if (hasDeploymentTask && need.kind === "shellcheck-command") {
60
57
  checkEnvironmentLines.push(" if: matrix.check == 'root'");
61
58
  }
62
59
  }
63
60
  lines.push(...checkEnvironmentLines);
64
61
  lines.push(` - run: ${taskLayer.checkCommand}`);
65
- if (deploymentChecks.length > 0) {
62
+ if (hasDeploymentTask) {
66
63
  lines.push(" if: matrix.check == 'root'");
67
64
  }
68
- const deploymentCheck = deploymentChecks[0];
69
- if (deploymentCheck !== undefined) {
70
- lines.push(` - run: pnpm run ${deploymentCheckTaskName(deploymentCheck)}`, " if: matrix.check == 'deployment'");
65
+ if (hasDeploymentTask) {
66
+ lines.push(" - run: pnpm run check:deployment", " if: matrix.check == 'deployment'");
71
67
  }
72
68
  lines.push("");
73
69
  return lines.join("\n");
@@ -83,15 +79,14 @@ function rustCiPreparationLines() {
83
79
  /** Limited substitutions for the Foundation-owned workflow Template Source. */
84
80
  export function projectCheckWorkflowTemplateReplacements(options) {
85
81
  const requiresRustToolchain = options.environmentPreparation?.rustToolchain === true ||
86
- options.checkPlan.environmentNeeds.some((need) => need.kind === "rust-toolchain");
87
- const deploymentChecks = options.checkPlan.deploymentChecks ?? [];
88
- const needsDocker = deploymentChecks.some((check) => deploymentCheckEnvironmentNeeds(check).some((need) => need.kind === "docker-engine"));
89
- const deploymentCheck = deploymentChecks[0];
90
- const environmentSteps = options.checkPlan.environmentNeeds
82
+ options.environment.needs.some((need) => need.kind === "rust-toolchain");
83
+ const hasDeploymentTask = options.hasDeploymentTask === true;
84
+ const needsDocker = (options.deploymentEnvironmentNeeds ?? []).some((need) => need.kind === "docker-engine");
85
+ const environmentSteps = options.environment.needs
91
86
  .filter((need) => need.kind !== "rust-toolchain")
92
87
  .map((need) => [
93
88
  ` - run: ${renderCiEnvironmentNeedCommand(need)}`,
94
- ...(deploymentChecks.length > 0 && need.kind === "shellcheck-command"
89
+ ...(hasDeploymentTask && need.kind === "shellcheck-command"
95
90
  ? [" if: matrix.check == 'root'"]
96
91
  : []),
97
92
  ].join("\n"));
@@ -100,18 +95,18 @@ export function projectCheckWorkflowTemplateReplacements(options) {
100
95
  ? `\n${rustCiPreparationLines().join("\n")}`
101
96
  : "",
102
97
  CHECK_ENVIRONMENT_PREPARATION: environmentSteps.length === 0 ? "" : `\n${environmentSteps.join("\n")}`,
103
- DEPLOYMENT_MATRIX: deploymentChecks.length === 0
104
- ? ""
105
- : "\n strategy:\n matrix:\n check: [root, deployment]",
106
- DEPLOYMENT_DOCKER_PREPARATION: needsDocker
98
+ DEPLOYMENT_MATRIX: hasDeploymentTask
99
+ ? "\n strategy:\n matrix:\n check: [root, deployment]"
100
+ : "",
101
+ DEPLOYMENT_DOCKER_PREPARATION: hasDeploymentTask && needsDocker
107
102
  ? "\n - uses: docker/setup-buildx-action@v3\n if: matrix.check == 'deployment'"
108
103
  : "",
109
- ROOT_CHECK_CONDITION: deploymentChecks.length === 0
110
- ? ""
111
- : "\n if: matrix.check == 'root'",
112
- DEPLOYMENT_CHECK: deploymentCheck === undefined
113
- ? ""
114
- : `\n - run: pnpm run ${deploymentCheckTaskName(deploymentCheck)}\n if: matrix.check == 'deployment'`,
104
+ ROOT_CHECK_CONDITION: hasDeploymentTask
105
+ ? "\n if: matrix.check == 'root'"
106
+ : "",
107
+ DEPLOYMENT_CHECK: hasDeploymentTask
108
+ ? "\n - run: pnpm run check:deployment\n if: matrix.check == 'deployment'"
109
+ : "",
115
110
  };
116
111
  }
117
112
  export function projectDependabotConfig(policy) {
@@ -4,7 +4,7 @@ export type ExplicitProjectLinkPlan = {
4
4
  readonly manifestDependenciesByPackagePath: ReadonlyMap<string, Readonly<Record<string, "workspace:*">>>;
5
5
  /**
6
6
  * Build ordering follows the same explicit package relationships as manifest
7
- * dependencies. Turbo resolves ^build:run through the derived workspace
7
+ * dependencies. Turbo resolves ^build through the derived workspace
8
8
  * dependency rather than through Preset or framework vocabulary.
9
9
  */
10
10
  readonly hasBuildOrdering: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "private": false,
5
5
  "description": "Project template generator for YKDZ starter projects.",
6
6
  "keywords": [
@@ -1,14 +0,0 @@
1
- const typeOnlyPeerOwners = new Set(["valibot"]);
2
-
3
- function readPackage(pkg: {
4
- name?: string;
5
- peerDependencies?: Record<string, string>;
6
- peerDependenciesMeta?: Record<string, unknown>;
7
- }) {
8
- if (!pkg.name || !typeOnlyPeerOwners.has(pkg.name)) return pkg;
9
- delete pkg.peerDependencies?.typescript;
10
- delete pkg.peerDependenciesMeta?.typescript;
11
- return pkg;
12
- }
13
-
14
- export default { hooks: { readPackage } };