@orkestrel/scaffold 0.0.132 → 0.0.134
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-dispatch/scripts/bench.js +61 -96
- package/dist/agents/skills/orkestrel-dispatch/scripts/brief.js +48 -76
- package/dist/agents/skills/orkestrel-dispatch/scripts/chain.js +27 -66
- package/dist/agents/skills/orkestrel-dispatch/scripts/cite.js +31 -64
- package/dist/agents/skills/orkestrel-dispatch/scripts/launch.js +43 -57
- package/dist/agents/skills/orkestrel-dispatch/scripts/login.js +43 -86
- package/dist/agents/skills/orkestrel-dispatch/scripts/patch.js +68 -104
- package/dist/agents/skills/orkestrel-dispatch/scripts/result.js +35 -69
- package/dist/agents/skills/orkestrel-dispatch/scripts/sweep.js +47 -84
- package/dist/agents/skills/orkestrel-falsify/scripts/mutate.js +134 -116
- package/dist/agents/skills/orkestrel-harden/scripts/discovery.js +38 -90
- package/dist/agents/skills/orkestrel-harden/scripts/interleave.js +39 -103
- package/dist/agents/skills/orkestrel-harden/scripts/measure.js +40 -89
- package/dist/agents/skills/orkestrel-harden/scripts/titles.js +41 -87
- package/dist/agents/skills/orkestrel-parallel/scripts/cases.js +43 -88
- package/dist/agents/skills/orkestrel-parallel/scripts/lane.js +1018 -194
- package/dist/agents/skills/orkestrel-publish/scripts/compare.js +40 -60
- package/dist/agents/skills/orkestrel-publish/scripts/pins.js +47 -81
- package/dist/agents/skills/orkestrel-publish/scripts/steps.js +66 -104
- package/dist/agents/skills/orkestrel-publish/scripts/swap.js +74 -88
- package/dist/agents/skills/orkestrel-publish/scripts/wave.js +95 -108
- package/dist/agents/skills/orkestrel-publish/scripts/window.js +55 -96
- package/dist/agents/skills/orkestrel-scout/scripts/map.js +54 -101
- package/dist/bin/main.js +30 -6
- package/dist/bin/main.js.map +1 -1
- package/dist/host/agents/orchestration.md +1 -0
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/bench.ts +81 -97
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/brief.ts +64 -72
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/chain.ts +41 -63
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/cite.ts +56 -79
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/launch.ts +61 -74
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/login.ts +59 -89
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/patch.ts +87 -106
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/result.ts +57 -76
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/sweep.ts +73 -88
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +2 -2
- package/dist/host/agents/skills/orkestrel-falsify/scripts/mutate.ts +167 -119
- package/dist/host/agents/skills/orkestrel-harden/references/methods.md +1 -1
- package/dist/host/agents/skills/orkestrel-harden/scripts/discovery.ts +58 -75
- package/dist/host/agents/skills/orkestrel-harden/scripts/interleave.ts +55 -99
- package/dist/host/agents/skills/orkestrel-harden/scripts/measure.ts +59 -90
- package/dist/host/agents/skills/orkestrel-harden/scripts/titles.ts +60 -80
- package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +4 -4
- package/dist/host/agents/skills/orkestrel-parallel/scripts/cases.ts +71 -108
- package/dist/host/agents/skills/orkestrel-parallel/scripts/lane.ts +1288 -239
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +10 -6
- package/dist/host/agents/skills/orkestrel-publish/scripts/compare.ts +58 -79
- package/dist/host/agents/skills/orkestrel-publish/scripts/pins.ts +66 -87
- package/dist/host/agents/skills/orkestrel-publish/scripts/steps.ts +84 -102
- package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +92 -99
- package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +130 -126
- package/dist/host/agents/skills/orkestrel-publish/scripts/window.ts +82 -120
- package/dist/host/agents/skills/orkestrel-scout/SKILL.md +3 -3
- package/dist/host/agents/skills/orkestrel-scout/scripts/map.ts +85 -112
- package/dist/host/claude/agents/orkestrel.md +54 -54
- package/dist/host/claude/rules/documentation.md +1 -1
- package/dist/host/claude/rules/patterns.md +5 -4
- package/dist/host/claude/rules/styles.md +1 -1
- package/dist/host/claude/rules/tests.md +8 -3
- package/dist/host/claude/rules/workspace.md +47 -35
- package/dist/host/configs/helpers.ts +40 -15
- package/dist/host/dotfiles/oxlintrc.json +62 -0
- package/dist/host/guides/browser.md +1 -1
- package/dist/host/guides/form.md +79 -4
- package/dist/host/guides/queue.md +3 -1
- package/dist/host/guides/scaffold.md +95 -67
- package/dist/host/guides/table.md +20 -6
- package/dist/host/guides/test.md +342 -202
- package/dist/host/guides/workflow.md +4 -2
- package/dist/host/manifest.json +48 -48
- package/dist/host/tests/config.test.ts +201 -11
- package/dist/host/tests/policy.test.ts +15 -22
- package/dist/host/tests/setupPolicy.ts +43 -36
- package/dist/src/core/index.cjs +194 -97
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +27 -13
- package/dist/src/core/index.d.ts +27 -13
- package/dist/src/core/index.js +192 -97
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +8 -9
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +1 -1
- package/dist/src/server/index.d.ts +1 -1
- package/dist/src/server/index.js +8 -9
- package/dist/src/server/index.js.map +1 -1
- package/package.json +5 -5
package/dist/src/core/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { fillTemplate } from "@orkestrel/template";
|
|
|
3
3
|
import { Emitter } from "@orkestrel/emitter";
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "@orkestrel/scaffold",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.134",
|
|
7
7
|
description: "Scaffold workspaces with commands: new, audit, surface, repair, catalog, and overwrite.",
|
|
8
8
|
keywords: [
|
|
9
9
|
"audit",
|
|
@@ -104,11 +104,11 @@ var package_default = {
|
|
|
104
104
|
},
|
|
105
105
|
devDependencies: {
|
|
106
106
|
"@microsoft/api-extractor": "^7.60.1",
|
|
107
|
-
"@orkestrel/browser": "^0.0.
|
|
108
|
-
"@orkestrel/guide": "^0.0.
|
|
107
|
+
"@orkestrel/browser": "^0.0.33",
|
|
108
|
+
"@orkestrel/guide": "^0.0.31",
|
|
109
109
|
"@orkestrel/html": "^0.0.16",
|
|
110
|
-
"@orkestrel/probe": "^0.0.
|
|
111
|
-
"@orkestrel/test": "^0.0.
|
|
110
|
+
"@orkestrel/probe": "^0.0.30",
|
|
111
|
+
"@orkestrel/test": "^0.0.37",
|
|
112
112
|
"@types/node": "^24.19.2",
|
|
113
113
|
"@vitest/browser-playwright": "^5.1.0",
|
|
114
114
|
"oxfmt": "^0.78.0",
|
|
@@ -169,6 +169,7 @@ var STYLES_DEV_DEPENDENCIES = Object.freeze({ sass: "^1.105.1" });
|
|
|
169
169
|
var RESERVED_SHEET_NAMES = Object.freeze([
|
|
170
170
|
...ENVIRONMENTS,
|
|
171
171
|
"bin",
|
|
172
|
+
"reporter",
|
|
172
173
|
"styles",
|
|
173
174
|
"themes",
|
|
174
175
|
...FRAMEWORKS
|
|
@@ -247,12 +248,18 @@ var APP_MATRIX = Object.freeze({
|
|
|
247
248
|
});
|
|
248
249
|
/** Lists the configuration files a workspace that ships its own executable adds, frozen. */
|
|
249
250
|
var BIN_CONFIGS = Object.freeze(["configs/src/vite.bin.config.ts", "configs/src/tsconfig.bin.json"]);
|
|
251
|
+
/** Lists the configuration files a workspace that publishes a Vitest reporter adds, frozen. */
|
|
252
|
+
var REPORTER_CONFIGS = Object.freeze(["configs/src/vite.reporter.config.ts", "configs/src/tsconfig.reporter.json"]);
|
|
250
253
|
/** Lists the configuration file a workspace with studies and a server application adds, frozen. */
|
|
251
254
|
var BARREL_CONFIGS = Object.freeze(["configs/app/vite.barrel.config.ts"]);
|
|
252
255
|
/** Names the executable entry whose presence makes a workspace `bin`. */
|
|
253
256
|
var BIN_ENTRY_PATH = "src/bin/main.ts";
|
|
254
257
|
/** Names the built executable a bin workspace's manifest command runs. */
|
|
255
258
|
var BIN_OUTPUT_PATH = "dist/bin/main.js";
|
|
259
|
+
/** Names the reporter entry whose presence makes a workspace `reporter`. */
|
|
260
|
+
var REPORTER_ENTRY_PATH = "src/reporter/main.ts";
|
|
261
|
+
/** Names the built reporter module a reporter workspace's `./reporter` export loads. */
|
|
262
|
+
var REPORTER_OUTPUT_PATH = "dist/reporter/main.js";
|
|
256
263
|
/**
|
|
257
264
|
* Lists the paths a target receives from the vendored data root, frozen.
|
|
258
265
|
*
|
|
@@ -673,6 +680,7 @@ var WORKSPACE_DEV_ENGINES = Object.freeze({ packageManager: Object.freeze({
|
|
|
673
680
|
}) });
|
|
674
681
|
/** Holds the baseline tooling versions, before framework holds apply. */
|
|
675
682
|
var BASE_DEV_DEPENDENCIES = Object.freeze({
|
|
683
|
+
"@orkestrel/contract": package_default.dependencies["@orkestrel/contract"],
|
|
676
684
|
"@orkestrel/guide": package_default.devDependencies["@orkestrel/guide"],
|
|
677
685
|
"@orkestrel/probe": package_default.devDependencies["@orkestrel/probe"],
|
|
678
686
|
"@orkestrel/scaffold": `^${package_default.version}`,
|
|
@@ -812,8 +820,6 @@ var BROWSE_UPSTREAM = Object.freeze([
|
|
|
812
820
|
"@orkestrel/tool",
|
|
813
821
|
"@orkestrel/websocket"
|
|
814
822
|
]);
|
|
815
|
-
/** Names the development dependency every private `app` environment adds. */
|
|
816
|
-
var APP_DEV_DEPENDENCIES = Object.freeze({ "@orkestrel/contract": package_default.dependencies["@orkestrel/contract"] });
|
|
817
823
|
/** Lists the development dependencies a private browser application adds. */
|
|
818
824
|
var APP_BROWSER_DEV_DEPENDENCIES = Object.freeze({
|
|
819
825
|
...SOURCE_BROWSER_DEV_DEPENDENCIES,
|
|
@@ -1252,6 +1258,46 @@ export function srcBin(override?: UserConfig): UserConfig {
|
|
|
1252
1258
|
}
|
|
1253
1259
|
return mergeOverride(project, override)
|
|
1254
1260
|
}
|
|
1261
|
+
`,
|
|
1262
|
+
reporter: `function resolveReporterFilename(): string {
|
|
1263
|
+
return 'main.js'
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
function resolveReporterExternal(id: string): boolean {
|
|
1267
|
+
return id.startsWith('@src/') || resolveExternal(id, { peers, refused: [], siblings: [] })
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
export function srcReporter(override?: UserConfig): UserConfig {
|
|
1271
|
+
const project: UserConfig = {
|
|
1272
|
+
resolve,
|
|
1273
|
+
publicDir: false,
|
|
1274
|
+
plugins: [outputBoundary('dist/reporter')],
|
|
1275
|
+
build: {
|
|
1276
|
+
emptyOutDir: true,
|
|
1277
|
+
sourcemap: true,
|
|
1278
|
+
minify: false,
|
|
1279
|
+
lib: {
|
|
1280
|
+
entry: resolveWorkspacePath('${REPORTER_ENTRY_PATH}'),
|
|
1281
|
+
formats: ['es'],
|
|
1282
|
+
fileName: resolveReporterFilename,
|
|
1283
|
+
},
|
|
1284
|
+
outDir: 'dist/reporter',
|
|
1285
|
+
target: 'node22',
|
|
1286
|
+
rolldownOptions: {
|
|
1287
|
+
onLog: enforceBuildLog,
|
|
1288
|
+
external: resolveReporterExternal,
|
|
1289
|
+
},
|
|
1290
|
+
},
|
|
1291
|
+
test: {
|
|
1292
|
+
name: { label: 'src:reporter', color: 'cyan' },
|
|
1293
|
+
include: ['tests/src/reporter/**/*.test.ts'],
|
|
1294
|
+
setupFiles: ['./tests/setup.ts', './tests/setupServer.ts'],
|
|
1295
|
+
environment: 'node',
|
|
1296
|
+
browser: { enabled: false },
|
|
1297
|
+
},
|
|
1298
|
+
}
|
|
1299
|
+
return mergeOverride(project, override)
|
|
1300
|
+
}
|
|
1255
1301
|
`
|
|
1256
1302
|
}),
|
|
1257
1303
|
app: Object.freeze({
|
|
@@ -1702,7 +1748,6 @@ export function studies(override?: UserConfig): UserConfig {
|
|
|
1702
1748
|
browser: { enabled: false },
|
|
1703
1749
|
testTimeout: 120_000,
|
|
1704
1750
|
hookTimeout: 120_000,
|
|
1705
|
-
fileParallelism: false,
|
|
1706
1751
|
sequence: { groupOrder: 1 },
|
|
1707
1752
|
},
|
|
1708
1753
|
}
|
|
@@ -1937,6 +1982,25 @@ export function probe(override?: UserConfig): UserConfig {
|
|
|
1937
1982
|
"../../src/bin/**/*.tsx"
|
|
1938
1983
|
]
|
|
1939
1984
|
}
|
|
1985
|
+
`,
|
|
1986
|
+
reporter: `{
|
|
1987
|
+
"extends": "../../tsconfig.json",
|
|
1988
|
+
"compilerOptions": {
|
|
1989
|
+
"lib": ["ESNext"],
|
|
1990
|
+
"types": ["node"],
|
|
1991
|
+
"noEmit": false,
|
|
1992
|
+
"declaration": true,
|
|
1993
|
+
"emitDeclarationOnly": true,
|
|
1994
|
+
"rootDir": "../../src",
|
|
1995
|
+
"outDir": "../../dist/reporter"
|
|
1996
|
+
},
|
|
1997
|
+
"include": [
|
|
1998
|
+
"../../src/reporter/**/*.cts",
|
|
1999
|
+
"../../src/reporter/**/*.mts",
|
|
2000
|
+
"../../src/reporter/**/*.ts",
|
|
2001
|
+
"../../src/reporter/**/*.tsx"
|
|
2002
|
+
]
|
|
2003
|
+
}
|
|
1940
2004
|
`,
|
|
1941
2005
|
skills: `{
|
|
1942
2006
|
"extends": "../../tsconfig.json",
|
|
@@ -2102,6 +2166,29 @@ export default defineConfig(
|
|
|
2102
2166
|
},
|
|
2103
2167
|
}),
|
|
2104
2168
|
)
|
|
2169
|
+
`,
|
|
2170
|
+
reporter: `import { defineConfig } from 'vite'
|
|
2171
|
+
import { declarationRollup, rewriteServerSpecifier } from '../helpers.js'
|
|
2172
|
+
import { resolveWorkspacePath, srcReporter } from '../../vite.config.ts'
|
|
2173
|
+
|
|
2174
|
+
// Each external \`@src/*\` path resolves from \`dist/reporter/\` to the built environment.
|
|
2175
|
+
export default defineConfig(
|
|
2176
|
+
srcReporter({
|
|
2177
|
+
plugins: [
|
|
2178
|
+
declarationRollup({
|
|
2179
|
+
project: resolveWorkspacePath('configs/src/tsconfig.reporter.json'),
|
|
2180
|
+
rewrite: rewriteServerSpecifier,
|
|
2181
|
+
}),
|
|
2182
|
+
],
|
|
2183
|
+
build: {
|
|
2184
|
+
rolldownOptions: {
|
|
2185
|
+
output: {
|
|
2186
|
+
{{paths}}
|
|
2187
|
+
},
|
|
2188
|
+
},
|
|
2189
|
+
},
|
|
2190
|
+
}),
|
|
2191
|
+
)
|
|
2105
2192
|
`,
|
|
2106
2193
|
app: Object.freeze({
|
|
2107
2194
|
vue: `import { defineConfig } from 'vite'
|
|
@@ -2702,12 +2789,22 @@ describe('bin entry', () => {
|
|
|
2702
2789
|
expect(Object.keys(entry)).toStrictEqual([])
|
|
2703
2790
|
})
|
|
2704
2791
|
})
|
|
2792
|
+
`,
|
|
2793
|
+
reporter: `import { describe, expect, it } from 'vitest'
|
|
2794
|
+
import reporter from '../../../src/reporter/main.js'
|
|
2795
|
+
|
|
2796
|
+
describe('reporter entry', () => {
|
|
2797
|
+
it('exports the reporter class by default', () => {
|
|
2798
|
+
expect(reporter).toBeTypeOf('function')
|
|
2799
|
+
})
|
|
2800
|
+
})
|
|
2705
2801
|
`,
|
|
2706
2802
|
distribution: Object.freeze({
|
|
2707
2803
|
module: `{{types}}import type { SpawnSyncReturns } from 'node:child_process'
|
|
2708
2804
|
import type { TestContext } from 'vitest'
|
|
2805
|
+
import { arrayOf, isArray, isRecord, isString } from '@orkestrel/contract'
|
|
2709
2806
|
import { spawnSync } from 'node:child_process'
|
|
2710
|
-
import {
|
|
2807
|
+
{{events}}import {
|
|
2711
2808
|
existsSync,
|
|
2712
2809
|
mkdirSync,
|
|
2713
2810
|
mkdtempSync,
|
|
@@ -2954,39 +3051,6 @@ export interface DistributionStage {
|
|
|
2954
3051
|
readonly targets: readonly string[]
|
|
2955
3052
|
}
|
|
2956
3053
|
|
|
2957
|
-
/**
|
|
2958
|
-
* Checks whether a value is a non-null object other than an array.
|
|
2959
|
-
*
|
|
2960
|
-
* @param value - The value to inspect.
|
|
2961
|
-
* @returns True if the value is a record; false otherwise.
|
|
2962
|
-
*/
|
|
2963
|
-
export function isDistributionRecord(value: unknown): value is Readonly<Record<string, unknown>> {
|
|
2964
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
2965
|
-
}
|
|
2966
|
-
|
|
2967
|
-
/**
|
|
2968
|
-
* Checks whether a value is an array of strings.
|
|
2969
|
-
*
|
|
2970
|
-
* @param value - The value to inspect.
|
|
2971
|
-
* @returns True if every array member is a string; false otherwise.
|
|
2972
|
-
*/
|
|
2973
|
-
export function isDistributionNames(value: unknown): value is readonly string[] {
|
|
2974
|
-
return Array.isArray(value) && value.every((name) => typeof name === 'string')
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
// A fallback list, which is what Node reads an array in an exports entry as. The
|
|
2978
|
-
// narrowing is what the following walkers need: \`Array.isArray\` widens an \`unknown\`
|
|
2979
|
-
// member to \`any\`, and an entry read that way is not read at all.
|
|
2980
|
-
/**
|
|
2981
|
-
* Checks whether a value is a fallback array.
|
|
2982
|
-
*
|
|
2983
|
-
* @param value - The value to inspect.
|
|
2984
|
-
* @returns True if the value is an array; false otherwise.
|
|
2985
|
-
*/
|
|
2986
|
-
export function isDistributionList(value: unknown): value is readonly unknown[] {
|
|
2987
|
-
return Array.isArray(value)
|
|
2988
|
-
}
|
|
2989
|
-
|
|
2990
3054
|
// Whether a string is a valid package target. Node rejects a target outside the
|
|
2991
3055
|
// package and a target containing a dot, parent, or node_modules segment during
|
|
2992
3056
|
// package-target resolution. A later module-resolution failure is not the same
|
|
@@ -3031,7 +3095,7 @@ export function readDistributionJSON(path: string): unknown {
|
|
|
3031
3095
|
*/
|
|
3032
3096
|
export function readDistributionManifestName(path: string): string {
|
|
3033
3097
|
const manifest = readDistributionJSON(path)
|
|
3034
|
-
if (!
|
|
3098
|
+
if (!isRecord(manifest) || typeof manifest.name !== 'string') {
|
|
3035
3099
|
throw new Error(\`The manifest at \${path} declares no package name\`)
|
|
3036
3100
|
}
|
|
3037
3101
|
return manifest.name
|
|
@@ -3048,19 +3112,17 @@ export function readDistributionManifestName(path: string): string {
|
|
|
3048
3112
|
*/
|
|
3049
3113
|
export function readDistributionPeers(path: string): Readonly<Record<string, string>> {
|
|
3050
3114
|
const manifest = readDistributionJSON(path)
|
|
3051
|
-
if (!
|
|
3115
|
+
if (!isRecord(manifest) || !isRecord(manifest.peerDependencies)) {
|
|
3052
3116
|
return {}
|
|
3053
3117
|
}
|
|
3054
|
-
const meta =
|
|
3055
|
-
? manifest.peerDependenciesMeta
|
|
3056
|
-
: undefined
|
|
3118
|
+
const meta = isRecord(manifest.peerDependenciesMeta) ? manifest.peerDependenciesMeta : undefined
|
|
3057
3119
|
const peers = Object.entries(manifest.peerDependencies).filter(
|
|
3058
3120
|
(entry): entry is [string, string] => typeof entry[1] === 'string',
|
|
3059
3121
|
)
|
|
3060
3122
|
return Object.fromEntries(
|
|
3061
3123
|
peers.filter(([name]) => {
|
|
3062
3124
|
const entry = meta?.[name]
|
|
3063
|
-
return !
|
|
3125
|
+
return !isRecord(entry) || entry.optional !== true
|
|
3064
3126
|
}),
|
|
3065
3127
|
)
|
|
3066
3128
|
}
|
|
@@ -3075,7 +3137,7 @@ export function createDistributionConsumerManifest(
|
|
|
3075
3137
|
peers: Readonly<Record<string, string>>,
|
|
3076
3138
|
): string {
|
|
3077
3139
|
const manifest: unknown = JSON.parse(DISTRIBUTION_CONSUMER_MANIFEST)
|
|
3078
|
-
if (Object.keys(peers).length === 0 || !
|
|
3140
|
+
if (Object.keys(peers).length === 0 || !isRecord(manifest)) {
|
|
3079
3141
|
return DISTRIBUTION_CONSUMER_MANIFEST
|
|
3080
3142
|
}
|
|
3081
3143
|
return \`\${JSON.stringify({ ...manifest, dependencies: peers })}\\n\`
|
|
@@ -3196,7 +3258,7 @@ export function resolveDistributionPackageTarget(
|
|
|
3196
3258
|
conditions: readonly string[],
|
|
3197
3259
|
): DistributionTargetResult | undefined {
|
|
3198
3260
|
if (typeof entry === 'string') return { target: entry }
|
|
3199
|
-
if (
|
|
3261
|
+
if (isArray(entry)) {
|
|
3200
3262
|
for (const member of entry) {
|
|
3201
3263
|
const resolved = resolveDistributionPackageTarget(member, conditions)
|
|
3202
3264
|
if (resolved !== undefined && matchesDistributionPackageTarget(resolved.target))
|
|
@@ -3204,7 +3266,7 @@ export function resolveDistributionPackageTarget(
|
|
|
3204
3266
|
}
|
|
3205
3267
|
return undefined
|
|
3206
3268
|
}
|
|
3207
|
-
if (!
|
|
3269
|
+
if (!isRecord(entry)) return undefined
|
|
3208
3270
|
for (const [condition, nested] of Object.entries(entry)) {
|
|
3209
3271
|
if (condition !== 'default' && !conditions.includes(condition)) continue
|
|
3210
3272
|
const resolved = resolveDistributionPackageTarget(nested, conditions)
|
|
@@ -3289,14 +3351,14 @@ export function resolveDistributionDeclaration(
|
|
|
3289
3351
|
installed: string,
|
|
3290
3352
|
): string | undefined {
|
|
3291
3353
|
if (typeof entry === 'string') return targetToDistributionDeclaration(entry, installed)
|
|
3292
|
-
if (
|
|
3354
|
+
if (isArray(entry)) {
|
|
3293
3355
|
for (const member of entry) {
|
|
3294
3356
|
const resolved = resolveDistributionDeclaration(member, conditions, installed)
|
|
3295
3357
|
if (resolved !== undefined) return resolved
|
|
3296
3358
|
}
|
|
3297
3359
|
return undefined
|
|
3298
3360
|
}
|
|
3299
|
-
if (!
|
|
3361
|
+
if (!isRecord(entry)) return undefined
|
|
3300
3362
|
for (const [condition, nested] of Object.entries(entry)) {
|
|
3301
3363
|
if (condition !== 'default' && !conditions.includes(condition)) continue
|
|
3302
3364
|
const resolved = resolveDistributionDeclaration(nested, conditions, installed)
|
|
@@ -3329,7 +3391,7 @@ export function readDistributionPackageType(installed: string, target: string):
|
|
|
3329
3391
|
if (scope === undefined) return undefined
|
|
3330
3392
|
try {
|
|
3331
3393
|
const manifest = readDistributionJSON(join(scope, 'package.json'))
|
|
3332
|
-
return
|
|
3394
|
+
return isRecord(manifest) ? manifest.type : undefined
|
|
3333
3395
|
} catch {
|
|
3334
3396
|
return undefined
|
|
3335
3397
|
}
|
|
@@ -3406,9 +3468,9 @@ export function declaresDistributionCommonJS(entry: unknown, installed: string):
|
|
|
3406
3468
|
*/
|
|
3407
3469
|
export function collectDistributionTargets(entry: unknown): readonly string[] {
|
|
3408
3470
|
if (typeof entry === 'string') return [entry]
|
|
3409
|
-
if (
|
|
3471
|
+
if (isArray(entry))
|
|
3410
3472
|
return entry.flatMap(collectDistributionTargets).filter(matchesDistributionPackageTarget)
|
|
3411
|
-
if (!
|
|
3473
|
+
if (!isRecord(entry)) return []
|
|
3412
3474
|
return Object.values(entry).flatMap((nested) => collectDistributionTargets(nested))
|
|
3413
3475
|
}
|
|
3414
3476
|
|
|
@@ -3539,7 +3601,7 @@ export function filterDistributionUntypable(
|
|
|
3539
3601
|
return entries.filter(
|
|
3540
3602
|
(entry) =>
|
|
3541
3603
|
entry.requirable &&
|
|
3542
|
-
|
|
3604
|
+
isRecord(entry.mapping) &&
|
|
3543
3605
|
Object.hasOwn(entry.mapping, 'require') &&
|
|
3544
3606
|
!declaresDistributionCommonJS(entry.mapping, installed),
|
|
3545
3607
|
)
|
|
@@ -3729,7 +3791,7 @@ export function driveDistributionRuntime(
|
|
|
3729
3791
|
)
|
|
3730
3792
|
}
|
|
3731
3793
|
const published: unknown = JSON.parse(result.stdout)
|
|
3732
|
-
if (!
|
|
3794
|
+
if (!arrayOf(isString)(published))
|
|
3733
3795
|
throw new Error(\`The driver printed no name list for \${specifier}\`)
|
|
3734
3796
|
return published
|
|
3735
3797
|
}
|
|
@@ -3775,7 +3837,7 @@ export function buildDistributionStage(scratch: string): DistributionStage {
|
|
|
3775
3837
|
const name = readDistributionManifestName(join(DISTRIBUTION_ROOT, 'package.json'))
|
|
3776
3838
|
const installed = join(consumer, 'node_modules', ...name.split('/'))
|
|
3777
3839
|
const manifest = readDistributionJSON(join(installed, 'package.json'))
|
|
3778
|
-
if (!
|
|
3840
|
+
if (!isRecord(manifest) || !isRecord(manifest.exports)) {
|
|
3779
3841
|
throw new Error('The installed manifest publishes no exports map')
|
|
3780
3842
|
}
|
|
3781
3843
|
return { consumer, installed, archives, ...classifyDistributionStage(manifest, installed, name) }
|
|
@@ -3870,7 +3932,7 @@ export function classifyDistributionStage(
|
|
|
3870
3932
|
installed: string,
|
|
3871
3933
|
name: string,
|
|
3872
3934
|
): DistributionClassification {
|
|
3873
|
-
if (!
|
|
3935
|
+
if (!isRecord(manifest.exports))
|
|
3874
3936
|
throw new Error('The installed manifest publishes no exports map')
|
|
3875
3937
|
const readings = Object.entries(manifest.exports).map(([subpath, mapping]) => {
|
|
3876
3938
|
const files = collectDistributionTargets(mapping)
|
|
@@ -3960,8 +4022,8 @@ export function readDistributionFace(installed: string, path: string): string |
|
|
|
3960
4022
|
return output === 'dist'
|
|
3961
4023
|
? axis === 'src'
|
|
3962
4024
|
? face
|
|
3963
|
-
: axis === 'bin'
|
|
3964
|
-
?
|
|
4025
|
+
: axis === 'bin' || axis === 'reporter'
|
|
4026
|
+
? axis
|
|
3965
4027
|
: undefined
|
|
3966
4028
|
: undefined
|
|
3967
4029
|
}
|
|
@@ -4049,8 +4111,8 @@ export function scanDistributionSourceMaps(installed: string): readonly string[]
|
|
|
4049
4111
|
: Buffer.from(payload[2], 'base64').toString('utf8'),
|
|
4050
4112
|
)
|
|
4051
4113
|
if (
|
|
4052
|
-
!
|
|
4053
|
-
!
|
|
4114
|
+
!isRecord(map) ||
|
|
4115
|
+
!arrayOf(isString)(map.sources) ||
|
|
4054
4116
|
(map.sourceRoot !== undefined && typeof map.sourceRoot !== 'string')
|
|
4055
4117
|
) {
|
|
4056
4118
|
throw new Error('Unreadable source map')
|
|
@@ -4216,8 +4278,7 @@ export function checkDistributionManifest(installed: string, scratch: string): r
|
|
|
4216
4278
|
if (result.status !== 0)
|
|
4217
4279
|
throw new Error(\`npm pkg fix failed: \${readDistributionOutput(result)}\`)
|
|
4218
4280
|
const after = readDistributionJSON(path)
|
|
4219
|
-
if (!
|
|
4220
|
-
throw new Error('Unreadable manifest')
|
|
4281
|
+
if (!isRecord(before) || !isRecord(after)) throw new Error('Unreadable manifest')
|
|
4221
4282
|
return [...new Set([...Object.keys(before), ...Object.keys(after)])]
|
|
4222
4283
|
.filter((key) => !isDeepStrictEqual(before[key], after[key]))
|
|
4223
4284
|
.sort()
|
|
@@ -4269,7 +4330,7 @@ export function buildDistributionCases(
|
|
|
4269
4330
|
writeDistributionFile(join(root, 'module/package.json'), '{ "type": "module" }\\n')
|
|
4270
4331
|
writeDistributionFile(join(root, 'commonjs/package.json'), '{ "type": "commonjs" }\\n')
|
|
4271
4332
|
const manifest = readDistributionJSON(join(root, 'package.json'))
|
|
4272
|
-
if (!
|
|
4333
|
+
if (!isRecord(manifest) || !isRecord(manifest.exports)) {
|
|
4273
4334
|
throw new Error('The classifier fixture declares no exports map')
|
|
4274
4335
|
}
|
|
4275
4336
|
const mappings = manifest.exports
|
|
@@ -4394,7 +4455,7 @@ export function buildDistributionCases(
|
|
|
4394
4455
|
},
|
|
4395
4456
|
expected: {
|
|
4396
4457
|
undeclared: [],
|
|
4397
|
-
partitioned:
|
|
4458
|
+
partitioned: stage.subpaths.toSorted(),
|
|
4398
4459
|
unreachable: [],
|
|
4399
4460
|
untypable: [],
|
|
4400
4461
|
},
|
|
@@ -4540,6 +4601,8 @@ describe('installed package consumer', () => {
|
|
|
4540
4601
|
})
|
|
4541
4602
|
}
|
|
4542
4603
|
{{guard}}{{drive}}})
|
|
4604
|
+
`,
|
|
4605
|
+
events: `import { once } from 'node:events'
|
|
4543
4606
|
`,
|
|
4544
4607
|
transport: `import { createServer } from 'node:http'
|
|
4545
4608
|
`,
|
|
@@ -4668,9 +4731,8 @@ export async function readDistributionBrowserExports(
|
|
|
4668
4731
|
response.end(readFileSync(path))
|
|
4669
4732
|
})
|
|
4670
4733
|
try {
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
})
|
|
4734
|
+
server.listen(0, '127.0.0.1')
|
|
4735
|
+
await once(server, 'listening')
|
|
4674
4736
|
const address = server.address()
|
|
4675
4737
|
if (address === null || typeof address === 'string') {
|
|
4676
4738
|
throw new Error('The bundle server bound no port')
|
|
@@ -4681,8 +4743,7 @@ export async function readDistributionBrowserExports(
|
|
|
4681
4743
|
await page.goto(\`http://127.0.0.1:\${String(address.port)}/\`, { waitUntil: 'load' })
|
|
4682
4744
|
const published: unknown = await page.evaluate('globalThis.subject')
|
|
4683
4745
|
if (failures.length > 0) throw new Error(\`The bundle raised \${failures.join(' | ')}\`)
|
|
4684
|
-
if (!
|
|
4685
|
-
throw new Error('The bundled module published no name list')
|
|
4746
|
+
if (!arrayOf(isString)(published)) throw new Error('The bundled module published no name list')
|
|
4686
4747
|
return published
|
|
4687
4748
|
} finally {
|
|
4688
4749
|
server.close()
|
|
@@ -5234,6 +5295,7 @@ var isBlueprint = recordOf({
|
|
|
5234
5295
|
engines: isString,
|
|
5235
5296
|
overrides: andOf(isCollection, arrayOf(isOverride)),
|
|
5236
5297
|
bin: isBoolean,
|
|
5298
|
+
reporter: isBoolean,
|
|
5237
5299
|
setup: andOf(isCollection, arrayOf(literalOf("node", "browser"))),
|
|
5238
5300
|
guides: isBoolean,
|
|
5239
5301
|
integration: isBoolean,
|
|
@@ -6953,9 +7015,10 @@ function blueprintToSheets(blueprint) {
|
|
|
6953
7015
|
return [...blueprint.styles ? ["styles"] : [], ...sortValues(blueprint.extensions.flatMap((extension) => extension.surface === "styles" && isSheetName(extension.name) ? [extension.name] : []))];
|
|
6954
7016
|
}
|
|
6955
7017
|
/**
|
|
6956
|
-
* Projects published environments and
|
|
7018
|
+
* Projects published environments, sheets, and the reporter entry into the manifest export map.
|
|
6957
7019
|
* @param blueprint - The workspace specification.
|
|
6958
|
-
* @returns JavaScript conditions
|
|
7020
|
+
* @returns JavaScript conditions, CSS and SCSS subpaths, and the ES-only `./reporter` subpath,
|
|
7021
|
+
* without an invented JavaScript root.
|
|
6959
7022
|
* @example
|
|
6960
7023
|
* ```ts
|
|
6961
7024
|
* import { blueprintToExports, createBlueprint } from '@orkestrel/scaffold'
|
|
@@ -6971,7 +7034,8 @@ function blueprintToExports(blueprint) {
|
|
|
6971
7034
|
const face = [`./${extension.name}`, pathToCondition(`./dist/src/${extension.name}/index`, ["es"])];
|
|
6972
7035
|
return blueprint.src.includes("browser") ? [face, ["./browser", pathToCondition("./dist/src/browser/index", ["es"])]] : [face];
|
|
6973
7036
|
})),
|
|
6974
|
-
...Object.fromEntries([...blueprintToSheets(blueprint), ...blueprint.themes ? ["styles/themes"] : []].flatMap((name) => [[`./${name}`, `./dist/src/${name}/index.css`], [`./${name}/scss`, `./src/${name}/index.scss`]]))
|
|
7037
|
+
...Object.fromEntries([...blueprintToSheets(blueprint), ...blueprint.themes ? ["styles/themes"] : []].flatMap((name) => [[`./${name}`, `./dist/src/${name}/index.css`], [`./${name}/scss`, `./src/${name}/index.scss`]])),
|
|
7038
|
+
...blueprint.reporter ? { "./reporter": pathToCondition(`./${REPORTER_OUTPUT_PATH.replace(/\.js$/u, "")}`, ["es"]) } : {}
|
|
6975
7039
|
};
|
|
6976
7040
|
return Object.keys(exported).length > 0 ? {
|
|
6977
7041
|
...exported,
|
|
@@ -7145,9 +7209,8 @@ function blueprintToDevDependencies(blueprint) {
|
|
|
7145
7209
|
...rendered && !BROWSE_UPSTREAM.includes(own) ? BROWSE_DEV_DEPENDENCIES : {},
|
|
7146
7210
|
...blueprint.journey && blueprint.app.includes("browser") && (blueprint.base || blueprintToFaces(blueprint).some((extension) => extension.axes.includes("app"))) && !CAPTURE_UPSTREAM.includes(own) ? CAPTURE_DEV_DEPENDENCIES : {},
|
|
7147
7211
|
...sheets ? STYLES_DEV_DEPENDENCIES : {},
|
|
7148
|
-
...blueprint.src.length > 0 || blueprint.bin ? DECLARATION_DEV_DEPENDENCIES : {},
|
|
7212
|
+
...blueprint.src.length > 0 || blueprint.bin || blueprint.reporter ? DECLARATION_DEV_DEPENDENCIES : {},
|
|
7149
7213
|
...blueprint.src.includes("browser") || blueprint.setup.includes("browser") || sheets ? SOURCE_BROWSER_DEV_DEPENDENCIES : {},
|
|
7150
|
-
...blueprint.app.length > 0 ? APP_DEV_DEPENDENCIES : {},
|
|
7151
7214
|
...blueprint.app.includes("browser") ? APP_BROWSER_DEV_DEPENDENCIES : {},
|
|
7152
7215
|
...blueprint.app.includes("server") ? APP_SERVER_DEV_DEPENDENCIES : {},
|
|
7153
7216
|
...Object.fromEntries(blueprintToMachinery(blueprint).frameworks.flatMap((framework) => Object.entries(FRAMEWORK_MATRIX[framework].dependencies))),
|
|
@@ -7339,7 +7402,7 @@ function blueprintToScripts(blueprint) {
|
|
|
7339
7402
|
const checker = application.includes("vue") ? FRAMEWORK_MATRIX.vue.checker : "tsc";
|
|
7340
7403
|
const publishes = blueprint.src.length > 0 || targets.length > 0;
|
|
7341
7404
|
const integrates = blueprint.integration;
|
|
7342
|
-
const compiles = publishes || blueprint.bin;
|
|
7405
|
+
const compiles = publishes || blueprint.bin || blueprint.reporter;
|
|
7343
7406
|
const runtime = blueprint.app.filter((environment) => environment !== "core" && (environment !== "browser" || base));
|
|
7344
7407
|
const vitest = "vitest run --config vite.config.ts --no-cache --reporter=dot";
|
|
7345
7408
|
const built = [...runtime, ...application].flatMap((environment) => environment === "server" && matchesBarrel(blueprint) ? [environment, "barrel"] : [environment]);
|
|
@@ -7347,7 +7410,8 @@ function blueprintToScripts(blueprint) {
|
|
|
7347
7410
|
...blueprint.src,
|
|
7348
7411
|
...source,
|
|
7349
7412
|
...sheets,
|
|
7350
|
-
...blueprint.bin ? ["bin"] : []
|
|
7413
|
+
...blueprint.bin ? ["bin"] : [],
|
|
7414
|
+
...blueprint.reporter ? ["reporter"] : []
|
|
7351
7415
|
].map((name) => `npm run check:src:${name}`);
|
|
7352
7416
|
const journey = `vitest run --config ${JOURNEY_CONFIG_PATH} --no-cache --reporter=dot`;
|
|
7353
7417
|
const showcase = `vite --config ${SHOWCASE_CONFIG_PATH}`;
|
|
@@ -7369,6 +7433,7 @@ function blueprintToScripts(blueprint) {
|
|
|
7369
7433
|
"check:src": checks.join(" && "),
|
|
7370
7434
|
...Object.fromEntries(Iterator.from(blueprint.src).map((environment) => [`check:src:${environment}`, `tsc --noEmit -p configs/src/tsconfig.${environment}.json`]).toArray()),
|
|
7371
7435
|
...blueprint.bin ? { "check:src:bin": "tsc --noEmit -p configs/src/tsconfig.bin.json" } : {},
|
|
7436
|
+
...blueprint.reporter ? { "check:src:reporter": "tsc --noEmit -p configs/src/tsconfig.reporter.json" } : {},
|
|
7372
7437
|
...Object.fromEntries([...sheets, ...source].map((name) => [`check:src:${name}`, `tsc --noEmit -p configs/src/tsconfig.${name}.json`]))
|
|
7373
7438
|
} : {},
|
|
7374
7439
|
...blueprint.app.length > 0 ? {
|
|
@@ -7393,14 +7458,16 @@ function blueprintToScripts(blueprint) {
|
|
|
7393
7458
|
...!publishes && blueprint.service ? ["npm run test:service"] : []
|
|
7394
7459
|
].join(" && "),
|
|
7395
7460
|
...compiles ? {
|
|
7396
|
-
"test:src": [...blueprint.src.length > 0 || blueprint.bin ? [[
|
|
7461
|
+
"test:src": [...blueprint.src.length > 0 || blueprint.bin || blueprint.reporter ? [[
|
|
7397
7462
|
vitest,
|
|
7398
7463
|
...blueprint.src.map((environment) => `--project ${SRC_MATRIX[environment].project}`),
|
|
7399
7464
|
...source.map((name) => `--project src:${name}`),
|
|
7400
|
-
...blueprint.bin ? ["--project src:bin"] : []
|
|
7465
|
+
...blueprint.bin ? ["--project src:bin"] : [],
|
|
7466
|
+
...blueprint.reporter ? ["--project src:reporter"] : []
|
|
7401
7467
|
].join(" ")] : [], ...targets.map((name) => `npm run test:src:${name}`)].join(" && "),
|
|
7402
7468
|
...Object.fromEntries(Iterator.from(blueprint.src).map((environment) => [`test:src:${environment}`, `${vitest} --project ${SRC_MATRIX[environment].project}`]).toArray()),
|
|
7403
7469
|
...blueprint.bin ? { "test:src:bin": `${vitest} --project src:bin` } : {},
|
|
7470
|
+
...blueprint.reporter ? { "test:src:reporter": `${vitest} --project src:reporter` } : {},
|
|
7404
7471
|
...Object.fromEntries(source.map((name) => [`test:src:${name}`, `${vitest} --project src:${name}`])),
|
|
7405
7472
|
...Object.fromEntries(targets.map((name) => [`test:src:${name}`, `npm run build:src:${name} && ${vitest} --project src:${name}`]))
|
|
7406
7473
|
} : {},
|
|
@@ -7447,10 +7514,12 @@ function blueprintToScripts(blueprint) {
|
|
|
7447
7514
|
...blueprint.src.map((environment) => `npm run build:src:${environment}`),
|
|
7448
7515
|
...source.map((name) => `npm run build:src:${name}`),
|
|
7449
7516
|
...targets.map((name) => `npm run build:src:${name}`),
|
|
7450
|
-
...blueprint.bin ? ["npm run build:src:bin"] : []
|
|
7517
|
+
...blueprint.bin ? ["npm run build:src:bin"] : [],
|
|
7518
|
+
...blueprint.reporter ? ["npm run build:src:reporter"] : []
|
|
7451
7519
|
].join(" && "),
|
|
7452
7520
|
...Object.fromEntries(Iterator.from(blueprint.src).map((environment) => [`build:src:${environment}`, SRC_MATRIX[environment].formats.includes("cjs") ? `vite build --config configs/src/vite.${environment}.config.ts && npm run copy dist/src/${environment}/index.d.ts dist/src/${environment}/index.d.cts` : `vite build --config configs/src/vite.${environment}.config.ts`]).toArray()),
|
|
7453
7521
|
...blueprint.bin ? { "build:src:bin": "vite build --config configs/src/vite.bin.config.ts" } : {},
|
|
7522
|
+
...blueprint.reporter ? { "build:src:reporter": "vite build --config configs/src/vite.reporter.config.ts" } : {},
|
|
7454
7523
|
...Object.fromEntries(source.map((name) => [`build:src:${name}`, `vite build --config configs/src/vite.${name}.config.ts`])),
|
|
7455
7524
|
...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(" && ")]))
|
|
7456
7525
|
} : {},
|
|
@@ -7493,9 +7562,9 @@ function blueprintToScripts(blueprint) {
|
|
|
7493
7562
|
* Every direct `test:<project>` script is writable, together with the probe and
|
|
7494
7563
|
* benchmark workbench scripts. A workspace carrying guides adds `test:guides`,
|
|
7495
7564
|
* whose package-owned entry runs the guides project and handles explicit parity
|
|
7496
|
-
* rewrites, and one carrying skills adds `test:skills`. Publishing adds the pack and publication
|
|
7497
|
-
* Sheet and framework faces add their check and build scripts, application
|
|
7498
|
-
* and selected showcases and journeys add their mode scripts.
|
|
7565
|
+
* rewrites, and one carrying skills adds `test:skills`. Publishing adds the pack and publication
|
|
7566
|
+
* lifecycle scripts. Sheet and framework faces add their check and build scripts, application
|
|
7567
|
+
* frameworks add dev scripts, and selected showcases and journeys add their mode scripts.
|
|
7499
7568
|
* A base browser application's journey axis also adds `journey` and `capture`, and each
|
|
7500
7569
|
* app-side browser face adds `journey:<name>` and `capture:<name>`. Their generated
|
|
7501
7570
|
* commands are writable and have no predecessor forms; customized values remain caller-owned.
|
|
@@ -7512,10 +7581,10 @@ function blueprintToScripts(blueprint) {
|
|
|
7512
7581
|
* existed. The pack hook accepts the build chain emitted before it
|
|
7513
7582
|
* delegated to `build`. The publication hook accepts the same gate chain without
|
|
7514
7583
|
* {@link RELEASE_PROOF_COMMAND}. No accepted publication chain carries a study
|
|
7515
|
-
* step. `serve:build` accepts the server-only chain it ran before it delegated to
|
|
7516
|
-
*
|
|
7517
|
-
* customized, and {@link replaceManifestScripts} retains it while
|
|
7518
|
-
* other named scripts independently.
|
|
7584
|
+
* step. `serve:build` accepts the server-only chain it ran before it delegated to `build`.
|
|
7585
|
+
* The value being written is always writable, so it is not repeated there. Any other value is a
|
|
7586
|
+
* script the workspace author customized, and {@link replaceManifestScripts} retains it while
|
|
7587
|
+
* writing the other named scripts independently.
|
|
7519
7588
|
*
|
|
7520
7589
|
* @example
|
|
7521
7590
|
* ```ts
|
|
@@ -7601,8 +7670,8 @@ function blueprintToManifest(blueprint) {
|
|
|
7601
7670
|
const targets = [...sheets, ...blueprint.themes ? ["styles/themes"] : []];
|
|
7602
7671
|
const publishes = blueprint.src.length > 0 || targets.length > 0;
|
|
7603
7672
|
const name = publishes ? `@orkestrel/${blueprint.name}` : blueprint.name;
|
|
7604
|
-
const dependencies = Object.fromEntries(
|
|
7605
|
-
const peers =
|
|
7673
|
+
const dependencies = Object.fromEntries(blueprint.dependencies.toSorted((left, right) => comparePrimitives(left.name, right.name)).map((dependency) => [dependency.name, dependency.range]));
|
|
7674
|
+
const peers = blueprint.peers.toSorted((left, right) => comparePrimitives(left.name, right.name));
|
|
7606
7675
|
const peerDependencies = Object.fromEntries(peers.map((peer) => [peer.name, peer.range]));
|
|
7607
7676
|
const peerDependenciesMeta = Object.fromEntries(peers.filter((peer) => peer.optional === true).map((peer) => [peer.name, { optional: true }]));
|
|
7608
7677
|
const entry = srcToEntry(blueprint.src);
|
|
@@ -7625,6 +7694,7 @@ function blueprintToManifest(blueprint) {
|
|
|
7625
7694
|
files: [
|
|
7626
7695
|
blueprint.bin || publishes ? "dist/src" : "dist/app",
|
|
7627
7696
|
...blueprint.bin ? ["dist/bin"] : [],
|
|
7697
|
+
...blueprint.reporter ? ["dist/reporter"] : [],
|
|
7628
7698
|
...targets.map((face) => `!dist/src/${face}/index.js`),
|
|
7629
7699
|
...sheets.map((face) => `src/${face}/**/*.scss`),
|
|
7630
7700
|
...blueprint.themes && !blueprint.styles ? ["src/styles/themes/**/*.scss"] : [],
|
|
@@ -7681,7 +7751,7 @@ function blueprintToMachinery(blueprint) {
|
|
|
7681
7751
|
return {
|
|
7682
7752
|
browser: blueprint.src.includes("browser") || blueprint.app.includes("browser") || blueprint.setup.includes("browser") || blueprintToSheets(blueprint).length > 0 || blueprint.themes || frameworks.length > 0,
|
|
7683
7753
|
frameworks,
|
|
7684
|
-
output: blueprint.src.length > 0 || blueprint.bin || hosted || blueprintToSheets(blueprint).length > 0 || blueprint.themes,
|
|
7754
|
+
output: blueprint.src.length > 0 || blueprint.bin || blueprint.reporter || hosted || blueprintToSheets(blueprint).length > 0 || blueprint.themes,
|
|
7685
7755
|
showcase: blueprint.showcase && (blueprint.base && blueprint.app.includes("browser") || blueprintToFaces(blueprint).some((extension) => extension.axes.includes("app")))
|
|
7686
7756
|
};
|
|
7687
7757
|
}
|
|
@@ -7779,6 +7849,7 @@ function blueprintToProjects(blueprint) {
|
|
|
7779
7849
|
...ENVIRONMENTS.filter((environment) => (axis !== "app" || environment !== "server") && blueprint[axis].includes(environment)).map((environment) => `${axis}:${environment}`),
|
|
7780
7850
|
...faces.filter((face) => face.axes.includes(axis)).map((face) => `${axis}:${face.name}`),
|
|
7781
7851
|
...axis === "src" && blueprint.bin ? ["src:bin"] : [],
|
|
7852
|
+
...axis === "src" && blueprint.reporter ? ["src:reporter"] : [],
|
|
7782
7853
|
...axis === "app" && blueprint.app.includes("server") ? ["app:server"] : []
|
|
7783
7854
|
]),
|
|
7784
7855
|
"policy",
|
|
@@ -7909,6 +7980,7 @@ function blueprintToRootVite(blueprint) {
|
|
|
7909
7980
|
})) : [],
|
|
7910
7981
|
...planned.has("src:vue") ? [CONFIG_TEMPLATES.factories.src.vue] : [],
|
|
7911
7982
|
...planned.has("src:bin") ? [CONFIG_TEMPLATES.factories.src.bin] : [],
|
|
7983
|
+
...planned.has("src:reporter") ? [CONFIG_TEMPLATES.factories.src.reporter] : [],
|
|
7912
7984
|
...planned.has("app:core") ? [CONFIG_TEMPLATES.factories.app.core] : [],
|
|
7913
7985
|
...planned.has("app:browser") ? [fillTemplate(CONFIG_TEMPLATES.factories.app.browser, {
|
|
7914
7986
|
vuePlugin: machinery.frameworks.includes("vue") ? ", vue()" : "",
|
|
@@ -7944,6 +8016,7 @@ function blueprintToRootVite(blueprint) {
|
|
|
7944
8016
|
...planned.has("src:server") ? ["srcServer"] : [],
|
|
7945
8017
|
...planned.has("src:vue") ? ["srcVue"] : [],
|
|
7946
8018
|
...planned.has("src:bin") ? ["srcBin"] : [],
|
|
8019
|
+
...planned.has("src:reporter") ? ["srcReporter"] : [],
|
|
7947
8020
|
...planned.has("app:core") ? ["appCore"] : [],
|
|
7948
8021
|
...planned.has("app:browser") ? ["appBrowser"] : [],
|
|
7949
8022
|
...planned.has("app:vue") ? ["appVue"] : [],
|
|
@@ -8057,7 +8130,7 @@ function blueprintToConfigArtifacts(blueprint) {
|
|
|
8057
8130
|
environment,
|
|
8058
8131
|
content: path === "configs/src/tsconfig.core.json" ? CONFIG_TEMPLATES.tsconfigs.src.core : path === "configs/src/vite.browser.config.ts" ? CONFIG_TEMPLATES.vites.src.browser : path === "configs/src/tsconfig.browser.json" ? CONFIG_TEMPLATES.tsconfigs.src.browser : path === "configs/src/vite.server.config.ts" ? CONFIG_TEMPLATES.vites.src.server : path === "configs/src/tsconfig.server.json" ? CONFIG_TEMPLATES.tsconfigs.src.server : CONFIG_TEMPLATES.vites.src.core
|
|
8059
8132
|
}))).toArray();
|
|
8060
|
-
const paths = blueprint.bin ? blueprint.src.map((environment) => `\t\t\t\t\t\t'@src/${environment}': '../src/${environment}/index.js',`) : [];
|
|
8133
|
+
const paths = blueprint.bin || blueprint.reporter ? blueprint.src.map((environment) => `\t\t\t\t\t\t'@src/${environment}': '../src/${environment}/index.js',`) : [];
|
|
8061
8134
|
const renderedPaths = paths.length === 0 ? " paths: {}," : `\t\t\t\t\tpaths: {
|
|
8062
8135
|
${paths.join("\n")}
|
|
8063
8136
|
},`;
|
|
@@ -8068,6 +8141,13 @@ ${paths.join("\n")}
|
|
|
8068
8141
|
origin: "template",
|
|
8069
8142
|
content: path === "configs/src/tsconfig.bin.json" ? CONFIG_TEMPLATES.tsconfigs.bin : fillTemplate(CONFIG_TEMPLATES.vites.bin, { paths: renderedPaths })
|
|
8070
8143
|
})) : [];
|
|
8144
|
+
const reporters = blueprint.reporter ? REPORTER_CONFIGS.map((path) => ({
|
|
8145
|
+
path,
|
|
8146
|
+
group: "configs",
|
|
8147
|
+
ownership: "content",
|
|
8148
|
+
origin: "template",
|
|
8149
|
+
content: path === "configs/src/tsconfig.reporter.json" ? CONFIG_TEMPLATES.tsconfigs.reporter : fillTemplate(CONFIG_TEMPLATES.vites.reporter, { paths: renderedPaths })
|
|
8150
|
+
})) : [];
|
|
8071
8151
|
const barrels = matchesBarrel(blueprint) ? BARREL_CONFIGS.map((path) => ({
|
|
8072
8152
|
path,
|
|
8073
8153
|
group: "configs",
|
|
@@ -8180,6 +8260,7 @@ ${paths.join("\n")}
|
|
|
8180
8260
|
...sheets,
|
|
8181
8261
|
...sources,
|
|
8182
8262
|
...bins,
|
|
8263
|
+
...reporters,
|
|
8183
8264
|
...applications,
|
|
8184
8265
|
...barrels,
|
|
8185
8266
|
...faces,
|
|
@@ -8391,7 +8472,7 @@ function blueprintToTestArtifacts(blueprint) {
|
|
|
8391
8472
|
environment: "browser",
|
|
8392
8473
|
content: blueprint.journey ? ARTIFACT_TEMPLATES.tests.browser : ARTIFACT_TEMPLATES.tests.setup
|
|
8393
8474
|
}] : [];
|
|
8394
|
-
const servers = blueprint.src.includes("server") || blueprint.app.includes("server") || blueprint.bin || blueprint.conformance || blueprint.tree ? [{
|
|
8475
|
+
const servers = blueprint.src.includes("server") || blueprint.app.includes("server") || blueprint.bin || blueprint.reporter || blueprint.conformance || blueprint.tree ? [{
|
|
8395
8476
|
path: "tests/setupServer.ts",
|
|
8396
8477
|
group: "tests",
|
|
8397
8478
|
ownership: "birth",
|
|
@@ -8455,6 +8536,13 @@ function blueprintToTestArtifacts(blueprint) {
|
|
|
8455
8536
|
origin: "template",
|
|
8456
8537
|
content: fillTemplate(ARTIFACT_TEMPLATES.tests.bin, { import: matchesPrintWidth(joinedImport) ? joinedImport : `\t\tconst entry =\n\t\t\tawait import(${binSpecifier})` })
|
|
8457
8538
|
}] : [];
|
|
8539
|
+
const reporters = blueprint.reporter ? [{
|
|
8540
|
+
path: "tests/src/reporter/main.test.ts",
|
|
8541
|
+
group: "tests",
|
|
8542
|
+
ownership: "birth",
|
|
8543
|
+
origin: "template",
|
|
8544
|
+
content: ARTIFACT_TEMPLATES.tests.reporter
|
|
8545
|
+
}] : [];
|
|
8458
8546
|
const applications = Iterator.from(blueprint.app).map((environment) => ({
|
|
8459
8547
|
path: `tests/app/${environment}/index.test.ts`,
|
|
8460
8548
|
group: "tests",
|
|
@@ -8474,6 +8562,7 @@ function blueprintToTestArtifacts(blueprint) {
|
|
|
8474
8562
|
origin: "template",
|
|
8475
8563
|
content: fillTemplate(distribution.module, {
|
|
8476
8564
|
types: browser ? distribution.types : "",
|
|
8565
|
+
events: browser ? distribution.events : "",
|
|
8477
8566
|
transport: browser ? distribution.transport : "",
|
|
8478
8567
|
launcher: browser ? distribution.launcher : "",
|
|
8479
8568
|
helpers: browser ? distribution.helpers : ""
|
|
@@ -8532,6 +8621,7 @@ function blueprintToTestArtifacts(blueprint) {
|
|
|
8532
8621
|
...journeys,
|
|
8533
8622
|
...sources,
|
|
8534
8623
|
...bins,
|
|
8624
|
+
...reporters,
|
|
8535
8625
|
...applications,
|
|
8536
8626
|
...distributions,
|
|
8537
8627
|
...integrations
|
|
@@ -8568,6 +8658,10 @@ function blueprintToGuideArtifacts(blueprint) {
|
|
|
8568
8658
|
directory: "src/bin",
|
|
8569
8659
|
test: "tests/src/bin"
|
|
8570
8660
|
}] : [],
|
|
8661
|
+
...blueprint.reporter ? [{
|
|
8662
|
+
directory: "src/reporter",
|
|
8663
|
+
test: "tests/src/reporter"
|
|
8664
|
+
}] : [],
|
|
8571
8665
|
...[...blueprint.app, ...blueprintToFaces(blueprint).filter((extension) => extension.axes.includes("app")).map((extension) => extension.name)].map((environment) => ({
|
|
8572
8666
|
directory: `app/${environment}`,
|
|
8573
8667
|
test: `tests/app/${environment}`
|
|
@@ -8962,7 +9056,7 @@ function insertManifestDependencies(manifest, additions) {
|
|
|
8962
9056
|
function insertManifestSection(manifest, section, dependencies, present) {
|
|
8963
9057
|
const tokens = scanManifestTokens(manifest);
|
|
8964
9058
|
if (tokens === void 0) return void 0;
|
|
8965
|
-
const ordered =
|
|
9059
|
+
const ordered = dependencies.toSorted((left, right) => comparePrimitives(left.name, right.name));
|
|
8966
9060
|
const lines = ordered.map(({ name, range }) => `${JSON.stringify(name)}: ${JSON.stringify(range)}`);
|
|
8967
9061
|
const sibling = section === "dependencies" ? "devDependencies" : "dependencies";
|
|
8968
9062
|
const occurrences = tokens.flatMap((token, at) => {
|
|
@@ -9694,6 +9788,7 @@ function createBlueprint(name, input) {
|
|
|
9694
9788
|
engines: input?.engines ?? ">=22.18.0",
|
|
9695
9789
|
overrides: input?.overrides ?? [],
|
|
9696
9790
|
bin: input?.bin ?? false,
|
|
9791
|
+
reporter: input?.reporter ?? false,
|
|
9697
9792
|
setup: input?.setup ?? [],
|
|
9698
9793
|
guides: input?.guides ?? false,
|
|
9699
9794
|
integration: input?.integration ?? false,
|
|
@@ -10011,6 +10106,6 @@ var Compiler = class {
|
|
|
10011
10106
|
return error;
|
|
10012
10107
|
}
|
|
10013
10108
|
};
|
|
10014
|
-
export { APP_BROWSER_DEV_DEPENDENCIES,
|
|
10109
|
+
export { APP_BROWSER_DEV_DEPENDENCIES, APP_MATRIX, APP_SERVER_DEV_DEPENDENCIES, ARTIFACT_GROUPS, ARTIFACT_TEMPLATES, AXES, BARREL_CONFIGS, BASE_DEV_DEPENDENCIES, BIN_CONFIGS, BIN_ENTRY_PATH, BIN_OUTPUT_PATH, BROWSER_ENTRIES, BROWSE_DEV_DEPENDENCIES, BROWSE_UPSTREAM, CANON_PATHS, CAPTURE_DEV_DEPENDENCIES, CAPTURE_UPSTREAM, CATALOG_AGENT_PATH, CATALOG_END_MARKER, CATALOG_START_MARKER, CONFIG_TEMPLATES, CONFORMANCE_TEST_PATH, CONTROL_CHARACTER_PATTERN, Compiler, DECLARATION_DEV_DEPENDENCIES, DEFAULT_ENGINES, DEFAULT_VERSION, DEPENDENCY_NAME_PATTERN, DISTRIBUTION_SETUP_PATH, DISTRIBUTION_TEST_PATH, ENGINES_PATTERN, ENVIRONMENTS, EXECUTABLE_PATHS, EXTRA_RANGE_PATTERN, FLOOR_RANGE_PATTERN, FOREIGN_NAME_PATTERN, FRAMEWORKS, FRAMEWORK_MATRIX, GLOBAL_SETUP_PATH, GUIDES_TEST_PATH, HEX_PATTERN, HOST_INVENTORY_PATH, HOST_PATHS, INTEGRATION_TEST_PATH, INVALID_PATH_CHARACTER_PATTERN, JOURNEY_CONFIG_PATH, MANIFEST_PATH, MAX_ARTIFACT_BYTES, MAX_ARTIFACT_HEX_LENGTH, MAX_AUDIT_FINDINGS, MAX_COLLECTION_ITEMS, MAX_DEPENDENCY_NAME_LENGTH, MAX_MANIFEST_BYTES, MAX_NAME_LENGTH, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, MAX_REGISTRY_BYTES, MAX_SCRIPT_LENGTH, MAX_TOTAL_ARTIFACT_BYTES, MAX_TOTAL_REGISTRY_BYTES, MINIMUM_NODE_VERSION, MINIMUM_NPM_VERSION, NAME_PATTERN, ORCHESTRATION_PATH_NAMES, ORCHESTRATION_PATH_PREFIXES, ORKESTREL_RANGE_PATTERN, PRINT_WIDTH, REFERENCE_PATHS, RELEASE_PROOF_COMMAND, REPORTER_CONFIGS, REPORTER_ENTRY_PATH, REPORTER_OUTPUT_PATH, RESERVED_SHEET_NAMES, SEED_GUIDE_PATHS, SERVICE_SCRIPT_PATH, SERVICE_SETUP_PATH, SERVICE_TEST_INCLUDE, SHEET_ENTRY_NAME, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SHOWCASE_OVERRIDES, SHOWCASE_PAGES_PATH, SKILLS_CONFIG_PATH, SOURCE_BROWSER_DEV_DEPENDENCIES, SRC_MATRIX, STUDIES_TEST_INCLUDE, STYLES_DEV_DEPENDENCIES, STYLES_ENTRY_PATH, SURFACES, SURFACE_EDIT_LENGTH, SURFACE_TRANSFERS, ScaffoldError, TAB_WIDTH, TARGET_SKILL_NAMES, THEMES_BARREL_PATH, THEMES_ENTRY_PATH, TOOLCHAIN_HOLDS, TREE_TEST_PATH, VERSION_PATTERN, WORKSPACE_DEV_ENGINES, WORKSPACE_OWNED_PATHS, applyOverrides, artifactToArtifactFinding, artifactToHex, artifactsToQuestions, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToDocumentArtifacts, blueprintToExports, blueprintToFaces, blueprintToGuideArtifacts, blueprintToHostArtifacts, blueprintToMachinery, blueprintToManifest, blueprintToManifestOverrides, blueprintToOptimizedDependencies, blueprintToOrchestrationArtifacts, blueprintToProjects, blueprintToQuestions, blueprintToRootTsconfig, blueprintToRootVite, blueprintToScripts, blueprintToSheets, blueprintToSourceArtifacts, blueprintToTestArtifacts, blueprintToToolchainHolds, blueprintToWritableScripts, bytesToHex, catalogToLayers, collectSurfaceAdvisories, collectSurfaceCollisions, collectSurfaceConflicts, compareSurfaceCollisions, compareVersions, computeBytes, computeHash, computeTotal, contentToHex, createBlueprint, dependenciesToQuestions, extractRangeMajor, extractVersion, inferArtifactDrift, inferArtifactGroup, inferSurfaceSimilarity, insertManifestDependencies, insertManifestSection, isArtifact, isArtifactFinding, isArtifactGroup, isArtifactGroups, isAudit, isBlueprint, isBrowserExtension, isCanonPath, isCatalogEntry, isCollection, isCompilerHooks, isCompilerOptions, isContent, isDeferredPath, isDependency, isDependencyName, isEnvironment, isExtension, isFloorPath, isHexContent, isManifestScript, isMirror, isOverride, isPath, isPlan, isQuestion, isRetainedPath, isScaffoldError, isSheetName, isSnapshot, isStylesExtension, isSurface, iterateAnswers, manifestToDependencies, manifestToName, matchesArtifactDriftReachability, matchesBarrel, matchesEngines, matchesGuideRefusal, matchesOrchestrationPath, matchesPrintWidth, matchesRange, matchesSurfaceStructure, nameToGuide, overridesToQuestions, parseArtifactGroups, parseBlueprint, parseCompilerOptions, parseExtension, parseOwnedJSONValue, parseSnapshot, pathToCondition, planToArtifactFindings, planToHash, planToSummary, renderSkillPointer, replaceManifestOverride, replaceManifestOverrides, replaceManifestRanges, replaceManifestScripts, replacePlanRanges, scanManifestTokens, selectArtifactGroups, selectHostPaths, serializeTypeScriptString, srcToEntry, srcToExports, srcToRoot };
|
|
10015
10110
|
|
|
10016
10111
|
//# sourceMappingURL=index.js.map
|