@ykdz/template 0.0.3 → 0.0.5

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 (95) hide show
  1. package/README.md +1 -1
  2. package/dist/src/cli.d.ts +0 -1
  3. package/dist/src/cli.js +26 -2
  4. package/dist/src/declarations.d.ts +38 -3
  5. package/dist/src/declarations.js +75 -36
  6. package/dist/src/dependency-catalog.d.ts +9 -1
  7. package/dist/src/dependency-catalog.js +69 -0
  8. package/dist/src/devcontainer.d.ts +49 -9
  9. package/dist/src/devcontainer.js +192 -14
  10. package/dist/src/editor-customization.d.ts +0 -1
  11. package/dist/src/editor-customization.js +54 -47
  12. package/dist/src/generation-context.d.ts +0 -1
  13. package/dist/src/generation-context.js +4 -1
  14. package/dist/src/module-graph.d.ts +8 -5
  15. package/dist/src/module-graph.js +20 -2
  16. package/dist/src/next-step-instructions.d.ts +0 -1
  17. package/dist/src/next-step-instructions.js +35 -0
  18. package/dist/src/package-addition-support.d.ts +5 -0
  19. package/dist/src/package-addition-support.js +4 -0
  20. package/dist/src/package-addition.d.ts +2 -1
  21. package/dist/src/package-addition.js +557 -55
  22. package/dist/src/package-linking.d.ts +55 -0
  23. package/dist/src/package-linking.js +116 -0
  24. package/dist/src/preset-projection.d.ts +4 -2
  25. package/dist/src/project-github.d.ts +3 -2
  26. package/dist/src/project-github.js +24 -6
  27. package/dist/src/renderer.d.ts +16 -2
  28. package/dist/src/renderer.js +96 -12
  29. package/dist/src/runtime-paths.d.ts +0 -1
  30. package/dist/src/template-boundary-check.d.ts +34 -0
  31. package/dist/src/template-boundary-check.js +448 -0
  32. package/dist/src/toolchain-resolution.d.ts +0 -1
  33. package/dist/templates/hono-api/projection.d.ts +2 -3
  34. package/dist/templates/hono-api/projection.js +258 -76
  35. package/dist/templates/projection-plans.d.ts +0 -1
  36. package/dist/templates/registry.d.ts +0 -1
  37. package/dist/templates/registry.js +5 -2
  38. package/dist/templates/rust-bin/projection.d.ts +2 -3
  39. package/dist/templates/rust-bin/projection.js +171 -53
  40. package/dist/templates/ts-lib/projection.d.ts +2 -3
  41. package/dist/templates/ts-lib/projection.js +251 -87
  42. package/dist/templates/vue-app/projection.d.ts +2 -3
  43. package/dist/templates/vue-app/projection.js +266 -94
  44. package/dist/templates/vue-hono-app/projection.d.ts +0 -1
  45. package/dist/templates/vue-hono-app/projection.js +232 -108
  46. package/package.json +10 -5
  47. package/pnpm-workspace.yaml +1 -0
  48. package/templates/hono-api/.github/dependabot.yml +13 -0
  49. package/templates/hono-api/src/server.ts +1 -1
  50. package/templates/hono-api/test/app.test.ts +1 -1
  51. package/templates/rust-bin/.github/dependabot.yml +18 -1
  52. package/templates/rust-bin/rust-toolchain.toml +3 -0
  53. package/templates/rust-bin/rustfmt.toml +2 -0
  54. package/templates/shared/devcontainer/browser-test.Dockerfile +2 -0
  55. package/templates/shared/devcontainer/node-pnpm.Dockerfile +6 -0
  56. package/templates/shared/devcontainer/rust.Dockerfile +16 -0
  57. package/templates/shared/editor-customization/capabilities.json +56 -0
  58. package/templates/ts-lib/.github/dependabot.yml +13 -0
  59. package/templates/ts-lib/src/index.ts +5 -1
  60. package/templates/ts-lib/src/name-schema.ts +3 -0
  61. package/templates/vue-app/.github/dependabot.yml +13 -0
  62. package/templates/vue-app/.github/workflows/check.yml +1 -1
  63. package/templates/vue-app/src/App.vue +1 -1
  64. package/templates/vue-app/test/app.test.ts +1 -1
  65. package/templates/vue-hono-app/.github/dependabot.yml +13 -0
  66. package/templates/vue-hono-app/web/src/App.vue +2 -2
  67. package/templates/vue-hono-app/web/test/app.test.ts +1 -1
  68. package/dist/src/cli.d.ts.map +0 -1
  69. package/dist/src/declarations.d.ts.map +0 -1
  70. package/dist/src/dependency-catalog.d.ts.map +0 -1
  71. package/dist/src/devcontainer.d.ts.map +0 -1
  72. package/dist/src/editor-customization.d.ts.map +0 -1
  73. package/dist/src/generation-context.d.ts.map +0 -1
  74. package/dist/src/module-graph.d.ts.map +0 -1
  75. package/dist/src/next-step-instructions.d.ts.map +0 -1
  76. package/dist/src/package-addition.d.ts.map +0 -1
  77. package/dist/src/preset-projection.d.ts.map +0 -1
  78. package/dist/src/project-github.d.ts.map +0 -1
  79. package/dist/src/renderer.d.ts.map +0 -1
  80. package/dist/src/runtime-paths.d.ts.map +0 -1
  81. package/dist/src/toolchain-resolution.d.ts.map +0 -1
  82. package/dist/templates/hono-api/projection.d.ts.map +0 -1
  83. package/dist/templates/projection-plans.d.ts.map +0 -1
  84. package/dist/templates/registry.d.ts.map +0 -1
  85. package/dist/templates/rust-bin/projection.d.ts.map +0 -1
  86. package/dist/templates/ts-lib/projection.d.ts.map +0 -1
  87. package/dist/templates/vue-app/projection.d.ts.map +0 -1
  88. package/dist/templates/vue-hono-app/projection.d.ts.map +0 -1
  89. package/templates/hono-api/projection.ts +0 -453
  90. package/templates/projection-plans.ts +0 -135
  91. package/templates/registry.ts +0 -59
  92. package/templates/rust-bin/projection.ts +0 -346
  93. package/templates/ts-lib/projection.ts +0 -454
  94. package/templates/vue-app/projection.ts +0 -687
  95. package/templates/vue-hono-app/projection.ts +0 -669
