@orkestrel/scaffold 0.0.99 → 0.0.100
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 +74 -19
- package/dist/bin/main.js.map +1 -1
- package/dist/host/guides/scaffold.md +26 -4
- package/dist/host/manifest.json +2 -2
- package/dist/src/core/index.cjs +103 -4
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +40 -1
- package/dist/src/core/index.d.ts +40 -1
- package/dist/src/core/index.js +101 -5
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +9 -3
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +7 -1
- package/dist/src/server/index.d.ts +7 -1
- package/dist/src/server/index.js +11 -5
- package/dist/src/server/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -185,7 +185,8 @@ Exported from `@orkestrel/scaffold`, and reachable from
|
|
|
185
185
|
| `SERVICE_TEST_INCLUDE` | const | Names the include the live-service project covers, which is a directory rather than one proof. |
|
|
186
186
|
| `SHEET_ENTRY_NAME` | const | Names the build entry beside each stylesheet marker. |
|
|
187
187
|
| `SHOWCASE_CONFIG_PATH` | const | Names the Vite wrapper whose presence makes a workspace `showcase`. |
|
|
188
|
-
| `SHOWCASE_DEV_DEPENDENCIES` | const | Names the
|
|
188
|
+
| `SHOWCASE_DEV_DEPENDENCIES` | const | Names the tested dependency pair selected by the optional single-file showcase build. |
|
|
189
|
+
| `SHOWCASE_OVERRIDES` | const | Names the scoped npm override required by the tested showcase plugin. |
|
|
189
190
|
| `SHOWCASE_PAGES_PATH` | const | Names the physical showcase output directory. |
|
|
190
191
|
| `SKILLS_CONFIG_PATH` | const | Names the TypeScript wrapper whose presence makes a workspace `skills`. |
|
|
191
192
|
| `SOURCE_BROWSER_DEV_DEPENDENCIES` | const | Lists the development dependencies a published browser `src` environment adds. |
|
|
@@ -295,6 +296,7 @@ Exported from `@orkestrel/scaffold`, and reachable from
|
|
|
295
296
|
| `blueprintToHostArtifacts` | function | Compiles the vendored host artifacts a workspace plans. |
|
|
296
297
|
| `blueprintToMachinery` | function | Derives the host-specific machinery a generated root Vite configuration carries. |
|
|
297
298
|
| `blueprintToManifest` | function | Compiles a blueprint into its `package.json` content. |
|
|
299
|
+
| `blueprintToManifestOverrides` | function | Projects the scoped npm overrides required by a selected browser showcase. |
|
|
298
300
|
| `blueprintToOrchestrationArtifacts` | function | Compiles the blueprint-dependent orchestration artifacts. |
|
|
299
301
|
| `blueprintToQuestions` | function | Measures a blueprint against every law its own fields decide. |
|
|
300
302
|
| `blueprintToRootTsconfig` | function | Compiles the root TypeScript configuration for a blueprint. |
|
|
@@ -313,6 +315,7 @@ Exported from `@orkestrel/scaffold`, and reachable from
|
|
|
313
315
|
| `planToFindings` | function | Compares a plan against a target's current content. |
|
|
314
316
|
| `planToHash` | function | Computes a plan's content identity. |
|
|
315
317
|
| `replaceManifestRanges` | function | Replaces the runtime and development dependency ranges in package manifest text, and never a peer range. |
|
|
318
|
+
| `replaceManifestOverrides` | function | Replaces selected npm override leaves while preserving every byte outside the edited path. |
|
|
316
319
|
| `replaceManifestScripts` | function | Replaces named script values in package manifest text. |
|
|
317
320
|
| `replacePlanRanges` | function | Replaces dependency ranges in a plan's manifest and recomputes its identity. |
|
|
318
321
|
| `srcToEntry` | function | Projects a published selection into the manifest's entry fields. |
|
|
@@ -1776,15 +1779,34 @@ lookup verdict records why the registry row could not enter a layer.
|
|
|
1776
1779
|
|
|
1777
1780
|
## Dependency floors
|
|
1778
1781
|
|
|
1779
|
-
|
|
1782
|
+
Except for the selected showcase policy, every scaffold-owned runtime or development range is a floor: a caret over a whole
|
|
1780
1783
|
`major.minor.patch` version. The triple is the newest release the registry served when that floor
|
|
1781
1784
|
was last raised, so a workspace generated with no network still receives the latest floor scaffold
|
|
1782
1785
|
knew rather than a bare `major.0.0`. A `Blueprint.peers` row is written during creation into a
|
|
1783
1786
|
vacant target. After creation, peer declarations and `peerDependenciesMeta` are caller-owned:
|
|
1784
1787
|
`audit`, `repair`, `catalog`, and `overwrite` do not invent, rewrite, insert, or remove them. Caller
|
|
1785
|
-
extras
|
|
1788
|
+
extras pass through unchanged except for the selected showcase pair. Extras follow `EXTRA_RANGE_PATTERN`; fleet peers follow
|
|
1786
1789
|
`ORKESTREL_RANGE_PATTERN`; foreign peers follow `FLOOR_RANGE_PATTERN`.
|
|
1787
1790
|
|
|
1791
|
+
A browser application with `showcase: true`, including its Vue face, selects exact
|
|
1792
|
+
`vite-plugin-singlefile: 2.3.3`, Vite `^8.3.4` from scaffold's manifest, and the npm override
|
|
1793
|
+
`"vite-plugin-singlefile@2.3.3": { "micromatch": "npm:picomatch@2.3.2" }`. This policy applies
|
|
1794
|
+
after extras. Online resolution excludes this pair from ordinary foreign-major updates; other
|
|
1795
|
+
dependencies retain their usual resolution. Repair preserves each package's runtime or development
|
|
1796
|
+
section. Audit reports pin drift and override-only drift. Overwrite lands the pair and override in
|
|
1797
|
+
its offline half, including missing planned dependencies, before the catalog read.
|
|
1798
|
+
|
|
1799
|
+
`blueprintToManifestOverrides(blueprint: Blueprint): Readonly<Record<string, Readonly<Record<string, string>>>>`
|
|
1800
|
+
projects this metadata for a selected showcase and returns an empty map otherwise.
|
|
1801
|
+
`replaceManifestOverrides(manifest: string, overrides: Readonly<Record<string, Readonly<Record<string, string>>>>): string | undefined`
|
|
1802
|
+
inserts missing ancestors or leaves and replaces stale string leaves without changing unrelated
|
|
1803
|
+
bytes. Aligned text is returned unchanged. Invalid JSON, duplicate selected keys, malformed
|
|
1804
|
+
ancestors, and non-string owned leaves return `undefined`; repair and overwrite refuse these
|
|
1805
|
+
structures before writing configuration. `ManifestRegionSet.overrides` carries the same optional
|
|
1806
|
+
map into `Materializer.declare`, independently of the artifact replacements in `Blueprint.overrides`.
|
|
1807
|
+
Like other manifest-region writes, repair and overwrite apply this policy with any `--groups`
|
|
1808
|
+
selection. `replaceManifestRanges` continues to ignore npm overrides.
|
|
1809
|
+
|
|
1788
1810
|
The distribution project packs a caller-owned peer beside a co-peer witness that requires an exact
|
|
1789
1811
|
version. The real npm resolver accepts the preserved range. Its narrowed-range control reports
|
|
1790
1812
|
`ERESOLVE`.
|
|
@@ -1800,7 +1822,7 @@ row entering or leaving the manifest moves a test rather than passing unnoticed.
|
|
|
1800
1822
|
of `STYLES_DEV_DEPENDENCIES`, is a seed as well: it carries the `^1.105.1` range the
|
|
1801
1823
|
`@orkestrel/veneer` checkout declared on 2026-09-30, and that test names it in the seeded set.
|
|
1802
1824
|
|
|
1803
|
-
|
|
1825
|
+
Outside the selected showcase pair, a newer major is never crossed for you. `audit` reports one as a non-blocking `dependencies`
|
|
1804
1826
|
question, and a person decides whether the generated toolchain supports it. Inside the declared
|
|
1805
1827
|
major the verbs raise the floor themselves, which is what makes the caret's own width beside the
|
|
1806
1828
|
point: `^0.64.0` admits no `0.65.0`, and `repair` rewrites the range to `^0.65.0` rather than
|
package/dist/host/manifest.json
CHANGED
|
@@ -1042,7 +1042,7 @@
|
|
|
1042
1042
|
"storage": "guides/scaffold.md",
|
|
1043
1043
|
"destination": "guides/scaffold.md",
|
|
1044
1044
|
"executable": false,
|
|
1045
|
-
"digest": "
|
|
1045
|
+
"digest": "d0a34d3e2fce85649ad48e6ab59da0a0098bd9945bac33168412410d5f0b8ad4"
|
|
1046
1046
|
},
|
|
1047
1047
|
{
|
|
1048
1048
|
"storage": "guides/sea.md",
|
|
@@ -2120,5 +2120,5 @@
|
|
|
2120
2120
|
]
|
|
2121
2121
|
}
|
|
2122
2122
|
],
|
|
2123
|
-
"digest": "
|
|
2123
|
+
"digest": "2eb5a827baa67b121d77f333051acf59bd11b1572c9f26f7364444b1b4d9a9f4"
|
|
2124
2124
|
}
|
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.100",
|
|
8
8
|
description: "Scaffold workspaces with commands: new, audit, repair, catalog, and overwrite.",
|
|
9
9
|
keywords: [
|
|
10
10
|
"audit",
|
|
@@ -710,7 +710,7 @@ var APP_BROWSER_DEV_DEPENDENCIES = Object.freeze({
|
|
|
710
710
|
"@orkestrel/html": package_default.devDependencies["@orkestrel/html"]
|
|
711
711
|
});
|
|
712
712
|
/**
|
|
713
|
-
* Names the
|
|
713
|
+
* Names the tested dependency pair selected by the optional single-file showcase build.
|
|
714
714
|
*
|
|
715
715
|
* @example
|
|
716
716
|
* ```ts
|
|
@@ -719,7 +719,12 @@ var APP_BROWSER_DEV_DEPENDENCIES = Object.freeze({
|
|
|
719
719
|
* SHOWCASE_DEV_DEPENDENCIES['vite-plugin-singlefile'] // the showcase plugin range
|
|
720
720
|
* ```
|
|
721
721
|
*/
|
|
722
|
-
var SHOWCASE_DEV_DEPENDENCIES = Object.freeze({
|
|
722
|
+
var SHOWCASE_DEV_DEPENDENCIES = Object.freeze({
|
|
723
|
+
"vite-plugin-singlefile": "2.3.3",
|
|
724
|
+
vite: package_default.devDependencies.vite
|
|
725
|
+
});
|
|
726
|
+
/** Names the scoped npm override required by the tested showcase plugin. */
|
|
727
|
+
var SHOWCASE_OVERRIDES = Object.freeze({ [`vite-plugin-singlefile@${SHOWCASE_DEV_DEPENDENCIES["vite-plugin-singlefile"]}`]: Object.freeze({ micromatch: "npm:picomatch@2.3.2" }) });
|
|
723
728
|
/** Lists the development dependencies a private server application adds. */
|
|
724
729
|
var APP_SERVER_DEV_DEPENDENCIES = Object.freeze({
|
|
725
730
|
"@orkestrel/emitter": package_default.dependencies["@orkestrel/emitter"],
|
|
@@ -5765,16 +5770,106 @@ function blueprintToDevDependencies(blueprint) {
|
|
|
5765
5770
|
...blueprint.src.includes("browser") || blueprint.setup.includes("browser") || sheets ? SOURCE_BROWSER_DEV_DEPENDENCIES : {},
|
|
5766
5771
|
...blueprint.app.length > 0 ? APP_DEV_DEPENDENCIES : {},
|
|
5767
5772
|
...blueprint.app.includes("browser") ? APP_BROWSER_DEV_DEPENDENCIES : {},
|
|
5768
|
-
...blueprint.showcase && blueprint.app.includes("browser") ? SHOWCASE_DEV_DEPENDENCIES : {},
|
|
5769
5773
|
...blueprint.app.includes("server") ? APP_SERVER_DEV_DEPENDENCIES : {}
|
|
5770
5774
|
};
|
|
5771
5775
|
for (const framework of blueprintToMachinery(blueprint).frameworks) Object.assign(merged, FRAMEWORK_MATRIX[framework].dependencies);
|
|
5772
5776
|
for (const extra of blueprint.extras) merged[extra.name] = extra.range;
|
|
5777
|
+
if (blueprint.showcase && blueprint.app.includes("browser")) Object.assign(merged, SHOWCASE_DEV_DEPENDENCIES);
|
|
5773
5778
|
for (const peer of blueprint.peers) if (!Object.hasOwn(merged, peer.name)) merged[peer.name] = peer.range;
|
|
5774
5779
|
const runtime = new Set(blueprint.dependencies.map((dependency) => dependency.name));
|
|
5775
5780
|
return Object.fromEntries(Object.entries(merged).filter(([name]) => name !== own && !runtime.has(name)).sort(([left], [right]) => (0, _orkestrel_contract.compareValues)(left, right)));
|
|
5776
5781
|
}
|
|
5777
5782
|
/**
|
|
5783
|
+
* Projects the scoped npm overrides required by a selected browser showcase.
|
|
5784
|
+
*
|
|
5785
|
+
* @param blueprint - The workspace specification.
|
|
5786
|
+
* @returns The showcase override map, or an empty map for other workspaces.
|
|
5787
|
+
* @example
|
|
5788
|
+
* ```ts
|
|
5789
|
+
* import { blueprintToManifestOverrides, createBlueprint } from '@orkestrel/scaffold'
|
|
5790
|
+
* blueprintToManifestOverrides(createBlueprint('desk', { app: ['browser'], showcase: true }))
|
|
5791
|
+
* // { 'vite-plugin-singlefile@2.3.3': { micromatch: 'npm:picomatch@2.3.2' } }
|
|
5792
|
+
* ```
|
|
5793
|
+
*/
|
|
5794
|
+
function blueprintToManifestOverrides(blueprint) {
|
|
5795
|
+
return blueprint.showcase && blueprint.app.includes("browser") ? SHOWCASE_OVERRIDES : {};
|
|
5796
|
+
}
|
|
5797
|
+
/**
|
|
5798
|
+
* Replaces selected npm override leaves while preserving every byte outside the edited path.
|
|
5799
|
+
*
|
|
5800
|
+
* @param manifest - The JSON package manifest text.
|
|
5801
|
+
* @param overrides - The scoped selectors and string leaves to write.
|
|
5802
|
+
* @returns The aligned text, or `undefined` for invalid JSON, duplicate selected keys, malformed ancestors, or non-string owned leaves.
|
|
5803
|
+
* @remarks
|
|
5804
|
+
* Absent ancestors and leaves are inserted. Aligned strings retain their original spelling.
|
|
5805
|
+
* Unrelated overrides remain caller-owned. Artifact replacements in `Blueprint.overrides` are independent.
|
|
5806
|
+
* @example
|
|
5807
|
+
* ```ts
|
|
5808
|
+
* import { replaceManifestOverrides } from '@orkestrel/scaffold'
|
|
5809
|
+
* replaceManifestOverrides('{}', { 'plugin@1.0.0': { child: '2.0.0' } })
|
|
5810
|
+
* // '{"overrides":{"plugin@1.0.0":{"child":"2.0.0"}}}'
|
|
5811
|
+
* ```
|
|
5812
|
+
*/
|
|
5813
|
+
function replaceManifestOverrides(manifest, overrides) {
|
|
5814
|
+
if (!(0, _orkestrel_contract.isRecord)((0, _orkestrel_contract.parseJSON)(manifest))) return void 0;
|
|
5815
|
+
let compiled = manifest;
|
|
5816
|
+
for (const [selector, children] of Object.entries(overrides)) for (const [child, range] of Object.entries(children)) {
|
|
5817
|
+
const path = [
|
|
5818
|
+
"overrides",
|
|
5819
|
+
selector,
|
|
5820
|
+
child
|
|
5821
|
+
];
|
|
5822
|
+
let open = compiled.indexOf("{");
|
|
5823
|
+
for (let level = 0; level < path.length; level += 1) {
|
|
5824
|
+
const key = path[level];
|
|
5825
|
+
let depth = 0;
|
|
5826
|
+
let close = -1;
|
|
5827
|
+
let start = -1;
|
|
5828
|
+
let end = -1;
|
|
5829
|
+
let count = 0;
|
|
5830
|
+
for (const token of compiled.slice(open).matchAll(/"(?:\\[\s\S]|[^"\\])*"|[{}[\]]/gu)) {
|
|
5831
|
+
const position = open + token.index;
|
|
5832
|
+
const text = token[0];
|
|
5833
|
+
if (text === "{" || text === "[") depth += 1;
|
|
5834
|
+
else if (text === "}" || text === "]") {
|
|
5835
|
+
depth -= 1;
|
|
5836
|
+
if (depth === 1 && start >= 0 && end < 0) end = position + 1;
|
|
5837
|
+
if (depth === 0) {
|
|
5838
|
+
close = position;
|
|
5839
|
+
break;
|
|
5840
|
+
}
|
|
5841
|
+
} else if (depth === 1) {
|
|
5842
|
+
if (position === start) end = position + text.length;
|
|
5843
|
+
let colon = position + text.length;
|
|
5844
|
+
while (/\s/u.test(compiled.charAt(colon))) colon += 1;
|
|
5845
|
+
if (compiled.charAt(colon) !== ":" || (0, _orkestrel_contract.parseJSON)(text) !== key) continue;
|
|
5846
|
+
count += 1;
|
|
5847
|
+
start = colon + 1;
|
|
5848
|
+
while (/\s/u.test(compiled.charAt(start))) start += 1;
|
|
5849
|
+
end = -1;
|
|
5850
|
+
}
|
|
5851
|
+
}
|
|
5852
|
+
if (close < 0 || count > 1) return void 0;
|
|
5853
|
+
if (count === 0) {
|
|
5854
|
+
let insertion = JSON.stringify(range);
|
|
5855
|
+
for (const name of path.slice(level).reverse()) insertion = `{${JSON.stringify(name)}:${insertion}}`;
|
|
5856
|
+
let tail = close - 1;
|
|
5857
|
+
while (tail > open && /\s/u.test(compiled.charAt(tail))) tail -= 1;
|
|
5858
|
+
compiled = compiled.slice(0, tail + 1) + (tail === open ? "" : ",") + insertion.slice(1, -1) + compiled.slice(tail + 1);
|
|
5859
|
+
break;
|
|
5860
|
+
}
|
|
5861
|
+
if (level < path.length - 1) {
|
|
5862
|
+
if (compiled.charAt(start) !== "{") return void 0;
|
|
5863
|
+
open = start;
|
|
5864
|
+
} else {
|
|
5865
|
+
if (compiled.charAt(start) !== "\"" || end < 0) return void 0;
|
|
5866
|
+
if ((0, _orkestrel_contract.parseJSON)(compiled.slice(start, end)) !== range) compiled = compiled.slice(0, start) + JSON.stringify(range) + compiled.slice(end);
|
|
5867
|
+
}
|
|
5868
|
+
}
|
|
5869
|
+
}
|
|
5870
|
+
return compiled;
|
|
5871
|
+
}
|
|
5872
|
+
/**
|
|
5778
5873
|
* Projects a blueprint into the scripts its manifest declares.
|
|
5779
5874
|
*
|
|
5780
5875
|
* @param blueprint - The workspace specification.
|
|
@@ -6107,6 +6202,7 @@ function blueprintToManifest(blueprint) {
|
|
|
6107
6202
|
scripts: blueprintToScripts(blueprint),
|
|
6108
6203
|
dependencies,
|
|
6109
6204
|
devDependencies: blueprintToDevDependencies(blueprint),
|
|
6205
|
+
...Object.keys(blueprintToManifestOverrides(blueprint)).length > 0 ? { overrides: blueprintToManifestOverrides(blueprint) } : {},
|
|
6110
6206
|
...Object.keys(peerDependencies).length > 0 ? { peerDependencies } : {},
|
|
6111
6207
|
...Object.keys(peerDependenciesMeta).length > 0 ? { peerDependenciesMeta } : {},
|
|
6112
6208
|
devEngines: WORKSPACE_DEV_ENGINES,
|
|
@@ -8778,6 +8874,7 @@ exports.SERVICE_TEST_INCLUDE = SERVICE_TEST_INCLUDE;
|
|
|
8778
8874
|
exports.SHEET_ENTRY_NAME = SHEET_ENTRY_NAME;
|
|
8779
8875
|
exports.SHOWCASE_CONFIG_PATH = SHOWCASE_CONFIG_PATH;
|
|
8780
8876
|
exports.SHOWCASE_DEV_DEPENDENCIES = SHOWCASE_DEV_DEPENDENCIES;
|
|
8877
|
+
exports.SHOWCASE_OVERRIDES = SHOWCASE_OVERRIDES;
|
|
8781
8878
|
exports.SHOWCASE_PAGES_PATH = SHOWCASE_PAGES_PATH;
|
|
8782
8879
|
exports.SKILLS_CONFIG_PATH = SKILLS_CONFIG_PATH;
|
|
8783
8880
|
exports.SOURCE_BROWSER_DEV_DEPENDENCIES = SOURCE_BROWSER_DEV_DEPENDENCIES;
|
|
@@ -8806,6 +8903,7 @@ exports.blueprintToGuideArtifacts = blueprintToGuideArtifacts;
|
|
|
8806
8903
|
exports.blueprintToHostArtifacts = blueprintToHostArtifacts;
|
|
8807
8904
|
exports.blueprintToMachinery = blueprintToMachinery;
|
|
8808
8905
|
exports.blueprintToManifest = blueprintToManifest;
|
|
8906
|
+
exports.blueprintToManifestOverrides = blueprintToManifestOverrides;
|
|
8809
8907
|
exports.blueprintToOptimizedDependencies = blueprintToOptimizedDependencies;
|
|
8810
8908
|
exports.blueprintToOrchestrationArtifacts = blueprintToOrchestrationArtifacts;
|
|
8811
8909
|
exports.blueprintToProjects = blueprintToProjects;
|
|
@@ -8882,6 +8980,7 @@ exports.planToFindings = planToFindings;
|
|
|
8882
8980
|
exports.planToHash = planToHash;
|
|
8883
8981
|
exports.planToSummary = planToSummary;
|
|
8884
8982
|
exports.renderSkillPointer = renderSkillPointer;
|
|
8983
|
+
exports.replaceManifestOverrides = replaceManifestOverrides;
|
|
8885
8984
|
exports.replaceManifestRanges = replaceManifestRanges;
|
|
8886
8985
|
exports.replaceManifestScripts = replaceManifestScripts;
|
|
8887
8986
|
exports.replacePlanRanges = replacePlanRanges;
|