@ykdz/template 0.0.9 → 0.0.11
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/cli.js +2 -2
- package/node_modules/@ykdz/template-builtin-source/dist/src/index.d.ts +4 -4
- package/node_modules/@ykdz/template-builtin-source/dist/src/index.js +12 -5
- package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.d.ts +1 -1
- package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.js +1 -1
- package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.js +9 -6
- package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.d.ts +1 -1
- package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.js +1 -1
- package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.d.ts +1 -1
- package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +1 -1
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.d.ts +1 -1
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +9 -4
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.d.ts +1 -1
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +7 -7
- package/node_modules/@ykdz/template-builtin-source/package.json +4 -3
- package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +39 -11
- package/node_modules/@ykdz/template-builtin-source/templates/vue-app/scripts/run-playwright.ts +25 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vue-app/src/App.vue +18 -4
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/scripts/run-playwright.ts +25 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/App.vue +18 -4
- package/node_modules/@ykdz/template-core/dist/declarations.d.ts +2 -203
- package/node_modules/@ykdz/template-core/dist/declarations.js +1 -303
- package/node_modules/@ykdz/template-core/dist/devcontainer.d.ts +17 -0
- package/node_modules/@ykdz/template-core/dist/devcontainer.js +22 -21
- package/node_modules/@ykdz/template-core/dist/editor-customization.d.ts +10 -1
- package/node_modules/@ykdz/template-core/dist/editor-customization.js +36 -26
- package/node_modules/@ykdz/template-core/dist/generated-scenarios.d.ts +5 -0
- package/node_modules/@ykdz/template-core/dist/generated-scenarios.js +42 -24
- package/node_modules/@ykdz/template-core/dist/generation-context.d.ts +1 -1
- package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +19 -1
- package/node_modules/@ykdz/template-core/dist/module-graph.js +42 -3
- package/node_modules/@ykdz/template-core/dist/next-step-instructions.d.ts +2 -0
- package/node_modules/@ykdz/template-core/dist/next-step-instructions.js +11 -22
- package/node_modules/@ykdz/template-core/dist/package-addition-support.d.ts +2 -1
- package/node_modules/@ykdz/template-core/dist/package-addition-support.js +2 -4
- package/node_modules/@ykdz/template-core/dist/package-addition.js +4 -3
- package/node_modules/@ykdz/template-core/dist/package-linking.d.ts +2 -6
- package/node_modules/@ykdz/template-core/dist/package-linking.js +1 -1
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +3 -5
- package/node_modules/@ykdz/template-core/dist/preset-projection.d.ts +1 -2
- package/node_modules/@ykdz/template-core/dist/preset-source.d.ts +4 -418
- package/node_modules/@ykdz/template-core/dist/preset-source.js +81 -726
- package/node_modules/@ykdz/template-core/dist/project-github.js +2 -6
- package/node_modules/@ykdz/template-core/dist/projection-capabilities.d.ts +5 -53
- package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +108 -507
- package/node_modules/@ykdz/template-core/dist/toolchain-resolution.js +1 -1
- package/node_modules/@ykdz/template-core/package.json +4 -3
- package/node_modules/@ykdz/template-shared/dist/index.d.ts +794 -0
- package/node_modules/@ykdz/template-shared/dist/index.js +1637 -0
- package/node_modules/@ykdz/template-shared/package.json +32 -0
- package/package.json +9 -6
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
4
2
|
import * as v from "valibot";
|
|
5
3
|
const capabilityOrder = [
|
|
6
4
|
"oxc-format-lint",
|
|
@@ -26,28 +24,40 @@ const editorCustomizationDeclarationsSchema = v.object({
|
|
|
26
24
|
vitest: capabilityProjectionSchema,
|
|
27
25
|
}),
|
|
28
26
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
path.resolve(moduleDirectory, "..", "..", "..", "packages", relativeDeclarationPath),
|
|
38
|
-
];
|
|
39
|
-
const declarationPath = candidates.find((candidate) => existsSync(candidate));
|
|
40
|
-
if (!declarationPath) {
|
|
41
|
-
throw new Error(`Unable to find editor customization declarations at ${relativeDeclarationPath}`);
|
|
42
|
-
}
|
|
43
|
-
return declarationPath;
|
|
27
|
+
function editorCustomizationDeclarationIssuePath(issue) {
|
|
28
|
+
const segments = issue.path?.flatMap((item) => typeof item.key === "string" || typeof item.key === "number"
|
|
29
|
+
? [String(item.key)]
|
|
30
|
+
: []) ?? [];
|
|
31
|
+
return segments.length === 0 ? "$" : `$.${segments.join(".")}`;
|
|
32
|
+
}
|
|
33
|
+
function errorMessage(error) {
|
|
34
|
+
return error instanceof Error ? error.message : String(error);
|
|
44
35
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
36
|
+
function editorCustomizationSharedResourceLabel(resourcePath) {
|
|
37
|
+
return `Editor Customization Shared Resource ${resourcePath}`;
|
|
38
|
+
}
|
|
39
|
+
export function loadEditorCustomizationDeclarations(resourcePath) {
|
|
40
|
+
const resourceLabel = editorCustomizationSharedResourceLabel(resourcePath);
|
|
41
|
+
let resourceText;
|
|
42
|
+
try {
|
|
43
|
+
resourceText = readFileSync(resourcePath, "utf8");
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
throw new Error(`${resourceLabel} is unreadable: ${errorMessage(error)}`, {
|
|
47
|
+
cause: error,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
let source;
|
|
51
|
+
try {
|
|
52
|
+
source = JSON.parse(resourceText);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
throw new Error(`${resourceLabel} is invalid: invalid JSON: ${errorMessage(error)}`, { cause: error });
|
|
56
|
+
}
|
|
47
57
|
const result = v.safeParse(editorCustomizationDeclarationsSchema, source);
|
|
48
58
|
if (!result.success) {
|
|
49
|
-
throw new Error(
|
|
50
|
-
.map((issue) => issue.message)
|
|
59
|
+
throw new Error(`${resourceLabel} is invalid: ${result.issues
|
|
60
|
+
.map((issue) => `${editorCustomizationDeclarationIssuePath(issue)}: ${issue.message}`)
|
|
51
61
|
.join("; ")}`);
|
|
52
62
|
}
|
|
53
63
|
return result.output;
|
|
@@ -66,19 +76,19 @@ function oxcConfigPathSettings(configPaths) {
|
|
|
66
76
|
};
|
|
67
77
|
}
|
|
68
78
|
function oxcProjection(options) {
|
|
69
|
-
const baseProjection = declarations.capabilities["oxc-format-lint"];
|
|
79
|
+
const baseProjection = options.declarations.capabilities["oxc-format-lint"];
|
|
70
80
|
return {
|
|
71
81
|
extensions: baseProjection.extensions,
|
|
72
82
|
settings: {
|
|
73
83
|
...baseProjection.settings,
|
|
74
|
-
...oxcConfigPathSettings(options?.oxcConfigPaths),
|
|
84
|
+
...oxcConfigPathSettings(options.editorOptions?.oxcConfigPaths),
|
|
75
85
|
},
|
|
76
86
|
};
|
|
77
87
|
}
|
|
78
88
|
function mergeSettings(base, patch) {
|
|
79
89
|
return { ...base, ...patch };
|
|
80
90
|
}
|
|
81
|
-
export function editorCustomizationForCapabilities(capabilities, options) {
|
|
91
|
+
export function editorCustomizationForCapabilities(capabilities, declarations, options) {
|
|
82
92
|
const selected = new Set(capabilities);
|
|
83
93
|
const extensions = new Set();
|
|
84
94
|
let settings = {};
|
|
@@ -87,7 +97,7 @@ export function editorCustomizationForCapabilities(capabilities, options) {
|
|
|
87
97
|
continue;
|
|
88
98
|
}
|
|
89
99
|
const projection = capability === "oxc-format-lint"
|
|
90
|
-
? oxcProjection(options)
|
|
100
|
+
? oxcProjection({ declarations, editorOptions: options })
|
|
91
101
|
: declarations.capabilities[capability];
|
|
92
102
|
for (const extension of projection.extensions) {
|
|
93
103
|
extensions.add(extension);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CheckEnvironmentNeed } from "./module-graph.js";
|
|
1
2
|
import type { PresetSourceManifest } from "./preset-source.js";
|
|
2
3
|
import { type PresetProjectionSourceRoots } from "./projection-capabilities.js";
|
|
3
4
|
export type GeneratedScenarioSet = "init" | "package-addition-matrix";
|
|
@@ -27,6 +28,7 @@ export type GeneratedScenarioCommandStep = {
|
|
|
27
28
|
readonly args: readonly string[];
|
|
28
29
|
readonly cwd: string;
|
|
29
30
|
readonly display: string;
|
|
31
|
+
readonly environmentNeedKind?: CheckEnvironmentNeed["kind"];
|
|
30
32
|
};
|
|
31
33
|
export type GeneratedScenarioCommandRunner = (command: string, args: readonly string[], cwd: string, options?: {
|
|
32
34
|
readonly env?: Record<string, string> | undefined;
|
|
@@ -48,6 +50,7 @@ export type GeneratedScenarioRunnerOptions = {
|
|
|
48
50
|
export type ExclusiveLock = {
|
|
49
51
|
readonly run: <T>(callback: () => Promise<T>) => Promise<T>;
|
|
50
52
|
};
|
|
53
|
+
export declare function generatedScenarioChildProcessEnv(env?: Record<string, string>): NodeJS.ProcessEnv;
|
|
51
54
|
export declare function createExclusiveLock(): ExclusiveLock;
|
|
52
55
|
export declare function generatedScenarioId(scenario: Pick<GeneratedScenario, "basePreset" | "addedPreset" | "linkFrom">): string;
|
|
53
56
|
export declare function generatedScenarioLabel(scenario: Pick<GeneratedScenario, "basePreset" | "addedPreset" | "linkFrom">): string;
|
|
@@ -57,6 +60,8 @@ export declare function defaultGeneratedScenarioCommandRunner(command: string, a
|
|
|
57
60
|
readonly env?: Record<string, string> | undefined;
|
|
58
61
|
readonly logPrefix?: string | undefined;
|
|
59
62
|
}): Promise<void>;
|
|
63
|
+
export declare function generatedScenarioEnvironmentNeedSteps(needs: readonly CheckEnvironmentNeed[], projectDir: string): GeneratedScenarioCommandStep[];
|
|
64
|
+
export declare function generatedScenarioRequiresSerializedRootCheck(steps: readonly GeneratedScenarioCommandStep[]): boolean;
|
|
60
65
|
export declare function generatedScenarioQualityGateSteps(manifest: PresetSourceManifest, scenario: GeneratedScenario, projectDir: string, addedPackagePath: string | undefined, options: GeneratedScenarioRunnerOptions): GeneratedScenarioCommandStep[];
|
|
61
66
|
export declare function fixtureConcurrency(scenarioCount: number): number;
|
|
62
67
|
export declare function errorForFailedGeneratedScenario(scenario: GeneratedScenario, error: unknown): Error;
|
|
@@ -3,7 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { execa } from "execa";
|
|
4
4
|
import * as v from "valibot";
|
|
5
5
|
import { assembleGenerationContext } from "./generation-context.js";
|
|
6
|
-
import {
|
|
6
|
+
import { playwrightBrowserAssetsEnvironmentNeed, } from "./module-graph.js";
|
|
7
7
|
import { planNextStepInstructions } from "./next-step-instructions.js";
|
|
8
8
|
import { findPresetSourceManifestPreset } from "./preset-source.js";
|
|
9
9
|
import { blueprintForPresetSourcePreset, projectPresetSourcePreset, } from "./projection-capabilities.js";
|
|
@@ -17,6 +17,13 @@ const storedBlueprintSchema = v.object({
|
|
|
17
17
|
path: v.string(),
|
|
18
18
|
}))),
|
|
19
19
|
});
|
|
20
|
+
export function generatedScenarioChildProcessEnv(env = {}) {
|
|
21
|
+
const childEnv = { ...process.env, ...env };
|
|
22
|
+
if (childEnv.NO_COLOR !== undefined && childEnv.FORCE_COLOR !== undefined) {
|
|
23
|
+
delete childEnv.FORCE_COLOR;
|
|
24
|
+
}
|
|
25
|
+
return childEnv;
|
|
26
|
+
}
|
|
20
27
|
function cliSourceExecutionEnv(options, env = {}) {
|
|
21
28
|
return {
|
|
22
29
|
...env,
|
|
@@ -116,7 +123,8 @@ export async function defaultGeneratedScenarioCommandRunner(command, args, cwd,
|
|
|
116
123
|
console.log(`${prefix}$ ${[command, ...args].join(" ")}`);
|
|
117
124
|
await execa(command, [...args], {
|
|
118
125
|
cwd,
|
|
119
|
-
|
|
126
|
+
env: generatedScenarioChildProcessEnv(options.env),
|
|
127
|
+
extendEnv: false,
|
|
120
128
|
stdio: "inherit",
|
|
121
129
|
});
|
|
122
130
|
}
|
|
@@ -225,7 +233,7 @@ function projectionPlanForPreset(presetName, projectDir, manifest, options, pack
|
|
|
225
233
|
blueprint,
|
|
226
234
|
toolchain: {
|
|
227
235
|
nodeLtsMajor: { kind: "NodeLtsMajor", value: "24" },
|
|
228
|
-
packageManagerPin: { kind: "PackageManagerPin", value: "pnpm@10.
|
|
236
|
+
packageManagerPin: { kind: "PackageManagerPin", value: "pnpm@10.34.4" },
|
|
229
237
|
source: "bundled-fallback",
|
|
230
238
|
diagnostics: [],
|
|
231
239
|
},
|
|
@@ -240,13 +248,18 @@ function machineVerifiableNextStepsForPreset(presetName, projectDir, manifest, o
|
|
|
240
248
|
});
|
|
241
249
|
return plan.steps
|
|
242
250
|
.filter((step) => step.machineVerifiable && step.kind === "command")
|
|
243
|
-
.map((step) =>
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
251
|
+
.map((step) => {
|
|
252
|
+
return {
|
|
253
|
+
id: step.id,
|
|
254
|
+
command: step.command,
|
|
255
|
+
args: step.args,
|
|
256
|
+
cwd: step.cwd,
|
|
257
|
+
display: step.display,
|
|
258
|
+
...(step.environmentNeedKind === undefined
|
|
259
|
+
? {}
|
|
260
|
+
: { environmentNeedKind: step.environmentNeedKind }),
|
|
261
|
+
};
|
|
262
|
+
});
|
|
250
263
|
}
|
|
251
264
|
function addedPresetEnvironmentNeeds(manifest, scenario, projectDir, addedPackagePath, options) {
|
|
252
265
|
if (!scenario.addedPreset || !addedPackagePath) {
|
|
@@ -256,30 +269,35 @@ function addedPresetEnvironmentNeeds(manifest, scenario, projectDir, addedPackag
|
|
|
256
269
|
if (need.owner.kind !== "package-boundary") {
|
|
257
270
|
return need;
|
|
258
271
|
}
|
|
259
|
-
return {
|
|
260
|
-
|
|
272
|
+
return playwrightBrowserAssetsEnvironmentNeed({
|
|
273
|
+
browser: need.browser,
|
|
261
274
|
owner: { kind: "package-boundary", path: addedPackagePath },
|
|
262
|
-
|
|
275
|
+
machineVerifiable: need.nextStep.machineVerifiable,
|
|
276
|
+
});
|
|
263
277
|
});
|
|
264
278
|
}
|
|
265
279
|
function environmentNeedStep(need, projectDir) {
|
|
266
|
-
const display = renderPlaywrightBrowserInstallCommand(need);
|
|
267
|
-
const [command, ...args] = display.split(" ");
|
|
268
|
-
if (command === undefined) {
|
|
269
|
-
throw new Error(`Cannot parse environment setup command: ${display}`);
|
|
270
|
-
}
|
|
271
280
|
return {
|
|
272
|
-
id:
|
|
273
|
-
command,
|
|
274
|
-
args,
|
|
281
|
+
id: need.nextStep.id,
|
|
282
|
+
command: need.nextStep.command,
|
|
283
|
+
args: [...need.nextStep.args],
|
|
275
284
|
cwd: projectDir,
|
|
276
|
-
display,
|
|
285
|
+
display: need.nextStep.display,
|
|
286
|
+
environmentNeedKind: need.kind,
|
|
277
287
|
};
|
|
278
288
|
}
|
|
289
|
+
export function generatedScenarioEnvironmentNeedSteps(needs, projectDir) {
|
|
290
|
+
return needs
|
|
291
|
+
.filter((need) => need.nextStep.machineVerifiable)
|
|
292
|
+
.map((need) => environmentNeedStep(need, projectDir));
|
|
293
|
+
}
|
|
294
|
+
export function generatedScenarioRequiresSerializedRootCheck(steps) {
|
|
295
|
+
return steps.some((step) => step.environmentNeedKind === "playwright-browser-assets");
|
|
296
|
+
}
|
|
279
297
|
export function generatedScenarioQualityGateSteps(manifest, scenario, projectDir, addedPackagePath, options) {
|
|
280
298
|
const normalizedOptions = normalizeRunnerOptions(options);
|
|
281
299
|
const steps = machineVerifiableNextStepsForPreset(scenario.basePreset, projectDir, manifest, normalizedOptions);
|
|
282
|
-
const addedEnvironmentSteps = addedPresetEnvironmentNeeds(manifest, scenario, projectDir, addedPackagePath, normalizedOptions)
|
|
300
|
+
const addedEnvironmentSteps = generatedScenarioEnvironmentNeedSteps(addedPresetEnvironmentNeeds(manifest, scenario, projectDir, addedPackagePath, normalizedOptions), projectDir);
|
|
283
301
|
const existingDisplays = new Set(steps.map((step) => step.display));
|
|
284
302
|
const extraEnvironmentSteps = addedEnvironmentSteps.filter((step) => !existingDisplays.has(step.display));
|
|
285
303
|
if (extraEnvironmentSteps.length === 0) {
|
|
@@ -297,7 +315,7 @@ export function generatedScenarioQualityGateSteps(manifest, scenario, projectDir
|
|
|
297
315
|
}
|
|
298
316
|
async function runGeneratedScenarioQualityGate(manifest, scenario, projectDir, addedPackagePath, options) {
|
|
299
317
|
const steps = generatedScenarioQualityGateSteps(manifest, scenario, projectDir, addedPackagePath, options);
|
|
300
|
-
const requiresSerializedPlaywrightRootCheck = steps
|
|
318
|
+
const requiresSerializedPlaywrightRootCheck = generatedScenarioRequiresSerializedRootCheck(steps);
|
|
301
319
|
for (const step of steps) {
|
|
302
320
|
const env = step.id === "run-root-check" ? { CI: "1" } : undefined;
|
|
303
321
|
const runStep = async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PackageManager, ProjectBlueprint } from "
|
|
1
|
+
import type { PackageManager, ProjectBlueprint } from "@ykdz/template-shared";
|
|
2
2
|
import type { ResolvedToolchainVersions } from "./toolchain-resolution.js";
|
|
3
3
|
export type ProjectName = {
|
|
4
4
|
readonly kind: "ProjectName";
|
|
@@ -13,6 +13,14 @@ export type CheckEnvironmentNeed = {
|
|
|
13
13
|
readonly kind: "playwright-browser-assets";
|
|
14
14
|
readonly browser: "chromium";
|
|
15
15
|
readonly owner: ComponentOwner;
|
|
16
|
+
readonly nextStep: {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly label: string;
|
|
19
|
+
readonly command: string;
|
|
20
|
+
readonly args: readonly string[];
|
|
21
|
+
readonly display: string;
|
|
22
|
+
readonly machineVerifiable: boolean;
|
|
23
|
+
};
|
|
16
24
|
};
|
|
17
25
|
export type CheckComponent = {
|
|
18
26
|
readonly kind: CheckComponentKind;
|
|
@@ -31,4 +39,14 @@ export type FixPlan = {
|
|
|
31
39
|
};
|
|
32
40
|
export declare function renderRootCheckCommand(plan: CheckPlan): string;
|
|
33
41
|
export declare function renderFixCommand(plan: FixPlan): string;
|
|
34
|
-
export declare function renderPlaywrightBrowserInstallCommand(need: CheckEnvironmentNeed
|
|
42
|
+
export declare function renderPlaywrightBrowserInstallCommand(need: CheckEnvironmentNeed, options?: {
|
|
43
|
+
readonly withDeps?: boolean;
|
|
44
|
+
}): string;
|
|
45
|
+
export declare function playwrightBrowserAssetsNextStepDescriptor(owner: ComponentOwner): Pick<CheckEnvironmentNeed["nextStep"], "id" | "label">;
|
|
46
|
+
export declare function playwrightBrowserAssetsEnvironmentNeed(options: {
|
|
47
|
+
readonly browser: "chromium";
|
|
48
|
+
readonly owner: ComponentOwner;
|
|
49
|
+
readonly id?: string;
|
|
50
|
+
readonly label?: string;
|
|
51
|
+
readonly machineVerifiable?: boolean;
|
|
52
|
+
}): CheckEnvironmentNeed;
|
|
@@ -58,9 +58,48 @@ export function renderRootCheckCommand(plan) {
|
|
|
58
58
|
export function renderFixCommand(plan) {
|
|
59
59
|
return plan.components.map(renderFixComponentCommand).join(" && ");
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
function playwrightBrowserInstallArgs(need, options = {}) {
|
|
62
|
+
const installArgs = [
|
|
63
|
+
"exec",
|
|
64
|
+
"playwright",
|
|
65
|
+
"install",
|
|
66
|
+
...(options.withDeps ? ["--with-deps"] : []),
|
|
67
|
+
need.browser,
|
|
68
|
+
];
|
|
62
69
|
if (need.owner.kind === "package-boundary" && need.owner.path !== ".") {
|
|
63
|
-
return
|
|
70
|
+
return ["--filter", `./${need.owner.path}`, ...installArgs];
|
|
64
71
|
}
|
|
65
|
-
return
|
|
72
|
+
return installArgs;
|
|
73
|
+
}
|
|
74
|
+
export function renderPlaywrightBrowserInstallCommand(need, options = {}) {
|
|
75
|
+
return ["pnpm", ...playwrightBrowserInstallArgs(need, options)].join(" ");
|
|
76
|
+
}
|
|
77
|
+
export function playwrightBrowserAssetsNextStepDescriptor(owner) {
|
|
78
|
+
if (owner.kind === "package-boundary" && owner.path !== ".") {
|
|
79
|
+
return {
|
|
80
|
+
id: `install-${owner.path.replaceAll("/", "-")}-playwright-browsers`,
|
|
81
|
+
label: `Install Playwright browser assets for ${owner.path} package`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
id: "install-workspace-playwright-browsers",
|
|
86
|
+
label: "Install Playwright browser assets for workspace",
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export function playwrightBrowserAssetsEnvironmentNeed(options) {
|
|
90
|
+
const args = playwrightBrowserInstallArgs(options);
|
|
91
|
+
const descriptor = playwrightBrowserAssetsNextStepDescriptor(options.owner);
|
|
92
|
+
return {
|
|
93
|
+
kind: "playwright-browser-assets",
|
|
94
|
+
browser: options.browser,
|
|
95
|
+
owner: options.owner,
|
|
96
|
+
nextStep: {
|
|
97
|
+
id: options.id ?? descriptor.id,
|
|
98
|
+
label: options.label ?? descriptor.label,
|
|
99
|
+
command: "pnpm",
|
|
100
|
+
args,
|
|
101
|
+
display: ["pnpm", ...args].join(" "),
|
|
102
|
+
machineVerifiable: options.machineVerifiable ?? true,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
66
105
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CheckEnvironmentNeed } from "./module-graph.js";
|
|
1
2
|
import type { PresetProjectionPlan } from "./preset-projection.js";
|
|
2
3
|
export type NextStepInstruction = {
|
|
3
4
|
readonly id: string;
|
|
@@ -8,6 +9,7 @@ export type NextStepInstruction = {
|
|
|
8
9
|
readonly cwd: string;
|
|
9
10
|
readonly display: string;
|
|
10
11
|
readonly machineVerifiable: boolean;
|
|
12
|
+
readonly environmentNeedKind?: CheckEnvironmentNeed["kind"];
|
|
11
13
|
};
|
|
12
14
|
export type NextStepInstructionPlan = {
|
|
13
15
|
readonly targetDir: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { renderPlaywrightBrowserInstallCommand } from "./module-graph.js";
|
|
2
1
|
function rootCheckInstruction() {
|
|
3
2
|
return {
|
|
4
3
|
id: "run-root-check",
|
|
@@ -70,27 +69,17 @@ function fixInstruction() {
|
|
|
70
69
|
};
|
|
71
70
|
}
|
|
72
71
|
function checkEnvironmentInstructions(plan) {
|
|
73
|
-
return plan.checkPlan.environmentNeeds.map((need) => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
? "Install Playwright browser assets for web workspace"
|
|
85
|
-
: "Install Playwright browser assets",
|
|
86
|
-
kind: "command",
|
|
87
|
-
command,
|
|
88
|
-
args,
|
|
89
|
-
cwd: "",
|
|
90
|
-
display,
|
|
91
|
-
machineVerifiable: true,
|
|
92
|
-
};
|
|
93
|
-
});
|
|
72
|
+
return plan.checkPlan.environmentNeeds.map((need) => ({
|
|
73
|
+
id: need.nextStep.id,
|
|
74
|
+
label: need.nextStep.label,
|
|
75
|
+
kind: "command",
|
|
76
|
+
command: need.nextStep.command,
|
|
77
|
+
args: need.nextStep.args,
|
|
78
|
+
cwd: "",
|
|
79
|
+
display: need.nextStep.display,
|
|
80
|
+
machineVerifiable: need.nextStep.machineVerifiable,
|
|
81
|
+
environmentNeedKind: need.kind,
|
|
82
|
+
}));
|
|
94
83
|
}
|
|
95
84
|
function projectionInstructions(plan) {
|
|
96
85
|
const steps = [installDependenciesInstruction()];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { PackageAdditionSupport as SharedPackageAdditionSupportType } from "@ykdz/template-shared";
|
|
1
2
|
export declare const PackageAdditionSupport: {
|
|
2
3
|
readonly Supported: "supported";
|
|
3
4
|
readonly Unsupported: "unsupported";
|
|
4
5
|
};
|
|
5
|
-
export type PackageAdditionSupport =
|
|
6
|
+
export type PackageAdditionSupport = SharedPackageAdditionSupportType;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { validateProjectBlueprint, } from "
|
|
3
|
+
import { validateProjectBlueprint, } from "@ykdz/template-shared";
|
|
4
|
+
import { PackageAdditionSupport, } from "@ykdz/template-shared";
|
|
4
5
|
import { collectGeneratedManifestCatalogReferences, pnpmWorkspaceYamlWithCatalogDependencies, } from "./dependency-catalog.js";
|
|
5
|
-
import { PackageAdditionSupport } from "./package-addition-support.js";
|
|
6
6
|
import { assertTypeScriptPackageBoundaryForLinkIntent, packageTurboTasks, planPackageLinks, } from "./package-linking.js";
|
|
7
7
|
import { findPresetSourceManifestPreset, } from "./preset-source.js";
|
|
8
8
|
import { defaultPackagePathForPresetSourcePackageAddition, planPresetSourcePackageAddition, } from "./projection-capabilities.js";
|
|
@@ -433,6 +433,7 @@ function rootPackageJsonWithPackageTaskFilters(input, blueprint, packageManifest
|
|
|
433
433
|
assertRootPackageJson(input);
|
|
434
434
|
const workspacePackageGlobs = workspacePackageGlobsFromBlueprint(blueprint);
|
|
435
435
|
const taskNames = turboTaskNamesForPackageManifests(packageManifests);
|
|
436
|
+
const rootCheckTaskNames = taskNames.filter((taskName) => taskName !== "test:e2e");
|
|
436
437
|
const checkScript = input.scripts.check;
|
|
437
438
|
const fixScript = input.scripts.fix;
|
|
438
439
|
if (checkScript === undefined || fixScript === undefined) {
|
|
@@ -444,7 +445,7 @@ function rootPackageJsonWithPackageTaskFilters(input, blueprint, packageManifest
|
|
|
444
445
|
...input.scripts,
|
|
445
446
|
check: rootScriptWithTurboPackageTasks({
|
|
446
447
|
script: checkScript,
|
|
447
|
-
taskNames,
|
|
448
|
+
taskNames: rootCheckTaskNames,
|
|
448
449
|
workspacePackageGlobs,
|
|
449
450
|
}),
|
|
450
451
|
fix: rootScriptWithTurboPackageTask(fixScript, "fix", workspacePackageGlobs),
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
1
|
+
import type { PackageLinkIntent, PackageRole, PackageSourcePreset } from "@ykdz/template-shared";
|
|
2
|
+
export type { PackageLinkIntent, PackageRole, PackageSourcePreset, } from "@ykdz/template-shared";
|
|
3
3
|
export type PackageDefinition = {
|
|
4
4
|
readonly name: string;
|
|
5
5
|
readonly path: string;
|
|
6
6
|
readonly role?: PackageRole;
|
|
7
7
|
readonly sourcePreset?: PackageSourcePreset;
|
|
8
8
|
};
|
|
9
|
-
export type PackageLinkIntent = {
|
|
10
|
-
readonly consumerPackagePath: string;
|
|
11
|
-
readonly providerPackagePath: string;
|
|
12
|
-
};
|
|
13
9
|
export type JitSourcePackageExposure = {
|
|
14
10
|
readonly kind: "jit-source";
|
|
15
11
|
readonly entrypoint: string;
|
|
@@ -75,7 +75,7 @@ export function packageTurboTasks({ dependencyBuildsRequired, }) {
|
|
|
75
75
|
"test:e2e": {
|
|
76
76
|
dependsOn: dependencyBuildsRequired ? ["build", "^build"] : ["build"],
|
|
77
77
|
},
|
|
78
|
-
check: { dependsOn: ["typecheck", "build", "test"
|
|
78
|
+
check: { dependsOn: ["typecheck", "build", "test"] },
|
|
79
79
|
fix: { cache: false },
|
|
80
80
|
};
|
|
81
81
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
packages:
|
|
2
2
|
- packages/*
|
|
3
3
|
|
|
4
|
+
nodeLinker: hoisted
|
|
5
|
+
|
|
4
6
|
catalog:
|
|
5
7
|
"@hono/node-server": ^2.0.6
|
|
6
8
|
"@playwright/test": ^1.61.1
|
|
@@ -9,7 +11,6 @@ catalog:
|
|
|
9
11
|
"@types/web-bluetooth": ^0.0.21
|
|
10
12
|
"@vitejs/plugin-vue": ^6.0.7
|
|
11
13
|
"@vue/tsconfig": ^0.9.1
|
|
12
|
-
"@vueuse/core": ^14.3.0
|
|
13
14
|
execa: ^9.6.1
|
|
14
15
|
hono: ^4.12.27
|
|
15
16
|
oxfmt: ^0.57.0
|
|
@@ -19,7 +20,7 @@ catalog:
|
|
|
19
20
|
tailwindcss: ^4.3.2
|
|
20
21
|
tsc-alias: ^1.8.17
|
|
21
22
|
tsx: ^4.22.4
|
|
22
|
-
turbo:
|
|
23
|
+
turbo: 2.10.2
|
|
23
24
|
typescript: ^6.0.3
|
|
24
25
|
valibot: ^1.4.2
|
|
25
26
|
vite: ^8.1.2
|
|
@@ -31,8 +32,5 @@ catalog:
|
|
|
31
32
|
allowBuilds:
|
|
32
33
|
esbuild: true
|
|
33
34
|
|
|
34
|
-
minimumReleaseAgeExclude:
|
|
35
|
-
- valibot@1.4.2
|
|
36
|
-
|
|
37
35
|
onlyBuiltDependencies:
|
|
38
36
|
- esbuild
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { BuiltInPreset, ProjectBlueprint } from "
|
|
1
|
+
import type { BuiltInPreset, PackageRole, PackageSourcePreset, ProjectBlueprint } from "@ykdz/template-shared";
|
|
2
2
|
import type { GenerationContext } from "./generation-context.js";
|
|
3
3
|
import { type CheckPlan, type FixPlan } from "./module-graph.js";
|
|
4
4
|
import { type NextStepInstruction } from "./next-step-instructions.js";
|
|
5
|
-
import type { PackageRole, PackageSourcePreset } from "./package-linking.js";
|
|
6
5
|
import type { DependencyMaintenancePolicy } from "./project-github.js";
|
|
7
6
|
import type { RenderOperation } from "./renderer.js";
|
|
8
7
|
export type PresetPackageAdditionOptions = {
|