@@ -1,24 +1,202 @@
1
- export function pnpmVersionFromPackageManagerPin(packageManagerPin) {
2
- return packageManagerPin.replace(/^pnpm@/, "");
1
+ import { readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { loadTemplateDependencyCatalog } from "./dependency-catalog.js";
5
+ import { packageTemplateRoot } from "./runtime-paths.js";
6
+ const runtimeDockerfileInstructions = new Set([
7
+ "CMD",
8
+ "ENTRYPOINT",
9
+ "EXPOSE",
10
+ "HEALTHCHECK",
11
+ "STOPSIGNAL",
12
+ "VOLUME",
13
+ ]);
14
+ function dockerfileInstructions(text) {
15
+ return text
16
+ .split(/\r?\n/)
17
+ .map((line) => line.trim())
18
+ .filter((line) => line.length > 0 && !line.startsWith("#"))
19
+ .map((line) => line.match(/^([A-Za-z]+)/)?.[1]?.toUpperCase())
20
+ .filter((instruction) => instruction !== undefined);
3
21
  }
4
- export function devcontainerNodeFeature(options) {
22
+ export function composeDevelopmentContainerDockerfile(options) {
23
+ const baseImageInstructionCount = options.layers.reduce((count, layer) => count +
24
+ dockerfileInstructions(layer.text).filter((instruction) => instruction === "FROM").length, 0);
25
+ if (baseImageInstructionCount !== 1) {
26
+ throw new Error(`Development Container Dockerfile must have exactly one base layer with a FROM instruction; found ${baseImageInstructionCount}.`);
27
+ }
28
+ for (const layer of options.layers) {
29
+ const instructions = dockerfileInstructions(layer.text);
30
+ if (layer.kind === "capability" && instructions.includes("FROM")) {
31
+ throw new Error(`${layer.name} capability layer must not supply a Dockerfile FROM instruction.`);
32
+ }
33
+ if (layer.kind !== "capability") {
34
+ continue;
35
+ }
36
+ for (const instruction of instructions) {
37
+ if (runtimeDockerfileInstructions.has(instruction)) {
38
+ throw new Error(`${layer.name} must not use runtime Dockerfile instruction ${instruction}.`);
39
+ }
40
+ }
41
+ }
42
+ return options.layers.map((layer) => layer.text.trimEnd()).join("\n\n");
43
+ }
44
+ export function nodePnpmToolLayer(options) {
45
+ return {
46
+ kind: "node-pnpm",
47
+ nodeVersion: options.nodeVersion,
48
+ packageManagerPin: options.packageManagerPin,
49
+ };
50
+ }
51
+ export function browserTestToolLayer() {
52
+ const playwrightTestVersion = loadTemplateDependencyCatalog()["@playwright/test"];
53
+ if (playwrightTestVersion === undefined) {
54
+ throw new Error("Template Dependency Catalog is missing dependency: @playwright/test");
55
+ }
5
56
  return {
6
- "ghcr.io/devcontainers/features/node:1": {
7
- version: options.nodeVersion,
8
- pnpmVersion: pnpmVersionFromPackageManagerPin(options.packageManagerPin),
57
+ kind: "browser-test",
58
+ playwrightCliPackage: `@playwright/test@${playwrightTestVersion}`,
59
+ };
60
+ }
61
+ export function rustToolLayer(options = {}) {
62
+ return { kind: "rust", toolchain: options.toolchain ?? "stable" };
63
+ }
64
+ function sharedDevcontainerSourceRoot() {
65
+ return packageTemplateRoot(path.dirname(fileURLToPath(import.meta.url)), "shared", "devcontainer");
66
+ }
67
+ function checkedDockerfileFragment(name) {
68
+ return readFileSync(path.join(sharedDevcontainerSourceRoot(), name), "utf8");
69
+ }
70
+ function checkedNodePnpmDockerfile(options = {}) {
71
+ return composeDevelopmentContainerDockerfile({
72
+ layers: [
73
+ {
74
+ kind: "base",
75
+ name: "node-pnpm",
76
+ text: checkedDockerfileFragment("node-pnpm.Dockerfile"),
77
+ },
78
+ ...(options.additionalLayers ?? []).map((layer) => {
79
+ switch (layer.kind) {
80
+ case "browser-test":
81
+ return {
82
+ kind: "capability",
83
+ name: "browser-test",
84
+ text: checkedDockerfileFragment("browser-test.Dockerfile"),
85
+ };
86
+ case "rust":
87
+ return {
88
+ kind: "capability",
89
+ name: "rust",
90
+ text: checkedDockerfileFragment("rust.Dockerfile"),
91
+ };
92
+ }
93
+ }),
94
+ ],
95
+ });
96
+ }
97
+ function checkedNodePnpmDockerfileFragments(options = {}) {
98
+ return [
99
+ {
100
+ sourceRoot: "sharedDevcontainer",
101
+ from: "node-pnpm.Dockerfile",
9
102
  },
103
+ ...(options.additionalLayers ?? []).map((layer) => {
104
+ switch (layer.kind) {
105
+ case "browser-test":
106
+ return {
107
+ sourceRoot: "sharedDevcontainer",
108
+ from: "browser-test.Dockerfile",
109
+ };
110
+ case "rust":
111
+ return {
112
+ sourceRoot: "sharedDevcontainer",
113
+ from: "rust.Dockerfile",
114
+ };
115
+ }
116
+ }),
117
+ ];
118
+ }
119
+ function browserTestBuildArgs(layers = []) {
120
+ const browserTestLayer = layers.find((layer) => layer.kind === "browser-test");
121
+ return browserTestLayer === undefined
122
+ ? {}
123
+ : { PLAYWRIGHT_CLI_PACKAGE: browserTestLayer.playwrightCliPackage };
124
+ }
125
+ function rustBuildArgs(layers = []) {
126
+ const rustLayer = layers.find((layer) => layer.kind === "rust");
127
+ return rustLayer === undefined ? {} : { RUST_TOOLCHAIN: rustLayer.toolchain };
128
+ }
129
+ export function dockerfileFirstNodePnpmDevcontainer(options) {
130
+ return {
131
+ devcontainer: {
132
+ name: options.name,
133
+ build: {
134
+ dockerfile: "Dockerfile",
135
+ args: {
136
+ NODE_VERSION: options.layer.nodeVersion,
137
+ PACKAGE_MANAGER_PIN: options.layer.packageManagerPin,
138
+ },
139
+ },
140
+ customizations: {
141
+ vscode: {
142
+ extensions: options.extensions,
143
+ ...(options.settings ? { settings: options.settings } : {}),
144
+ },
145
+ },
146
+ },
147
+ dockerfile: [
148
+ `FROM mcr.microsoft.com/devcontainers/typescript-node:${options.layer.nodeVersion}`,
149
+ "",
150
+ 'SHELL ["/bin/bash", "-o", "pipefail", "-c"]',
151
+ `RUN corepack enable && corepack prepare ${options.layer.packageManagerPin} --activate`,
152
+ "",
153
+ ].join("\n"),
10
154
  };
11
155
  }
12
- export function nodePnpmDevcontainer(options) {
156
+ export function checkedDockerfileFirstNodePnpmDevcontainer(options) {
13
157
  return {
14
- name: options.name,
15
- image: `mcr.microsoft.com/devcontainers/typescript-node:${options.nodeVersion}`,
16
- features: devcontainerNodeFeature(options),
17
- customizations: {
18
- vscode: {
19
- extensions: options.extensions,
20
- ...(options.settings ? { settings: options.settings } : {}),
158
+ devcontainer: {
159
+ name: options.name,
160
+ build: {
161
+ dockerfile: "Dockerfile",
162
+ args: {
163
+ NODE_VERSION: options.layer.nodeVersion,
164
+ PACKAGE_MANAGER_PIN: options.layer.packageManagerPin,
165
+ ...browserTestBuildArgs(options.additionalLayers),
166
+ ...rustBuildArgs(options.additionalLayers),
167
+ },
168
+ },
169
+ customizations: {
170
+ vscode: {
171
+ extensions: options.extensions,
172
+ ...(options.settings ? { settings: options.settings } : {}),
173
+ },
21
174
  },
175
+ ...(options.mounts ? { mounts: options.mounts } : {}),
176
+ },
177
+ dockerfile: checkedNodePnpmDockerfile({
178
+ additionalLayers: options.additionalLayers,
179
+ }),
180
+ dockerfileOperation: {
181
+ kind: "writeTextFromFragments",
182
+ to: ".devcontainer/Dockerfile",
183
+ fragments: checkedNodePnpmDockerfileFragments({
184
+ additionalLayers: options.additionalLayers,
185
+ }),
22
186
  },
23
187
  };
24
188
  }
189
+ export function dockerfileFirstRustPnpmDevcontainer(options) {
190
+ return checkedDockerfileFirstNodePnpmDevcontainer({
191
+ name: options.name,
192
+ layer: options.nodeLayer,
193
+ additionalLayers: [options.rustLayer],
194
+ extensions: options.extensions,
195
+ settings: options.settings,
196
+ mounts: [
197
+ "source=${localWorkspaceFolderBasename}-cargo-registry,target=/usr/local/cargo/registry,type=volume",
198
+ "source=${localWorkspaceFolderBasename}-cargo-git,target=/usr/local/cargo/git,type=volume",
199
+ "source=${localWorkspaceFolderBasename}-target,target=${containerWorkspaceFolder}/target,type=volume",
200
+ ],
201
+ });
202
+ }
@@ -10,4 +10,3 @@ export type EditorCustomizationOptions = {
10
10
  };
11
11
  };
12
12
  export declare function editorCustomizationForCapabilities(capabilities: readonly EditorCustomizationCapability[], options?: EditorCustomizationOptions): EditorCustomization;
13
- //# sourceMappingURL=editor-customization.d.ts.map
@@ -1,3 +1,6 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
1
4
  const capabilityOrder = [
2
5
  "oxc-format-lint",
3
6
  "vue",
@@ -5,13 +8,57 @@ const capabilityOrder = [
5
8
  "rust-tooling",
6
9
  "vitest",
7
10
  ];
8
- const oxcFormatterSettings = {
9
- "editor.defaultFormatter": "oxc.oxc-vscode",
10
- };
11
11
  const defaultOxcConfigPaths = {
12
12
  formatter: "./oxfmt.config.ts",
13
13
  lint: "./oxlint.config.ts",
14
14
  };
15
+ const declarations = loadEditorCustomizationDeclarations();
16
+ function editorCustomizationDeclarationPath() {
17
+ const moduleDirectory = path.dirname(fileURLToPath(import.meta.url));
18
+ const relativeDeclarationPath = "templates/shared/editor-customization/capabilities.json";
19
+ const candidates = [
20
+ path.resolve(moduleDirectory, "..", relativeDeclarationPath),
21
+ path.resolve(moduleDirectory, "..", "..", relativeDeclarationPath),
22
+ ];
23
+ const declarationPath = candidates.find((candidate) => existsSync(candidate));
24
+ if (!declarationPath) {
25
+ throw new Error(`Unable to find editor customization declarations at ${relativeDeclarationPath}`);
26
+ }
27
+ return declarationPath;
28
+ }
29
+ function isRecord(value) {
30
+ return typeof value === "object" && value !== null && !Array.isArray(value);
31
+ }
32
+ function assertCapabilityProjection(capability, value) {
33
+ if (!isRecord(value)) {
34
+ throw new Error(`Editor customization ${capability} must be an object`);
35
+ }
36
+ const extensions = value.extensions;
37
+ const settings = value.settings;
38
+ if (!Array.isArray(extensions) ||
39
+ extensions.some((extension) => typeof extension !== "string")) {
40
+ throw new Error(`Editor customization ${capability} must declare string extensions`);
41
+ }
42
+ if (!isRecord(settings)) {
43
+ throw new Error(`Editor customization ${capability} must declare object settings`);
44
+ }
45
+ }
46
+ function loadEditorCustomizationDeclarations() {
47
+ const source = JSON.parse(readFileSync(editorCustomizationDeclarationPath(), "utf8"));
48
+ if (!isRecord(source) || !isRecord(source.capabilities)) {
49
+ throw new Error("Editor customization declarations must contain capabilities");
50
+ }
51
+ const capabilities = source.capabilities;
52
+ for (const capability of capabilityOrder) {
53
+ assertCapabilityProjection(capability, capabilities[capability]);
54
+ }
55
+ return {
56
+ capabilities: Object.fromEntries(capabilityOrder.map((capability) => [
57
+ capability,
58
+ capabilities[capability],
59
+ ])),
60
+ };
61
+ }
15
62
  function oxcConfigPathSettings(configPaths) {
16
63
  if (configPaths === "nested") {
17
64
  return {};
@@ -26,55 +73,15 @@ function oxcConfigPathSettings(configPaths) {
26
73
  };
27
74
  }
28
75
  function oxcProjection(options) {
76
+ const baseProjection = declarations.capabilities["oxc-format-lint"];
29
77
  return {
30
- extensions: ["oxc.oxc-vscode"],
78
+ extensions: baseProjection.extensions,
31
79
  settings: {
32
- "editor.codeActionsOnSave": {
33
- "source.format.oxc": "always",
34
- "source.fixAll.oxc": "always",
35
- },
36
- ...oxcFormatterSettings,
37
- "editor.formatOnPaste": true,
38
- "editor.formatOnSave": true,
39
- "editor.formatOnSaveMode": "file",
40
- "oxc.enable": true,
80
+ ...baseProjection.settings,
41
81
  ...oxcConfigPathSettings(options?.oxcConfigPaths),
42
- "[javascript]": oxcFormatterSettings,
43
- "[json]": oxcFormatterSettings,
44
- "[markdown]": oxcFormatterSettings,
45
- "[typescript]": oxcFormatterSettings,
46
82
  },
47
83
  };
48
84
  }
49
- const capabilityProjections = {
50
- "oxc-format-lint": oxcProjection(),
51
- "rust-tooling": {
52
- extensions: ["rust-lang.rust-analyzer", "tamasfe.even-better-toml"],
53
- settings: {
54
- "rust-analyzer.cargo.features": "all",
55
- "rust-analyzer.check.command": "clippy",
56
- "rust-analyzer.procMacro.enable": true,
57
- "[rust]": {
58
- "editor.defaultFormatter": "rust-lang.rust-analyzer",
59
- },
60
- "[toml]": {
61
- "editor.defaultFormatter": "tamasfe.even-better-toml",
62
- },
63
- },
64
- },
65
- tailwind: {
66
- extensions: ["bradlc.vscode-tailwindcss"],
67
- settings: {},
68
- },
69
- vue: {
70
- extensions: ["Vue.volar"],
71
- settings: {},
72
- },
73
- vitest: {
74
- extensions: ["vitest.explorer"],
75
- settings: {},
76
- },
77
- };
78
85
  function mergeSettings(base, patch) {
79
86
  return { ...base, ...patch };
80
87
  }
@@ -88,7 +95,7 @@ export function editorCustomizationForCapabilities(capabilities, options) {
88
95
  }
89
96
  const projection = capability === "oxc-format-lint"
90
97
  ? oxcProjection(options)
91
- : capabilityProjections[capability];
98
+ : declarations.capabilities[capability];
92
99
  for (const extension of projection.extensions) {
93
100
  extensions.add(extension);
94
101
  }
@@ -21,4 +21,3 @@ export type AssembleGenerationContextOptions = {
21
21
  readonly toolchain: ResolvedToolchainVersions;
22
22
  };
23
23
  export declare function assembleGenerationContext(options: AssembleGenerationContextOptions): GenerationContext;
24
- //# sourceMappingURL=generation-context.d.ts.map
@@ -1,7 +1,10 @@
1
1
  import path from "node:path";
2
2
  export function assembleGenerationContext(options) {
3
3
  return {
4
- projectName: { kind: "ProjectName", value: path.basename(path.resolve(options.targetDir)) },
4
+ projectName: {
5
+ kind: "ProjectName",
6
+ value: path.basename(path.resolve(options.targetDir)),
7
+ },
5
8
  preset: options.blueprint.preset,
6
9
  packageManager: options.blueprint.packageManager
7
10
  ? { kind: "PackageManager", value: options.blueprint.packageManager }
@@ -1,10 +1,14 @@
1
1
  export type PackageBoundaryOwner = {
2
2
  readonly kind: "package-boundary";
3
- readonly path: "." | "apps/api" | "apps/web";
3
+ readonly path: string;
4
4
  };
5
- export type ComponentOwner = PackageBoundaryOwner;
6
- export type CheckComponentKind = "typescript-typecheck" | "oxc-lint" | "oxc-format-check" | "build" | "unit-test" | "e2e-test" | "turbo-check" | "rustfmt-check" | "cargo-clippy" | "cargo-test";
7
- export type FixComponentKind = "oxc-format-write" | "oxc-lint-fix" | "turbo-fix" | "rustfmt-write";
5
+ export type WorkspaceOrchestrationOwner = {
6
+ readonly kind: "workspace-orchestration";
7
+ readonly path: ".";
8
+ };
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";
8
12
  export type CheckEnvironmentNeed = {
9
13
  readonly kind: "playwright-browser-assets";
10
14
  readonly browser: "chromium";
@@ -28,4 +32,3 @@ export type FixPlan = {
28
32
  export declare function renderRootCheckCommand(plan: CheckPlan): string;
29
33
  export declare function renderFixCommand(plan: FixPlan): string;
30
34
  export declare function renderPlaywrightBrowserInstallCommand(need: CheckEnvironmentNeed): string;
31
- //# sourceMappingURL=module-graph.d.ts.map
@@ -1,3 +1,9 @@
1
+ function renderTurboPackageFilter(owner) {
2
+ if (owner.kind !== "package-boundary") {
3
+ throw new Error("Turbo package tasks require a Package Boundary owner.");
4
+ }
5
+ return `--filter './${owner.path}'`;
6
+ }
1
7
  function renderCheckComponentCommand(component) {
2
8
  switch (component.kind) {
3
9
  case "typescript-typecheck":
@@ -14,6 +20,16 @@ function renderCheckComponentCommand(component) {
14
20
  return "pnpm run test:e2e";
15
21
  case "turbo-check":
16
22
  return "turbo run check";
23
+ case "turbo-package-typecheck":
24
+ return `turbo run typecheck ${renderTurboPackageFilter(component.owner)}`;
25
+ case "turbo-package-build":
26
+ return `turbo run build ${renderTurboPackageFilter(component.owner)}`;
27
+ case "turbo-package-test":
28
+ return `turbo run test ${renderTurboPackageFilter(component.owner)}`;
29
+ case "turbo-package-e2e-test":
30
+ return `turbo run test:e2e ${renderTurboPackageFilter(component.owner)}`;
31
+ case "turbo-package-check":
32
+ return `turbo run check ${renderTurboPackageFilter(component.owner)}`;
17
33
  case "rustfmt-check":
18
34
  return "cargo fmt --all -- --check";
19
35
  case "cargo-clippy":
@@ -30,6 +46,8 @@ function renderFixComponentCommand(component) {
30
46
  return "pnpm run lint:fix";
31
47
  case "turbo-fix":
32
48
  return "turbo run fix";
49
+ case "turbo-package-fix":
50
+ return `turbo run fix ${renderTurboPackageFilter(component.owner)}`;
33
51
  case "rustfmt-write":
34
52
  return "cargo fmt --all";
35
53
  }
@@ -41,8 +59,8 @@ export function renderFixCommand(plan) {
41
59
  return plan.components.map(renderFixComponentCommand).join(" && ");
42
60
  }
43
61
  export function renderPlaywrightBrowserInstallCommand(need) {
44
- if (need.owner.path === "apps/web") {
45
- return `pnpm --filter ./apps/web exec playwright install ${need.browser}`;
62
+ if (need.owner.kind === "package-boundary" && need.owner.path !== ".") {
63
+ return `pnpm --filter ./${need.owner.path} exec playwright install ${need.browser}`;
46
64
  }
47
65
  return `pnpm exec playwright install ${need.browser}`;
48
66
  }
@@ -18,4 +18,3 @@ export type PlanNextStepInstructionsOptions = {
18
18
  readonly projectionPlan: PresetProjectionPlan;
19
19
  };
20
20
  export declare function planNextStepInstructions(options: PlanNextStepInstructionsOptions): NextStepInstructionPlan;
21
- //# sourceMappingURL=next-step-instructions.d.ts.map
@@ -11,6 +11,40 @@ function rootCheckInstruction() {
11
11
  machineVerifiable: true,
12
12
  };
13
13
  }
14
+ function optionalGitInstructions() {
15
+ return [
16
+ {
17
+ id: "optional-git-init",
18
+ label: "Optional: initialize git",
19
+ kind: "command",
20
+ command: "git",
21
+ args: ["init"],
22
+ cwd: "",
23
+ display: "git init",
24
+ machineVerifiable: false,
25
+ },
26
+ {
27
+ id: "optional-git-add",
28
+ label: "Optional: stage files",
29
+ kind: "command",
30
+ command: "git",
31
+ args: ["add", "."],
32
+ cwd: "",
33
+ display: "git add .",
34
+ machineVerifiable: false,
35
+ },
36
+ {
37
+ id: "optional-git-commit",
38
+ label: "Optional: create your first commit",
39
+ kind: "command",
40
+ command: "git",
41
+ args: ["commit", "-m", "Initial commit"],
42
+ cwd: "",
43
+ display: 'git commit -m "Initial commit"',
44
+ machineVerifiable: false,
45
+ },
46
+ ];
47
+ }
14
48
  function installDependenciesInstruction() {
15
49
  return {
16
50
  id: "install-dependencies",
@@ -64,6 +98,7 @@ function projectionInstructions(plan) {
64
98
  if (plan.capabilities.rootCheck) {
65
99
  steps.push(rootCheckInstruction());
66
100
  }
101
+ steps.push(...optionalGitInstructions());
67
102
  return steps;
68
103
  }
69
104
  export function planNextStepInstructions(options) {
@@ -0,0 +1,5 @@
1
+ export declare const PackageAdditionSupport: {
2
+ readonly Supported: "supported";
3
+ readonly Unsupported: "unsupported";
4
+ };
5
+ export type PackageAdditionSupport = (typeof PackageAdditionSupport)[keyof typeof PackageAdditionSupport];
@@ -0,0 +1,4 @@
1
+ export const PackageAdditionSupport = {
2
+ Supported: "supported",
3
+ Unsupported: "unsupported",
4
+ };
@@ -2,6 +2,7 @@ export type AddPackageOptions = {
2
2
  cwd: string;
3
3
  preset: string;
4
4
  name: string;
5
+ path?: string;
6
+ linkFrom?: readonly string[];
5
7
  };
6
8
  export declare function addPackage(options: AddPackageOptions): Promise<void>;
7
- //# sourceMappingURL=package-addition.d.ts.map