@orkestrel/scaffold 0.0.15 → 0.0.16
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 +6 -3
- package/dist/bin/scaffold.js.map +1 -1
- package/dist/host/guides/src/scaffold.md +23 -12
- package/dist/src/core/index.cjs +6 -8
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +1 -1
- package/dist/src/core/index.d.ts +1 -1
- package/dist/src/core/index.js +6 -8
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +70 -17
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +21 -0
- package/dist/src/server/index.d.ts +21 -0
- package/dist/src/server/index.js +71 -19
- package/dist/src/server/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -319,6 +319,7 @@ From [`types.ts`](../../src/server/types.ts).
|
|
|
319
319
|
| `CatalogAllowance` | type |
|
|
320
320
|
| `SyncBase` | type |
|
|
321
321
|
| `SyncBranch` | type |
|
|
322
|
+
| `VersionLookup` | type |
|
|
322
323
|
| `GuideWrite` | interface |
|
|
323
324
|
| `MaterializerInterface` | interface |
|
|
324
325
|
| `SyncEventMap` | type |
|
|
@@ -346,7 +347,9 @@ identity, and `WriteDirectoryResult` pairs the final anchor with the subset a ca
|
|
|
346
347
|
`CatalogAllowance` are one-cell `Float64Array` allowances: the former shares a byte budget across
|
|
347
348
|
concurrent network readers, while the latter shares one entry budget across every fleet root and
|
|
348
349
|
child visited by a catalog operation. `SyncBase` and `SyncBranch` are normalized strings returned
|
|
349
|
-
only by their corresponding boundary parsers.
|
|
350
|
+
only by their corresponding boundary parsers. `VersionLookup` is the bare-name registry result:
|
|
351
|
+
a successful lookup carries `latest` with `freshness: 'behind'` because no declared range was
|
|
352
|
+
supplied as a reference, while `missing` and `failed` carry a `note` and no invented version.
|
|
350
353
|
|
|
351
354
|
`SyncOptions` groups the injectable endpoints under the entity they configure — `guides` with
|
|
352
355
|
`base`, `branch`, and `timeout`; `registry` with `base` and `timeout` — alongside `concurrency`,
|
|
@@ -689,6 +692,7 @@ From [`parsers.ts`](../../src/server/parsers.ts).
|
|
|
689
692
|
| Name | Kind |
|
|
690
693
|
| -------------------------- | -------- |
|
|
691
694
|
| `parseSyncDependencies` | function |
|
|
695
|
+
| `parseSyncNames` | function |
|
|
692
696
|
| `parseFilesystemPaths` | function |
|
|
693
697
|
| `parsePortablePaths` | function |
|
|
694
698
|
| `parseWritePreconditions` | function |
|
|
@@ -708,7 +712,9 @@ subset used in raw-guide URLs: it rejects overlong values, empty or dot-leading
|
|
|
708
712
|
`@{`, the single `@`, trailing dots, and `.lock` suffixes without regard to case.
|
|
709
713
|
`parseSyncCurrent` snapshots only the declared guide references, enforcing both the per-file and
|
|
710
714
|
cumulative byte allowance. The three array parsers return frozen copies read through property
|
|
711
|
-
descriptors, so a caller-supplied array can never smuggle in a getter.
|
|
715
|
+
descriptors, so a caller-supplied array can never smuggle in a getter. `parseSyncNames` snapshots a
|
|
716
|
+
bounded dense array of unique npm package names and validates only the names; declaration ranges
|
|
717
|
+
remain the responsibility of `parseSyncDependencies` and the blueprint gate.
|
|
712
718
|
|
|
713
719
|
### Shapers — core
|
|
714
720
|
|
|
@@ -1290,16 +1296,18 @@ The interface also exposes the readonly `emitter`.
|
|
|
1290
1296
|
|
|
1291
1297
|
#### `SyncInterface`
|
|
1292
1298
|
|
|
1293
|
-
| Method | Returns
|
|
1294
|
-
| ---------- |
|
|
1295
|
-
| `
|
|
1296
|
-
| `
|
|
1297
|
-
| `
|
|
1298
|
-
| `
|
|
1299
|
-
| `
|
|
1300
|
-
| `
|
|
1301
|
-
|
|
1302
|
-
|
|
1299
|
+
| Method | Returns |
|
|
1300
|
+
| ---------- | ----------------------------------- |
|
|
1301
|
+
| `lookup` | `Promise<readonly VersionLookup[]>` |
|
|
1302
|
+
| `guides` | `Promise<readonly GuideSync[]>` |
|
|
1303
|
+
| `versions` | `Promise<readonly VersionSync[]>` |
|
|
1304
|
+
| `catalog` | `Promise<readonly CatalogEntry[]>` |
|
|
1305
|
+
| `pull` | `Promise<SyncReport>` |
|
|
1306
|
+
| `write` | `Promise<readonly string[]>` |
|
|
1307
|
+
| `destroy` | `void` |
|
|
1308
|
+
|
|
1309
|
+
`lookup(names)` resolves registry versions from bare package names, with no declaration range
|
|
1310
|
+
required or synthesized. `guides(deps, current?)` fetches each dependency's upstream guide. The optional `current` map is
|
|
1303
1311
|
keyed by dependency name: with it, a fetched guide byte-equal to its entry verdicts `current` and
|
|
1304
1312
|
anything else verdicts `behind`; without it, every successful fetch verdicts `behind`, because no
|
|
1305
1313
|
reference means it needs syncing. `versions(deps)` compares each declared range to the registry
|
|
@@ -2308,6 +2316,7 @@ import { createSync } from '@orkestrel/scaffold/server'
|
|
|
2308
2316
|
|
|
2309
2317
|
const sync = createSync({ concurrency: 4, retries: 1 })
|
|
2310
2318
|
|
|
2319
|
+
await sync.lookup(['@orkestrel/contract'])
|
|
2311
2320
|
const report = await sync.pull('.')
|
|
2312
2321
|
if (report.failed === 0) await sync.write(report, '.')
|
|
2313
2322
|
|
|
@@ -2432,6 +2441,7 @@ import {
|
|
|
2432
2441
|
parseSyncBranch,
|
|
2433
2442
|
parseSyncCurrent,
|
|
2434
2443
|
parseSyncDependencies,
|
|
2444
|
+
parseSyncNames,
|
|
2435
2445
|
parseSyncOptions,
|
|
2436
2446
|
parseWritePreconditions,
|
|
2437
2447
|
syncGuideOptionsShape,
|
|
@@ -2454,6 +2464,7 @@ parseMaterializerOptions({ host: './dist/host' })
|
|
|
2454
2464
|
parseSyncBase('registry.npmjs.org') // 'https://registry.npmjs.org'
|
|
2455
2465
|
parseSyncBranch('main')
|
|
2456
2466
|
parseSyncCurrent({ '@orkestrel/contract': '# contract\n' }, ['@orkestrel/contract'], 16_777_216)
|
|
2467
|
+
parseSyncNames(['@orkestrel/contract', 'zod'])
|
|
2457
2468
|
parseSyncDependencies([{ name: '@orkestrel/contract', range: '^0.0.7' }], false)
|
|
2458
2469
|
parsePortablePaths(['src/core/index.ts'], 1_000)
|
|
2459
2470
|
parseFilesystemPaths(['./packages'], 1_000)
|
package/dist/src/core/index.cjs
CHANGED
|
@@ -227,7 +227,7 @@ var DEFAULT_VERSION = "0.0.1";
|
|
|
227
227
|
/** The `engines.node` range the `blueprint` builder fills. */
|
|
228
228
|
var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
|
|
229
229
|
/** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
|
|
230
|
-
var SCAFFOLD_RANGE = "^0.0.
|
|
230
|
+
var SCAFFOLD_RANGE = "^0.0.16";
|
|
231
231
|
/** Tooling versions shared by scaffold and every generated workspace. */
|
|
232
232
|
var BASE_DEV_DEPENDENCIES = Object.freeze({
|
|
233
233
|
"@microsoft/api-extractor": "^7.58.12",
|
|
@@ -4140,9 +4140,7 @@ ${EXPORT_KEYWORD} ${FUNCTION_KEYWORD} isBrowserVuePath(path: string): boolean {
|
|
|
4140
4140
|
content: `import { globSync{{browserPolicySpecifier}} } from 'node:fs'
|
|
4141
4141
|
import { describe, expect, it } from 'vitest'
|
|
4142
4142
|
import { isBrowserVuePath } from './setup.js'
|
|
4143
|
-
import { inspectCodingWorkspace } from './setupPolicy.js'
|
|
4144
|
-
{{browserPolicyImport}}
|
|
4145
|
-
{{vuePolicyImport}}
|
|
4143
|
+
import { inspectCodingWorkspace } from './setupPolicy.js'{{browserPolicyImport}}{{vuePolicyImport}}
|
|
4146
4144
|
|
|
4147
4145
|
describe('repository coding law', () => {
|
|
4148
4146
|
it('keeps Vue single-file components exclusively in browser environments', () => {
|
|
@@ -4153,8 +4151,7 @@ describe('repository coding law', () => {
|
|
|
4153
4151
|
|
|
4154
4152
|
it('enforces source placement, exports, readonly contracts, and syntax law', () => {
|
|
4155
4153
|
{{workspacePolicyAssertion}}
|
|
4156
|
-
})
|
|
4157
|
-
{{browserPolicyTest}}
|
|
4154
|
+
}){{browserPolicyTest}}
|
|
4158
4155
|
})
|
|
4159
4156
|
`
|
|
4160
4157
|
}),
|
|
@@ -8653,8 +8650,8 @@ function testArtifacts(spec, pascal) {
|
|
|
8653
8650
|
const hasBrowser = spec.src.includes("browser") || spec.app.includes("browser");
|
|
8654
8651
|
const hasVue = spec.app.includes("browser");
|
|
8655
8652
|
const browserPolicySpecifier = hasBrowser ? ", accessSync, constants as FS_CONSTANTS, statSync" : "";
|
|
8656
|
-
const browserPolicyImport = hasBrowser ? "
|
|
8657
|
-
const vuePolicyImport = hasVue ? "
|
|
8653
|
+
const browserPolicyImport = hasBrowser ? "\nimport { chromium } from 'playwright'\nimport { resolveChromium } from '../vite.config.js'" : "";
|
|
8654
|
+
const vuePolicyImport = hasVue ? "\nimport { parse as parseVue } from 'vue/compiler-sfc'" : "";
|
|
8658
8655
|
const workspacePolicyAssertion = hasVue ? `expect(
|
|
8659
8656
|
inspectCodingWorkspace(process.cwd(), (path, content) => {
|
|
8660
8657
|
const parsed = parseVue(content, { filename: path })
|
|
@@ -8665,6 +8662,7 @@ function testArtifacts(spec, pascal) {
|
|
|
8665
8662
|
}),
|
|
8666
8663
|
).toEqual([])` : "expect(inspectCodingWorkspace(process.cwd())).toEqual([])";
|
|
8667
8664
|
const browserPolicyTest = hasBrowser ? `
|
|
8665
|
+
|
|
8668
8666
|
it('resolves Chromium only to a real executable file', () => {
|
|
8669
8667
|
const chromiumPath = resolveChromium(chromium.executablePath())
|
|
8670
8668
|
if (chromiumPath === undefined) return
|