@ykdz/template 0.0.40 → 0.0.42
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/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +144 -101
- package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.js +29 -4
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +11 -2
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-cli/definition.js +14 -4
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.js +13 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.js +44 -10
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.js +4 -1
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.js +19 -8
- package/node_modules/@ykdz/template-builtin-presets/package.json +23 -10
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment-diagnostics.yml +30 -29
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment.yml +8 -21
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-diagnostics.yml +21 -5
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.yml +4 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/AGENTS.md.template +9 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/{shared/devcontainer/node-pnpm.Dockerfile → foundation/devcontainer/base.Dockerfile} +14 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/gitignore +1 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +3 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/node-test-count-reporter.ts +31 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/run-rust-tests.ts +100 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/run-turbo-boundaries.ts +74 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/task-gates.ts +589 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-projections/database-preparation.json +17 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-projections/deployment.json +13 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-projections/rust-toolchain.json +5 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-projections/vue-hono-joint-e2e.json +13 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo.json +14 -15
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/typescript-config/turbo.json +30 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/devcontainer/rust.Dockerfile +1 -5
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/tsconfig.scripts.json +12 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/turbo.json +19 -4
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/github-cli.Dockerfile +1 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/TESTING.md +7 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/src/components/CounterButton.vue +18 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/test/counter.browser.test.ts +16 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/test/{app.test.ts → counter.node.test.ts} +1 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.test.json +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/vitest.config.ts +50 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/check-artifact.ts +16 -5
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/release.yml +5 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/turbo.json +5 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/bridge.ts +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/cli-command-identity.ts +0 -45
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/e2e/run-journeys.test.ts +11 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/integration/command.test.ts +43 -39
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/unit/cli-command-identity.test.ts +52 -52
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/tsconfig.json +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/turbo.json +58 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/test/greet.test.ts +20 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/tsconfig.json +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/turbo.json +44 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/test/todos.test.ts +8 -11
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/turbo.json +38 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/turbo.json +44 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/playwright.config.ts +18 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/test/counter.browser.test.ts +14 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.test.json +8 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/turbo.json +61 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/vitest.config.ts +29 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/src/App.vue +2 -12
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/turbo.json +60 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/test/app.test.ts +7 -6
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.json +2 -7
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/turbo.json +46 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/src/App.vue +2 -11
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/turbo.json +57 -1
- package/node_modules/@ykdz/template-core/dist/ci-diagnostic-artifact.d.ts +1 -1
- package/node_modules/@ykdz/template-core/dist/ci-diagnostic-artifact.js +6 -3
- package/node_modules/@ykdz/template-core/dist/dependency-catalog.d.ts +0 -1
- package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +0 -19
- package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +0 -9
- package/node_modules/@ykdz/template-core/dist/module-graph.js +0 -40
- package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +2 -2
- package/node_modules/@ykdz/template-core/dist/package-contribution.js +2 -44
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +4 -1
- package/node_modules/@ykdz/template-core/dist/project-github.d.ts +0 -59
- package/node_modules/@ykdz/template-core/dist/project-github.js +7 -70
- package/node_modules/@ykdz/template-core/dist/renderer.d.ts +1 -0
- package/node_modules/@ykdz/template-core/dist/renderer.js +39 -1
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +34 -16
- package/node_modules/@ykdz/template-core/package.json +0 -5
- package/package.json +4 -10
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.github/workflows/check.yml +0 -23
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/.github/workflows/check.yml +0 -19
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/.github/workflows/check.yml +0 -20
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/vitest.config.ts +0 -8
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/vitest.config.ts +0 -15
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/vitest.config.ts +0 -10
|
@@ -2,12 +2,70 @@
|
|
|
2
2
|
"extends": ["//"],
|
|
3
3
|
"tags": ["app"],
|
|
4
4
|
"tasks": {
|
|
5
|
+
"browser:prepare": {
|
|
6
|
+
"cache": false,
|
|
7
|
+
"outputs": [],
|
|
8
|
+
"tags": ["work:preparation"]
|
|
9
|
+
},
|
|
5
10
|
"build": {
|
|
6
|
-
"
|
|
11
|
+
"cache": true,
|
|
12
|
+
"dependsOn": ["^build"],
|
|
13
|
+
"outputs": ["dist/**"],
|
|
14
|
+
"tags": ["quality:light"]
|
|
15
|
+
},
|
|
16
|
+
"dev": {
|
|
17
|
+
"cache": false,
|
|
18
|
+
"outputs": [],
|
|
19
|
+
"tags": ["work:development"]
|
|
20
|
+
},
|
|
21
|
+
"format:check": {
|
|
22
|
+
"cache": true,
|
|
23
|
+
"outputs": [],
|
|
24
|
+
"tags": ["quality:light"]
|
|
25
|
+
},
|
|
26
|
+
"format:write": {
|
|
27
|
+
"cache": false,
|
|
28
|
+
"dependsOn": ["lint:fix"],
|
|
29
|
+
"outputs": [],
|
|
30
|
+
"tags": ["work:repair"]
|
|
31
|
+
},
|
|
32
|
+
"lint": {
|
|
33
|
+
"cache": true,
|
|
34
|
+
"outputs": [],
|
|
35
|
+
"tags": ["quality:light"]
|
|
36
|
+
},
|
|
37
|
+
"lint:fix": {
|
|
38
|
+
"cache": false,
|
|
39
|
+
"outputs": [],
|
|
40
|
+
"tags": ["work:repair"]
|
|
41
|
+
},
|
|
42
|
+
"preview": {
|
|
43
|
+
"cache": false,
|
|
44
|
+
"outputs": [],
|
|
45
|
+
"tags": ["work:development"]
|
|
46
|
+
},
|
|
47
|
+
"test": {
|
|
48
|
+
"cache": true,
|
|
49
|
+
"outputs": [],
|
|
50
|
+
"tags": ["quality:light"]
|
|
51
|
+
},
|
|
52
|
+
"test:browser": {
|
|
53
|
+
"cache": true,
|
|
54
|
+
"dependsOn": ["browser:prepare"],
|
|
55
|
+
"outputs": [],
|
|
56
|
+
"tags": ["quality:heavy"]
|
|
7
57
|
},
|
|
8
58
|
"test:e2e": {
|
|
9
59
|
"cache": false,
|
|
10
|
-
"dependsOn": ["build"]
|
|
60
|
+
"dependsOn": ["build", "browser:prepare"],
|
|
61
|
+
"outputs": [],
|
|
62
|
+
"tags": ["quality:heavy"]
|
|
63
|
+
},
|
|
64
|
+
"typecheck": {
|
|
65
|
+
"cache": true,
|
|
66
|
+
"dependsOn": ["^typecheck"],
|
|
67
|
+
"outputs": [],
|
|
68
|
+
"tags": ["quality:light"]
|
|
11
69
|
}
|
|
12
70
|
}
|
|
13
71
|
}
|
package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/test/app.test.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { it } from "node:test";
|
|
3
|
+
|
|
1
4
|
import { app } from "#/runtime";
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const response = await app.request("/api/health");
|
|
6
|
+
void it("responds to the health route", async () => {
|
|
7
|
+
const response = await app.request("/api/health");
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
9
|
+
assert.equal(response.status, 200);
|
|
10
|
+
assert.deepStrictEqual(await response.json(), { status: "ok" });
|
|
10
11
|
});
|
package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.json
CHANGED
|
@@ -10,12 +10,7 @@
|
|
|
10
10
|
"moduleResolution": "nodenext",
|
|
11
11
|
"rewriteRelativeImportExtensions": true,
|
|
12
12
|
"target": "es2024",
|
|
13
|
-
"types": ["node"
|
|
13
|
+
"types": ["node"]
|
|
14
14
|
},
|
|
15
|
-
"include": [
|
|
16
|
-
"src/**/*.ts",
|
|
17
|
-
"test/**/*.ts",
|
|
18
|
-
"scripts/**/*.ts",
|
|
19
|
-
"vitest.config.ts"
|
|
20
|
-
]
|
|
15
|
+
"include": ["src/**/*.ts", "test/**/*.ts", "scripts/**/*.ts"]
|
|
21
16
|
}
|
|
@@ -3,7 +3,52 @@
|
|
|
3
3
|
"tags": ["app"],
|
|
4
4
|
"tasks": {
|
|
5
5
|
"build": {
|
|
6
|
-
"
|
|
6
|
+
"cache": true,
|
|
7
|
+
"dependsOn": ["^build"],
|
|
8
|
+
"outputs": ["dist/**"],
|
|
9
|
+
"tags": ["quality:light"]
|
|
10
|
+
},
|
|
11
|
+
"dev": {
|
|
12
|
+
"cache": false,
|
|
13
|
+
"outputs": [],
|
|
14
|
+
"tags": ["work:development"]
|
|
15
|
+
},
|
|
16
|
+
"format:check": {
|
|
17
|
+
"cache": true,
|
|
18
|
+
"outputs": [],
|
|
19
|
+
"tags": ["quality:light"]
|
|
20
|
+
},
|
|
21
|
+
"format:write": {
|
|
22
|
+
"cache": false,
|
|
23
|
+
"dependsOn": ["lint:fix"],
|
|
24
|
+
"outputs": [],
|
|
25
|
+
"tags": ["work:repair"]
|
|
26
|
+
},
|
|
27
|
+
"lint": {
|
|
28
|
+
"cache": true,
|
|
29
|
+
"outputs": [],
|
|
30
|
+
"tags": ["quality:light"]
|
|
31
|
+
},
|
|
32
|
+
"lint:fix": {
|
|
33
|
+
"cache": false,
|
|
34
|
+
"outputs": [],
|
|
35
|
+
"tags": ["work:repair"]
|
|
36
|
+
},
|
|
37
|
+
"start": {
|
|
38
|
+
"cache": false,
|
|
39
|
+
"outputs": [],
|
|
40
|
+
"tags": ["work:development"]
|
|
41
|
+
},
|
|
42
|
+
"test": {
|
|
43
|
+
"cache": true,
|
|
44
|
+
"outputs": [],
|
|
45
|
+
"tags": ["quality:light"]
|
|
46
|
+
},
|
|
47
|
+
"typecheck": {
|
|
48
|
+
"cache": true,
|
|
49
|
+
"dependsOn": ["^typecheck"],
|
|
50
|
+
"outputs": [],
|
|
51
|
+
"tags": ["quality:light"]
|
|
7
52
|
}
|
|
8
53
|
}
|
|
9
54
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { storeToRefs } from "pinia";
|
|
3
2
|
import { onMounted, onUnmounted, ref } from "vue";
|
|
4
3
|
|
|
5
4
|
import { getHealth } from "#/api";
|
|
6
|
-
import { useCounterStore } from "#/stores/counter";
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
const { count } = storeToRefs(counter);
|
|
6
|
+
import CounterButton from "./components/CounterButton.vue";
|
|
10
7
|
const themeLabel = ref<"深色" | "浅色">("浅色");
|
|
11
8
|
const apiStatus = ref("检查中");
|
|
12
9
|
|
|
@@ -45,13 +42,7 @@ onMounted(async () => {
|
|
|
45
42
|
Web 和 API 是独立应用包,共享代码应放入 packages/*。
|
|
46
43
|
</p>
|
|
47
44
|
<div class="mt-8 flex flex-wrap items-center gap-4">
|
|
48
|
-
<
|
|
49
|
-
class="rounded bg-cyan-300 px-4 py-2 font-semibold text-slate-950 hover:bg-cyan-200"
|
|
50
|
-
type="button"
|
|
51
|
-
@click="counter.increment()"
|
|
52
|
-
>
|
|
53
|
-
计数:{{ count }}
|
|
54
|
-
</button>
|
|
45
|
+
<CounterButton />
|
|
55
46
|
<span class="text-sm text-slate-400">系统主题:{{ themeLabel }}</span>
|
|
56
47
|
<span class="text-sm text-slate-400">API 状态:{{ apiStatus }}</span>
|
|
57
48
|
</div>
|
|
@@ -2,8 +2,64 @@
|
|
|
2
2
|
"extends": ["//"],
|
|
3
3
|
"tags": ["app"],
|
|
4
4
|
"tasks": {
|
|
5
|
+
"browser:prepare": {
|
|
6
|
+
"cache": false,
|
|
7
|
+
"outputs": [],
|
|
8
|
+
"tags": ["work:preparation"]
|
|
9
|
+
},
|
|
5
10
|
"build": {
|
|
6
|
-
"
|
|
11
|
+
"cache": true,
|
|
12
|
+
"dependsOn": ["^build"],
|
|
13
|
+
"outputs": ["dist/**"],
|
|
14
|
+
"tags": ["quality:light"]
|
|
15
|
+
},
|
|
16
|
+
"dev": {
|
|
17
|
+
"cache": false,
|
|
18
|
+
"outputs": [],
|
|
19
|
+
"tags": ["work:development"]
|
|
20
|
+
},
|
|
21
|
+
"format:check": {
|
|
22
|
+
"cache": true,
|
|
23
|
+
"outputs": [],
|
|
24
|
+
"tags": ["quality:light"]
|
|
25
|
+
},
|
|
26
|
+
"format:write": {
|
|
27
|
+
"cache": false,
|
|
28
|
+
"dependsOn": ["lint:fix"],
|
|
29
|
+
"outputs": [],
|
|
30
|
+
"tags": ["work:repair"]
|
|
31
|
+
},
|
|
32
|
+
"lint": {
|
|
33
|
+
"cache": true,
|
|
34
|
+
"outputs": [],
|
|
35
|
+
"tags": ["quality:light"]
|
|
36
|
+
},
|
|
37
|
+
"lint:fix": {
|
|
38
|
+
"cache": false,
|
|
39
|
+
"outputs": [],
|
|
40
|
+
"tags": ["work:repair"]
|
|
41
|
+
},
|
|
42
|
+
"preview": {
|
|
43
|
+
"cache": false,
|
|
44
|
+
"outputs": [],
|
|
45
|
+
"tags": ["work:development"]
|
|
46
|
+
},
|
|
47
|
+
"test": {
|
|
48
|
+
"cache": true,
|
|
49
|
+
"outputs": [],
|
|
50
|
+
"tags": ["quality:light"]
|
|
51
|
+
},
|
|
52
|
+
"test:browser": {
|
|
53
|
+
"cache": true,
|
|
54
|
+
"dependsOn": ["browser:prepare"],
|
|
55
|
+
"outputs": [],
|
|
56
|
+
"tags": ["quality:heavy"]
|
|
57
|
+
},
|
|
58
|
+
"typecheck": {
|
|
59
|
+
"cache": true,
|
|
60
|
+
"dependsOn": ["^typecheck"],
|
|
61
|
+
"outputs": [],
|
|
62
|
+
"tags": ["quality:light"]
|
|
7
63
|
}
|
|
8
64
|
}
|
|
9
65
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentOwner } from "./module-graph.ts";
|
|
2
2
|
/** Closed, owner-scoped native evidence a Package Contribution may retain in CI. */
|
|
3
3
|
export type CiDiagnosticArtifactDeclaration = {
|
|
4
|
-
readonly kind: "playwright";
|
|
4
|
+
readonly kind: "playwright" | "vitest-browser";
|
|
5
5
|
readonly owner: ComponentOwner;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
@@ -28,7 +28,7 @@ export function assertCiDiagnosticArtifactDeclaration(value) {
|
|
|
28
28
|
if (!isRecord(value) || !hasExactKeys(value, ["kind", "owner"])) {
|
|
29
29
|
throw new Error("CI Diagnostic Artifact declarations may contain only kind and owner");
|
|
30
30
|
}
|
|
31
|
-
if (value.kind !== "playwright") {
|
|
31
|
+
if (value.kind !== "playwright" && value.kind !== "vitest-browser") {
|
|
32
32
|
throw new Error("Unsupported CI Diagnostic Artifact kind");
|
|
33
33
|
}
|
|
34
34
|
if (!isRecord(value.owner) || !hasExactKeys(value.owner, ["kind", "path"])) {
|
|
@@ -42,7 +42,7 @@ export function assertCiDiagnosticArtifactDeclaration(value) {
|
|
|
42
42
|
throw new Error("CI Diagnostic Artifact owner has an unsafe Package Boundary path");
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
|
-
kind:
|
|
45
|
+
kind: value.kind,
|
|
46
46
|
owner: value.owner.kind === "workspace-orchestration"
|
|
47
47
|
? { kind: "workspace-orchestration", path: "." }
|
|
48
48
|
: { kind: "package-boundary", path: value.owner.path },
|
|
@@ -69,5 +69,8 @@ export function composeCiDiagnosticArtifacts(options) {
|
|
|
69
69
|
const key = `${declaration.kind}:${declaration.owner.path}`;
|
|
70
70
|
artifacts.set(key, declaration);
|
|
71
71
|
}
|
|
72
|
-
return [...artifacts.values()].toSorted((left, right) =>
|
|
72
|
+
return [...artifacts.values()].toSorted((left, right) => {
|
|
73
|
+
const ownerOrder = left.owner.path.localeCompare(right.owner.path);
|
|
74
|
+
return ownerOrder === 0 ? left.kind.localeCompare(right.kind) : ownerOrder;
|
|
75
|
+
});
|
|
73
76
|
}
|
|
@@ -28,7 +28,6 @@ export declare function renderCargoLockForPackage(options: {
|
|
|
28
28
|
}): string;
|
|
29
29
|
export declare function selectTemplateCargoDependencyVersions(dependencies: readonly string[], catalog?: TemplateCargoDependencyVersions): TemplateCargoDependencyVersions;
|
|
30
30
|
export declare function renderCargoDependencyTomlEntries(dependencies: readonly string[], catalog?: TemplateCargoDependencyVersions): string[];
|
|
31
|
-
export declare function collectGeneratedManifestCatalogDependencies(manifests: readonly GeneratedPackageManifestDependencies[]): string[];
|
|
32
31
|
export declare function collectGeneratedManifestCatalogReferences(manifests: readonly GeneratedPackageManifestDependencies[]): string[];
|
|
33
32
|
export declare function pnpmWorkspaceYamlWithCatalogDependencies(workspaceYaml: string, dependencies: readonly string[], templateCatalog?: TemplateDependencyCatalog): string;
|
|
34
33
|
export declare function renderGeneratedPnpmWorkspaceYaml(options: GeneratedDependencyCatalogOptions): string;
|
|
@@ -127,25 +127,6 @@ export function renderCargoDependencyTomlEntries(dependencies, catalog = loadTem
|
|
|
127
127
|
return `${renderTomlKey(dependency)} = ${JSON.stringify(version)}`;
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
export function collectGeneratedManifestCatalogDependencies(manifests) {
|
|
131
|
-
const dependencies = new Set();
|
|
132
|
-
for (const manifest of manifests) {
|
|
133
|
-
for (const dependencyMap of [
|
|
134
|
-
manifest.dependencies,
|
|
135
|
-
manifest.devDependencies,
|
|
136
|
-
manifest.optionalDependencies,
|
|
137
|
-
manifest.peerDependencies,
|
|
138
|
-
]) {
|
|
139
|
-
for (const [dependency, specifier] of Object.entries(dependencyMap ?? {})) {
|
|
140
|
-
if (specifier !== "catalog:") {
|
|
141
|
-
throw new Error(`Generated manifest dependency ${dependency} must use catalog:, got ${specifier}`);
|
|
142
|
-
}
|
|
143
|
-
dependencies.add(dependency);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return [...dependencies].toSorted();
|
|
148
|
-
}
|
|
149
130
|
export function collectGeneratedManifestCatalogReferences(manifests) {
|
|
150
131
|
const dependencies = new Set();
|
|
151
132
|
for (const manifest of manifests) {
|
|
@@ -46,15 +46,6 @@ export declare function normalizeEnvironmentNeeds(options: {
|
|
|
46
46
|
export declare function parseEnvironmentNeedsMetadata(value: unknown): EnvironmentNeedsMetadata;
|
|
47
47
|
export declare function rustToolchainEnvironmentNeed(owner: ComponentOwner): RustToolchainEnvironmentNeed;
|
|
48
48
|
export declare function dockerEngineEnvironmentNeed(): DockerEngineEnvironmentNeed;
|
|
49
|
-
export declare const qualityTaskVocabulary: readonly ["format:check", "lint", "typecheck", "build", "test", "test:e2e"];
|
|
50
|
-
export declare function renderTurboRunCommand(taskNames: readonly string[], args?: readonly string[], options?: {
|
|
51
|
-
readonly outputLogs?: "errors-only" | "full";
|
|
52
|
-
readonly continueAfterFailure?: boolean;
|
|
53
|
-
readonly taskPrefix?: boolean;
|
|
54
|
-
}): string;
|
|
55
|
-
export declare function renderRootCheckCommand(additionalTasks?: readonly string[]): string;
|
|
56
|
-
export declare function renderDeploymentCheckCommand(): string;
|
|
57
|
-
export declare function renderFixCommand(): string;
|
|
58
49
|
export declare function playwrightBrowserAssetsEnvironmentNeed(options: {
|
|
59
50
|
readonly browser: "chromium";
|
|
60
51
|
readonly owner: ComponentOwner;
|
|
@@ -152,46 +152,6 @@ export function rustToolchainEnvironmentNeed(owner) {
|
|
|
152
152
|
export function dockerEngineEnvironmentNeed() {
|
|
153
153
|
return { kind: "docker-engine" };
|
|
154
154
|
}
|
|
155
|
-
export const qualityTaskVocabulary = [
|
|
156
|
-
"format:check",
|
|
157
|
-
"lint",
|
|
158
|
-
"typecheck",
|
|
159
|
-
"build",
|
|
160
|
-
"test",
|
|
161
|
-
"test:e2e",
|
|
162
|
-
];
|
|
163
|
-
export function renderTurboRunCommand(taskNames, args = [], options = {}) {
|
|
164
|
-
return [
|
|
165
|
-
"turbo run",
|
|
166
|
-
...taskNames,
|
|
167
|
-
...args,
|
|
168
|
-
...(options.continueAfterFailure
|
|
169
|
-
? ["--continue=dependencies-successful"]
|
|
170
|
-
: []),
|
|
171
|
-
`--output-logs=${options.outputLogs ?? "errors-only"}`,
|
|
172
|
-
"--log-order=grouped",
|
|
173
|
-
...(options.taskPrefix ? ["--log-prefix=task"] : []),
|
|
174
|
-
].join(" ");
|
|
175
|
-
}
|
|
176
|
-
export function renderRootCheckCommand(additionalTasks = []) {
|
|
177
|
-
return [
|
|
178
|
-
"pnpm run boundaries",
|
|
179
|
-
renderTurboRunCommand([...qualityTaskVocabulary, ...additionalTasks], [], {
|
|
180
|
-
continueAfterFailure: true,
|
|
181
|
-
taskPrefix: true,
|
|
182
|
-
}),
|
|
183
|
-
].join(" && ");
|
|
184
|
-
}
|
|
185
|
-
export function renderDeploymentCheckCommand() {
|
|
186
|
-
return renderTurboRunCommand(["deployment"], [], { taskPrefix: true });
|
|
187
|
-
}
|
|
188
|
-
export function renderFixCommand() {
|
|
189
|
-
return renderTurboRunCommand(["lint:fix", "format:write"], [], {
|
|
190
|
-
continueAfterFailure: true,
|
|
191
|
-
outputLogs: "full",
|
|
192
|
-
taskPrefix: true,
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
155
|
export function playwrightBrowserAssetsEnvironmentNeed(options) {
|
|
196
156
|
return {
|
|
197
157
|
kind: "playwright-browser-assets",
|
|
@@ -80,9 +80,9 @@ export type PackageContribution = {
|
|
|
80
80
|
/** Closed native CI evidence owned by this Package Boundary. */
|
|
81
81
|
readonly ciDiagnosticArtifacts?: readonly CiDiagnosticArtifactDeclaration[];
|
|
82
82
|
};
|
|
83
|
-
/**
|
|
83
|
+
/** 校验 CLI 命令名的格式及工作区内是否重名。 */
|
|
84
84
|
export declare function validateCliCommandName(commandName: string, occupiedCommandNames?: readonly string[]): string;
|
|
85
|
-
/**
|
|
85
|
+
/** 校验完整生成计划中的命令名格式和唯一性。 */
|
|
86
86
|
export declare function assertPackageContributionCommandNames(contributions: readonly PackageContribution[]): readonly PackageContribution[];
|
|
87
87
|
export declare function assertPackageContribution(contribution: PackageContribution, provenance?: {
|
|
88
88
|
readonly definitionName?: string;
|
|
@@ -6,46 +6,7 @@ const operationPath = (operation) => {
|
|
|
6
6
|
return operation.path;
|
|
7
7
|
return "";
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
"aux",
|
|
11
|
-
"bash",
|
|
12
|
-
"bun",
|
|
13
|
-
"cmd",
|
|
14
|
-
"com1",
|
|
15
|
-
"com2",
|
|
16
|
-
"com3",
|
|
17
|
-
"com4",
|
|
18
|
-
"com5",
|
|
19
|
-
"com6",
|
|
20
|
-
"com7",
|
|
21
|
-
"com8",
|
|
22
|
-
"com9",
|
|
23
|
-
"con",
|
|
24
|
-
"corepack",
|
|
25
|
-
"deno",
|
|
26
|
-
"git",
|
|
27
|
-
"lpt1",
|
|
28
|
-
"lpt2",
|
|
29
|
-
"lpt3",
|
|
30
|
-
"lpt4",
|
|
31
|
-
"lpt5",
|
|
32
|
-
"lpt6",
|
|
33
|
-
"lpt7",
|
|
34
|
-
"lpt8",
|
|
35
|
-
"lpt9",
|
|
36
|
-
"node",
|
|
37
|
-
"nul",
|
|
38
|
-
"npm",
|
|
39
|
-
"npx",
|
|
40
|
-
"pnpm",
|
|
41
|
-
"powershell",
|
|
42
|
-
"prn",
|
|
43
|
-
"pwsh",
|
|
44
|
-
"sh",
|
|
45
|
-
"yarn",
|
|
46
|
-
"zsh",
|
|
47
|
-
]);
|
|
48
|
-
/** Validates the portable executable name promised by a CLI Package Boundary. */
|
|
9
|
+
/** 校验 CLI 命令名的格式及工作区内是否重名。 */
|
|
49
10
|
export function validateCliCommandName(commandName, occupiedCommandNames = []) {
|
|
50
11
|
if (/[/\\]/u.test(commandName)) {
|
|
51
12
|
throw new Error(`CLI command name must not be a path; received ${JSON.stringify(commandName)}`);
|
|
@@ -62,9 +23,6 @@ export function validateCliCommandName(commandName, occupiedCommandNames = []) {
|
|
|
62
23
|
if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(commandName)) {
|
|
63
24
|
throw new Error(`CLI command name must use lowercase ASCII letters, digits, and single hyphens; received ${JSON.stringify(commandName)}`);
|
|
64
25
|
}
|
|
65
|
-
if (reservedSystemToolNames.has(commandName)) {
|
|
66
|
-
throw new Error(`CLI command name is a reserved system tool; received ${JSON.stringify(commandName)}`);
|
|
67
|
-
}
|
|
68
26
|
if (occupiedCommandNames.includes(commandName)) {
|
|
69
27
|
throw new Error(`CLI command name is already used by another workspace package; received ${JSON.stringify(commandName)}`);
|
|
70
28
|
}
|
|
@@ -77,7 +35,7 @@ function manifestBinEntries(contribution) {
|
|
|
77
35
|
}
|
|
78
36
|
return Object.entries(bin);
|
|
79
37
|
}
|
|
80
|
-
/**
|
|
38
|
+
/** 校验完整生成计划中的命令名格式和唯一性。 */
|
|
81
39
|
export function assertPackageContributionCommandNames(contributions) {
|
|
82
40
|
const commandOwner = new Map();
|
|
83
41
|
for (const contribution of contributions) {
|
|
@@ -25,7 +25,8 @@ catalog:
|
|
|
25
25
|
"@valibot/to-json-schema": ^1.8.0
|
|
26
26
|
"@devcontainers/cli": 0.89.0
|
|
27
27
|
"@hono/node-server": ^2.0.12
|
|
28
|
-
"@playwright/test":
|
|
28
|
+
"@playwright/test": 1.64.0
|
|
29
|
+
"@vitest/browser-playwright": ^5.0.0
|
|
29
30
|
"@tailwindcss/vite": ^4.3.3
|
|
30
31
|
"@types/node": ^24.13.3
|
|
31
32
|
"@types/web-bluetooth": ^0.0.21
|
|
@@ -48,6 +49,7 @@ catalog:
|
|
|
48
49
|
spdx-expression-parse: ^5.0.0
|
|
49
50
|
"@types/spdx-expression-parse": ^4.0.0
|
|
50
51
|
pinia: ^4.0.2
|
|
52
|
+
playwright: 1.64.0
|
|
51
53
|
srvx: ^1.0.0
|
|
52
54
|
tailwindcss: ^4.3.3
|
|
53
55
|
tar: ^7.5.22
|
|
@@ -60,6 +62,7 @@ catalog:
|
|
|
60
62
|
vike: ^0.4.260
|
|
61
63
|
vike-vue: ^0.9.12
|
|
62
64
|
vitest: ^5.0.0
|
|
65
|
+
vitest-browser-vue: ^3.1.0
|
|
63
66
|
vue: ^3.5.40
|
|
64
67
|
vue-tsc: ^3.3.9
|
|
65
68
|
yaml: ^2.9.0
|
|
@@ -1,52 +1,4 @@
|
|
|
1
|
-
import { type CiDiagnosticArtifactDeclaration } from "./ci-diagnostic-artifact.ts";
|
|
2
1
|
import type { DeploymentEnvironmentNeed } from "./module-graph.ts";
|
|
3
|
-
export type CiCapability = {
|
|
4
|
-
readonly workflowName: "Check";
|
|
5
|
-
readonly jobName: "check";
|
|
6
|
-
readonly jobDisplayName: "Root Check";
|
|
7
|
-
readonly runner: "ubuntu-latest";
|
|
8
|
-
readonly timeoutMinutes: 30;
|
|
9
|
-
};
|
|
10
|
-
export type CiEnvironmentPreparation = {
|
|
11
|
-
readonly nodeFromPackageMetadata: boolean;
|
|
12
|
-
readonly packageManagerFromPackageMetadata: boolean;
|
|
13
|
-
readonly pnpmStoreCache: boolean;
|
|
14
|
-
};
|
|
15
|
-
export type PnpmTaskLayer = {
|
|
16
|
-
readonly installCommand: "pnpm install --frozen-lockfile";
|
|
17
|
-
readonly checkCommand: "pnpm run check";
|
|
18
|
-
};
|
|
19
|
-
export type CiCheckMatrixEntry = {
|
|
20
|
-
readonly capability: "root" | "deployment";
|
|
21
|
-
readonly jobDisplayName: "Root Check" | "Deployment Check";
|
|
22
|
-
readonly taskEntrypoint: "pnpm run check" | "pnpm run check:deployment";
|
|
23
|
-
readonly timeoutMinutes: 30 | 45;
|
|
24
|
-
readonly requiresDocker: boolean;
|
|
25
|
-
};
|
|
26
|
-
export type ProjectCheckWorkflowPlan = {
|
|
27
|
-
readonly workflowName: "Check";
|
|
28
|
-
readonly triggers: {
|
|
29
|
-
readonly pullRequest: true;
|
|
30
|
-
readonly pushBranches: readonly ["main"];
|
|
31
|
-
};
|
|
32
|
-
readonly permissions: {
|
|
33
|
-
readonly contents: "read";
|
|
34
|
-
};
|
|
35
|
-
readonly concurrency: {
|
|
36
|
-
readonly group: "${{ github.workflow }}-${{ github.ref }}";
|
|
37
|
-
readonly cancelInProgress: true;
|
|
38
|
-
};
|
|
39
|
-
readonly rootCheck: CiCapability;
|
|
40
|
-
readonly matrix: {
|
|
41
|
-
readonly failFast: false;
|
|
42
|
-
readonly include: readonly CiCheckMatrixEntry[];
|
|
43
|
-
} | undefined;
|
|
44
|
-
readonly environmentPreparation: CiEnvironmentPreparation;
|
|
45
|
-
readonly taskLayer: PnpmTaskLayer;
|
|
46
|
-
/** Actual Package Boundaries allowed to own retained native diagnostics. */
|
|
47
|
-
readonly packagePaths: readonly string[];
|
|
48
|
-
readonly diagnosticArtifacts: readonly CiDiagnosticArtifactDeclaration[];
|
|
49
|
-
};
|
|
50
2
|
export type DependencyEcosystem = "npm" | "cargo" | "github-actions" | "docker" | "devcontainers" | "rust-toolchain";
|
|
51
3
|
export type DependabotDirectory = `/${string}`;
|
|
52
4
|
export type DependencyMaintenancePolicy = {
|
|
@@ -60,16 +12,6 @@ export type ProjectCheckWorkflowDiagnosticOptions = {
|
|
|
60
12
|
readonly packagePaths: readonly string[];
|
|
61
13
|
readonly diagnosticArtifacts?: readonly unknown[] | undefined;
|
|
62
14
|
};
|
|
63
|
-
type ProjectCheckWorkflowOptions = ProjectCheckWorkflowDiagnosticOptions & {
|
|
64
|
-
readonly deploymentCheck?: {
|
|
65
|
-
readonly environmentNeeds: readonly DeploymentEnvironmentNeed[];
|
|
66
|
-
} | undefined;
|
|
67
|
-
readonly capability?: CiCapability | undefined;
|
|
68
|
-
readonly environmentPreparation?: Partial<CiEnvironmentPreparation> | undefined;
|
|
69
|
-
readonly taskLayer?: PnpmTaskLayer | undefined;
|
|
70
|
-
};
|
|
71
|
-
/** Capability facts for the Foundation-owned GitHub Actions Template Source. */
|
|
72
|
-
export declare function projectCheckWorkflowPlan(options: ProjectCheckWorkflowOptions): ProjectCheckWorkflowPlan;
|
|
73
15
|
/** Selects a complete Foundation-owned workflow Template Source. */
|
|
74
16
|
export declare function projectCheckWorkflowTemplateSource(options: ProjectCheckWorkflowDiagnosticOptions & {
|
|
75
17
|
readonly deploymentCheck?: {
|
|
@@ -81,4 +23,3 @@ export declare function projectCheckWorkflowTemplateReplacements(options: Projec
|
|
|
81
23
|
export declare function projectDependabotConfig(policy: DependencyMaintenancePolicy): string;
|
|
82
24
|
/** Limited substitution for the Foundation-owned Dependabot Template Source. */
|
|
83
25
|
export declare function projectDependabotTemplateReplacements(policy: DependencyMaintenancePolicy): Record<string, string>;
|
|
84
|
-
export {};
|
|
@@ -5,73 +5,6 @@ function validatedDiagnosticArtifacts(options) {
|
|
|
5
5
|
declarations: options.artifacts,
|
|
6
6
|
});
|
|
7
7
|
}
|
|
8
|
-
const defaultCiCapability = {
|
|
9
|
-
workflowName: "Check",
|
|
10
|
-
jobName: "check",
|
|
11
|
-
jobDisplayName: "Root Check",
|
|
12
|
-
runner: "ubuntu-latest",
|
|
13
|
-
timeoutMinutes: 30,
|
|
14
|
-
};
|
|
15
|
-
const pnpmTaskLayer = {
|
|
16
|
-
installCommand: "pnpm install --frozen-lockfile",
|
|
17
|
-
checkCommand: "pnpm run check",
|
|
18
|
-
};
|
|
19
|
-
/** Capability facts for the Foundation-owned GitHub Actions Template Source. */
|
|
20
|
-
export function projectCheckWorkflowPlan(options) {
|
|
21
|
-
const capability = options.capability ?? defaultCiCapability;
|
|
22
|
-
const environmentPreparation = {
|
|
23
|
-
nodeFromPackageMetadata: true,
|
|
24
|
-
packageManagerFromPackageMetadata: true,
|
|
25
|
-
pnpmStoreCache: true,
|
|
26
|
-
...options.environmentPreparation,
|
|
27
|
-
};
|
|
28
|
-
const taskLayer = options.taskLayer ?? pnpmTaskLayer;
|
|
29
|
-
const hasDeploymentTask = options.deploymentCheck !== undefined;
|
|
30
|
-
const needsDocker = (options.deploymentCheck?.environmentNeeds ?? []).some((need) => need.kind === "docker-engine");
|
|
31
|
-
if (hasDeploymentTask && !needsDocker) {
|
|
32
|
-
throw new Error("Deployment Check requires a Docker environment need");
|
|
33
|
-
}
|
|
34
|
-
const packagePaths = [...options.packagePaths];
|
|
35
|
-
const diagnosticArtifacts = validatedDiagnosticArtifacts({
|
|
36
|
-
packagePaths,
|
|
37
|
-
artifacts: options.diagnosticArtifacts ?? [],
|
|
38
|
-
});
|
|
39
|
-
return {
|
|
40
|
-
workflowName: capability.workflowName,
|
|
41
|
-
triggers: { pullRequest: true, pushBranches: ["main"] },
|
|
42
|
-
permissions: { contents: "read" },
|
|
43
|
-
concurrency: {
|
|
44
|
-
group: "${{ github.workflow }}-${{ github.ref }}",
|
|
45
|
-
cancelInProgress: true,
|
|
46
|
-
},
|
|
47
|
-
rootCheck: capability,
|
|
48
|
-
matrix: hasDeploymentTask
|
|
49
|
-
? {
|
|
50
|
-
failFast: false,
|
|
51
|
-
include: [
|
|
52
|
-
{
|
|
53
|
-
capability: "root",
|
|
54
|
-
jobDisplayName: capability.jobDisplayName,
|
|
55
|
-
taskEntrypoint: taskLayer.checkCommand,
|
|
56
|
-
timeoutMinutes: capability.timeoutMinutes,
|
|
57
|
-
requiresDocker: false,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
capability: "deployment",
|
|
61
|
-
jobDisplayName: "Deployment Check",
|
|
62
|
-
taskEntrypoint: "pnpm run check:deployment",
|
|
63
|
-
timeoutMinutes: 45,
|
|
64
|
-
requiresDocker: true,
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
}
|
|
68
|
-
: undefined,
|
|
69
|
-
environmentPreparation,
|
|
70
|
-
taskLayer,
|
|
71
|
-
packagePaths,
|
|
72
|
-
diagnosticArtifacts,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
8
|
/** Selects a complete Foundation-owned workflow Template Source. */
|
|
76
9
|
export function projectCheckWorkflowTemplateSource(options) {
|
|
77
10
|
const hasDeploymentTask = options.deploymentCheck !== undefined;
|
|
@@ -100,10 +33,14 @@ export function projectCheckWorkflowTemplateReplacements(options) {
|
|
|
100
33
|
});
|
|
101
34
|
if (declarations.length === 0)
|
|
102
35
|
return {};
|
|
36
|
+
const ownerPaths = (kind) => declarations
|
|
37
|
+
.filter((declaration) => declaration.kind === kind)
|
|
38
|
+
.map((declaration) => declaration.owner.path)
|
|
39
|
+
.toSorted()
|
|
40
|
+
.join("\n ");
|
|
103
41
|
return {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
.join("\n "),
|
|
42
|
+
PLAYWRIGHT_DIAGNOSTIC_OWNER_PATHS: ownerPaths("playwright"),
|
|
43
|
+
VITEST_BROWSER_DIAGNOSTIC_OWNER_PATHS: ownerPaths("vitest-browser"),
|
|
107
44
|
};
|
|
108
45
|
}
|
|
109
46
|
export function projectDependabotConfig(policy) {
|