@orkestrel/scaffold 0.0.5 → 0.0.7
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/scaffold.js +57 -22
- package/dist/bin/scaffold.js.map +1 -1
- package/dist/host/CLAUDE.md +64 -24
- package/dist/host/claude/rules/workspace.md +8 -8
- package/dist/host/guides/src/scaffold.md +178 -94
- package/dist/host/scripts/codex.sh +5 -0
- package/dist/host/tests/setupPolicy.ts +179 -4
- package/dist/src/core/index.cjs +289 -69
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +74 -13
- package/dist/src/core/index.d.ts +74 -13
- package/dist/src/core/index.js +287 -70
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +11 -5
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +4 -2
- package/dist/src/server/index.d.ts +4 -2
- package/dist/src/server/index.js +12 -6
- package/dist/src/server/index.js.map +1 -1
- package/package.json +12 -11
|
@@ -144,7 +144,7 @@ export declare interface ArtifactBase {
|
|
|
144
144
|
*
|
|
145
145
|
* @returns A fresh `ContractShape` describing one planned file.
|
|
146
146
|
*/
|
|
147
|
-
export declare function artifactShape(): UnionShape<[ ObjectShape<{
|
|
147
|
+
export declare function artifactShape(): UnionShape<readonly [ ObjectShape<{
|
|
148
148
|
path: StringShape;
|
|
149
149
|
group: LiteralShape<readonly Group[]>;
|
|
150
150
|
origin: LiteralShape<readonly ["host"]>;
|
|
@@ -305,7 +305,7 @@ export declare function blueprintToMembers(spec: Blueprint): readonly Member[];
|
|
|
305
305
|
/**
|
|
306
306
|
* The full pure compilation: draft a blueprint's artifacts — the manifest and
|
|
307
307
|
* exports combination rules over the per-environment `SRC_MATRIX` rows, plus
|
|
308
|
-
* `HOST_PATHS` and `overrides` — then pin.
|
|
308
|
+
* the `selectHostPaths` selection of `HOST_PATHS` and `overrides` — then pin.
|
|
309
309
|
*
|
|
310
310
|
* @param blueprint - The `Blueprint` to compile.
|
|
311
311
|
* @param groups - An optional `Group[]` selection (default: all groups).
|
|
@@ -644,7 +644,7 @@ export declare function contentToHex(content: string): string;
|
|
|
644
644
|
export declare const CONTROL_CHARACTER_PATTERN: RegExp;
|
|
645
645
|
|
|
646
646
|
/**
|
|
647
|
-
* `configs/src/tsconfig.core.json` —
|
|
647
|
+
* `configs/src/tsconfig.core.json` — host-neutral core with web interop declarations.
|
|
648
648
|
*
|
|
649
649
|
* @returns The core environment `tsconfig` file content, newline-terminated.
|
|
650
650
|
*
|
|
@@ -1042,12 +1042,15 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
1042
1042
|
|
|
1043
1043
|
/**
|
|
1044
1044
|
* Draft the `guides` group's artifacts — the package's own filled guide stub,
|
|
1045
|
-
* the guides index, and
|
|
1045
|
+
* the guides index, and vendored dependency guide mirrors whose paths are
|
|
1046
|
+
* neither the package's own guide nor already carried by the selected host
|
|
1047
|
+
* set.
|
|
1046
1048
|
*
|
|
1047
1049
|
* @param spec - The `Blueprint` to derive guide artifacts from.
|
|
1048
1050
|
* @param pascal - The package's PascalCase entity name.
|
|
1049
1051
|
* @param members - The blueprint's derived `Member[]`.
|
|
1050
|
-
* @returns The `guides` group's `Artifact[]
|
|
1052
|
+
* @returns The `guides` group's `Artifact[]`, with one contributor per guide
|
|
1053
|
+
* path.
|
|
1051
1054
|
*
|
|
1052
1055
|
* @example
|
|
1053
1056
|
* ```ts
|
|
@@ -1184,9 +1187,12 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
1184
1187
|
* The root docs (`AGENTS.md` / `CLAUDE.md`), `LICENSE`, `.agents`, `.claude`, `.codex`,
|
|
1185
1188
|
* the four SessionStart hook scripts (`scripts/deps.sh` / `scripts/cursor.sh` /
|
|
1186
1189
|
* `scripts/codex.sh` / `scripts/ollama.sh`), the repository coding-law policy module,
|
|
1187
|
-
* the line's seven byte-identical root dotfiles, and the two guides-grouped
|
|
1188
|
-
* dev-tooling guide
|
|
1189
|
-
* scaffold engine's own self-guide
|
|
1190
|
+
* the line's seven byte-identical root dotfiles, and the two guides-grouped
|
|
1191
|
+
* mirror candidates: the line-wide dev-tooling guide
|
|
1192
|
+
* (`guides/src/guide.md`) and the scaffold engine's own self-guide
|
|
1193
|
+
* (`guides/src/scaffold.md`). `stageHost` vendors both; each plan carries the
|
|
1194
|
+
* subset selected by `selectHostPaths`, omitting the target blueprint's own
|
|
1195
|
+
* guide.
|
|
1190
1196
|
*/
|
|
1191
1197
|
export declare const HOST_PATHS: readonly string[];
|
|
1192
1198
|
|
|
@@ -1393,6 +1399,24 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
1393
1399
|
*/
|
|
1394
1400
|
export declare function manifestToDependencies(manifestText: string): readonly Dependency[];
|
|
1395
1401
|
|
|
1402
|
+
/**
|
|
1403
|
+
* Project a `package.json` text to its own string `name`.
|
|
1404
|
+
*
|
|
1405
|
+
* @param manifest - The `package.json` file content.
|
|
1406
|
+
* @returns The own string `name`, or `undefined` when the manifest exceeds its
|
|
1407
|
+
* byte ceiling, is malformed, has a non-object root, or has no own string
|
|
1408
|
+
* `name`.
|
|
1409
|
+
*
|
|
1410
|
+
* @example
|
|
1411
|
+
* ```ts
|
|
1412
|
+
* import { manifestToName } from '@orkestrel/scaffold'
|
|
1413
|
+
*
|
|
1414
|
+
* manifestToName('{"name":"@orkestrel/router"}') // '@orkestrel/router'
|
|
1415
|
+
* manifestToName('{}') // undefined
|
|
1416
|
+
* ```
|
|
1417
|
+
*/
|
|
1418
|
+
export declare function manifestToName(manifest: string): string | undefined;
|
|
1419
|
+
|
|
1396
1420
|
/** Maximum byte size accepted for one scaffold artifact. */
|
|
1397
1421
|
export declare const MAX_ARTIFACT_BYTES = 5242880;
|
|
1398
1422
|
|
|
@@ -1493,12 +1517,13 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
1493
1517
|
export declare const ORKESTREL_RANGE_PATTERN: RegExp;
|
|
1494
1518
|
|
|
1495
1519
|
/**
|
|
1496
|
-
* One
|
|
1520
|
+
* One artifact override.
|
|
1497
1521
|
*
|
|
1498
1522
|
* @remarks
|
|
1499
1523
|
* `content` REPLACES the rendered artifact at `path`, never partially merges.
|
|
1500
|
-
* An override whose `path` matches no planned artifact,
|
|
1501
|
-
* `host`-origin path, is a BLOCKING question
|
|
1524
|
+
* An override whose `path` matches no planned artifact, targets a
|
|
1525
|
+
* `host`-origin path, or targets `package.json` is a BLOCKING question.
|
|
1526
|
+
* Accepted overrides surface as retained non-blocking advisories.
|
|
1502
1527
|
*/
|
|
1503
1528
|
export declare interface Override {
|
|
1504
1529
|
readonly path: string;
|
|
@@ -1931,7 +1956,7 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
1931
1956
|
engine: BooleanShape;
|
|
1932
1957
|
}, false>;
|
|
1933
1958
|
groups: ArrayShape<LiteralShape<readonly Group[]>>;
|
|
1934
|
-
artifacts: ArrayShape<UnionShape<[ ObjectShape<{
|
|
1959
|
+
artifacts: ArrayShape<UnionShape<readonly [ ObjectShape<{
|
|
1935
1960
|
path: StringShape;
|
|
1936
1961
|
group: LiteralShape<readonly Group[]>;
|
|
1937
1962
|
origin: LiteralShape<readonly ["host"]>;
|
|
@@ -2085,6 +2110,22 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
2085
2110
|
*/
|
|
2086
2111
|
export declare function renderValue(entry: unknown, indent: string, prefix: string, suffix: string): string;
|
|
2087
2112
|
|
|
2113
|
+
/**
|
|
2114
|
+
* Render the root Vitest project registration, preserving browser ownership
|
|
2115
|
+
* supplied by the caller.
|
|
2116
|
+
*
|
|
2117
|
+
* @param registrations - Ordered project factory identifiers with optional browser labels.
|
|
2118
|
+
* @param browser - Whether the generated configuration carries browser machinery.
|
|
2119
|
+
* @returns The rendered root `test` property.
|
|
2120
|
+
*
|
|
2121
|
+
* @example
|
|
2122
|
+
* ```ts
|
|
2123
|
+
* renderViteTest([{ project: 'srcCore' }], false)
|
|
2124
|
+
* // '\ttest: {\n\t\tprojects: [srcCore],\n\t},'
|
|
2125
|
+
* ```
|
|
2126
|
+
*/
|
|
2127
|
+
export declare function renderViteTest(registrations: readonly ViteProjectRegistration[], browser: boolean): string;
|
|
2128
|
+
|
|
2088
2129
|
/**
|
|
2089
2130
|
* The root `tsconfig.json` — one `@src/<environment>` path alias per declared
|
|
2090
2131
|
* environment, in declared order.
|
|
@@ -2132,7 +2173,7 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
2132
2173
|
export declare function rootViteConfig(src: readonly Environment[], engine?: boolean): string;
|
|
2133
2174
|
|
|
2134
2175
|
/** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
|
|
2135
|
-
export declare const SCAFFOLD_RANGE = "^0.0.
|
|
2176
|
+
export declare const SCAFFOLD_RANGE = "^0.0.7";
|
|
2136
2177
|
|
|
2137
2178
|
/**
|
|
2138
2179
|
* Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
|
|
@@ -2175,6 +2216,20 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
2175
2216
|
readonly digest: string;
|
|
2176
2217
|
}
|
|
2177
2218
|
|
|
2219
|
+
/**
|
|
2220
|
+
* Select host paths without the guide owned by the target blueprint.
|
|
2221
|
+
*
|
|
2222
|
+
* @param paths - Host artifact paths in deterministic input order.
|
|
2223
|
+
* @param name - The target blueprint's unscoped package name.
|
|
2224
|
+
* @returns Every host path except `guides/src/<name>.md`, in input order.
|
|
2225
|
+
*
|
|
2226
|
+
* @example
|
|
2227
|
+
* ```ts
|
|
2228
|
+
* selectHostPaths(['guides/src/guide.md', 'LICENSE'], 'guide') // ['LICENSE']
|
|
2229
|
+
* ```
|
|
2230
|
+
*/
|
|
2231
|
+
export declare function selectHostPaths(paths: readonly string[], name: string): readonly string[];
|
|
2232
|
+
|
|
2178
2233
|
/**
|
|
2179
2234
|
* Serialize text as a single-quoted TypeScript string literal.
|
|
2180
2235
|
*
|
|
@@ -2633,4 +2688,10 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
2633
2688
|
*/
|
|
2634
2689
|
export declare function viteMachinery(src: readonly Environment[], app?: readonly Environment[], engine?: boolean): ViteMachinery;
|
|
2635
2690
|
|
|
2691
|
+
/** One generated Vitest project factory and its optional browser-project label. */
|
|
2692
|
+
export declare interface ViteProjectRegistration {
|
|
2693
|
+
readonly project: string;
|
|
2694
|
+
readonly browser?: string;
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2636
2697
|
export { }
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -144,7 +144,7 @@ export declare interface ArtifactBase {
|
|
|
144
144
|
*
|
|
145
145
|
* @returns A fresh `ContractShape` describing one planned file.
|
|
146
146
|
*/
|
|
147
|
-
export declare function artifactShape(): UnionShape<[ ObjectShape<{
|
|
147
|
+
export declare function artifactShape(): UnionShape<readonly [ ObjectShape<{
|
|
148
148
|
path: StringShape;
|
|
149
149
|
group: LiteralShape<readonly Group[]>;
|
|
150
150
|
origin: LiteralShape<readonly ["host"]>;
|
|
@@ -305,7 +305,7 @@ export declare function blueprintToMembers(spec: Blueprint): readonly Member[];
|
|
|
305
305
|
/**
|
|
306
306
|
* The full pure compilation: draft a blueprint's artifacts — the manifest and
|
|
307
307
|
* exports combination rules over the per-environment `SRC_MATRIX` rows, plus
|
|
308
|
-
* `HOST_PATHS` and `overrides` — then pin.
|
|
308
|
+
* the `selectHostPaths` selection of `HOST_PATHS` and `overrides` — then pin.
|
|
309
309
|
*
|
|
310
310
|
* @param blueprint - The `Blueprint` to compile.
|
|
311
311
|
* @param groups - An optional `Group[]` selection (default: all groups).
|
|
@@ -644,7 +644,7 @@ export declare function contentToHex(content: string): string;
|
|
|
644
644
|
export declare const CONTROL_CHARACTER_PATTERN: RegExp;
|
|
645
645
|
|
|
646
646
|
/**
|
|
647
|
-
* `configs/src/tsconfig.core.json` —
|
|
647
|
+
* `configs/src/tsconfig.core.json` — host-neutral core with web interop declarations.
|
|
648
648
|
*
|
|
649
649
|
* @returns The core environment `tsconfig` file content, newline-terminated.
|
|
650
650
|
*
|
|
@@ -1042,12 +1042,15 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
1042
1042
|
|
|
1043
1043
|
/**
|
|
1044
1044
|
* Draft the `guides` group's artifacts — the package's own filled guide stub,
|
|
1045
|
-
* the guides index, and
|
|
1045
|
+
* the guides index, and vendored dependency guide mirrors whose paths are
|
|
1046
|
+
* neither the package's own guide nor already carried by the selected host
|
|
1047
|
+
* set.
|
|
1046
1048
|
*
|
|
1047
1049
|
* @param spec - The `Blueprint` to derive guide artifacts from.
|
|
1048
1050
|
* @param pascal - The package's PascalCase entity name.
|
|
1049
1051
|
* @param members - The blueprint's derived `Member[]`.
|
|
1050
|
-
* @returns The `guides` group's `Artifact[]
|
|
1052
|
+
* @returns The `guides` group's `Artifact[]`, with one contributor per guide
|
|
1053
|
+
* path.
|
|
1051
1054
|
*
|
|
1052
1055
|
* @example
|
|
1053
1056
|
* ```ts
|
|
@@ -1184,9 +1187,12 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
1184
1187
|
* The root docs (`AGENTS.md` / `CLAUDE.md`), `LICENSE`, `.agents`, `.claude`, `.codex`,
|
|
1185
1188
|
* the four SessionStart hook scripts (`scripts/deps.sh` / `scripts/cursor.sh` /
|
|
1186
1189
|
* `scripts/codex.sh` / `scripts/ollama.sh`), the repository coding-law policy module,
|
|
1187
|
-
* the line's seven byte-identical root dotfiles, and the two guides-grouped
|
|
1188
|
-
* dev-tooling guide
|
|
1189
|
-
* scaffold engine's own self-guide
|
|
1190
|
+
* the line's seven byte-identical root dotfiles, and the two guides-grouped
|
|
1191
|
+
* mirror candidates: the line-wide dev-tooling guide
|
|
1192
|
+
* (`guides/src/guide.md`) and the scaffold engine's own self-guide
|
|
1193
|
+
* (`guides/src/scaffold.md`). `stageHost` vendors both; each plan carries the
|
|
1194
|
+
* subset selected by `selectHostPaths`, omitting the target blueprint's own
|
|
1195
|
+
* guide.
|
|
1190
1196
|
*/
|
|
1191
1197
|
export declare const HOST_PATHS: readonly string[];
|
|
1192
1198
|
|
|
@@ -1393,6 +1399,24 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
1393
1399
|
*/
|
|
1394
1400
|
export declare function manifestToDependencies(manifestText: string): readonly Dependency[];
|
|
1395
1401
|
|
|
1402
|
+
/**
|
|
1403
|
+
* Project a `package.json` text to its own string `name`.
|
|
1404
|
+
*
|
|
1405
|
+
* @param manifest - The `package.json` file content.
|
|
1406
|
+
* @returns The own string `name`, or `undefined` when the manifest exceeds its
|
|
1407
|
+
* byte ceiling, is malformed, has a non-object root, or has no own string
|
|
1408
|
+
* `name`.
|
|
1409
|
+
*
|
|
1410
|
+
* @example
|
|
1411
|
+
* ```ts
|
|
1412
|
+
* import { manifestToName } from '@orkestrel/scaffold'
|
|
1413
|
+
*
|
|
1414
|
+
* manifestToName('{"name":"@orkestrel/router"}') // '@orkestrel/router'
|
|
1415
|
+
* manifestToName('{}') // undefined
|
|
1416
|
+
* ```
|
|
1417
|
+
*/
|
|
1418
|
+
export declare function manifestToName(manifest: string): string | undefined;
|
|
1419
|
+
|
|
1396
1420
|
/** Maximum byte size accepted for one scaffold artifact. */
|
|
1397
1421
|
export declare const MAX_ARTIFACT_BYTES = 5242880;
|
|
1398
1422
|
|
|
@@ -1493,12 +1517,13 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
1493
1517
|
export declare const ORKESTREL_RANGE_PATTERN: RegExp;
|
|
1494
1518
|
|
|
1495
1519
|
/**
|
|
1496
|
-
* One
|
|
1520
|
+
* One artifact override.
|
|
1497
1521
|
*
|
|
1498
1522
|
* @remarks
|
|
1499
1523
|
* `content` REPLACES the rendered artifact at `path`, never partially merges.
|
|
1500
|
-
* An override whose `path` matches no planned artifact,
|
|
1501
|
-
* `host`-origin path, is a BLOCKING question
|
|
1524
|
+
* An override whose `path` matches no planned artifact, targets a
|
|
1525
|
+
* `host`-origin path, or targets `package.json` is a BLOCKING question.
|
|
1526
|
+
* Accepted overrides surface as retained non-blocking advisories.
|
|
1502
1527
|
*/
|
|
1503
1528
|
export declare interface Override {
|
|
1504
1529
|
readonly path: string;
|
|
@@ -1931,7 +1956,7 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
1931
1956
|
engine: BooleanShape;
|
|
1932
1957
|
}, false>;
|
|
1933
1958
|
groups: ArrayShape<LiteralShape<readonly Group[]>>;
|
|
1934
|
-
artifacts: ArrayShape<UnionShape<[ ObjectShape<{
|
|
1959
|
+
artifacts: ArrayShape<UnionShape<readonly [ ObjectShape<{
|
|
1935
1960
|
path: StringShape;
|
|
1936
1961
|
group: LiteralShape<readonly Group[]>;
|
|
1937
1962
|
origin: LiteralShape<readonly ["host"]>;
|
|
@@ -2085,6 +2110,22 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
2085
2110
|
*/
|
|
2086
2111
|
export declare function renderValue(entry: unknown, indent: string, prefix: string, suffix: string): string;
|
|
2087
2112
|
|
|
2113
|
+
/**
|
|
2114
|
+
* Render the root Vitest project registration, preserving browser ownership
|
|
2115
|
+
* supplied by the caller.
|
|
2116
|
+
*
|
|
2117
|
+
* @param registrations - Ordered project factory identifiers with optional browser labels.
|
|
2118
|
+
* @param browser - Whether the generated configuration carries browser machinery.
|
|
2119
|
+
* @returns The rendered root `test` property.
|
|
2120
|
+
*
|
|
2121
|
+
* @example
|
|
2122
|
+
* ```ts
|
|
2123
|
+
* renderViteTest([{ project: 'srcCore' }], false)
|
|
2124
|
+
* // '\ttest: {\n\t\tprojects: [srcCore],\n\t},'
|
|
2125
|
+
* ```
|
|
2126
|
+
*/
|
|
2127
|
+
export declare function renderViteTest(registrations: readonly ViteProjectRegistration[], browser: boolean): string;
|
|
2128
|
+
|
|
2088
2129
|
/**
|
|
2089
2130
|
* The root `tsconfig.json` — one `@src/<environment>` path alias per declared
|
|
2090
2131
|
* environment, in declared order.
|
|
@@ -2132,7 +2173,7 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
2132
2173
|
export declare function rootViteConfig(src: readonly Environment[], engine?: boolean): string;
|
|
2133
2174
|
|
|
2134
2175
|
/** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
|
|
2135
|
-
export declare const SCAFFOLD_RANGE = "^0.0.
|
|
2176
|
+
export declare const SCAFFOLD_RANGE = "^0.0.7";
|
|
2136
2177
|
|
|
2137
2178
|
/**
|
|
2138
2179
|
* Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
|
|
@@ -2175,6 +2216,20 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
2175
2216
|
readonly digest: string;
|
|
2176
2217
|
}
|
|
2177
2218
|
|
|
2219
|
+
/**
|
|
2220
|
+
* Select host paths without the guide owned by the target blueprint.
|
|
2221
|
+
*
|
|
2222
|
+
* @param paths - Host artifact paths in deterministic input order.
|
|
2223
|
+
* @param name - The target blueprint's unscoped package name.
|
|
2224
|
+
* @returns Every host path except `guides/src/<name>.md`, in input order.
|
|
2225
|
+
*
|
|
2226
|
+
* @example
|
|
2227
|
+
* ```ts
|
|
2228
|
+
* selectHostPaths(['guides/src/guide.md', 'LICENSE'], 'guide') // ['LICENSE']
|
|
2229
|
+
* ```
|
|
2230
|
+
*/
|
|
2231
|
+
export declare function selectHostPaths(paths: readonly string[], name: string): readonly string[];
|
|
2232
|
+
|
|
2178
2233
|
/**
|
|
2179
2234
|
* Serialize text as a single-quoted TypeScript string literal.
|
|
2180
2235
|
*
|
|
@@ -2633,4 +2688,10 @@ export declare function coreViteConfig(browser?: boolean): string;
|
|
|
2633
2688
|
*/
|
|
2634
2689
|
export declare function viteMachinery(src: readonly Environment[], app?: readonly Environment[], engine?: boolean): ViteMachinery;
|
|
2635
2690
|
|
|
2691
|
+
/** One generated Vitest project factory and its optional browser-project label. */
|
|
2692
|
+
export declare interface ViteProjectRegistration {
|
|
2693
|
+
readonly project: string;
|
|
2694
|
+
readonly browser?: string;
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2636
2697
|
export { }
|