@ykdz/template 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/{cli.js → src/cli.js} +126 -128
- package/dist/{declarations.d.ts → src/declarations.d.ts} +1 -2
- package/dist/src/declarations.d.ts.map +1 -0
- package/dist/{declarations.js → src/declarations.js} +2 -109
- package/dist/src/dependency-catalog.d.ts +10 -0
- package/dist/src/dependency-catalog.d.ts.map +1 -0
- package/dist/src/dependency-catalog.js +63 -0
- package/dist/src/devcontainer.d.ts +18 -0
- package/dist/src/devcontainer.d.ts.map +1 -0
- package/dist/src/devcontainer.js +24 -0
- package/dist/src/editor-customization.d.ts +13 -0
- package/dist/src/editor-customization.d.ts.map +1 -0
- package/dist/src/editor-customization.js +101 -0
- package/dist/src/generation-context.d.ts +24 -0
- package/dist/src/generation-context.d.ts.map +1 -0
- package/dist/src/generation-context.js +12 -0
- package/dist/src/module-graph.d.ts +31 -0
- package/dist/src/module-graph.d.ts.map +1 -0
- package/dist/src/module-graph.js +48 -0
- package/dist/src/next-step-instructions.d.ts +21 -0
- package/dist/src/next-step-instructions.d.ts.map +1 -0
- package/dist/src/next-step-instructions.js +89 -0
- package/dist/src/package-addition.d.ts.map +1 -0
- package/dist/src/package-addition.js +188 -0
- package/dist/src/preset-projection.d.ts +66 -0
- package/dist/src/preset-projection.d.ts.map +1 -0
- package/dist/src/preset-projection.js +7 -0
- package/dist/src/project-github.d.ts +29 -0
- package/dist/src/project-github.d.ts.map +1 -0
- package/dist/src/project-github.js +63 -0
- package/dist/src/renderer.d.ts.map +1 -0
- package/dist/{renderer.js → src/renderer.js} +0 -3
- package/dist/src/runtime-paths.d.ts +2 -0
- package/dist/src/runtime-paths.d.ts.map +1 -0
- package/dist/src/runtime-paths.js +11 -0
- package/dist/src/toolchain-resolution.d.ts +35 -0
- package/dist/src/toolchain-resolution.d.ts.map +1 -0
- package/dist/src/toolchain-resolution.js +192 -0
- package/dist/templates/hono-api/projection.d.ts +7 -0
- package/dist/templates/hono-api/projection.d.ts.map +1 -0
- package/dist/templates/hono-api/projection.js +377 -0
- package/dist/templates/projection-plans.d.ts +8 -0
- package/dist/templates/projection-plans.d.ts.map +1 -0
- package/dist/templates/projection-plans.js +94 -0
- package/dist/templates/registry.d.ts +8 -0
- package/dist/templates/registry.d.ts.map +1 -0
- package/dist/templates/registry.js +42 -0
- package/dist/templates/rust-bin/projection.d.ts +10 -0
- package/dist/templates/rust-bin/projection.d.ts.map +1 -0
- package/dist/templates/rust-bin/projection.js +282 -0
- package/dist/templates/ts-lib/projection.d.ts +7 -0
- package/dist/templates/ts-lib/projection.d.ts.map +1 -0
- package/dist/templates/ts-lib/projection.js +372 -0
- package/dist/templates/vue-app/projection.d.ts +7 -0
- package/dist/templates/vue-app/projection.d.ts.map +1 -0
- package/dist/templates/vue-app/projection.js +594 -0
- package/dist/templates/vue-hono-app/projection.d.ts +9 -0
- package/dist/templates/vue-hono-app/projection.d.ts.map +1 -0
- package/dist/templates/vue-hono-app/projection.js +589 -0
- package/package.json +30 -24
- package/pnpm-workspace.yaml +34 -0
- package/templates/hono-api/projection.ts +453 -0
- package/templates/projection-plans.ts +135 -0
- package/templates/registry.ts +59 -0
- package/templates/rust-bin/.github/dependabot.yml +4 -0
- package/templates/rust-bin/.github/workflows/check.yml +6 -1
- package/templates/rust-bin/projection.ts +346 -0
- package/templates/ts-lib/projection.ts +454 -0
- package/templates/vue-app/projection.ts +687 -0
- package/templates/vue-app/test/e2e/app.spec.ts +4 -1
- package/templates/vue-hono-app/projection.ts +669 -0
- package/templates/vue-hono-app/web/test/e2e/app.spec.ts +4 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/declarations.d.ts.map +0 -1
- package/dist/hono-api.d.ts +0 -2
- package/dist/hono-api.d.ts.map +0 -1
- package/dist/hono-api.js +0 -208
- package/dist/package-addition.d.ts.map +0 -1
- package/dist/package-addition.js +0 -560
- package/dist/post-commands.d.ts +0 -40
- package/dist/post-commands.d.ts.map +0 -1
- package/dist/post-commands.js +0 -154
- package/dist/renderer.d.ts.map +0 -1
- package/dist/rust-bin.d.ts +0 -2
- package/dist/rust-bin.d.ts.map +0 -1
- package/dist/rust-bin.js +0 -174
- package/dist/ts-lib.d.ts +0 -2
- package/dist/ts-lib.d.ts.map +0 -1
- package/dist/ts-lib.js +0 -181
- package/dist/vue-app.d.ts +0 -2
- package/dist/vue-app.d.ts.map +0 -1
- package/dist/vue-app.js +0 -299
- package/dist/vue-hono-app.d.ts +0 -4
- package/dist/vue-hono-app.d.ts.map +0 -1
- package/dist/vue-hono-app.js +0 -436
- package/templates/shared/oxc/package.json +0 -18
- package/templates/shared/oxc/tsconfig.json +0 -11
- /package/dist/{cli.d.ts → src/cli.d.ts} +0 -0
- /package/dist/{package-addition.d.ts → src/package-addition.d.ts} +0 -0
- /package/dist/{renderer.d.ts → src/renderer.d.ts} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type EditorCustomizationCapability = "oxc-format-lint" | "rust-tooling" | "tailwind" | "vue" | "vitest";
|
|
2
|
+
export type EditorCustomization = {
|
|
3
|
+
readonly extensions: readonly string[];
|
|
4
|
+
readonly settings: Record<string, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export type EditorCustomizationOptions = {
|
|
7
|
+
readonly oxcConfigPaths?: "nested" | {
|
|
8
|
+
readonly lint?: string;
|
|
9
|
+
readonly formatter?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare function editorCustomizationForCapabilities(capabilities: readonly EditorCustomizationCapability[], options?: EditorCustomizationOptions): EditorCustomization;
|
|
13
|
+
//# sourceMappingURL=editor-customization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-customization.d.ts","sourceRoot":"","sources":["../../src/editor-customization.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,6BAA6B,GACrC,iBAAiB,GACjB,cAAc,GACd,UAAU,GACV,KAAK,GACL,QAAQ,CAAC;AAEb,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,cAAc,CAAC,EACpB,QAAQ,GACR;QACE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;CACP,CAAC;AA0GF,wBAAgB,kCAAkC,CAChD,YAAY,EAAE,SAAS,6BAA6B,EAAE,EACtD,OAAO,CAAC,EAAE,0BAA0B,GACnC,mBAAmB,CAwBrB"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
const capabilityOrder = [
|
|
2
|
+
"oxc-format-lint",
|
|
3
|
+
"vue",
|
|
4
|
+
"tailwind",
|
|
5
|
+
"rust-tooling",
|
|
6
|
+
"vitest",
|
|
7
|
+
];
|
|
8
|
+
const oxcFormatterSettings = {
|
|
9
|
+
"editor.defaultFormatter": "oxc.oxc-vscode",
|
|
10
|
+
};
|
|
11
|
+
const defaultOxcConfigPaths = {
|
|
12
|
+
formatter: "./oxfmt.config.ts",
|
|
13
|
+
lint: "./oxlint.config.ts",
|
|
14
|
+
};
|
|
15
|
+
function oxcConfigPathSettings(configPaths) {
|
|
16
|
+
if (configPaths === "nested") {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
const paths = {
|
|
20
|
+
...defaultOxcConfigPaths,
|
|
21
|
+
...configPaths,
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
"oxc.configPath": paths.lint,
|
|
25
|
+
"oxc.fmt.configPath": paths.formatter,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function oxcProjection(options) {
|
|
29
|
+
return {
|
|
30
|
+
extensions: ["oxc.oxc-vscode"],
|
|
31
|
+
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,
|
|
41
|
+
...oxcConfigPathSettings(options?.oxcConfigPaths),
|
|
42
|
+
"[javascript]": oxcFormatterSettings,
|
|
43
|
+
"[json]": oxcFormatterSettings,
|
|
44
|
+
"[markdown]": oxcFormatterSettings,
|
|
45
|
+
"[typescript]": oxcFormatterSettings,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
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
|
+
function mergeSettings(base, patch) {
|
|
79
|
+
return { ...base, ...patch };
|
|
80
|
+
}
|
|
81
|
+
export function editorCustomizationForCapabilities(capabilities, options) {
|
|
82
|
+
const selected = new Set(capabilities);
|
|
83
|
+
const extensions = new Set();
|
|
84
|
+
let settings = {};
|
|
85
|
+
for (const capability of capabilityOrder) {
|
|
86
|
+
if (!selected.has(capability)) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const projection = capability === "oxc-format-lint"
|
|
90
|
+
? oxcProjection(options)
|
|
91
|
+
: capabilityProjections[capability];
|
|
92
|
+
for (const extension of projection.extensions) {
|
|
93
|
+
extensions.add(extension);
|
|
94
|
+
}
|
|
95
|
+
settings = mergeSettings(settings, projection.settings);
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
extensions: [...extensions],
|
|
99
|
+
settings,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PackageManager, ProjectBlueprint } from "./declarations.js";
|
|
2
|
+
import type { ResolvedToolchainVersions } from "./toolchain-resolution.js";
|
|
3
|
+
export type ProjectName = {
|
|
4
|
+
readonly kind: "ProjectName";
|
|
5
|
+
readonly value: string;
|
|
6
|
+
};
|
|
7
|
+
export type GenerationPackageManager = {
|
|
8
|
+
readonly kind: "PackageManager";
|
|
9
|
+
readonly value: PackageManager;
|
|
10
|
+
};
|
|
11
|
+
export type GenerationContext = {
|
|
12
|
+
readonly projectName: ProjectName;
|
|
13
|
+
readonly preset: string;
|
|
14
|
+
readonly packageManager?: GenerationPackageManager;
|
|
15
|
+
readonly blueprint: ProjectBlueprint;
|
|
16
|
+
readonly toolchain: ResolvedToolchainVersions;
|
|
17
|
+
};
|
|
18
|
+
export type AssembleGenerationContextOptions = {
|
|
19
|
+
readonly targetDir: string;
|
|
20
|
+
readonly blueprint: ProjectBlueprint;
|
|
21
|
+
readonly toolchain: ResolvedToolchainVersions;
|
|
22
|
+
};
|
|
23
|
+
export declare function assembleGenerationContext(options: AssembleGenerationContextOptions): GenerationContext;
|
|
24
|
+
//# sourceMappingURL=generation-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generation-context.d.ts","sourceRoot":"","sources":["../../src/generation-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,wBAAwB,CAAC;IACnD,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;CAC/C,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,gCAAgC,GACxC,iBAAiB,CAUnB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
export function assembleGenerationContext(options) {
|
|
3
|
+
return {
|
|
4
|
+
projectName: { kind: "ProjectName", value: path.basename(path.resolve(options.targetDir)) },
|
|
5
|
+
preset: options.blueprint.preset,
|
|
6
|
+
packageManager: options.blueprint.packageManager
|
|
7
|
+
? { kind: "PackageManager", value: options.blueprint.packageManager }
|
|
8
|
+
: undefined,
|
|
9
|
+
blueprint: options.blueprint,
|
|
10
|
+
toolchain: options.toolchain,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type PackageBoundaryOwner = {
|
|
2
|
+
readonly kind: "package-boundary";
|
|
3
|
+
readonly path: "." | "apps/api" | "apps/web";
|
|
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";
|
|
8
|
+
export type CheckEnvironmentNeed = {
|
|
9
|
+
readonly kind: "playwright-browser-assets";
|
|
10
|
+
readonly browser: "chromium";
|
|
11
|
+
readonly owner: ComponentOwner;
|
|
12
|
+
};
|
|
13
|
+
export type CheckComponent = {
|
|
14
|
+
readonly kind: CheckComponentKind;
|
|
15
|
+
readonly owner: ComponentOwner;
|
|
16
|
+
};
|
|
17
|
+
export type FixComponent = {
|
|
18
|
+
readonly kind: FixComponentKind;
|
|
19
|
+
readonly owner: ComponentOwner;
|
|
20
|
+
};
|
|
21
|
+
export type CheckPlan = {
|
|
22
|
+
readonly components: CheckComponent[];
|
|
23
|
+
readonly environmentNeeds: CheckEnvironmentNeed[];
|
|
24
|
+
};
|
|
25
|
+
export type FixPlan = {
|
|
26
|
+
readonly components: FixComponent[];
|
|
27
|
+
};
|
|
28
|
+
export declare function renderRootCheckCommand(plan: CheckPlan): string;
|
|
29
|
+
export declare function renderFixCommand(plan: FixPlan): string;
|
|
30
|
+
export declare function renderPlaywrightBrowserInstallCommand(need: CheckEnvironmentNeed): string;
|
|
31
|
+
//# sourceMappingURL=module-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-graph.d.ts","sourceRoot":"","sources":["../../src/module-graph.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,UAAU,GAAG,UAAU,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,UAAU,GACV,kBAAkB,GAClB,OAAO,GACP,WAAW,GACX,UAAU,GACV,aAAa,GACb,eAAe,GACf,cAAc,GACd,YAAY,CAAC;AAEjB,MAAM,MAAM,gBAAgB,GACxB,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,eAAe,CAAC;AAEpB,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,UAAU,EAAE,cAAc,EAAE,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,UAAU,EAAE,YAAY,EAAE,CAAC;CACrC,CAAC;AAwCF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAEtD;AAED,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,oBAAoB,GACzB,MAAM,CAMR"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
function renderCheckComponentCommand(component) {
|
|
2
|
+
switch (component.kind) {
|
|
3
|
+
case "typescript-typecheck":
|
|
4
|
+
return "pnpm run typecheck";
|
|
5
|
+
case "oxc-lint":
|
|
6
|
+
return "pnpm run lint";
|
|
7
|
+
case "oxc-format-check":
|
|
8
|
+
return "pnpm run format:check";
|
|
9
|
+
case "build":
|
|
10
|
+
return "pnpm run build";
|
|
11
|
+
case "unit-test":
|
|
12
|
+
return "pnpm run test";
|
|
13
|
+
case "e2e-test":
|
|
14
|
+
return "pnpm run test:e2e";
|
|
15
|
+
case "turbo-check":
|
|
16
|
+
return "turbo run check";
|
|
17
|
+
case "rustfmt-check":
|
|
18
|
+
return "cargo fmt --all -- --check";
|
|
19
|
+
case "cargo-clippy":
|
|
20
|
+
return "cargo clippy --workspace --all-targets -- -D warnings";
|
|
21
|
+
case "cargo-test":
|
|
22
|
+
return "cargo test --workspace";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function renderFixComponentCommand(component) {
|
|
26
|
+
switch (component.kind) {
|
|
27
|
+
case "oxc-format-write":
|
|
28
|
+
return "pnpm run format:write";
|
|
29
|
+
case "oxc-lint-fix":
|
|
30
|
+
return "pnpm run lint:fix";
|
|
31
|
+
case "turbo-fix":
|
|
32
|
+
return "turbo run fix";
|
|
33
|
+
case "rustfmt-write":
|
|
34
|
+
return "cargo fmt --all";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export function renderRootCheckCommand(plan) {
|
|
38
|
+
return plan.components.map(renderCheckComponentCommand).join(" && ");
|
|
39
|
+
}
|
|
40
|
+
export function renderFixCommand(plan) {
|
|
41
|
+
return plan.components.map(renderFixComponentCommand).join(" && ");
|
|
42
|
+
}
|
|
43
|
+
export function renderPlaywrightBrowserInstallCommand(need) {
|
|
44
|
+
if (need.owner.path === "apps/web") {
|
|
45
|
+
return `pnpm --filter ./apps/web exec playwright install ${need.browser}`;
|
|
46
|
+
}
|
|
47
|
+
return `pnpm exec playwright install ${need.browser}`;
|
|
48
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PresetProjectionPlan } from "./preset-projection.js";
|
|
2
|
+
export type NextStepInstruction = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly kind: "navigation" | "command";
|
|
6
|
+
readonly command: string;
|
|
7
|
+
readonly args: readonly string[];
|
|
8
|
+
readonly cwd: string;
|
|
9
|
+
readonly display: string;
|
|
10
|
+
readonly machineVerifiable: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type NextStepInstructionPlan = {
|
|
13
|
+
readonly targetDir: string;
|
|
14
|
+
readonly steps: readonly NextStepInstruction[];
|
|
15
|
+
};
|
|
16
|
+
export type PlanNextStepInstructionsOptions = {
|
|
17
|
+
readonly targetDir: string;
|
|
18
|
+
readonly projectionPlan: PresetProjectionPlan;
|
|
19
|
+
};
|
|
20
|
+
export declare function planNextStepInstructions(options: PlanNextStepInstructionsOptions): NextStepInstructionPlan;
|
|
21
|
+
//# sourceMappingURL=next-step-instructions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-step-instructions.d.ts","sourceRoot":"","sources":["../../src/next-step-instructions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;CAC/C,CAAC;AAqFF,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,+BAA+B,GACvC,uBAAuB,CAyBzB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { renderPlaywrightBrowserInstallCommand } from "./module-graph.js";
|
|
2
|
+
function rootCheckInstruction() {
|
|
3
|
+
return {
|
|
4
|
+
id: "run-root-check",
|
|
5
|
+
label: "Run Root Check",
|
|
6
|
+
kind: "command",
|
|
7
|
+
command: "pnpm",
|
|
8
|
+
args: ["run", "check"],
|
|
9
|
+
cwd: "",
|
|
10
|
+
display: "pnpm run check",
|
|
11
|
+
machineVerifiable: true,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function installDependenciesInstruction() {
|
|
15
|
+
return {
|
|
16
|
+
id: "install-dependencies",
|
|
17
|
+
label: "Install dependencies",
|
|
18
|
+
kind: "command",
|
|
19
|
+
command: "pnpm",
|
|
20
|
+
args: ["install"],
|
|
21
|
+
cwd: "",
|
|
22
|
+
display: "pnpm install",
|
|
23
|
+
machineVerifiable: true,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function fixInstruction() {
|
|
27
|
+
return {
|
|
28
|
+
id: "run-fix",
|
|
29
|
+
label: "Run Fix Command",
|
|
30
|
+
kind: "command",
|
|
31
|
+
command: "pnpm",
|
|
32
|
+
args: ["run", "fix"],
|
|
33
|
+
cwd: "",
|
|
34
|
+
display: "pnpm run fix",
|
|
35
|
+
machineVerifiable: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function checkEnvironmentInstructions(plan) {
|
|
39
|
+
return plan.checkPlan.environmentNeeds.map((need) => {
|
|
40
|
+
const display = renderPlaywrightBrowserInstallCommand(need);
|
|
41
|
+
const [command, ...args] = display.split(" ");
|
|
42
|
+
return {
|
|
43
|
+
id: need.owner.path === "apps/web"
|
|
44
|
+
? "install-web-playwright-browsers"
|
|
45
|
+
: "install-playwright-browsers",
|
|
46
|
+
label: need.owner.path === "apps/web"
|
|
47
|
+
? "Install Playwright browser assets for web workspace"
|
|
48
|
+
: "Install Playwright browser assets",
|
|
49
|
+
kind: "command",
|
|
50
|
+
command,
|
|
51
|
+
args,
|
|
52
|
+
cwd: "",
|
|
53
|
+
display,
|
|
54
|
+
machineVerifiable: true,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function projectionInstructions(plan) {
|
|
59
|
+
const steps = [installDependenciesInstruction()];
|
|
60
|
+
if (plan.capabilities.fixCommand) {
|
|
61
|
+
steps.push(fixInstruction());
|
|
62
|
+
}
|
|
63
|
+
steps.push(...checkEnvironmentInstructions(plan));
|
|
64
|
+
if (plan.capabilities.rootCheck) {
|
|
65
|
+
steps.push(rootCheckInstruction());
|
|
66
|
+
}
|
|
67
|
+
return steps;
|
|
68
|
+
}
|
|
69
|
+
export function planNextStepInstructions(options) {
|
|
70
|
+
const targetDir = options.targetDir;
|
|
71
|
+
const commandSteps = projectionInstructions(options.projectionPlan).map((step) => ({
|
|
72
|
+
...step,
|
|
73
|
+
cwd: targetDir,
|
|
74
|
+
}));
|
|
75
|
+
const navigationStep = {
|
|
76
|
+
id: "enter-project",
|
|
77
|
+
label: "Enter Generated Repository",
|
|
78
|
+
kind: "navigation",
|
|
79
|
+
command: "cd",
|
|
80
|
+
args: [targetDir],
|
|
81
|
+
cwd: ".",
|
|
82
|
+
display: `cd ${targetDir}`,
|
|
83
|
+
machineVerifiable: false,
|
|
84
|
+
};
|
|
85
|
+
return Object.freeze({
|
|
86
|
+
targetDir,
|
|
87
|
+
steps: Object.freeze([navigationStep, ...commandSteps].map((step) => Object.freeze(step))),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-addition.d.ts","sourceRoot":"","sources":["../../src/package-addition.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA0PF,wBAAsB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+E1E"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { findBuiltInPresetProjection } from "../templates/registry.js";
|
|
4
|
+
import { validateProjectBlueprint, } from "./declarations.js";
|
|
5
|
+
import { renderProject } from "./renderer.js";
|
|
6
|
+
function projectNameFromBlueprint(blueprint) {
|
|
7
|
+
const firstPackage = blueprint.packages?.[0];
|
|
8
|
+
const match = firstPackage?.name.match(/^@([^/]+)\//);
|
|
9
|
+
if (!match) {
|
|
10
|
+
throw new Error("Cannot infer workspace package scope from the stored Project Blueprint");
|
|
11
|
+
}
|
|
12
|
+
return match[1];
|
|
13
|
+
}
|
|
14
|
+
function assertSafePackageLeaf(name) {
|
|
15
|
+
if (!/^[a-z0-9][a-z0-9-]*$/.test(name)) {
|
|
16
|
+
throw new Error("--name must be a lowercase package leaf name using letters, numbers, and hyphens");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function readJson(filePath) {
|
|
20
|
+
return JSON.parse(await readFile(filePath, "utf8"));
|
|
21
|
+
}
|
|
22
|
+
async function writeJson(filePath, value) {
|
|
23
|
+
await writeFile(filePath, `${JSON.stringify(value, null, 2)}\n`, "utf8");
|
|
24
|
+
}
|
|
25
|
+
async function assertMissing(targetPath) {
|
|
26
|
+
try {
|
|
27
|
+
await stat(targetPath);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (isNodeError(error) && error.code === "ENOENT") {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
throw new Error(`Package Addition would overwrite an existing path: ${targetPath}`);
|
|
36
|
+
}
|
|
37
|
+
function resolveGeneratedPath(root, relativePath) {
|
|
38
|
+
if (path.isAbsolute(relativePath)) {
|
|
39
|
+
throw new Error(`Package Addition paths must be relative: ${relativePath}`);
|
|
40
|
+
}
|
|
41
|
+
const resolvedRoot = path.resolve(root);
|
|
42
|
+
const resolvedPath = path.resolve(resolvedRoot, relativePath);
|
|
43
|
+
const insideRoot = resolvedPath === resolvedRoot ||
|
|
44
|
+
resolvedPath.startsWith(`${resolvedRoot}${path.sep}`);
|
|
45
|
+
if (!insideRoot) {
|
|
46
|
+
throw new Error(`Package Addition path escapes the Generated Repository: ${relativePath}`);
|
|
47
|
+
}
|
|
48
|
+
return resolvedPath;
|
|
49
|
+
}
|
|
50
|
+
function isNodeError(error) {
|
|
51
|
+
return error instanceof Error && "code" in error;
|
|
52
|
+
}
|
|
53
|
+
function isRecord(value) {
|
|
54
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
55
|
+
}
|
|
56
|
+
async function readGeneratedWorkspaceBlueprint(root) {
|
|
57
|
+
const blueprintPath = path.join(root, ".project-kit/blueprint.json");
|
|
58
|
+
const result = validateProjectBlueprint(await readJson(blueprintPath));
|
|
59
|
+
if (!result.ok) {
|
|
60
|
+
throw new Error("Package Addition requires a valid .project-kit/blueprint.json");
|
|
61
|
+
}
|
|
62
|
+
const blueprint = result.value;
|
|
63
|
+
if (blueprint.projectKind !== "multi-package") {
|
|
64
|
+
throw new Error("Package Addition only supports existing workspace Generated Repositories");
|
|
65
|
+
}
|
|
66
|
+
if (blueprint.packageManager !== "pnpm") {
|
|
67
|
+
throw new Error("Package Addition only supports pnpm workspace Generated Repositories");
|
|
68
|
+
}
|
|
69
|
+
if (!blueprint.packages || blueprint.packages.length === 0) {
|
|
70
|
+
throw new Error("Package Addition requires package definitions in the stored Project Blueprint");
|
|
71
|
+
}
|
|
72
|
+
await stat(path.join(root, "turbo.json"));
|
|
73
|
+
await stat(path.join(root, "pnpm-workspace.yaml"));
|
|
74
|
+
return blueprint;
|
|
75
|
+
}
|
|
76
|
+
async function readGeneratedRepositoryNodeVersion(root) {
|
|
77
|
+
const packageJson = await readJson(path.join(root, "package.json"));
|
|
78
|
+
if (!isRecord(packageJson) || !isRecord(packageJson.engines)) {
|
|
79
|
+
throw new Error("Package Addition requires root package.json to declare engines.node");
|
|
80
|
+
}
|
|
81
|
+
const nodeVersion = packageJson.engines.node;
|
|
82
|
+
if (typeof nodeVersion !== "string" || nodeVersion.length === 0) {
|
|
83
|
+
throw new Error("Package Addition requires root package.json to declare engines.node");
|
|
84
|
+
}
|
|
85
|
+
return nodeVersion;
|
|
86
|
+
}
|
|
87
|
+
function workspaceTextWithPackageGlob(text, glob) {
|
|
88
|
+
if (text.includes(` - ${glob}`)) {
|
|
89
|
+
return text;
|
|
90
|
+
}
|
|
91
|
+
const nextText = text.replace(/^packages:\n/m, `packages:\n - ${glob}\n`);
|
|
92
|
+
if (nextText === text) {
|
|
93
|
+
throw new Error("Cannot update pnpm workspace membership: missing packages section");
|
|
94
|
+
}
|
|
95
|
+
return nextText;
|
|
96
|
+
}
|
|
97
|
+
function assertRootTsconfig(input) {
|
|
98
|
+
if (!isRecord(input)) {
|
|
99
|
+
throw new Error("Cannot update root TypeScript project references: tsconfig.json must be an object");
|
|
100
|
+
}
|
|
101
|
+
const references = input.references;
|
|
102
|
+
if (references === undefined) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (!Array.isArray(references)) {
|
|
106
|
+
throw new Error("Cannot update root TypeScript project references: references must be an array");
|
|
107
|
+
}
|
|
108
|
+
for (const reference of references) {
|
|
109
|
+
if (!isRecord(reference) || typeof reference.path !== "string") {
|
|
110
|
+
throw new Error("Cannot update root TypeScript project references: each reference must have a string path");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function rootTsconfigWithReferences(input, referencePaths) {
|
|
115
|
+
assertRootTsconfig(input);
|
|
116
|
+
const tsconfig = input;
|
|
117
|
+
const references = tsconfig.references ?? [];
|
|
118
|
+
for (const referencePath of referencePaths) {
|
|
119
|
+
if (!references.some((reference) => reference.path === referencePath)) {
|
|
120
|
+
references.push({ path: referencePath });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return { ...tsconfig, references };
|
|
124
|
+
}
|
|
125
|
+
function blueprintWithPackage(blueprint, packageName, packagePath) {
|
|
126
|
+
const nextBlueprint = {
|
|
127
|
+
...blueprint,
|
|
128
|
+
packages: [
|
|
129
|
+
...(blueprint.packages ?? []),
|
|
130
|
+
{ name: packageName, path: packagePath },
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
const result = validateProjectBlueprint(nextBlueprint);
|
|
134
|
+
if (!result.ok) {
|
|
135
|
+
throw new Error("Package Addition would write an invalid .project-kit/blueprint.json");
|
|
136
|
+
}
|
|
137
|
+
return result.value;
|
|
138
|
+
}
|
|
139
|
+
async function planRootUpdates(root, blueprint, packageName, packagePath, workspacePackageGlob, rootTsconfigReferences) {
|
|
140
|
+
const workspaceText = workspaceTextWithPackageGlob(await readFile(path.join(root, "pnpm-workspace.yaml"), "utf8"), workspacePackageGlob);
|
|
141
|
+
const rootTsconfig = rootTsconfigWithReferences(await readJson(path.join(root, "tsconfig.json")), rootTsconfigReferences);
|
|
142
|
+
return {
|
|
143
|
+
blueprint: blueprintWithPackage(blueprint, packageName, packagePath),
|
|
144
|
+
rootTsconfig,
|
|
145
|
+
workspaceText,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
export async function addPackage(options) {
|
|
149
|
+
assertSafePackageLeaf(options.name);
|
|
150
|
+
const root = path.resolve(options.cwd);
|
|
151
|
+
const blueprint = await readGeneratedWorkspaceBlueprint(root);
|
|
152
|
+
const nodeVersion = await readGeneratedRepositoryNodeVersion(root);
|
|
153
|
+
const projectName = projectNameFromBlueprint(blueprint);
|
|
154
|
+
const packageName = `@${projectName}/${options.name}`;
|
|
155
|
+
const projection = findBuiltInPresetProjection(options.preset);
|
|
156
|
+
const packageAddition = projection?.capabilities?.packageAddition;
|
|
157
|
+
if (!projection) {
|
|
158
|
+
throw new Error(`Unknown preset for Package Addition: ${options.preset}`);
|
|
159
|
+
}
|
|
160
|
+
if (!packageAddition) {
|
|
161
|
+
throw new Error(`Package Addition is not supported by preset: ${options.preset}`);
|
|
162
|
+
}
|
|
163
|
+
const additionPlan = await packageAddition.planPackageAddition({
|
|
164
|
+
root,
|
|
165
|
+
blueprint,
|
|
166
|
+
packageLeafName: options.name,
|
|
167
|
+
packageName,
|
|
168
|
+
nodeVersion,
|
|
169
|
+
});
|
|
170
|
+
if (blueprint.packages?.some((pkg) => pkg.name === packageName || pkg.path === additionPlan.packagePath)) {
|
|
171
|
+
throw new Error(`Package Addition conflicts with an existing package definition: ${packageName}`);
|
|
172
|
+
}
|
|
173
|
+
await assertMissing(path.join(root, additionPlan.packagePath));
|
|
174
|
+
const rootUpdatePlan = await planRootUpdates(root, blueprint, packageName, additionPlan.packagePath, additionPlan.workspacePackageGlob, additionPlan.rootTsconfigReferences);
|
|
175
|
+
await mkdir(path.join(root, additionPlan.packagePath), { recursive: true });
|
|
176
|
+
await renderProject({
|
|
177
|
+
sourceRoot: additionPlan.sourceRoot,
|
|
178
|
+
sourceRoots: additionPlan.sourceRoots,
|
|
179
|
+
targetRoot: root,
|
|
180
|
+
operations: [...additionPlan.operations],
|
|
181
|
+
});
|
|
182
|
+
for (const textFile of additionPlan.textFiles ?? []) {
|
|
183
|
+
await writeFile(resolveGeneratedPath(root, textFile.path), textFile.text, "utf8");
|
|
184
|
+
}
|
|
185
|
+
await writeFile(path.join(root, "pnpm-workspace.yaml"), rootUpdatePlan.workspaceText, "utf8");
|
|
186
|
+
await writeJson(path.join(root, "tsconfig.json"), rootUpdatePlan.rootTsconfig);
|
|
187
|
+
await writeJson(path.join(root, ".project-kit/blueprint.json"), rootUpdatePlan.blueprint);
|
|
188
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { BuiltInPreset, ProjectBlueprint } from "./declarations.js";
|
|
2
|
+
import type { GenerationContext } from "./generation-context.js";
|
|
3
|
+
import { type CheckPlan, type FixPlan } from "./module-graph.js";
|
|
4
|
+
import { type NextStepInstruction } from "./next-step-instructions.js";
|
|
5
|
+
import type { DependencyMaintenancePolicy } from "./project-github.js";
|
|
6
|
+
import type { RenderOperation } from "./renderer.js";
|
|
7
|
+
export type PresetPackageAdditionOptions = {
|
|
8
|
+
readonly root: string;
|
|
9
|
+
readonly blueprint: ProjectBlueprint;
|
|
10
|
+
readonly packageLeafName: string;
|
|
11
|
+
readonly packageName: string;
|
|
12
|
+
readonly nodeVersion: string;
|
|
13
|
+
};
|
|
14
|
+
export type PresetPackageAdditionPlan = {
|
|
15
|
+
readonly packagePath: string;
|
|
16
|
+
readonly workspacePackageGlob: string;
|
|
17
|
+
readonly rootTsconfigReferences: readonly string[];
|
|
18
|
+
readonly sourceRoot: string;
|
|
19
|
+
readonly sourceRoots?: Record<string, string>;
|
|
20
|
+
readonly operations: readonly RenderOperation[];
|
|
21
|
+
readonly textFiles?: readonly {
|
|
22
|
+
readonly path: string;
|
|
23
|
+
readonly text: string;
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
export type PresetPackageAdditionCapability = {
|
|
27
|
+
planPackageAddition(options: PresetPackageAdditionOptions): PresetPackageAdditionPlan | Promise<PresetPackageAdditionPlan>;
|
|
28
|
+
};
|
|
29
|
+
export type PresetProjectionPlan = {
|
|
30
|
+
readonly sourceRoot: string;
|
|
31
|
+
readonly sourceRoots?: Record<string, string>;
|
|
32
|
+
readonly operations: readonly RenderOperation[];
|
|
33
|
+
readonly checkPlan: CheckPlan;
|
|
34
|
+
readonly fixPlan: FixPlan;
|
|
35
|
+
readonly dependencyMaintenancePolicy: DependencyMaintenancePolicy;
|
|
36
|
+
readonly packageScripts: Record<string, string>;
|
|
37
|
+
readonly capabilities: {
|
|
38
|
+
readonly rootCheck: true;
|
|
39
|
+
readonly fixCommand: true;
|
|
40
|
+
readonly githubActions: true;
|
|
41
|
+
readonly dependabot: true;
|
|
42
|
+
readonly devcontainer: true;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export type PresetBlueprintOptions = {
|
|
46
|
+
readonly targetDir: string;
|
|
47
|
+
readonly scope?: string;
|
|
48
|
+
};
|
|
49
|
+
export type RenderPresetProjectionOptions = {
|
|
50
|
+
readonly targetDir: string;
|
|
51
|
+
readonly plan: PresetProjectionPlan;
|
|
52
|
+
};
|
|
53
|
+
export type PresetProjection = {
|
|
54
|
+
readonly metadata: BuiltInPreset;
|
|
55
|
+
readonly capabilities?: {
|
|
56
|
+
readonly packageAddition?: PresetPackageAdditionCapability;
|
|
57
|
+
};
|
|
58
|
+
blueprint(options: PresetBlueprintOptions): ProjectBlueprint;
|
|
59
|
+
project(context: GenerationContext): PresetProjectionPlan;
|
|
60
|
+
render(options: RenderPresetProjectionOptions): Promise<void>;
|
|
61
|
+
};
|
|
62
|
+
export declare function planNextStepInstructionsForProjection(options: {
|
|
63
|
+
readonly targetDir: string;
|
|
64
|
+
readonly plan: PresetProjectionPlan;
|
|
65
|
+
}): readonly NextStepInstruction[];
|
|
66
|
+
//# sourceMappingURL=preset-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-projection.d.ts","sourceRoot":"","sources":["../../src/preset-projection.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type CheckPlan } from "./module-graph.js";
|
|
2
|
+
export type CiCapability = {
|
|
3
|
+
readonly workflowName: "Check";
|
|
4
|
+
readonly jobName: "check";
|
|
5
|
+
readonly runner: "ubuntu-latest";
|
|
6
|
+
};
|
|
7
|
+
export type CiEnvironmentPreparation = {
|
|
8
|
+
readonly nodeFromPackageMetadata: boolean;
|
|
9
|
+
readonly rustToolchain: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type PnpmTaskLayer = {
|
|
12
|
+
readonly installCommand: "pnpm install";
|
|
13
|
+
readonly checkCommand: "pnpm run check";
|
|
14
|
+
};
|
|
15
|
+
export type DependencyEcosystem = "npm" | "cargo" | "github-actions";
|
|
16
|
+
export type DependencyMaintenancePolicy = {
|
|
17
|
+
readonly ecosystems: DependencyEcosystem[];
|
|
18
|
+
readonly interval: "weekly";
|
|
19
|
+
};
|
|
20
|
+
type ProjectCheckWorkflowOptions = {
|
|
21
|
+
readonly checkPlan: CheckPlan;
|
|
22
|
+
readonly capability?: CiCapability;
|
|
23
|
+
readonly environmentPreparation?: Partial<CiEnvironmentPreparation>;
|
|
24
|
+
readonly taskLayer?: PnpmTaskLayer;
|
|
25
|
+
};
|
|
26
|
+
export declare function projectCheckWorkflow(options: ProjectCheckWorkflowOptions): string;
|
|
27
|
+
export declare function projectDependabotConfig(policy: DependencyMaintenancePolicy): string;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=project-github.d.ts.map
|