@orkestrel/scaffold 0.0.113 → 0.0.115
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/agents/skills/orkestrel-publish/scripts/wave.js +83 -16
- package/dist/bin/main.js +71 -23
- package/dist/bin/main.js.map +1 -1
- package/dist/host/agents/orchestration.md +5 -3
- package/dist/host/agents/platforms/windows.md +1 -0
- package/dist/host/agents/skills/orkestrel-align/references/integration.md +1 -1
- package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +4 -4
- package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +4 -1
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +8 -2
- package/dist/host/agents/skills/orkestrel-harden/references/equivalence.md +1 -0
- package/dist/host/agents/skills/orkestrel-harden/references/hardening.md +1 -1
- package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +1 -1
- package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +1 -0
- package/dist/host/agents/skills/orkestrel-publish/SKILL.md +7 -7
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +31 -11
- package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +150 -49
- package/dist/host/claude/agents/analyst.md +1 -1
- package/dist/host/claude/agents/astra.md +2 -2
- package/dist/host/claude/agents/builder.md +4 -4
- package/dist/host/claude/agents/opus.md +3 -3
- package/dist/host/claude/agents/orkestrel.md +57 -59
- package/dist/host/claude/agents/planner.md +8 -2
- package/dist/host/claude/rules/campaign.md +2 -1
- package/dist/host/claude/rules/documentation.md +1 -0
- package/dist/host/claude/rules/tests.md +13 -8
- package/dist/host/claude/rules/workspace.md +28 -28
- package/dist/host/claude/rules/writing.md +1 -0
- package/dist/host/claude/skills/enterprise-bootstrap/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-align/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-build/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-debrief/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-falsify/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-harden/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-journey/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-parallel/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-polish/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-publish/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-scout/SKILL.md +1 -1
- package/dist/host/codex/agents/analyst.toml +8 -5
- package/dist/host/codex/agents/astra.toml +4 -5
- package/dist/host/codex/agents/builder.toml +5 -5
- package/dist/host/codex/agents/opus.toml +3 -4
- package/dist/host/codex/agents/orkestrel.toml +2 -1
- package/dist/host/codex/agents/planner.toml +8 -5
- package/dist/host/codex/agents/reviewer.toml +5 -4
- package/dist/host/guides/agent.md +13 -13
- package/dist/host/guides/brief.md +4 -0
- package/dist/host/guides/browser.md +162 -44
- package/dist/host/guides/budget.md +1 -1
- package/dist/host/guides/capture.md +4 -0
- package/dist/host/guides/console.md +13 -0
- package/dist/host/guides/contract.md +38 -3
- package/dist/host/guides/csv.md +5 -0
- package/dist/host/guides/database.md +58 -8
- package/dist/host/guides/form.md +17 -0
- package/dist/host/guides/guide.md +36 -33
- package/dist/host/guides/html.md +72 -44
- package/dist/host/guides/indexeddb.md +4 -0
- package/dist/host/guides/lsp.md +49 -8
- package/dist/host/guides/markdown.md +146 -1
- package/dist/host/guides/mcp.md +117 -22
- package/dist/host/guides/middleware.md +194 -26
- package/dist/host/guides/msg.md +9 -5
- package/dist/host/guides/pool.md +8 -1
- package/dist/host/guides/probe.md +13 -1
- package/dist/host/guides/process.md +102 -90
- package/dist/host/guides/program.md +4 -0
- package/dist/host/guides/qualifier.md +4 -0
- package/dist/host/guides/rater.md +4 -0
- package/dist/host/guides/reason.md +6 -4
- package/dist/host/guides/relation.md +4 -0
- package/dist/host/guides/scaffold.md +32 -14
- package/dist/host/guides/server.md +29 -13
- package/dist/host/guides/sqlite.md +6 -0
- package/dist/host/guides/sse.md +6 -0
- package/dist/host/guides/study.md +473 -473
- package/dist/host/guides/table.md +3 -0
- package/dist/host/guides/template.md +3 -0
- package/dist/host/guides/test.md +38 -20
- package/dist/host/guides/tool.md +3 -0
- package/dist/host/guides/toolbox.md +21 -0
- package/dist/host/guides/websocket.md +3 -1
- package/dist/host/guides/workflow.md +103 -11
- package/dist/host/guides/workspace.md +4 -0
- package/dist/host/manifest.json +84 -84
- package/dist/host/tests/config.test.ts +7 -13
- package/dist/src/core/index.cjs +20 -28
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +7 -7
- package/dist/src/core/index.d.ts +7 -7
- package/dist/src/core/index.js +20 -28
- package/dist/src/core/index.js.map +1 -1
- package/package.json +12 -12
|
@@ -325,15 +325,15 @@ export function compareRanges(published, final) {
|
|
|
325
325
|
* Resolves the scaffold executable a target runs.
|
|
326
326
|
*
|
|
327
327
|
* @param target - The target directory.
|
|
328
|
-
* @returns Node and the installed scaffold entry, else Node and the target's own built entry
|
|
329
|
-
* none.
|
|
328
|
+
* @returns Node and the installed scaffold entry, else Node and the target's own built entry when
|
|
329
|
+
* its manifest names @orkestrel/scaffold, else none.
|
|
330
330
|
*/
|
|
331
331
|
export function resolveScaffold(target) {
|
|
332
332
|
const installed = join(target, 'node_modules', '@orkestrel', 'scaffold', 'dist', 'bin', 'main.js');
|
|
333
333
|
if (existsSync(installed))
|
|
334
334
|
return [process.execPath, installed];
|
|
335
335
|
const own = join(target, 'dist', 'bin', 'main.js');
|
|
336
|
-
if (existsSync(own))
|
|
336
|
+
if (readString(readManifest(target), 'name') === SCAFFOLD && existsSync(own))
|
|
337
337
|
return [process.execPath, own];
|
|
338
338
|
return [];
|
|
339
339
|
}
|
|
@@ -952,10 +952,12 @@ export function readReceipt(target) {
|
|
|
952
952
|
*
|
|
953
953
|
* @param runner - The visit's state.
|
|
954
954
|
* @param name - The package name the manifest declares.
|
|
955
|
-
* @
|
|
956
|
-
*
|
|
955
|
+
* @param format - The evidence collected by this invocation's format step. Without it, paths outside
|
|
956
|
+
* the overwrite receipt and manifest pair are refused.
|
|
957
|
+
* @returns Nothing after the rows are appended; each attributed group is committed separately when
|
|
958
|
+
* every dirty path belongs to the overwrite or this invocation's formatter rewrites.
|
|
957
959
|
*/
|
|
958
|
-
export function runRecord(runner, name) {
|
|
960
|
+
export function runRecord(runner, name, format) {
|
|
959
961
|
if (name === SCAFFOLD) {
|
|
960
962
|
appendStep(runner, 'record', 'git commit', `skipped: ${SCAFFOLD}`);
|
|
961
963
|
return;
|
|
@@ -963,10 +965,22 @@ export function runRecord(runner, name) {
|
|
|
963
965
|
if (refuseLocalSpecs(runner, 'record'))
|
|
964
966
|
return;
|
|
965
967
|
if (runner.dry) {
|
|
966
|
-
|
|
967
|
-
|
|
968
|
+
for (const message of ['Overwrite with scaffold <version>', 'Format with oxfmt <version>']) {
|
|
969
|
+
runStep(runner, 'record', 'git', ['--literal-pathspecs', 'add', '-A', '--pathspec-from-file=-', '--pathspec-file-nul'], runner.target);
|
|
970
|
+
runStep(runner, 'record', 'git', [
|
|
971
|
+
'--literal-pathspecs',
|
|
972
|
+
'commit',
|
|
973
|
+
'--only',
|
|
974
|
+
'-m',
|
|
975
|
+
message,
|
|
976
|
+
'--pathspec-from-file=-',
|
|
977
|
+
'--pathspec-file-nul',
|
|
978
|
+
], runner.target);
|
|
979
|
+
}
|
|
968
980
|
return;
|
|
969
981
|
}
|
|
982
|
+
if (format === undefined)
|
|
983
|
+
appendStep(runner, 'record', 'attribute format paths', 'format evidence is absent in this run; only overwrite receipt paths and the manifest pair can be committed');
|
|
970
984
|
const status = runStep(runner, 'record', 'git', ['status', '--porcelain=v1', '-z', '--untracked-files=all'], runner.target);
|
|
971
985
|
if (status?.status !== 0)
|
|
972
986
|
return;
|
|
@@ -986,25 +1000,76 @@ export function runRecord(runner, name) {
|
|
|
986
1000
|
return;
|
|
987
1001
|
}
|
|
988
1002
|
const allowed = [...receipt.written, ...receipt.removed, 'package.json', 'package-lock.json'].map((path) => normalizeSlashes(relative(runner.target, resolve(runner.target, path))));
|
|
989
|
-
const
|
|
1003
|
+
const overwritten = dirty.filter((path) => allowed.some((entry) => entry !== '' &&
|
|
990
1004
|
entry !== '..' &&
|
|
991
1005
|
!entry.startsWith('../') &&
|
|
992
1006
|
!isAbsolute(entry) &&
|
|
993
1007
|
path === entry));
|
|
1008
|
+
const formatted = dirty.filter((path) => !overwritten.includes(path) && format?.paths.includes(path));
|
|
1009
|
+
const outside = dirty.filter((path) => !overwritten.includes(path) && !formatted.includes(path));
|
|
994
1010
|
if (outside.length > 0) {
|
|
995
1011
|
appendStep(runner, 'record', 'contain overwrite paths', `dirty paths outside the overwrite: ${outside.join(', ')}`, 1);
|
|
996
1012
|
return;
|
|
997
1013
|
}
|
|
998
|
-
|
|
999
|
-
|
|
1014
|
+
if (formatted.length > 0 && (format?.version === undefined || !VERSION.test(format.version))) {
|
|
1015
|
+
appendStep(runner, 'record', 'read formatter version', 'cannot read the installed formatter version from node_modules/oxfmt/package.json; restore the oxfmt install before recording', 1);
|
|
1000
1016
|
return;
|
|
1001
|
-
|
|
1017
|
+
}
|
|
1018
|
+
for (const group of [
|
|
1019
|
+
{ paths: overwritten, message: `Overwrite with scaffold ${receipt.version}` },
|
|
1020
|
+
{ paths: formatted, message: `Format with oxfmt ${format?.version}` },
|
|
1021
|
+
]) {
|
|
1022
|
+
if (group.paths.length === 0)
|
|
1023
|
+
continue;
|
|
1024
|
+
const input = `${group.paths.join('\0')}\0`;
|
|
1025
|
+
runStep(runner, 'record', 'git', ['--literal-pathspecs', 'add', '-A', '--pathspec-from-file=-', '--pathspec-file-nul'], runner.target, readVerdict, input);
|
|
1026
|
+
if (failed(runner.steps))
|
|
1027
|
+
return;
|
|
1028
|
+
runStep(runner, 'record', 'git', [
|
|
1029
|
+
'--literal-pathspecs',
|
|
1030
|
+
'commit',
|
|
1031
|
+
'--only',
|
|
1032
|
+
'-m',
|
|
1033
|
+
group.message,
|
|
1034
|
+
'--pathspec-from-file=-',
|
|
1035
|
+
'--pathspec-file-nul',
|
|
1036
|
+
], runner.target, readVerdict, input);
|
|
1037
|
+
if (failed(runner.steps))
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1002
1040
|
if (failed(runner.steps))
|
|
1003
1041
|
return;
|
|
1004
1042
|
runStep(runner, 'record', 'git', ['status', '--porcelain'], runner.target, (result) => result.status === 0 && result.stdout.trim() !== ''
|
|
1005
1043
|
? { exit: 1, note: `tree remains dirty: ${result.stdout}` }
|
|
1006
1044
|
: readVerdict(result));
|
|
1007
1045
|
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Runs the formatter and attributes paths from the dirty sets read immediately before and after it.
|
|
1048
|
+
*
|
|
1049
|
+
* @param runner - The visit's state.
|
|
1050
|
+
* @returns This invocation's evidence, or undefined for a dry run or a failed step.
|
|
1051
|
+
*/
|
|
1052
|
+
export function runFormat(runner) {
|
|
1053
|
+
if (runner.dry) {
|
|
1054
|
+
runNpmStep(runner, 'format', ['run', 'format']);
|
|
1055
|
+
return undefined;
|
|
1056
|
+
}
|
|
1057
|
+
const version = readString(readManifest(join(runner.target, 'node_modules', 'oxfmt')), 'version');
|
|
1058
|
+
const before = runStep(runner, 'format', 'git', ['status', '--porcelain=v1', '-z', '--untracked-files=all'], runner.target);
|
|
1059
|
+
if (before?.status !== 0 || failed(runner.steps))
|
|
1060
|
+
return undefined;
|
|
1061
|
+
runNpmStep(runner, 'format', ['run', 'format']);
|
|
1062
|
+
if (failed(runner.steps))
|
|
1063
|
+
return undefined;
|
|
1064
|
+
const after = runStep(runner, 'format', 'git', ['status', '--porcelain=v1', '-z', '--untracked-files=all'], runner.target);
|
|
1065
|
+
if (after?.status !== 0 || failed(runner.steps))
|
|
1066
|
+
return undefined;
|
|
1067
|
+
const prior = new Set(readDirtyPaths(before.stdout));
|
|
1068
|
+
return {
|
|
1069
|
+
paths: [...new Set(readDirtyPaths(after.stdout))].filter((path) => !prior.has(path)),
|
|
1070
|
+
version,
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1008
1073
|
/**
|
|
1009
1074
|
* Moves one declared range to the registry caret of a release, keeping every other major a
|
|
1010
1075
|
* disjunctive range admits.
|
|
@@ -1273,7 +1338,10 @@ export function runVisit(argv) {
|
|
|
1273
1338
|
}
|
|
1274
1339
|
const scaffold = resolveScaffold(target);
|
|
1275
1340
|
if (scaffold.length === 0) {
|
|
1276
|
-
|
|
1341
|
+
const declared = [...readRanges(readManifest(target) ?? {}, RANGE_FIELDS).keys()].some((key) => key.endsWith(` ${SCAFFOLD}`));
|
|
1342
|
+
console.error(declared
|
|
1343
|
+
? `wave: no @orkestrel/scaffold executable under ${target}; run npm install to install its declared @orkestrel/scaffold dependency first`
|
|
1344
|
+
: `wave: no @orkestrel/scaffold executable under ${target}, and its manifest declares none; run npm install --save-dev @orkestrel/scaffold first`);
|
|
1277
1345
|
return undefined;
|
|
1278
1346
|
}
|
|
1279
1347
|
const [scaffoldFile, ...scaffoldPrefix] = scaffold;
|
|
@@ -1329,10 +1397,9 @@ export function runVisit(argv) {
|
|
|
1329
1397
|
const hits = selected.has('pins') && !failed(runner.steps)
|
|
1330
1398
|
? runPins(runner, before, readOption(argv, '--prior') ?? version)
|
|
1331
1399
|
: undefined;
|
|
1332
|
-
|
|
1333
|
-
runNpmStep(runner, 'format', ['run', 'format']);
|
|
1400
|
+
const format = selected.has('format') && !failed(runner.steps) ? runFormat(runner) : undefined;
|
|
1334
1401
|
if (selected.has('record') && !failed(runner.steps))
|
|
1335
|
-
runRecord(runner, name);
|
|
1402
|
+
runRecord(runner, name, format);
|
|
1336
1403
|
if (selected.has('gates') && !failed(runner.steps)) {
|
|
1337
1404
|
for (const gate of GATES) {
|
|
1338
1405
|
if (failed(runner.steps))
|
package/dist/bin/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { align, renderTable, strip, stripControls, width } from "@orkestrel/console";
|
|
3
3
|
import { attempt, isArray, isDefined, isError, isInstance, isRecord, isString, parseJSON } from "@orkestrel/contract";
|
|
4
|
-
import { AXES, BIN_ENTRY_PATH, CATALOG_AGENT_PATH, CONFORMANCE_TEST_PATH, Compiler, DEPENDENCY_NAME_PATTERN, ENVIRONMENTS, FRAMEWORKS, GLOBAL_SETUP_PATH, GROUPS, GUIDES_TEST_PATH, HOST_PATHS, INTEGRATION_TEST_PATH, JOURNEY_CONFIG_PATH, MAX_MANIFEST_BYTES, MAX_PATH_LENGTH, RESERVED_SHEET_NAMES, SERVICE_SETUP_PATH, SHEET_ENTRY_NAME, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SHOWCASE_PAGES_PATH, SKILLS_CONFIG_PATH, STYLES_ENTRY_PATH, ScaffoldError, THEMES_BARREL_PATH, THEMES_ENTRY_PATH, TREE_TEST_PATH, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToFaces, blueprintToManifestOverrides, blueprintToProjects, blueprintToScripts, blueprintToSheets, blueprintToTestArtifacts, blueprintToToolchainHolds, blueprintToWritableScripts, compareVersions, createBlueprint, extractRangeMajor, extractVersion, isFloorPath, isScaffoldError, isSheetName, iterateAnswers, manifestToDependencies, manifestToName, nameToGuide, parseExtension, replaceManifestOverrides, replaceManifestScripts, replacePlanRanges } from "../src/core/index.js";
|
|
4
|
+
import { AXES, BIN_ENTRY_PATH, CATALOG_AGENT_PATH, CONFORMANCE_TEST_PATH, Compiler, DEPENDENCY_NAME_PATTERN, ENVIRONMENTS, FRAMEWORKS, GLOBAL_SETUP_PATH, GROUPS, GUIDES_TEST_PATH, HOST_PATHS, INTEGRATION_TEST_PATH, JOURNEY_CONFIG_PATH, MAX_MANIFEST_BYTES, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, RESERVED_SHEET_NAMES, SERVICE_SETUP_PATH, SHEET_ENTRY_NAME, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SHOWCASE_PAGES_PATH, SKILLS_CONFIG_PATH, STYLES_ENTRY_PATH, ScaffoldError, THEMES_BARREL_PATH, THEMES_ENTRY_PATH, TREE_TEST_PATH, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToFaces, blueprintToManifestOverrides, blueprintToProjects, blueprintToScripts, blueprintToSheets, blueprintToTestArtifacts, blueprintToToolchainHolds, blueprintToWritableScripts, compareVersions, createBlueprint, extractRangeMajor, extractVersion, isFloorPath, isScaffoldError, isSheetName, iterateAnswers, manifestToDependencies, manifestToName, nameToGuide, parseExtension, replaceManifestOverrides, replaceManifestScripts, replacePlanRanges } from "../src/core/index.js";
|
|
5
5
|
import { MAX_INVENTORY_PATHS, Materializer, Upstream, filesToHost, isExactCaseFile, isPhysicalDirectory, isWorktree, listFiles, readFileText, readHostFloor, readHostManifest, readSnapshot, resolveContainedPath } from "../src/server/index.js";
|
|
6
6
|
import { createSession } from "@orkestrel/process/server";
|
|
7
7
|
import { createMarkdown, flattenText, isTableNode } from "@orkestrel/markdown";
|
|
@@ -10,7 +10,7 @@ import { normalize } from "node:path";
|
|
|
10
10
|
import { parseArgs } from "node:util";
|
|
11
11
|
var package_default = {
|
|
12
12
|
name: "@orkestrel/scaffold",
|
|
13
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.115",
|
|
14
14
|
description: "Scaffold workspaces with commands: new, audit, repair, catalog, and overwrite.",
|
|
15
15
|
keywords: [
|
|
16
16
|
"audit",
|
|
@@ -101,20 +101,20 @@ var package_default = {
|
|
|
101
101
|
"prepublishOnly": "npm run format:check && npm run lint:check && npm run check && npm run build && npm test && npm run test:templates && npm run test:distribution -- --mode release"
|
|
102
102
|
},
|
|
103
103
|
dependencies: {
|
|
104
|
-
"@orkestrel/console": "^0.0.
|
|
105
|
-
"@orkestrel/contract": "^0.0.
|
|
106
|
-
"@orkestrel/emitter": "^0.0.
|
|
107
|
-
"@orkestrel/markdown": "^0.0.
|
|
108
|
-
"@orkestrel/process": "^0.0.
|
|
109
|
-
"@orkestrel/template": "^0.0.
|
|
104
|
+
"@orkestrel/console": "^0.0.17",
|
|
105
|
+
"@orkestrel/contract": "^0.0.20",
|
|
106
|
+
"@orkestrel/emitter": "^0.0.13",
|
|
107
|
+
"@orkestrel/markdown": "^0.0.18",
|
|
108
|
+
"@orkestrel/process": "^0.0.16",
|
|
109
|
+
"@orkestrel/template": "^0.0.11"
|
|
110
110
|
},
|
|
111
111
|
devDependencies: {
|
|
112
112
|
"@microsoft/api-extractor": "^7.60.0",
|
|
113
|
-
"@orkestrel/browser": "^0.0.
|
|
114
|
-
"@orkestrel/guide": "^0.0.
|
|
115
|
-
"@orkestrel/html": "^0.0.
|
|
116
|
-
"@orkestrel/probe": "^0.0.
|
|
117
|
-
"@orkestrel/test": "^0.0.
|
|
113
|
+
"@orkestrel/browser": "^0.0.30",
|
|
114
|
+
"@orkestrel/guide": "^0.0.26",
|
|
115
|
+
"@orkestrel/html": "^0.0.13",
|
|
116
|
+
"@orkestrel/probe": "^0.0.26",
|
|
117
|
+
"@orkestrel/test": "^0.0.31",
|
|
118
118
|
"@types/node": "^24.19.2",
|
|
119
119
|
"@vitest/browser-playwright": "^5.0.5",
|
|
120
120
|
"oxfmt": "^0.75.0",
|
|
@@ -633,12 +633,18 @@ function auditToExit(audit) {
|
|
|
633
633
|
*
|
|
634
634
|
* @param manifest - The target manifest text.
|
|
635
635
|
* @param blueprint - The workspace shape that supplies the planned tool set.
|
|
636
|
+
* @param lifted - If `true`, raises a foreign development declaration whose major trails the plan's
|
|
637
|
+
* to the planned range; if `false`, keeps every declaration. Default: `false`.
|
|
636
638
|
* @returns The declared fleet rows and planned foreign tools in their writable sections.
|
|
637
639
|
* @remarks
|
|
638
640
|
* Selected showcase tools retain every string declaration in both sections.
|
|
639
641
|
* Other foreign tools retain runtime precedence when declared in both sections.
|
|
642
|
+
* A lift reaches the development section alone and uses the blueprint's framework holds. It reads
|
|
643
|
+
* a major only from `^MAJOR` or a full version, optionally under `^` or `~`, in a range no longer
|
|
644
|
+
* than `MAX_RANGE_LENGTH`; equal and later majors, and every other form, stay as declared, and a
|
|
645
|
+
* disjunction lifts only when every arm carries a readable major below the plan's.
|
|
640
646
|
*/
|
|
641
|
-
function manifestToWritableDependencies(manifest, blueprint) {
|
|
647
|
+
function manifestToWritableDependencies(manifest, blueprint, lifted = false) {
|
|
642
648
|
const declared = manifestToDependencies(manifest);
|
|
643
649
|
const parsed = parseJSON(manifest);
|
|
644
650
|
if (!isRecord(parsed)) return {
|
|
@@ -647,12 +653,21 @@ function manifestToWritableDependencies(manifest, blueprint) {
|
|
|
647
653
|
};
|
|
648
654
|
const runtimeRecord = isRecord(parsed.dependencies) ? parsed.dependencies : {};
|
|
649
655
|
const developmentRecord = isRecord(parsed.devDependencies) ? parsed.devDependencies : {};
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
+
const planned = blueprintToDevDependencies(blueprint);
|
|
657
|
+
const rows = Object.keys(planned).sort().filter((name) => !name.startsWith("@orkestrel/")).map((name) => {
|
|
658
|
+
const range = planned[name];
|
|
659
|
+
const major = range === void 0 ? void 0 : extractRangeMajor(range);
|
|
660
|
+
const declaredRange = developmentRecord[name];
|
|
661
|
+
return {
|
|
662
|
+
name,
|
|
663
|
+
runtimeRange: runtimeRecord[name],
|
|
664
|
+
developmentRange: lifted && isString(declaredRange) && declaredRange.length <= MAX_RANGE_LENGTH && major !== void 0 && declaredRange.split("||").every((arm) => {
|
|
665
|
+
const declaredMajor = extractRangeMajor(arm.trim());
|
|
666
|
+
return declaredMajor !== void 0 && declaredMajor < major;
|
|
667
|
+
}) ? range : declaredRange,
|
|
668
|
+
dual: blueprint.showcase && blueprint.app.includes("browser") && Object.hasOwn(SHOWCASE_DEV_DEPENDENCIES, name)
|
|
669
|
+
};
|
|
670
|
+
});
|
|
656
671
|
return {
|
|
657
672
|
runtime: [...dependenciesToFleet(declared.runtime), ...rows.flatMap(({ name, runtimeRange }) => isString(runtimeRange) ? [{
|
|
658
673
|
name,
|
|
@@ -665,6 +680,36 @@ function manifestToWritableDependencies(manifest, blueprint) {
|
|
|
665
680
|
};
|
|
666
681
|
}
|
|
667
682
|
/**
|
|
683
|
+
* Reports planned range changes that reached the same writable dependency section.
|
|
684
|
+
*
|
|
685
|
+
* @param declared - The ranges before the overwrite.
|
|
686
|
+
* @param planned - The declaration projection with foreign major lifts selected.
|
|
687
|
+
* @param written - The ranges read from the manifest after the overwrite.
|
|
688
|
+
* @returns Each lifted tool's name, original range, and written range, excluding unwritten lifts.
|
|
689
|
+
*
|
|
690
|
+
* @example
|
|
691
|
+
* ```ts
|
|
692
|
+
* import { pinsToLifts } from './helpers.js'
|
|
693
|
+
*
|
|
694
|
+
* pinsToLifts(
|
|
695
|
+
* { runtime: [], development: [{ name: 'vitest', range: '^4.1.12' }] },
|
|
696
|
+
* { runtime: [], development: [{ name: 'vitest', range: '^5.0.5' }] },
|
|
697
|
+
* { runtime: [], development: [{ name: 'vitest', range: '^5.0.6' }] },
|
|
698
|
+
* ) // [{ name: 'vitest', from: '^4.1.12', to: '^5.0.6' }]
|
|
699
|
+
* ```
|
|
700
|
+
*/
|
|
701
|
+
function pinsToLifts(declared, planned, written) {
|
|
702
|
+
return ["runtime", "development"].flatMap((section) => declared[section].flatMap(({ name, range }) => {
|
|
703
|
+
const next = planned[section].find((dependency) => dependency.name === name);
|
|
704
|
+
const final = written[section].find((dependency) => dependency.name === name);
|
|
705
|
+
return next !== void 0 && next.range !== range && final !== void 0 && final.range !== range ? [{
|
|
706
|
+
name,
|
|
707
|
+
from: range,
|
|
708
|
+
to: final.range
|
|
709
|
+
}] : [];
|
|
710
|
+
}));
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
668
713
|
* Reads the planned dependencies a target manifest declares in neither writable section.
|
|
669
714
|
*
|
|
670
715
|
* @param manifest - The target manifest text.
|
|
@@ -2039,9 +2084,10 @@ var CLI = class {
|
|
|
2039
2084
|
else this.#present(audit);
|
|
2040
2085
|
return 1;
|
|
2041
2086
|
}
|
|
2087
|
+
const manifest = this.#manifest(target);
|
|
2042
2088
|
const declared = {
|
|
2043
2089
|
overrides: blueprintToManifestOverrides(blueprint),
|
|
2044
|
-
pins: manifestToWritableDependencies(
|
|
2090
|
+
pins: manifestToWritableDependencies(manifest, blueprint, true),
|
|
2045
2091
|
scripts: manifestToWritableScripts(this.#manifest(target), blueprint)
|
|
2046
2092
|
};
|
|
2047
2093
|
const additions = manifestToAdditions(this.#manifest(target), blueprint);
|
|
@@ -2074,13 +2120,15 @@ var CLI = class {
|
|
|
2074
2120
|
...remainder,
|
|
2075
2121
|
...mergeResults(local, remainder),
|
|
2076
2122
|
audit: terminal,
|
|
2077
|
-
additions
|
|
2123
|
+
additions,
|
|
2124
|
+
lifts: pinsToLifts(manifestToWritableDependencies(manifest, blueprint), declared.pins, manifestToWritableDependencies(this.#manifest(target), blueprint))
|
|
2078
2125
|
};
|
|
2079
2126
|
if (command.json === true) this.#report(outcome);
|
|
2080
2127
|
else {
|
|
2081
2128
|
this.#present(terminal);
|
|
2082
2129
|
this.#reportReplacements(audit, terminal);
|
|
2083
2130
|
this.#recount(outcome);
|
|
2131
|
+
for (const { name, from, to } of outcome.lifts) this.#say(`Lifted ${JSON.stringify(name)} from ${JSON.stringify(from)} to ${JSON.stringify(to)}. Run npm install to install it.`);
|
|
2084
2132
|
for (const { section, dependencies } of [{
|
|
2085
2133
|
section: "dependencies",
|
|
2086
2134
|
dependencies: additions.runtime
|
|
@@ -2478,7 +2526,7 @@ var CLI = class {
|
|
|
2478
2526
|
return (scriptToInvocations(script)?.projects ?? []).flatMap((project) => {
|
|
2479
2527
|
const direct = `test:${project}`;
|
|
2480
2528
|
const command = expected[direct];
|
|
2481
|
-
return project === "probe" || command === void 0 ? [] : [[project, `"${direct}": ${JSON.stringify(command)},`]];
|
|
2529
|
+
return project === "probe" || project === "studies" || command === void 0 ? [] : [[project, `"${direct}": ${JSON.stringify(command)},`]];
|
|
2482
2530
|
});
|
|
2483
2531
|
}));
|
|
2484
2532
|
const faces = /* @__PURE__ */ new Set([...blueprintToSheets(blueprint).map((name) => `src:${name}`), ...blueprintToFaces(blueprint).flatMap(({ name, axes }) => axes.map((axis) => `${axis}:${name}`))]);
|