@orkestrel/scaffold 0.0.125 → 0.0.127
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/bin/main.js +50 -14
- package/dist/bin/main.js.map +1 -1
- package/dist/host/AGENTS.md +1 -1
- package/dist/host/agents/orchestration.md +5 -4
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +1 -1
- package/dist/host/agents/skills/orkestrel-harden/references/methods.md +2 -2
- package/dist/host/agents/skills/orkestrel-journey/SKILL.md +18 -19
- package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +2 -1
- package/dist/host/claude/AGENTS.md +2 -2
- package/dist/host/claude/agents/orkestrel.md +18 -18
- package/dist/host/claude/agents/planner.md +2 -2
- package/dist/host/claude/rules/quality.md +3 -0
- package/dist/host/claude/rules/tests.md +3 -0
- package/dist/host/claude/rules/workspace.md +11 -5
- package/dist/host/codex/agents/planner.toml +2 -2
- package/dist/host/guides/agent.md +285 -161
- package/dist/host/guides/capture.md +123 -123
- package/dist/host/guides/database.md +18 -7
- package/dist/host/guides/ndjson.md +4 -3
- package/dist/host/guides/ollama.md +2 -2
- package/dist/host/guides/program.md +3 -3
- package/dist/host/guides/qualifier.md +1 -1
- package/dist/host/guides/relation.md +71 -31
- package/dist/host/guides/scaffold.md +101 -64
- package/dist/host/guides/study.md +22 -12
- package/dist/host/guides/toolbox.md +9 -2
- package/dist/host/manifest.json +26 -26
- package/dist/host/tests/config.test.ts +24 -6
- package/dist/src/core/index.cjs +134 -79
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +30 -7
- package/dist/src/core/index.d.ts +30 -7
- package/dist/src/core/index.js +134 -80
- package/dist/src/core/index.js.map +1 -1
- package/package.json +4 -4
package/dist/src/core/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ let _orkestrel_template = require("@orkestrel/template");
|
|
|
4
4
|
let _orkestrel_emitter = require("@orkestrel/emitter");
|
|
5
5
|
var package_default = {
|
|
6
6
|
name: "@orkestrel/scaffold",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.127",
|
|
8
8
|
description: "Scaffold workspaces with commands: new, audit, surface, repair, catalog, and overwrite.",
|
|
9
9
|
keywords: [
|
|
10
10
|
"audit",
|
|
@@ -112,11 +112,11 @@ var package_default = {
|
|
|
112
112
|
"@orkestrel/test": "^0.0.33",
|
|
113
113
|
"@types/node": "^24.19.2",
|
|
114
114
|
"@vitest/browser-playwright": "^5.1.0",
|
|
115
|
-
"oxfmt": "^0.
|
|
116
|
-
"oxlint": "^1.
|
|
115
|
+
"oxfmt": "^0.78.0",
|
|
116
|
+
"oxlint": "^1.93.0",
|
|
117
117
|
"playwright": "^1.64.1",
|
|
118
118
|
"typescript": "^7.0.2",
|
|
119
|
-
"vite": "^8.3.
|
|
119
|
+
"vite": "^8.3.7",
|
|
120
120
|
"vitest": "^5.1.0"
|
|
121
121
|
},
|
|
122
122
|
engines: { "node": ">=22.18.0" }
|
|
@@ -730,10 +730,36 @@ var BROWSE_DEV_DEPENDENCIES = Object.freeze({ "@orkestrel/browser": package_defa
|
|
|
730
730
|
* ```ts
|
|
731
731
|
* import { CAPTURE_DEV_DEPENDENCIES } from '@orkestrel/scaffold'
|
|
732
732
|
*
|
|
733
|
-
* CAPTURE_DEV_DEPENDENCIES['@orkestrel/capture'] // '^0.0.
|
|
733
|
+
* CAPTURE_DEV_DEPENDENCIES['@orkestrel/capture'] // '^0.0.5'
|
|
734
734
|
* ```
|
|
735
735
|
*/
|
|
736
|
-
var CAPTURE_DEV_DEPENDENCIES = Object.freeze({ "@orkestrel/capture": "^0.0.
|
|
736
|
+
var CAPTURE_DEV_DEPENDENCIES = Object.freeze({ "@orkestrel/capture": "^0.0.5" });
|
|
737
|
+
/**
|
|
738
|
+
* Lists the Orkestrel packages that publish a `/browser` entry, frozen.
|
|
739
|
+
*
|
|
740
|
+
* @remarks
|
|
741
|
+
* A browser test project pre-bundles `<package>/browser` for each declared package listed here,
|
|
742
|
+
* so a first import mid-run does not reload the page. Each listed package's vendored guide names
|
|
743
|
+
* its own `/browser` specifier, and the constants test holds the list to the guide mirrors.
|
|
744
|
+
*
|
|
745
|
+
* @example
|
|
746
|
+
* ```ts
|
|
747
|
+
* import { BROWSER_ENTRIES } from '@orkestrel/scaffold'
|
|
748
|
+
*
|
|
749
|
+
* BROWSER_ENTRIES.includes('@orkestrel/router') // true
|
|
750
|
+
* ```
|
|
751
|
+
*/
|
|
752
|
+
var BROWSER_ENTRIES = Object.freeze([
|
|
753
|
+
"@orkestrel/browser",
|
|
754
|
+
"@orkestrel/console",
|
|
755
|
+
"@orkestrel/database",
|
|
756
|
+
"@orkestrel/form",
|
|
757
|
+
"@orkestrel/mcp",
|
|
758
|
+
"@orkestrel/router",
|
|
759
|
+
"@orkestrel/table",
|
|
760
|
+
"@orkestrel/test",
|
|
761
|
+
"@orkestrel/workflow"
|
|
762
|
+
]);
|
|
737
763
|
/**
|
|
738
764
|
* Lists the capture package and its fleet runtime dependency closure, frozen.
|
|
739
765
|
*
|
|
@@ -1012,7 +1038,7 @@ function isNamedPlugin(plugin: PluginOption): plugin is { name: string } {
|
|
|
1012
1038
|
resolve,
|
|
1013
1039
|
optimizeDeps,
|
|
1014
1040
|
publicDir: false,
|
|
1015
|
-
test: {
|
|
1041
|
+
{{vuePlugin}} test: {
|
|
1016
1042
|
name: { label: name, color: 'magenta' },
|
|
1017
1043
|
root: resolveWorkspacePath('.'),
|
|
1018
1044
|
isolate: false,
|
|
@@ -1108,7 +1134,7 @@ export function srcBrowser(override?: UserConfig): UserConfig {
|
|
|
1108
1134
|
resolve,
|
|
1109
1135
|
optimizeDeps,
|
|
1110
1136
|
publicDir: false,
|
|
1111
|
-
plugins: [outputBoundary('dist/src/browser'), environmentBoundary('src/browser')],
|
|
1137
|
+
plugins: [outputBoundary('dist/src/browser'), environmentBoundary('src/browser'){{vuePlugin}}],
|
|
1112
1138
|
build: {
|
|
1113
1139
|
emptyOutDir: true,
|
|
1114
1140
|
sourcemap: true,
|
|
@@ -1249,7 +1275,7 @@ export function srcBin(override?: UserConfig): UserConfig {
|
|
|
1249
1275
|
const project: UserConfig = {
|
|
1250
1276
|
resolve,
|
|
1251
1277
|
optimizeDeps,
|
|
1252
|
-
plugins: [outputBoundary(output), environmentBoundary('app/browser')],
|
|
1278
|
+
plugins: [outputBoundary(output), environmentBoundary('app/browser'){{vuePlugin}}],
|
|
1253
1279
|
root: resolveWorkspacePath('app/browser'),
|
|
1254
1280
|
publicDir: false,
|
|
1255
1281
|
build: {
|
|
@@ -5137,6 +5163,7 @@ var isBlueprint = (0, _orkestrel_contract.recordOf)({
|
|
|
5137
5163
|
global: _orkestrel_contract.isBoolean,
|
|
5138
5164
|
showcase: _orkestrel_contract.isBoolean,
|
|
5139
5165
|
journey: _orkestrel_contract.isBoolean,
|
|
5166
|
+
base: _orkestrel_contract.isBoolean,
|
|
5140
5167
|
skills: _orkestrel_contract.isBoolean
|
|
5141
5168
|
}, ["description"]);
|
|
5142
5169
|
/**
|
|
@@ -7018,7 +7045,7 @@ function blueprintToDevDependencies(blueprint) {
|
|
|
7018
7045
|
...BASE_DEV_DEPENDENCIES,
|
|
7019
7046
|
...Object.fromEntries(Object.entries(blueprintToToolchainHolds(blueprint)).map(([name, hold]) => [name, hold.range])),
|
|
7020
7047
|
...rendered && !BROWSE_UPSTREAM.includes(own) ? BROWSE_DEV_DEPENDENCIES : {},
|
|
7021
|
-
...blueprint.journey && blueprint.app.includes("browser") && !CAPTURE_UPSTREAM.includes(own) ? CAPTURE_DEV_DEPENDENCIES : {},
|
|
7048
|
+
...blueprint.journey && blueprint.app.includes("browser") && (blueprint.base || blueprintToFaces(blueprint).some((extension) => extension.axes.includes("app"))) && !CAPTURE_UPSTREAM.includes(own) ? CAPTURE_DEV_DEPENDENCIES : {},
|
|
7022
7049
|
...sheets ? STYLES_DEV_DEPENDENCIES : {},
|
|
7023
7050
|
...blueprint.src.length > 0 || blueprint.bin ? DECLARATION_DEV_DEPENDENCIES : {},
|
|
7024
7051
|
...blueprint.src.includes("browser") || blueprint.setup.includes("browser") || sheets ? SOURCE_BROWSER_DEV_DEPENDENCIES : {},
|
|
@@ -7182,6 +7209,8 @@ function replaceManifestOverride(manifest, path, range) {
|
|
|
7182
7209
|
* private workspace therefore omits it and runs a live-service proof from `test`.
|
|
7183
7210
|
* Study proofs run on demand through `test:studies` in either workspace; no gate
|
|
7184
7211
|
* or chain runs them.
|
|
7212
|
+
* Application and journey suites run on demand in a publishing workspace,
|
|
7213
|
+
* outside release gates and chains. A private workspace keeps them in `test`.
|
|
7185
7214
|
* Integration and conformance stay in `test` because they neither pack nor
|
|
7186
7215
|
* install the workspace and drive no external service. A conformance run may
|
|
7187
7216
|
* start a server, but it starts its own and reaches it over loopback, so the run
|
|
@@ -7192,7 +7221,7 @@ function replaceManifestOverride(manifest, path, range) {
|
|
|
7192
7221
|
* either matrix is a rename in both places.
|
|
7193
7222
|
* A browser application's journey axis adds `journey` (`capture journey`) and `capture`
|
|
7194
7223
|
* (`capture frames`) beside `test:journey`. The scoped commands take an explicit selection;
|
|
7195
|
-
* the whole-suite `test:journey` invocation
|
|
7224
|
+
* the whole-suite `test:journey` invocation joins `test` only in a private workspace.
|
|
7196
7225
|
*
|
|
7197
7226
|
* @example
|
|
7198
7227
|
* ```ts
|
|
@@ -7206,13 +7235,14 @@ function replaceManifestOverride(manifest, path, range) {
|
|
|
7206
7235
|
function blueprintToScripts(blueprint) {
|
|
7207
7236
|
const source = blueprintToFaces(blueprint).flatMap((extension) => extension.surface === "browser" && extension.axes.includes("src") ? [extension.name] : []);
|
|
7208
7237
|
const application = blueprintToFaces(blueprint).flatMap((extension) => extension.surface === "browser" && extension.axes.includes("app") ? [extension.name] : []);
|
|
7238
|
+
const base = blueprint.base && blueprint.app.includes("browser");
|
|
7209
7239
|
const sheets = blueprintToSheets(blueprint);
|
|
7210
7240
|
const targets = [...sheets, ...blueprint.themes && !blueprint.styles ? ["themes"] : []];
|
|
7211
7241
|
const checker = application.includes("vue") ? FRAMEWORK_MATRIX.vue.checker : "tsc";
|
|
7212
7242
|
const publishes = blueprint.src.length > 0 || targets.length > 0;
|
|
7213
7243
|
const integrates = blueprint.integration;
|
|
7214
7244
|
const compiles = publishes || blueprint.bin;
|
|
7215
|
-
const runtime = blueprint.app.filter((environment) => environment !== "core");
|
|
7245
|
+
const runtime = blueprint.app.filter((environment) => environment !== "core" && (environment !== "browser" || base));
|
|
7216
7246
|
const vitest = "vitest run --config vite.config.ts --no-cache --reporter=dot";
|
|
7217
7247
|
const checks = [
|
|
7218
7248
|
...blueprint.src,
|
|
@@ -7250,8 +7280,8 @@ function blueprintToScripts(blueprint) {
|
|
|
7250
7280
|
...blueprint.skills ? { "check:skills": `tsc --noEmit -p ${SKILLS_CONFIG_PATH}` } : {},
|
|
7251
7281
|
test: [
|
|
7252
7282
|
...compiles ? ["npm run test:src"] : [],
|
|
7253
|
-
|
|
7254
|
-
|
|
7283
|
+
...!publishes && blueprint.app.length > 0 ? ["npm run test:app"] : [],
|
|
7284
|
+
...!publishes && blueprint.journey && (base || application.length > 0) ? [...base ? ["npm run test:journey"] : [], ...application.map((name) => `npm run test:journey:${name}`)] : [],
|
|
7255
7285
|
"npm run test:policy",
|
|
7256
7286
|
"npm run test:config",
|
|
7257
7287
|
...blueprint.setup.includes("node") || blueprint.global ? ["npm run test:setup"] : [],
|
|
@@ -7288,11 +7318,15 @@ function blueprintToScripts(blueprint) {
|
|
|
7288
7318
|
"test:config": `${vitest} --project config`,
|
|
7289
7319
|
...blueprint.setup.includes("node") || blueprint.global ? { "test:setup": `${vitest} --project setup` } : {},
|
|
7290
7320
|
...blueprint.setup.includes("browser") ? { "test:setup:browser": `${vitest} --project setup:browser` } : {},
|
|
7291
|
-
...blueprint.journey &&
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7321
|
+
...blueprint.journey && (base || application.length > 0) ? {
|
|
7322
|
+
...base ? {
|
|
7323
|
+
"test:journey": journey,
|
|
7324
|
+
journey: "capture journey",
|
|
7325
|
+
capture: "capture frames"
|
|
7326
|
+
} : {},
|
|
7327
|
+
...Object.fromEntries(application.map((name) => [`test:journey:${name}`, `${journey} --mode ${name}`])),
|
|
7328
|
+
...Object.fromEntries(application.map((name) => [`journey:${name}`, `capture journey --mode ${name}`])),
|
|
7329
|
+
...Object.fromEntries(application.map((name) => [`capture:${name}`, `capture frames --mode ${name}`]))
|
|
7296
7330
|
} : {},
|
|
7297
7331
|
...blueprint.skills ? { "test:skills": `${vitest} --project skills` } : {},
|
|
7298
7332
|
...blueprint.guides ? { "test:guides": `node --experimental-strip-types ${GUIDES_TEST_PATH}` } : {},
|
|
@@ -7322,18 +7356,18 @@ function blueprintToScripts(blueprint) {
|
|
|
7322
7356
|
...Object.fromEntries(targets.map((name) => [`build:src:${name}`, [`vite build --config configs/src/vite.${name}.config.ts`, ...name === "styles" && blueprint.themes ? ["vite build --config configs/src/vite.themes.config.ts"] : []].join(" && ")]))
|
|
7323
7357
|
} : {},
|
|
7324
7358
|
...blueprint.app.length > 0 ? {
|
|
7325
|
-
"build:app": runtime.length > 0 ? [...runtime, ...application].map((environment) => `npm run build:app:${environment}`).join(" && ") :
|
|
7359
|
+
"build:app": runtime.length + application.length > 0 ? [...runtime, ...application].map((environment) => `npm run build:app:${environment}`).join(" && ") : `npm run check:app:${blueprint.app.includes("core") ? "core" : "browser"}`,
|
|
7326
7360
|
...Object.fromEntries([...runtime, ...application].map((environment) => [`build:app:${environment}`, `vite build --config configs/app/vite.${environment}.config.ts`]))
|
|
7327
7361
|
} : {},
|
|
7328
|
-
...
|
|
7362
|
+
...base ? {
|
|
7329
7363
|
dev: "vite --config configs/app/vite.browser.config.ts",
|
|
7330
|
-
...Object.fromEntries(application.map((name) => [`dev:${name}`, `vite --config configs/app/vite.${name}.config.ts`])),
|
|
7331
7364
|
...blueprint.showcase ? {
|
|
7332
7365
|
showcase,
|
|
7333
|
-
"build:showcase": buildShowcase
|
|
7334
|
-
...Object.fromEntries(application.flatMap((name) => [[`showcase:${name}`, `${showcase} --mode ${name}`], [`build:showcase:${name}`, `${buildShowcase} --mode ${name}`]]))
|
|
7366
|
+
"build:showcase": buildShowcase
|
|
7335
7367
|
} : {}
|
|
7336
7368
|
} : {},
|
|
7369
|
+
...Object.fromEntries(application.map((name) => [`dev:${name}`, `vite --config configs/app/vite.${name}.config.ts`])),
|
|
7370
|
+
...blueprint.showcase ? Object.fromEntries(application.flatMap((name) => [[`showcase:${name}`, `${showcase} --mode ${name}`], [`build:showcase:${name}`, `${buildShowcase} --mode ${name}`]])) : {},
|
|
7337
7371
|
...blueprint.app.includes("server") ? {
|
|
7338
7372
|
serve: "node dist/app/server/main.cjs",
|
|
7339
7373
|
"serve:build": "npm run build:app:server && npm run serve"
|
|
@@ -7342,7 +7376,7 @@ function blueprintToScripts(blueprint) {
|
|
|
7342
7376
|
prepack: "npm run build",
|
|
7343
7377
|
prepublishOnly: [
|
|
7344
7378
|
"npm run format:check && npm run lint:check && npm run check && npm run build",
|
|
7345
|
-
...blueprint.showcase && blueprint.app.includes("browser") ? ["npm run build:showcase", ...application.map((name) => `npm run build:showcase:${name}`)] : [],
|
|
7379
|
+
...blueprint.showcase && blueprint.app.includes("browser") ? [...base ? ["npm run build:showcase"] : [], ...application.map((name) => `npm run build:showcase:${name}`)] : [],
|
|
7346
7380
|
"npm test",
|
|
7347
7381
|
RELEASE_PROOF_COMMAND,
|
|
7348
7382
|
...blueprint.service ? ["npm run test:service"] : []
|
|
@@ -7363,7 +7397,8 @@ function blueprintToScripts(blueprint) {
|
|
|
7363
7397
|
* rewrites, and one carrying skills adds `test:skills`. Publishing adds the pack and publication lifecycle scripts.
|
|
7364
7398
|
* Sheet and framework faces add their check and build scripts, application frameworks add dev scripts,
|
|
7365
7399
|
* and selected showcases and journeys add their mode scripts.
|
|
7366
|
-
* A browser application's journey axis also adds `journey` and `capture
|
|
7400
|
+
* A base browser application's journey axis also adds `journey` and `capture`, and each
|
|
7401
|
+
* app-side browser face adds `journey:<name>` and `capture:<name>`. Their generated
|
|
7367
7402
|
* commands are writable and have no predecessor forms; customized values remain caller-owned.
|
|
7368
7403
|
* Aggregate test scripts and
|
|
7369
7404
|
* maintainer-owned gate chains stay outside the region.
|
|
@@ -7395,7 +7430,7 @@ function blueprintToWritableScripts(blueprint) {
|
|
|
7395
7430
|
const body = Object.entries(scripts).flatMap(([name, command]) => {
|
|
7396
7431
|
const direct = name.startsWith("test:") && name !== "test:src" && name !== "test:app";
|
|
7397
7432
|
const sheet = sheets.some((face) => name === `build:src:${face}` || name === `check:src:${face}`);
|
|
7398
|
-
const framework = blueprintToFaces(blueprint).some((extension) => extension.surface === "browser" && extension.axes.some((axis) => name === `check:${axis}:${extension.name}` || name === `build:${axis}:${extension.name}` || axis === "app" && name === `dev:${extension.name}`));
|
|
7433
|
+
const framework = blueprintToFaces(blueprint).some((extension) => extension.surface === "browser" && extension.axes.some((axis) => name === `check:${axis}:${extension.name}` || name === `build:${axis}:${extension.name}` || axis === "app" && (name === `dev:${extension.name}` || name === `journey:${extension.name}` || name === `capture:${extension.name}`)));
|
|
7399
7434
|
const showcase = name === "showcase" || name.startsWith("showcase:") || name === "build:showcase" || name.startsWith("build:showcase:");
|
|
7400
7435
|
if (!direct && !sheet && !framework && !showcase && !(name === "journey" || name === "capture")) return [];
|
|
7401
7436
|
return [{
|
|
@@ -7542,7 +7577,7 @@ function blueprintToMachinery(blueprint) {
|
|
|
7542
7577
|
browser: blueprint.src.includes("browser") || blueprint.app.includes("browser") || blueprint.setup.includes("browser") || blueprintToSheets(blueprint).length > 0 || blueprint.themes || frameworks.length > 0,
|
|
7543
7578
|
frameworks,
|
|
7544
7579
|
output: blueprint.src.length > 0 || blueprint.bin || hosted || blueprintToSheets(blueprint).length > 0 || blueprint.themes,
|
|
7545
|
-
showcase: blueprint.showcase && blueprint.app.includes("browser")
|
|
7580
|
+
showcase: blueprint.showcase && (blueprint.base && blueprint.app.includes("browser") || blueprintToFaces(blueprint).some((extension) => extension.axes.includes("app")))
|
|
7546
7581
|
};
|
|
7547
7582
|
}
|
|
7548
7583
|
/**
|
|
@@ -7662,9 +7697,9 @@ function blueprintToProjects(blueprint) {
|
|
|
7662
7697
|
*
|
|
7663
7698
|
* @remarks
|
|
7664
7699
|
* A browser-mode run that discovers a runtime package mid-collection reloads the page, so the
|
|
7665
|
-
* list names the test package,
|
|
7666
|
-
*
|
|
7667
|
-
* otherwise.
|
|
7700
|
+
* list names the test package, every Orkestrel runtime package the blueprint declares or peers
|
|
7701
|
+
* with, and the `/browser` entry of each one {@link BROWSER_ENTRIES} lists, inline when the
|
|
7702
|
+
* line fits the print width and stacked otherwise.
|
|
7668
7703
|
*
|
|
7669
7704
|
* @example
|
|
7670
7705
|
* ```ts
|
|
@@ -7676,17 +7711,20 @@ function blueprintToProjects(blueprint) {
|
|
|
7676
7711
|
* ```
|
|
7677
7712
|
*/
|
|
7678
7713
|
function blueprintToOptimizedDependencies(blueprint) {
|
|
7714
|
+
const packages = [.../* @__PURE__ */ new Set([
|
|
7715
|
+
...Object.hasOwn(blueprintToDevDependencies(blueprint), "@orkestrel/contract") ? ["@orkestrel/contract"] : [],
|
|
7716
|
+
...blueprint.dependencies.map((dependency) => dependency.name),
|
|
7717
|
+
...blueprint.peers.map((peer) => peer.name)
|
|
7718
|
+
])].filter((name) => name.startsWith("@orkestrel/")).sort();
|
|
7679
7719
|
const names = [
|
|
7680
7720
|
"@orkestrel/test",
|
|
7681
7721
|
"@orkestrel/test/browser",
|
|
7682
|
-
...
|
|
7683
|
-
|
|
7684
|
-
...blueprint.dependencies.map((dependency) => dependency.name),
|
|
7685
|
-
...blueprint.peers.map((peer) => peer.name)
|
|
7686
|
-
])].filter((name) => name.startsWith("@orkestrel/")).sort()
|
|
7722
|
+
...packages,
|
|
7723
|
+
...packages.filter((name) => BROWSER_ENTRIES.includes(name)).map((name) => `${name}/browser`)
|
|
7687
7724
|
];
|
|
7688
|
-
const
|
|
7689
|
-
|
|
7725
|
+
const includes = [...new Set(names)];
|
|
7726
|
+
const inline = `\tinclude: [${includes.map((name) => `'${name}'`).join(", ")}],`;
|
|
7727
|
+
return matchesPrintWidth(inline) ? `const optimizeDeps = {\n${inline}\n}\n\n` : `const optimizeDeps = {\n\tinclude: [\n${includes.map((name) => `\t\t'${name}',`).join("\n")}\n\t],\n}\n\n`;
|
|
7690
7728
|
}
|
|
7691
7729
|
/**
|
|
7692
7730
|
* Compiles the root Vite and Vitest configuration for a blueprint.
|
|
@@ -7711,6 +7749,9 @@ function blueprintToOptimizedDependencies(blueprint) {
|
|
|
7711
7749
|
function blueprintToRootVite(blueprint) {
|
|
7712
7750
|
const machinery = blueprintToMachinery(blueprint);
|
|
7713
7751
|
const planned = new Set(blueprintToProjects(blueprint));
|
|
7752
|
+
const applicationFaces = blueprintToFaces(blueprint).filter((extension) => extension.axes.includes("app"));
|
|
7753
|
+
const base = blueprint.base && blueprint.app.includes("browser");
|
|
7754
|
+
const journeyed = blueprint.journey && (base || applicationFaces.length > 0);
|
|
7714
7755
|
const sheets = blueprintToSheets(blueprint);
|
|
7715
7756
|
const styled = sheets.length > 0 || blueprint.themes;
|
|
7716
7757
|
const global = blueprint.global ? " globalSetup: ['./tests/setupGlobal.ts'],\n" : "";
|
|
@@ -7736,10 +7777,11 @@ function blueprintToRootVite(blueprint) {
|
|
|
7736
7777
|
return resolveExternal(id, { peers, refused: [], siblings: [] })
|
|
7737
7778
|
}
|
|
7738
7779
|
`] : [],
|
|
7739
|
-
...styled ? [CONFIG_TEMPLATES.factories.sheet] : [],
|
|
7780
|
+
...styled ? [(0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.factories.sheet, { vuePlugin: machinery.frameworks.includes("vue") ? " plugins: [vue()],\n" : "" })] : [],
|
|
7740
7781
|
...planned.has("src:core") ? [CONFIG_TEMPLATES.factories.src.core] : [],
|
|
7741
7782
|
...planned.has("src:browser") ? [blueprint.src.includes("core")].map((core) => (0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.factories.src.browser, {
|
|
7742
7783
|
external,
|
|
7784
|
+
vuePlugin: machinery.frameworks.includes("vue") ? ", vue()" : "",
|
|
7743
7785
|
output: core ? " output: { paths: { '@src/core': '../core/index.js' } }," : " output: {},",
|
|
7744
7786
|
exclude: core ? " exclude: ['tests/src/core/**/*.test.ts'],\n" : "",
|
|
7745
7787
|
global
|
|
@@ -7764,11 +7806,12 @@ function blueprintToRootVite(blueprint) {
|
|
|
7764
7806
|
...planned.has("src:bin") ? [CONFIG_TEMPLATES.factories.src.bin] : [],
|
|
7765
7807
|
...planned.has("app:core") ? [CONFIG_TEMPLATES.factories.app.core] : [],
|
|
7766
7808
|
...planned.has("app:browser") ? [(0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.factories.app.browser, {
|
|
7809
|
+
vuePlugin: machinery.frameworks.includes("vue") ? ", vue()" : "",
|
|
7767
7810
|
showcaseFactory: machinery.showcase ? CONFIG_TEMPLATES.factories.app.showcase : "",
|
|
7768
|
-
journeyFactory:
|
|
7769
|
-
journeyExclude: blueprint.journey ? " exclude: ['tests/app/browser/integration.test.ts'],\n" : ""
|
|
7811
|
+
journeyFactory: journeyed ? CONFIG_TEMPLATES.factories.app.journey : "",
|
|
7812
|
+
journeyExclude: blueprint.journey && base ? " exclude: ['tests/app/browser/integration.test.ts'],\n" : ""
|
|
7770
7813
|
})] : [],
|
|
7771
|
-
...planned.has("app:vue") ? [(0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.factories.app.vue, { journeyExclude:
|
|
7814
|
+
...planned.has("app:vue") ? [(0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.factories.app.vue, { journeyExclude: journeyed ? " exclude: ['tests/app/vue/integration.test.ts'],\n" : " exclude: [],\n" })] : [],
|
|
7772
7815
|
...planned.has("app:server") ? [CONFIG_TEMPLATES.factories.app.server] : [],
|
|
7773
7816
|
CONFIG_TEMPLATES.factories.policy,
|
|
7774
7817
|
CONFIG_TEMPLATES.factories.config,
|
|
@@ -7828,11 +7871,11 @@ ${projects.map((project) => `\t\t\t${project},`).join("\n")}
|
|
|
7828
7871
|
].filter((helper) => body.includes(helper));
|
|
7829
7872
|
const helperImport = `import { ${helpers.join(", ")} } from './configs/helpers.js'\n`;
|
|
7830
7873
|
return (0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.root.vite, {
|
|
7831
|
-
journey:
|
|
7874
|
+
journey: journeyed ? "import type { JourneyVariant } from '@orkestrel/test'\n" : "",
|
|
7832
7875
|
imports: imports.length === 0 ? "" : `${imports.join("\n")}\n`,
|
|
7833
7876
|
helpers: helpers.length === 0 ? "" : matchesPrintWidth(helperImport.trimEnd()) ? helperImport : `import {\n${helpers.map((helper) => `\t${helper},`).join("\n")}\n} from './configs/helpers.js'\n`,
|
|
7834
7877
|
browsers: machinery.browser ? "import { resolveBrowser, resolvePinnedBrowser } from './configs/browsers.js'\nimport { commands } from './configs/commands.js'\n" : "",
|
|
7835
|
-
options: (machinery.browser ? "const browserOptions = resolveBrowser(resolvePinnedBrowser(), process.platform, process.env)\n// Vitest writes a page.screenshot() capture beside its test file unless a directory is named.\nconst screenshots = resolveWorkspacePath('tmp/captures/screenshots')\n\n" + blueprintToOptimizedDependencies(blueprint) : "") + (
|
|
7878
|
+
options: (machinery.browser ? "const browserOptions = resolveBrowser(resolvePinnedBrowser(), process.platform, process.env)\n// Vitest writes a page.screenshot() capture beside its test file unless a directory is named.\nconst screenshots = resolveWorkspacePath('tmp/captures/screenshots')\n\n" + blueprintToOptimizedDependencies(blueprint) : "") + (journeyed ? "const capture = process.env.CAPTURE === '1'\n\n" : "") + ((blueprint.journey || blueprint.showcase) && (base || applicationFaces.length > 0) ? `const applications = {\n${base ? " browser: appBrowser,\n" : ""}${applicationFaces.map((extension) => `\t${extension.name}: app${extension.name[0]?.toUpperCase()}${extension.name.slice(1)},\n`).join("")}}\n\n` : ""),
|
|
7836
7879
|
factories: body,
|
|
7837
7880
|
projects: projectRows
|
|
7838
7881
|
});
|
|
@@ -7853,6 +7896,8 @@ ${projects.map((project) => `\t\t\t${project},`).join("\n")}
|
|
|
7853
7896
|
* ```
|
|
7854
7897
|
*/
|
|
7855
7898
|
function blueprintToConfigArtifacts(blueprint) {
|
|
7899
|
+
const applicationFaces = blueprintToFaces(blueprint).filter((extension) => extension.axes.includes("app"));
|
|
7900
|
+
const base = blueprint.base && blueprint.app.includes("browser");
|
|
7856
7901
|
const roots = [{
|
|
7857
7902
|
path: "tsconfig.json",
|
|
7858
7903
|
group: "configs",
|
|
@@ -7992,7 +8037,7 @@ ${paths.join("\n")}
|
|
|
7992
8037
|
content: axis === "src" ? CONFIG_TEMPLATES.tsconfigs.vue.src : (0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.tsconfigs.vue.app, { include: include.map((entry, index) => `\t\t${JSON.stringify(entry)}${index === include.length - 1 ? "" : ","}`).join("\n") })
|
|
7993
8038
|
}];
|
|
7994
8039
|
}));
|
|
7995
|
-
const showcase = blueprint.showcase &&
|
|
8040
|
+
const showcase = blueprint.showcase && (base || applicationFaces.length > 0) ? [{
|
|
7996
8041
|
path: SHOWCASE_CONFIG_PATH,
|
|
7997
8042
|
group: "configs",
|
|
7998
8043
|
ownership: "content",
|
|
@@ -8000,7 +8045,7 @@ ${paths.join("\n")}
|
|
|
8000
8045
|
environment: "browser",
|
|
8001
8046
|
content: CONFIG_TEMPLATES.vites.app.showcase
|
|
8002
8047
|
}] : [];
|
|
8003
|
-
const journey = blueprint.journey &&
|
|
8048
|
+
const journey = blueprint.journey && (base || applicationFaces.length > 0) ? [{
|
|
8004
8049
|
path: JOURNEY_CONFIG_PATH,
|
|
8005
8050
|
group: "configs",
|
|
8006
8051
|
ownership: "birth",
|
|
@@ -8079,25 +8124,21 @@ function blueprintToSourceArtifacts(blueprint) {
|
|
|
8079
8124
|
environment,
|
|
8080
8125
|
content: ARTIFACT_TEMPLATES.source.empty
|
|
8081
8126
|
};
|
|
8082
|
-
if (environment === "browser") return [
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
environment,
|
|
8098
|
-
content: ARTIFACT_TEMPLATES.source.browser
|
|
8099
|
-
}
|
|
8100
|
-
];
|
|
8127
|
+
if (environment === "browser") return [entry, ...blueprint.base ? [{
|
|
8128
|
+
path: "app/browser/main.ts",
|
|
8129
|
+
group: "source",
|
|
8130
|
+
ownership: "birth",
|
|
8131
|
+
origin: "template",
|
|
8132
|
+
environment,
|
|
8133
|
+
content: (0, _orkestrel_template.fillTemplate)(ARTIFACT_TEMPLATES.source.main, { heading: `${matchesPrintWidth(`\t.appendChild(document.createElement('h1')).textContent = ${serializeTypeScriptString(blueprint.name)}`) ? " " : "\n "}${serializeTypeScriptString(blueprint.name)}` })
|
|
8134
|
+
}, {
|
|
8135
|
+
path: "app/browser/index.html",
|
|
8136
|
+
group: "source",
|
|
8137
|
+
ownership: "birth",
|
|
8138
|
+
origin: "template",
|
|
8139
|
+
environment,
|
|
8140
|
+
content: ARTIFACT_TEMPLATES.source.browser
|
|
8141
|
+
}] : []];
|
|
8101
8142
|
return environment === "server" ? [entry, {
|
|
8102
8143
|
path: "app/server/main.ts",
|
|
8103
8144
|
group: "source",
|
|
@@ -8263,7 +8304,8 @@ function blueprintToTestArtifacts(blueprint) {
|
|
|
8263
8304
|
origin: "template",
|
|
8264
8305
|
content: ARTIFACT_TEMPLATES.tests.global.proof
|
|
8265
8306
|
}] : [];
|
|
8266
|
-
const
|
|
8307
|
+
const base = blueprint.base && blueprint.app.includes("browser");
|
|
8308
|
+
const journeys = blueprint.journey && (base || blueprintToFaces(blueprint).some((extension) => extension.surface === "browser" && extension.axes.includes("app"))) ? [...base ? ["browser"] : [], ...blueprintToFaces(blueprint).flatMap((extension) => extension.surface === "browser" && extension.axes.includes("app") ? [extension.name] : [])].map((application) => ({
|
|
8267
8309
|
path: `tests/app/${application}/integration.test.ts`,
|
|
8268
8310
|
group: "tests",
|
|
8269
8311
|
ownership: "birth",
|
|
@@ -9271,17 +9313,28 @@ function blueprintToQuestions(blueprint) {
|
|
|
9271
9313
|
blocking: false,
|
|
9272
9314
|
candidates: ENVIRONMENTS
|
|
9273
9315
|
}] : [],
|
|
9274
|
-
...ENVIRONMENTS.flatMap((environment) =>
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9316
|
+
...ENVIRONMENTS.flatMap((environment) => {
|
|
9317
|
+
const selected = blueprint.app.filter((declared) => declared === environment).length;
|
|
9318
|
+
return [
|
|
9319
|
+
...blueprint.src.filter((declared) => declared === environment).length > 1 ? [{
|
|
9320
|
+
field: "src",
|
|
9321
|
+
message: `src declares ${environment} more than once.`,
|
|
9322
|
+
blocking: true,
|
|
9323
|
+
candidates: ENVIRONMENTS
|
|
9324
|
+
}] : [],
|
|
9325
|
+
...selected > 1 ? [{
|
|
9326
|
+
field: "app",
|
|
9327
|
+
message: `app declares ${environment} more than once.`,
|
|
9328
|
+
blocking: true,
|
|
9329
|
+
candidates: ENVIRONMENTS
|
|
9330
|
+
}] : [],
|
|
9331
|
+
...environment === "browser" && selected > 0 && blueprint.base === false && blueprint.extensions.every((extension) => extension.surface !== "browser" || !extension.axes.includes("app")) ? [{
|
|
9332
|
+
field: "base",
|
|
9333
|
+
message: "No base browser entry or app-side browser face is declared, so browser scripts and arrival artifacts are omitted.",
|
|
9334
|
+
blocking: false
|
|
9335
|
+
}] : []
|
|
9336
|
+
];
|
|
9337
|
+
}),
|
|
9285
9338
|
...Iterator.from(blueprint.extensions).map((extension) => {
|
|
9286
9339
|
const selection = `${extension.surface}:${extension.name}`;
|
|
9287
9340
|
return {
|
|
@@ -9327,9 +9380,9 @@ function blueprintToQuestions(blueprint) {
|
|
|
9327
9380
|
message: "showcase projects a browser app, and this workspace declares none, so it emits nothing.",
|
|
9328
9381
|
blocking: false
|
|
9329
9382
|
}] : [],
|
|
9330
|
-
...blueprint.journey && !blueprint.app.includes("browser") ? [{
|
|
9383
|
+
...blueprint.journey && (!blueprint.app.includes("browser") || !blueprint.base && blueprint.extensions.every((extension) => extension.surface !== "browser" || !extension.axes.includes("app"))) ? [{
|
|
9331
9384
|
field: "journey",
|
|
9332
|
-
message: "journey projects a browser app, and this workspace declares none, so it emits nothing.",
|
|
9385
|
+
message: blueprint.app.includes("browser") ? "journey projects a browser application, and this workspace declares neither a base entry nor an app-side browser face, so it emits nothing." : "journey projects a browser app, and this workspace declares none, so it emits nothing.",
|
|
9333
9386
|
blocking: false
|
|
9334
9387
|
}] : [],
|
|
9335
9388
|
...dependenciesToQuestions(blueprint.dependencies, "dependencies", DEPENDENCY_NAME_PATTERN, ORKESTREL_RANGE_PATTERN),
|
|
@@ -9537,6 +9590,7 @@ function createBlueprint(name, input) {
|
|
|
9537
9590
|
global: input?.global ?? false,
|
|
9538
9591
|
showcase: input?.showcase ?? false,
|
|
9539
9592
|
journey: input?.journey ?? false,
|
|
9593
|
+
base: input?.base ?? input?.app?.includes("browser") ?? false,
|
|
9540
9594
|
skills: input?.skills ?? false
|
|
9541
9595
|
}));
|
|
9542
9596
|
if (blueprint === void 0) throw new ScaffoldError("INVALID", "The filled record is not a blueprint.", { name });
|
|
@@ -9853,6 +9907,7 @@ exports.BASE_DEV_DEPENDENCIES = BASE_DEV_DEPENDENCIES;
|
|
|
9853
9907
|
exports.BIN_CONFIGS = BIN_CONFIGS;
|
|
9854
9908
|
exports.BIN_ENTRY_PATH = BIN_ENTRY_PATH;
|
|
9855
9909
|
exports.BIN_OUTPUT_PATH = BIN_OUTPUT_PATH;
|
|
9910
|
+
exports.BROWSER_ENTRIES = BROWSER_ENTRIES;
|
|
9856
9911
|
exports.BROWSE_DEV_DEPENDENCIES = BROWSE_DEV_DEPENDENCIES;
|
|
9857
9912
|
exports.BROWSE_UPSTREAM = BROWSE_UPSTREAM;
|
|
9858
9913
|
exports.CANON_PATHS = CANON_PATHS;
|