@ykdz/template 0.2.0 → 0.3.0
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/application.d.ts +1 -1
- package/node_modules/@ykdz/default-content-authoring/dist/contracts.d.ts +2 -0
- package/node_modules/@ykdz/default-content-authoring/dist/preset-root-contribution.d.ts +1 -0
- package/node_modules/@ykdz/default-content-authoring/dist/reference-package.js +5 -2
- package/node_modules/@ykdz/default-content-authoring/package.json +2 -2
- package/node_modules/@ykdz/preset-rust-bin/native/package.json +2 -2
- package/node_modules/@ykdz/preset-ts-cli/native/package.json +2 -2
- package/node_modules/@ykdz/preset-ts-lib/native/package.json +2 -2
- package/node_modules/@ykdz/preset-vike-app/native/package.json +3 -3
- package/node_modules/@ykdz/preset-vike-app/native/resources/deployment/Dockerfile +5 -14
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.d.ts +1 -0
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.d.ts +1 -0
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.d.ts.map +1 -1
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.js +13 -1
- package/node_modules/@ykdz/preset-vike-app/package.json +1 -0
- package/node_modules/@ykdz/preset-vue-app/native/package.json +1 -1
- package/node_modules/@ykdz/preset-vue-hono-app/native/package.json +1 -1
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.d.ts +1 -0
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/reference-hono-api/native/package.json +0 -3
- package/node_modules/@ykdz/reference-npm-publication/native/package.json +0 -3
- package/node_modules/@ykdz/reference-npm-publication/native/resources/release.yml +15 -12
- package/node_modules/@ykdz/reference-rust-bin/native/package.json +1 -4
- package/node_modules/@ykdz/reference-tooling-config/native/package.json +0 -3
- package/node_modules/@ykdz/reference-ts-cli/native/package.json +1 -1
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/package-manifest.d.ts +1 -1
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/package-manifest.d.ts.map +1 -1
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/package-manifest.js +2 -2
- package/node_modules/@ykdz/reference-ts-lib/native/package.json +0 -3
- package/node_modules/@ykdz/reference-vike-db/native/package.json +0 -3
- package/node_modules/@ykdz/reference-vike-migrations/native/package.json +0 -3
- package/node_modules/@ykdz/reference-vike-web/native/package.json +0 -3
- package/node_modules/@ykdz/reference-vue-app/native/package.json +0 -3
- package/node_modules/@ykdz/reference-vue-hono-web/native/package.json +0 -3
- package/node_modules/@ykdz/reference-workspace-root/native/package.json +1 -5
- package/node_modules/@ykdz/reference-workspace-root/native/resources/environment/base.Dockerfile +10 -6
- package/node_modules/@ykdz/reference-workspace-root/native/resources/github/check.yml +7 -6
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment.d.ts +4 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment.d.ts.map +1 -1
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment.js +13 -2
- package/node_modules/@ykdz/template-core/package.json +1 -1
- package/node_modules/@ykdz/template-environment/dist/development-container-tool-layer.js +2 -2
- package/node_modules/@ykdz/template-environment/package.json +1 -1
- package/node_modules/@ykdz/template-generator/package.json +2 -2
- package/node_modules/@ykdz/template-workspace/dist/default-composition.js +22 -0
- package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.d.ts +1 -1
- package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.js +1 -1
- package/node_modules/@ykdz/template-workspace/dist/workspace-policy-snapshot.js +1 -1
- package/node_modules/@ykdz/template-workspace/package.json +2 -2
- package/node_modules/@ykdz/template-workspace-authoring/package.json +2 -2
- package/node_modules/@ykdz/tooling-config/package.json +1 -4
- package/package.json +4 -4
package/dist/application.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ export declare function listPresetCatalog(): PresetCatalogCommandResult;
|
|
|
128
128
|
* 初始化结果如实报告随 CLI 发版的不可变工具链快照:没有在线解析来源,也没有回退诊断。
|
|
129
129
|
*/
|
|
130
130
|
declare function toolchainReport(): {
|
|
131
|
-
nodeVersion: "
|
|
131
|
+
nodeVersion: "26.13.0";
|
|
132
132
|
packageManagerPin: "pnpm@12.9.1";
|
|
133
133
|
};
|
|
134
134
|
export declare function validateBlueprintFile(filePath: string, runtime: ApplicationRuntime): Promise<BlueprintValidationCommandResult>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PackageDefinition } from "@ykdz/template-core/project-blueprint";
|
|
2
|
+
import type { ProjectProjectionMirrorSlot } from "@ykdz/template-core/project-projection";
|
|
2
3
|
import type { PackageBinding } from "@ykdz/template-core/reference-package";
|
|
3
4
|
import type { TemplateSourceHandle } from "@ykdz/template-core/template-source";
|
|
4
5
|
import type { NativeContentManifest } from "@ykdz/template-workspace-authoring/content-artifact";
|
|
@@ -24,6 +25,7 @@ export type DefaultNativeDocument = {
|
|
|
24
25
|
readonly sourcePath: string;
|
|
25
26
|
};
|
|
26
27
|
export type DefaultCompositionFile = {
|
|
28
|
+
readonly mirrorSlots?: readonly ProjectProjectionMirrorSlot[];
|
|
27
29
|
readonly path: string;
|
|
28
30
|
readonly content: Uint8Array;
|
|
29
31
|
readonly mode: number;
|
|
@@ -28,6 +28,7 @@ export type DefaultPresetRootContributionOwner<OwnerFacts = unknown> = Readonly<
|
|
|
28
28
|
/** 仅包含该持久选择的节点,按 nodeIdentity 索引。 */
|
|
29
29
|
readonly selectedPackages: ReadonlyMap<string, DefaultPresetPackageEvaluation>;
|
|
30
30
|
readonly rootPackage: CompositionPackage;
|
|
31
|
+
readonly rootManifest: Readonly<Record<string, unknown>>;
|
|
31
32
|
readonly ownerFacts: OwnerFacts;
|
|
32
33
|
}>): Readonly<{
|
|
33
34
|
readonly rootPackageDefinitionId: PackageDefinitionId;
|
|
@@ -281,10 +281,13 @@ function outputManifest(options) {
|
|
|
281
281
|
}
|
|
282
282
|
manifest[field] = dependencies;
|
|
283
283
|
}
|
|
284
|
-
if (isRecord(
|
|
284
|
+
if (isRecord(options.stableCommon)) {
|
|
285
285
|
const nodeDeclaration = options.stableCommon.nodeDeclaration;
|
|
286
286
|
if (typeof nodeDeclaration === "string") {
|
|
287
|
-
manifest.engines = {
|
|
287
|
+
manifest.engines = {
|
|
288
|
+
...(isRecord(manifest.engines) ? manifest.engines : {}),
|
|
289
|
+
node: `^${nodeDeclaration}`,
|
|
290
|
+
};
|
|
288
291
|
}
|
|
289
292
|
}
|
|
290
293
|
return Object.freeze(manifest);
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"yaml": "^2.9.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@types/node": "^
|
|
43
|
+
"@types/node": "^26.0.0",
|
|
44
44
|
"@ykdz/tooling-config": "0.0.0",
|
|
45
45
|
"oxfmt": "^0.74.0",
|
|
46
46
|
"oxlint": "^1.89.0",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"lint": "oxlint --quiet --format=unix .",
|
|
55
55
|
"lint:fix": "oxlint --format=unix . --fix",
|
|
56
56
|
"typecheck": "tsc -p tsconfig.node.json --noEmit --pretty false",
|
|
57
|
-
"test": "node --conditions=source --
|
|
57
|
+
"test": "node --conditions=source --test --test-concurrency=2 --test-timeout=60000 --test-reporter=spec 'test/**/*.light.test.ts'"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"format:write": "oxfmt --write .",
|
|
23
23
|
"lint": "oxlint --quiet --format=unix --ignore-pattern template-dist .",
|
|
24
24
|
"lint:fix": "oxlint --format=unix --ignore-pattern template-dist . --fix",
|
|
25
|
-
"test": "node --conditions=source --
|
|
26
|
-
"test:integration": "node --conditions=source --
|
|
25
|
+
"test": "node --conditions=source --test --test-concurrency=2 --test-timeout=60000 'test/**/*.light.test.ts'",
|
|
26
|
+
"test:integration": "node --conditions=source --test --test-concurrency=1 --test-timeout=300000 'test/**/*.integration.test.ts'",
|
|
27
27
|
"typecheck": "tsc -p tsconfig.json --noEmit --pretty false"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"format:write": "oxfmt --write .",
|
|
23
23
|
"lint": "oxlint --quiet --format=unix --ignore-pattern template-dist .",
|
|
24
24
|
"lint:fix": "oxlint --format=unix --ignore-pattern template-dist . --fix",
|
|
25
|
-
"test": "node --conditions=source --
|
|
26
|
-
"test:integration": "node --conditions=source --
|
|
25
|
+
"test": "node --conditions=source --test --test-concurrency=2 --test-timeout=60000 'test/**/*.light.test.ts'",
|
|
26
|
+
"test:integration": "node --conditions=source --test --test-concurrency=1 --test-timeout=600000 'test/**/*.integration.test.ts'",
|
|
27
27
|
"typecheck": "tsc -p tsconfig.json --noEmit --pretty false"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"format:write": "oxfmt --write .",
|
|
23
23
|
"lint": "oxlint --quiet --format=unix --ignore-pattern template-dist .",
|
|
24
24
|
"lint:fix": "oxlint --format=unix --ignore-pattern template-dist . --fix",
|
|
25
|
-
"test": "node --conditions=source --
|
|
26
|
-
"test:integration": "node --conditions=source --
|
|
25
|
+
"test": "node --conditions=source --test --test-concurrency=2 --test-timeout=60000 'test/**/*.light.test.ts'",
|
|
26
|
+
"test:integration": "node --conditions=source --test --test-concurrency=1 --test-timeout=300000 'test/**/*.integration.test.ts'",
|
|
27
27
|
"typecheck": "tsc -p tsconfig.json --noEmit --pretty false"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
@@ -27,14 +27,15 @@
|
|
|
27
27
|
"format:write": "oxfmt --write .",
|
|
28
28
|
"lint": "oxlint --quiet --format=unix --ignore-pattern template-dist .",
|
|
29
29
|
"lint:fix": "oxlint --format=unix --ignore-pattern template-dist . --fix",
|
|
30
|
-
"test": "node --conditions=source --
|
|
31
|
-
"test:integration": "node --conditions=source --
|
|
30
|
+
"test": "node --conditions=source --test --test-concurrency=2 --test-timeout=60000 'test/**/*.light.test.ts'",
|
|
31
|
+
"test:integration": "node --conditions=source --test --test-concurrency=1 --test-timeout=300000 'test/**/*.integration.test.ts'",
|
|
32
32
|
"typecheck": "tsc -p tsconfig.node.json --noEmit --pretty false && tsc -p tsconfig.scripts.json --noEmit --pretty false"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ykdz/reference-vike-db": "workspace:*",
|
|
36
36
|
"@ykdz/reference-vike-migrations": "workspace:*",
|
|
37
37
|
"@ykdz/reference-vike-web": "workspace:*",
|
|
38
|
+
"@ykdz/reference-workspace-root": "workspace:*",
|
|
38
39
|
"@ykdz/template-core": "workspace:*",
|
|
39
40
|
"@ykdz/template-workspace": "workspace:*",
|
|
40
41
|
"@ykdz/template-workspace-authoring": "workspace:*",
|
|
@@ -46,7 +47,6 @@
|
|
|
46
47
|
"@ykdz/reference-npm-publication": "workspace:*",
|
|
47
48
|
"@ykdz/reference-tooling-config": "workspace:*",
|
|
48
49
|
"@ykdz/reference-ts-lib": "workspace:*",
|
|
49
|
-
"@ykdz/reference-workspace-root": "workspace:*",
|
|
50
50
|
"@ykdz/template-generator": "workspace:*",
|
|
51
51
|
"@ykdz/tooling-config": "workspace:*",
|
|
52
52
|
"execa": "catalog:",
|
|
@@ -8,21 +8,12 @@ FROM node:${NODE_VERSION}-bookworm-slim AS base
|
|
|
8
8
|
ARG APPLICATION_PACKAGE_NAME
|
|
9
9
|
ARG DATABASE_PACKAGE_NAME
|
|
10
10
|
ARG MIGRATION_PACKAGE_NAME
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
# @template-mirror pnpm-bootstrap
|
|
12
|
+
COPY --from=ghcr.io/pnpm/pnpm:__PNPM_VERSION__ /opt/pnpm /opt/pnpm
|
|
13
|
+
# @end-template-mirror
|
|
14
|
+
RUN for bin in pnpm pn pnpx pnx; do ln -s "/opt/pnpm/pnpm" "/usr/local/bin/$bin"; done
|
|
14
15
|
WORKDIR /repo
|
|
15
|
-
COPY package.json
|
|
16
|
-
RUN install -d -m 0755 "$COREPACK_HOME" "$PNPM_HOME" "$PNPM_HOME/bin" \
|
|
17
|
-
&& corepack enable --install-directory "$PNPM_HOME" \
|
|
18
|
-
&& package_manager="$(node -p "require('/root-manifest.json').packageManager")" \
|
|
19
|
-
&& rm /root-manifest.json \
|
|
20
|
-
&& for attempt in 1 2 3; do \
|
|
21
|
-
if corepack prepare "$package_manager" --activate; then break; fi; \
|
|
22
|
-
[ "$attempt" -lt 3 ] || exit 1; \
|
|
23
|
-
sleep 2; \
|
|
24
|
-
done \
|
|
25
|
-
&& chmod -R a+rX "$COREPACK_HOME" "$PNPM_HOME"
|
|
16
|
+
COPY package.json ./
|
|
26
17
|
|
|
27
18
|
FROM base AS pruner
|
|
28
19
|
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
@@ -42,6 +42,7 @@ export declare const preset: Readonly<{
|
|
|
42
42
|
readonly selection: import("@ykdz/template-core/generation-record").GenerationRecordSelection;
|
|
43
43
|
readonly selectedPackages: ReadonlyMap<string, import("@ykdz/default-content-authoring/preset-root-contribution").DefaultPresetPackageEvaluation>;
|
|
44
44
|
readonly rootPackage: import("@ykdz/template-core/composition").CompositionPackage;
|
|
45
|
+
readonly rootManifest: Readonly<Record<string, unknown>>;
|
|
45
46
|
readonly ownerFacts: VikeDeploymentOwnerFacts;
|
|
46
47
|
}) => {
|
|
47
48
|
readonly rootPackageDefinitionId: import("@ykdz/template-core/composition").CompositionPackage["packageDefinitionId"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../template/definition.ts"],"names":[],"mappings":"AAiBA,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAwCzB,oCAAoC;AACpC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;YAhCL,SAAS
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../template/definition.ts"],"names":[],"mappings":"AAiBA,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAwCzB,oCAAoC;AACpC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;YAhCL,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCrB,CAAC"}
|
|
@@ -44,6 +44,7 @@ declare function composeVikeDeploymentContribution(options: {
|
|
|
44
44
|
readonly selection: GenerationRecordSelection;
|
|
45
45
|
readonly selectedPackages: ReadonlyMap<string, DefaultPresetPackageEvaluation>;
|
|
46
46
|
readonly rootPackage: CompositionPackage;
|
|
47
|
+
readonly rootManifest: Readonly<Record<string, unknown>>;
|
|
47
48
|
readonly ownerFacts: VikeDeploymentOwnerFacts;
|
|
48
49
|
}): {
|
|
49
50
|
readonly rootPackageDefinitionId: CompositionPackage["packageDefinitionId"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../template/deployment.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAKV,0BAA0B,EAC3B,MAAM,2CAA2C,CAAC;AAKnD,OAAO,KAAK,EACV,8BAA8B,EAE/B,MAAM,0DAA0D,CAAC;
|
|
1
|
+
{"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../template/deployment.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAKV,0BAA0B,EAC3B,MAAM,2CAA2C,CAAC;AAKnD,OAAO,KAAK,EACV,8BAA8B,EAE/B,MAAM,0DAA0D,CAAC;AAIlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,E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M,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,yBAAyB,CAAC;IAC/C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CACrE,GAAG,OAAO,CAAC;IACV,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC;IAC9C,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,6BAA6B,EAAE,CAAC;CAC/D,CAAC,CAoCD;AA4HD,sCAAsC;AACtC,iBAAS,iCAAiC,CAAC,OAAO,EAAE;IAClD,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;IAC9C,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CACpC,MAAM,EACN,8BAA8B,CAC/B,CAAC;IACF,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC;CAC/C,GAAG;IACF,QAAQ,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;IAC5E,QAAQ,CAAC,eAAe,EAAE,0BAA0B,CAAC;CACtD,CAsIA;AAED,eAAO,MAAM,oBAAoB;;;EAGwC,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
import { dockerEngineEnvironmentNeed, shellCheckEnvironmentNeed, } from "@ykdz/default-content-authoring/environment-needs";
|
|
5
5
|
import { databaseDependencyKey as migrationsDatabaseDependencyKey } from "@ykdz/reference-vike-migrations/template";
|
|
6
6
|
import { databaseDependencyKey as webDatabaseDependencyKey } from "@ykdz/reference-vike-web/template";
|
|
7
|
+
import { projectPnpmBootstrapDockerfile } from "@ykdz/reference-workspace-root/environment";
|
|
7
8
|
import { contentIdentityKey, } from "@ykdz/template-core/content-identity";
|
|
8
9
|
import { resolveTemplateSource, createTemplateSourceHandle, } from "@ykdz/template-core/template-source";
|
|
9
10
|
import { YAMLMap, parseDocument } from "yaml";
|
|
@@ -397,6 +398,9 @@ function composeVikeDeploymentContribution(options) {
|
|
|
397
398
|
});
|
|
398
399
|
}
|
|
399
400
|
const resources = options.ownerFacts.resources;
|
|
401
|
+
const packageManagerPin = options.rootManifest.packageManager;
|
|
402
|
+
if (typeof packageManagerPin !== "string")
|
|
403
|
+
throw new Error("Vike 部署缺少根 packageManager 声明");
|
|
400
404
|
const buildxStep = parseVikeBuildxStep(resources.buildxStepSource);
|
|
401
405
|
const rootDeclaration = Object.freeze({
|
|
402
406
|
manifest: Object.freeze({
|
|
@@ -418,7 +422,15 @@ function composeVikeDeploymentContribution(options) {
|
|
|
418
422
|
"//#deployment": deploymentTask(application.package.definition, database.package.definition, migrations.package.definition),
|
|
419
423
|
}),
|
|
420
424
|
files: Object.freeze([
|
|
421
|
-
|
|
425
|
+
{
|
|
426
|
+
...rootFile("Dockerfile", projectPnpmBootstrapDockerfile(resources.dockerfile, packageManagerPin), resources.dockerfileMode, "resources/deployment/Dockerfile"),
|
|
427
|
+
mirrorSlots: [
|
|
428
|
+
{
|
|
429
|
+
id: "pnpm-bootstrap",
|
|
430
|
+
location: { kind: "text-anchor", name: "pnpm-bootstrap" },
|
|
431
|
+
},
|
|
432
|
+
],
|
|
433
|
+
},
|
|
422
434
|
rootFile(".dockerignore", resources.dockerIgnore, resources.dockerIgnoreMode, "resources/deployment/container.dockerignore"),
|
|
423
435
|
rootFile("scripts/check-standalone-deployment.ts", transformVikeDeploymentChecker(resources.checkerSource, {
|
|
424
436
|
applicationName: application.package.definition.name,
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"@ykdz/reference-vike-db": "0.0.0",
|
|
17
17
|
"@ykdz/reference-vike-migrations": "0.0.0",
|
|
18
18
|
"@ykdz/reference-vike-web": "0.0.0",
|
|
19
|
+
"@ykdz/reference-workspace-root": "0.0.0",
|
|
19
20
|
"@ykdz/template-core": "0.0.0",
|
|
20
21
|
"@ykdz/template-workspace": "0.0.0",
|
|
21
22
|
"@ykdz/template-workspace-authoring": "0.0.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"format:write": "oxfmt --write .",
|
|
23
23
|
"lint": "oxlint --quiet --format=unix --ignore-pattern template-dist .",
|
|
24
24
|
"lint:fix": "oxlint --format=unix --ignore-pattern template-dist . --fix",
|
|
25
|
-
"test": "node --conditions=source --
|
|
25
|
+
"test": "node --conditions=source --test --test-concurrency=2 --test-timeout=60000 'test/**/*.light.test.ts'",
|
|
26
26
|
"typecheck": "tsc -p tsconfig.json --noEmit --pretty false"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"format:write": "oxfmt --write .",
|
|
24
24
|
"lint": "oxlint --quiet --format=unix --ignore-pattern template-dist .",
|
|
25
25
|
"lint:fix": "oxlint --format=unix --ignore-pattern template-dist . --fix",
|
|
26
|
-
"test": "node --conditions=source --
|
|
26
|
+
"test": "node --conditions=source --test --test-concurrency=2 --test-timeout=60000 'test/**/*.light.test.ts'",
|
|
27
27
|
"test:e2e": "playwright test --config resources/joint-e2e/playwright.config.ts",
|
|
28
28
|
"typecheck": "tsc -p tsconfig.json --noEmit --pretty false"
|
|
29
29
|
},
|
|
@@ -46,6 +46,7 @@ export declare const preset: Readonly<{
|
|
|
46
46
|
readonly selection: import("@ykdz/template-core/generation-record").GenerationRecordSelection;
|
|
47
47
|
readonly selectedPackages: ReadonlyMap<string, import("@ykdz/default-content-authoring/preset-root-contribution").DefaultPresetPackageEvaluation>;
|
|
48
48
|
readonly rootPackage: import("@ykdz/template-core/composition").CompositionPackage;
|
|
49
|
+
readonly rootManifest: Readonly<Record<string, unknown>>;
|
|
49
50
|
readonly ownerFacts: Readonly<{
|
|
50
51
|
readonly resources: readonly import("./joint-e2e.ts").VueHonoJointE2eResourceSnapshot[];
|
|
51
52
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../template/definition.ts"],"names":[],"mappings":"AAwFA,mCAAmC;AACnC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;YA1BN,SAAS
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../template/definition.ts"],"names":[],"mappings":"AAwFA,mCAAmC;AACnC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;YA1BN,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BpB,CAAC;AAEH,YAAY,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -25,13 +25,14 @@ jobs:
|
|
|
25
25
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
26
26
|
with:
|
|
27
27
|
persist-credentials: false
|
|
28
|
-
- name:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
uses: pnpm/action-setup@d9184bf108216479bc5a137cc391f4d7b14c870b # v6.1.0
|
|
28
|
+
- name: 读取 Node 版本
|
|
29
|
+
id: node-runtime
|
|
30
|
+
run: echo "runtime=node@$(jq -er '.engines.node' package.json)" >> "$GITHUB_OUTPUT"
|
|
31
|
+
- name: 安装 pnpm 与 Node.js
|
|
32
|
+
uses: pnpm/setup@fa36a5ef7dcdefc3a7cb25655c122e00cf6e636e # v3.1.2
|
|
34
33
|
with:
|
|
34
|
+
runtime: ${{ steps.node-runtime.outputs.runtime }}
|
|
35
|
+
install: false
|
|
35
36
|
cache: true
|
|
36
37
|
- name: 安装依赖
|
|
37
38
|
run: pnpm install --frozen-lockfile
|
|
@@ -58,13 +59,15 @@ jobs:
|
|
|
58
59
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
59
60
|
with:
|
|
60
61
|
persist-credentials: false
|
|
61
|
-
- name:
|
|
62
|
-
|
|
62
|
+
- name: 读取 Node 版本
|
|
63
|
+
id: node-runtime
|
|
64
|
+
run: echo "runtime=node@$(jq -er '.engines.node' package.json)" >> "$GITHUB_OUTPUT"
|
|
65
|
+
- name: 安装 pnpm 与 Node.js
|
|
66
|
+
uses: pnpm/setup@fa36a5ef7dcdefc3a7cb25655c122e00cf6e636e # v3.1.2
|
|
63
67
|
with:
|
|
64
|
-
node-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
uses: pnpm/action-setup@d9184bf108216479bc5a137cc391f4d7b14c870b # v6.1.0
|
|
68
|
+
runtime: ${{ steps.node-runtime.outputs.runtime }}
|
|
69
|
+
install: false
|
|
70
|
+
cache: false
|
|
68
71
|
- name: 安装依赖
|
|
69
72
|
run: pnpm install --frozen-lockfile --ignore-scripts
|
|
70
73
|
- name: 发布已打包版本
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"format:write": "cargo fmt --all && oxfmt --write .",
|
|
27
27
|
"lint": "cargo clippy --workspace --all-targets -- -D warnings && oxlint --quiet --format=unix --ignore-pattern node_modules --ignore-pattern target .",
|
|
28
28
|
"lint:fix": "oxlint --format=unix --ignore-pattern node_modules --ignore-pattern target . --fix",
|
|
29
|
-
"test": "cargo test --workspace && node --conditions=source --
|
|
29
|
+
"test": "cargo test --workspace && node --conditions=source --test --test-reporter=spec 'test/**/*.light.test.ts'",
|
|
30
30
|
"typecheck": "tsc -p tsconfig.json --noEmit --pretty false"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -41,8 +41,5 @@
|
|
|
41
41
|
"oxlint-tsgolint": "catalog:",
|
|
42
42
|
"smol-toml": "catalog:",
|
|
43
43
|
"typescript-7": "catalog:"
|
|
44
|
-
},
|
|
45
|
-
"engines": {
|
|
46
|
-
"node": "24"
|
|
47
44
|
}
|
|
48
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manifest.d.ts","sourceRoot":"","sources":["../template/package-manifest.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"package-manifest.d.ts","sourceRoot":"","sources":["../template/package-manifest.ts"],"names":[],"mappings":"AAIA,qCAAqC;AACrC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IACjD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAyBpC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function isRecord(value) {
|
|
2
2
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
3
|
}
|
|
4
|
-
/**
|
|
4
|
+
/** 按目标命令名和工作区已测 Node 基线转换 CLI 清单。 */
|
|
5
5
|
export function projectCliPackageManifest(options) {
|
|
6
6
|
if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(options.commandName)) {
|
|
7
7
|
throw new Error("CLI 命令名必须使用小写 ASCII 字母、数字及单个连字符。");
|
|
@@ -23,6 +23,6 @@ export function projectCliPackageManifest(options) {
|
|
|
23
23
|
return {
|
|
24
24
|
...options.manifest,
|
|
25
25
|
bin: { [options.commandName]: entry[1] },
|
|
26
|
-
engines: { node:
|
|
26
|
+
engines: { node: `^${options.nodeDeclaration}` },
|
|
27
27
|
};
|
|
28
28
|
}
|
package/node_modules/@ykdz/reference-workspace-root/native/resources/environment/base.Dockerfile
CHANGED
|
@@ -2,9 +2,11 @@ ARG NODE_VERSION
|
|
|
2
2
|
FROM node:${NODE_VERSION}-bookworm-slim
|
|
3
3
|
|
|
4
4
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
5
|
-
|
|
6
|
-
ENV PATH="
|
|
7
|
-
|
|
5
|
+
# 覆盖镜像支持的两个用户,非交互命令也能直接执行全局工具。
|
|
6
|
+
ENV PATH="/root/.local/share/pnpm/bin:/home/node/.local/share/pnpm/bin:$PATH"
|
|
7
|
+
# @template-mirror pnpm-bootstrap
|
|
8
|
+
COPY --from=ghcr.io/pnpm/pnpm:__PNPM_VERSION__ /opt/pnpm /opt/pnpm
|
|
9
|
+
# @end-template-mirror
|
|
8
10
|
RUN apt-get update \
|
|
9
11
|
&& apt-get install -y --no-install-recommends \
|
|
10
12
|
bubblewrap \
|
|
@@ -22,6 +24,8 @@ RUN apt-get update \
|
|
|
22
24
|
unzip \
|
|
23
25
|
&& rm -rf /var/lib/apt/lists/* \
|
|
24
26
|
&& git config --system init.defaultBranch main \
|
|
25
|
-
&&
|
|
26
|
-
&&
|
|
27
|
-
&&
|
|
27
|
+
&& for bin in pnpm pn pnpx pnx; do ln -s "/opt/pnpm/pnpm" "/usr/local/bin/$bin"; done \
|
|
28
|
+
&& install -d /pnpm/store/root /root/.local/share/pnpm \
|
|
29
|
+
&& install -d -o node -g node /pnpm/store/node /home/node/.local/share/pnpm \
|
|
30
|
+
&& pnpm config set store-dir /pnpm/store/root --global \
|
|
31
|
+
&& su -s /bin/sh node -c 'pnpm config set store-dir /pnpm/store/node --global'
|
|
@@ -24,13 +24,14 @@ jobs:
|
|
|
24
24
|
with:
|
|
25
25
|
persist-credentials: false
|
|
26
26
|
fetch-depth: 1
|
|
27
|
-
- name:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
uses: pnpm/action-setup@d9184bf108216479bc5a137cc391f4d7b14c870b # v6.1.0
|
|
27
|
+
- name: 读取 Node 版本
|
|
28
|
+
id: node-runtime
|
|
29
|
+
run: echo "runtime=node@$(jq -er '.engines.node' package.json)" >> "$GITHUB_OUTPUT"
|
|
30
|
+
- name: 安装 pnpm 与 Node.js
|
|
31
|
+
uses: pnpm/setup@fa36a5ef7dcdefc3a7cb25655c122e00cf6e636e # v3.1.2
|
|
33
32
|
with:
|
|
33
|
+
runtime: ${{ steps.node-runtime.outputs.runtime }}
|
|
34
|
+
install: false
|
|
34
35
|
cache: true
|
|
35
36
|
- name: Install dependencies
|
|
36
37
|
run: pnpm install --frozen-lockfile
|
|
@@ -15,6 +15,7 @@ export type PreparedWorkspaceDevelopmentContainerResources = {
|
|
|
15
15
|
export declare function prepareWorkspaceDevelopmentContainerResources(): PreparedWorkspaceDevelopmentContainerResources;
|
|
16
16
|
declare function completeWorkspaceDevelopmentContainer(options: {
|
|
17
17
|
readonly nodeVersion: string;
|
|
18
|
+
readonly packageManagerPin: string;
|
|
18
19
|
readonly layers?: readonly DevelopmentContainerToolLayer[];
|
|
19
20
|
readonly resources: PreparedWorkspaceDevelopmentContainerResources;
|
|
20
21
|
}): DevelopmentContainerToolLayerPlan & {
|
|
@@ -25,6 +26,7 @@ declare function completeWorkspaceDevelopmentContainer(options: {
|
|
|
25
26
|
/** 只消费根环境快照和所选能力,投影开发容器配置。 */
|
|
26
27
|
export declare function projectWorkspaceDevelopmentContainer(options: {
|
|
27
28
|
readonly nodeVersion: string;
|
|
29
|
+
readonly packageManagerPin: string;
|
|
28
30
|
readonly layers?: readonly DevelopmentContainerToolLayer[];
|
|
29
31
|
readonly resources: PreparedWorkspaceDevelopmentContainerResources;
|
|
30
32
|
}): ReturnType<typeof completeWorkspaceDevelopmentContainer>;
|
|
@@ -33,4 +35,6 @@ export declare function shellCheckDevelopmentContainerToolLayer(): DevelopmentCo
|
|
|
33
35
|
export declare function prepareWorkspaceEditorCustomizationDeclarations(): EditorCustomizationDeclarations;
|
|
34
36
|
/** 只组合已准备的编辑器声明与实际能力。 */
|
|
35
37
|
export declare function projectWorkspaceEditorCustomization(capabilities: readonly EditorCustomizationCapability[], declarations: EditorCustomizationDeclarations): EditorCustomization;
|
|
38
|
+
/** 原生安装镜像是根包管理器声明的派生值。 */
|
|
39
|
+
export declare function projectPnpmBootstrapDockerfile(source: string, packageManagerPin: string): string;
|
|
36
40
|
//# sourceMappingURL=environment.d.ts.map
|
package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../template/environment.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,6BAA6B,EAClC,KAAK,iCAAiC,EACvC,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EACrC,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kCAAkC,EAClC,mCAAmC,GACpC,MAAM,2BAA2B,CAAC;AAEnC,wBAAgB,sCAAsC,IAAI,6BAA6B,CAgBtF;AAED,0BAA0B;AAC1B,wBAAgB,wCAAwC,CACtD,qBAAqB,EAAE,MAAM,GAC5B,6BAA6B,CA4B/B;AAED,MAAM,MAAM,8CAA8C,GAAG;IAC3D,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;QAC1D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;KACtE,CAAC;IACF,QAAQ,CAAC,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChE,CAAC;AASF,sCAAsC;AACtC,wBAAgB,6CAA6C,IAAI,8CAA8C,CAwC9G;AAuDD,iBAAS,qCAAqC,CAAC,OAAO,EAAE;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAC3D,QAAQ,CAAC,SAAS,EAAE,8CA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|
githubCliDevelopmentContainerToolLayer(),
|
|
138
138
|
...(options.layers ?? []),
|
|
139
139
|
];
|
|
140
|
+
const fragmentTexts = {
|
|
141
|
+
...options.resources.dockerfileFragments,
|
|
142
|
+
"base.Dockerfile": projectPnpmBootstrapDockerfile(options.resources.dockerfileFragments["base.Dockerfile"], options.packageManagerPin),
|
|
143
|
+
};
|
|
140
144
|
const plan = planDevelopmentContainerToolLayersFromTexts({
|
|
141
145
|
baseLayer: baseDevelopmentContainerToolLayer(options.nodeVersion),
|
|
142
146
|
layers,
|
|
143
|
-
fragmentTexts
|
|
147
|
+
fragmentTexts,
|
|
144
148
|
});
|
|
145
149
|
return {
|
|
146
150
|
...plan,
|
|
@@ -148,7 +152,7 @@ function completeWorkspaceDevelopmentContainer(options) {
|
|
|
148
152
|
features: options.resources.configuration.features,
|
|
149
153
|
dockerfile: developmentContainerDockerfileFromText({
|
|
150
154
|
layers: plan.layers,
|
|
151
|
-
fragmentTexts
|
|
155
|
+
fragmentTexts,
|
|
152
156
|
}),
|
|
153
157
|
probes: [
|
|
154
158
|
...plan.probes,
|
|
@@ -208,3 +212,10 @@ export function projectWorkspaceEditorCustomization(capabilities, declarations)
|
|
|
208
212
|
}
|
|
209
213
|
return editorCustomizationForCapabilities(capabilities, declarations);
|
|
210
214
|
}
|
|
215
|
+
/** 原生安装镜像是根包管理器声明的派生值。 */
|
|
216
|
+
export function projectPnpmBootstrapDockerfile(source, packageManagerPin) {
|
|
217
|
+
const version = /^pnpm@(\d+\.\d+\.\d+)$/u.exec(packageManagerPin)?.[1];
|
|
218
|
+
if (version === undefined)
|
|
219
|
+
throw new Error("pnpm 安装要求根 packageManager 声明精确版本");
|
|
220
|
+
return source.replaceAll("ghcr.io/pnpm/pnpm:__PNPM_VERSION__", `ghcr.io/pnpm/pnpm:${version}`);
|
|
221
|
+
}
|
|
@@ -129,13 +129,13 @@ function validateDockerfileFragment(fragment) {
|
|
|
129
129
|
}
|
|
130
130
|
const instructions = parseLogicalDockerfileInstructions(fragment.text, fragment.from);
|
|
131
131
|
const allowedInstructions = fragment.kind === "base"
|
|
132
|
-
? new Set(["ARG", "ENV", "FROM", "RUN", "SHELL"])
|
|
132
|
+
? new Set(["ARG", "ENV", "FROM", "RUN", "SHELL", "COPY"])
|
|
133
133
|
: new Set(["ARG", "ENV", "RUN"]);
|
|
134
134
|
for (const instruction of instructions) {
|
|
135
135
|
if (!allowedInstructions.has(instruction.name)) {
|
|
136
136
|
const role = fragment.kind === "base" ? "base" : "optional";
|
|
137
137
|
const allowed = fragment.kind === "base"
|
|
138
|
-
? "ARG, ENV, FROM, RUN, and
|
|
138
|
+
? "ARG, ENV, FROM, RUN, SHELL, and COPY"
|
|
139
139
|
: "ARG, ENV, and RUN";
|
|
140
140
|
throw new Error(`Development Container Tool Layer ${fragment.identity} ${role} fragment ${fragment.from} must not use Dockerfile instruction ${instruction.name}; allowed instructions are ${allowed}.`);
|
|
141
141
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@ykdz/template-core": "0.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/node": "^
|
|
25
|
+
"@types/node": "^26.0.0",
|
|
26
26
|
"oxfmt": "^0.74.0",
|
|
27
27
|
"oxlint": "^1.89.0",
|
|
28
28
|
"oxlint-tsgolint": "^7.0.2001",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"format:write": "oxfmt --write .",
|
|
35
35
|
"lint": "oxlint --quiet --format=unix --ignore-pattern dist .",
|
|
36
36
|
"lint:fix": "oxlint --format=unix --ignore-pattern dist . --fix",
|
|
37
|
-
"test": "node --conditions=source --
|
|
37
|
+
"test": "node --conditions=source --test --test-concurrency=2 --test-timeout=60000 'test/**/*.light.test.ts'",
|
|
38
38
|
"typecheck": "tsc -p tsconfig.json --noEmit --pretty false",
|
|
39
39
|
"test:integration": "node --test --test-concurrency=1 --test-timeout=300000 'test/**/*.integration.test.ts'"
|
|
40
40
|
}
|
|
@@ -81,6 +81,7 @@ function composePresetRootContributionDeclarations(options) {
|
|
|
81
81
|
selection,
|
|
82
82
|
selectedPackages,
|
|
83
83
|
rootPackage,
|
|
84
|
+
rootManifest: rootPackages[0].contribution.facts.manifest,
|
|
84
85
|
ownerFacts,
|
|
85
86
|
});
|
|
86
87
|
if (composition.rootPackageDefinitionId !== rootPackage.packageDefinitionId) {
|
|
@@ -711,6 +712,9 @@ function compositionFilesForRoot(options) {
|
|
|
711
712
|
reconciliation: {
|
|
712
713
|
path: target,
|
|
713
714
|
driver: /\.(?:json|jsonc)$/u.test(target) ? "structured" : "text",
|
|
715
|
+
...(file.mirrorSlots === undefined
|
|
716
|
+
? {}
|
|
717
|
+
: { mirrorSlots: file.mirrorSlots }),
|
|
714
718
|
},
|
|
715
719
|
});
|
|
716
720
|
};
|
|
@@ -1115,6 +1119,7 @@ export function createDefaultComposition(options) {
|
|
|
1115
1119
|
};
|
|
1116
1120
|
const developmentContainer = projectWorkspaceDevelopmentContainer({
|
|
1117
1121
|
nodeVersion: combineOptions.stableCommon.nodeDeclaration,
|
|
1122
|
+
packageManagerPin: combineOptions.stableCommon.packageManagerPin,
|
|
1118
1123
|
layers: developmentContainerLayers,
|
|
1119
1124
|
resources: developmentContainerResources,
|
|
1120
1125
|
});
|
|
@@ -1212,6 +1217,23 @@ export function createDefaultComposition(options) {
|
|
|
1212
1217
|
path: file.path,
|
|
1213
1218
|
content: file.content,
|
|
1214
1219
|
mode: file.mode,
|
|
1220
|
+
...(file.path === ".devcontainer/Dockerfile"
|
|
1221
|
+
? {
|
|
1222
|
+
reconciliation: {
|
|
1223
|
+
path: file.path,
|
|
1224
|
+
driver: "text",
|
|
1225
|
+
mirrorSlots: [
|
|
1226
|
+
{
|
|
1227
|
+
id: "pnpm-bootstrap",
|
|
1228
|
+
location: {
|
|
1229
|
+
kind: "text-anchor",
|
|
1230
|
+
name: "pnpm-bootstrap",
|
|
1231
|
+
},
|
|
1232
|
+
},
|
|
1233
|
+
],
|
|
1234
|
+
},
|
|
1235
|
+
}
|
|
1236
|
+
: {}),
|
|
1215
1237
|
...(file.path === ".devcontainer/devcontainer.json"
|
|
1216
1238
|
? {
|
|
1217
1239
|
reconciliation: {
|
|
@@ -8,7 +8,7 @@ export const dependencyCatalogSnapshot = {
|
|
|
8
8
|
"@playwright/test": "1.64.0",
|
|
9
9
|
"@vitest/browser-playwright": "^5.0.0",
|
|
10
10
|
"@tailwindcss/vite": "^4.3.3",
|
|
11
|
-
"@types/node": "^
|
|
11
|
+
"@types/node": "^26.0.0",
|
|
12
12
|
"@types/web-bluetooth": "^0.0.21",
|
|
13
13
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
14
14
|
"@vikejs/hono": "^0.2.1",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"yaml": "^2.9.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@types/node": "^
|
|
73
|
+
"@types/node": "^26.0.0",
|
|
74
74
|
"@ykdz/template-environment": "0.0.0",
|
|
75
75
|
"@ykdz/tooling-config": "0.0.0",
|
|
76
76
|
"oxfmt": "^0.74.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"lint": "oxlint --quiet --format=unix .",
|
|
87
87
|
"lint:fix": "oxlint --format=unix . --fix",
|
|
88
88
|
"sync:policy-snapshot": "node scripts/sync-snapshot.ts src/workspace-policy-snapshot.ts",
|
|
89
|
-
"test": "node --conditions=source --
|
|
89
|
+
"test": "node --conditions=source --test --test-concurrency=2 --test-timeout=60000 --test-reporter=spec 'test/**/*.light.test.ts'",
|
|
90
90
|
"typecheck": "tsc -p tsconfig.node.json --noEmit --pretty false && tsc -p tsconfig.scripts.json --noEmit --pretty false",
|
|
91
91
|
"sync:release-toolchain-snapshot": "node scripts/sync-snapshot.ts src/release-toolchain-snapshot.ts"
|
|
92
92
|
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typescript": "npm:typescript@^6.0.3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@types/node": "^
|
|
35
|
+
"@types/node": "^26.0.0",
|
|
36
36
|
"@ykdz/template-core": "0.0.0",
|
|
37
37
|
"@ykdz/tooling-config": "0.0.0",
|
|
38
38
|
"oxfmt": "^0.74.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"format:write": "oxfmt --write .",
|
|
50
50
|
"lint": "oxlint --quiet --format=unix .",
|
|
51
51
|
"lint:fix": "oxlint --format=unix . --fix",
|
|
52
|
-
"test": "node --conditions=source --
|
|
52
|
+
"test": "node --conditions=source --test --test-reporter=spec 'test/**/*.light.test.ts'",
|
|
53
53
|
"sync:resource-ignore-snapshot": "node scripts/sync-resource-ignore-snapshot.ts",
|
|
54
54
|
"typecheck": "tsc -p tsconfig.node.json --noEmit --pretty false && tsc -p tsconfig.scripts.json --noEmit --pretty false"
|
|
55
55
|
}
|
|
@@ -17,15 +17,12 @@
|
|
|
17
17
|
"./reference": "./package.json"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@types/node": "^
|
|
20
|
+
"@types/node": "^26.0.0",
|
|
21
21
|
"oxfmt": "^0.74.0",
|
|
22
22
|
"oxlint": "^1.89.0",
|
|
23
23
|
"oxlint-tsgolint": "^7.0.2001",
|
|
24
24
|
"typescript-7": "npm:typescript@^7.0.2"
|
|
25
25
|
},
|
|
26
|
-
"engines": {
|
|
27
|
-
"node": "24"
|
|
28
|
-
},
|
|
29
26
|
"scripts": {
|
|
30
27
|
"format:check": "oxfmt --list-different .",
|
|
31
28
|
"format:write": "oxfmt --write .",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ykdz/template",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Project template generator for YKDZ starter projects.",
|
|
6
6
|
"keywords": [
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"yaml"
|
|
164
164
|
],
|
|
165
165
|
"engines": {
|
|
166
|
-
"node": "^
|
|
166
|
+
"node": "^26.13.0"
|
|
167
167
|
},
|
|
168
168
|
"scripts": {
|
|
169
169
|
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
@@ -171,8 +171,8 @@
|
|
|
171
171
|
"format:write": "oxfmt --write .",
|
|
172
172
|
"lint": "oxlint --quiet --format=unix --ignore-pattern dist .",
|
|
173
173
|
"lint:fix": "oxlint --format=unix --ignore-pattern dist . --fix",
|
|
174
|
-
"test": "node --conditions=source --
|
|
175
|
-
"test:integration": "node --conditions=source --
|
|
174
|
+
"test": "node --conditions=source --test --test-concurrency=2 --test-timeout=60000 --test-reporter=spec 'test/**/*.light.test.ts'",
|
|
175
|
+
"test:integration": "node --conditions=source --test --test-concurrency=1 --test-timeout=300000 --test-reporter=spec 'test/**/*.integration.test.ts'",
|
|
176
176
|
"typecheck": "tsc -p tsconfig.node.json --noEmit --pretty false && tsc -p tsconfig.scripts.json --noEmit --pretty false",
|
|
177
177
|
"test:e2e:packed": "node --conditions=source --test --test-reporter=tap test/e2e/run-journeys.ts test/e2e/packed-failure.test.ts",
|
|
178
178
|
"test:e2e:source": "TEMPLATE_CLI_JOURNEY_MODE=source node --conditions=source --test --test-reporter=tap test/e2e/run-journeys.ts",
|