@orkestrel/scaffold 0.0.133 → 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 +27 -3
- package/dist/bin/main.js.map +1 -1
- 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 +4 -4
- 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 +3 -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/form.md +79 -4
- package/dist/host/guides/scaffold.md +93 -65
- package/dist/host/guides/table.md +20 -6
- package/dist/host/guides/test.md +9 -7
- package/dist/host/manifest.json +44 -44
- package/dist/host/tests/config.test.ts +201 -11
- package/dist/host/tests/policy.test.ts +14 -21
- package/dist/host/tests/setupPolicy.ts +43 -36
- package/dist/src/core/index.cjs +191 -93
- 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 +189 -93
- 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 +2 -2
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",
|
|
@@ -108,7 +108,7 @@ var package_default = {
|
|
|
108
108
|
"@orkestrel/guide": "^0.0.31",
|
|
109
109
|
"@orkestrel/html": "^0.0.16",
|
|
110
110
|
"@orkestrel/probe": "^0.0.30",
|
|
111
|
-
"@orkestrel/test": "^0.0.
|
|
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({
|
|
@@ -1936,6 +1982,25 @@ export function probe(override?: UserConfig): UserConfig {
|
|
|
1936
1982
|
"../../src/bin/**/*.tsx"
|
|
1937
1983
|
]
|
|
1938
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
|
+
}
|
|
1939
2004
|
`,
|
|
1940
2005
|
skills: `{
|
|
1941
2006
|
"extends": "../../tsconfig.json",
|
|
@@ -2101,6 +2166,29 @@ export default defineConfig(
|
|
|
2101
2166
|
},
|
|
2102
2167
|
}),
|
|
2103
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
|
+
)
|
|
2104
2192
|
`,
|
|
2105
2193
|
app: Object.freeze({
|
|
2106
2194
|
vue: `import { defineConfig } from 'vite'
|
|
@@ -2701,12 +2789,22 @@ describe('bin entry', () => {
|
|
|
2701
2789
|
expect(Object.keys(entry)).toStrictEqual([])
|
|
2702
2790
|
})
|
|
2703
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
|
+
})
|
|
2704
2801
|
`,
|
|
2705
2802
|
distribution: Object.freeze({
|
|
2706
2803
|
module: `{{types}}import type { SpawnSyncReturns } from 'node:child_process'
|
|
2707
2804
|
import type { TestContext } from 'vitest'
|
|
2805
|
+
import { arrayOf, isArray, isRecord, isString } from '@orkestrel/contract'
|
|
2708
2806
|
import { spawnSync } from 'node:child_process'
|
|
2709
|
-
import {
|
|
2807
|
+
{{events}}import {
|
|
2710
2808
|
existsSync,
|
|
2711
2809
|
mkdirSync,
|
|
2712
2810
|
mkdtempSync,
|
|
@@ -2953,39 +3051,6 @@ export interface DistributionStage {
|
|
|
2953
3051
|
readonly targets: readonly string[]
|
|
2954
3052
|
}
|
|
2955
3053
|
|
|
2956
|
-
/**
|
|
2957
|
-
* Checks whether a value is a non-null object other than an array.
|
|
2958
|
-
*
|
|
2959
|
-
* @param value - The value to inspect.
|
|
2960
|
-
* @returns True if the value is a record; false otherwise.
|
|
2961
|
-
*/
|
|
2962
|
-
export function isDistributionRecord(value: unknown): value is Readonly<Record<string, unknown>> {
|
|
2963
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
2964
|
-
}
|
|
2965
|
-
|
|
2966
|
-
/**
|
|
2967
|
-
* Checks whether a value is an array of strings.
|
|
2968
|
-
*
|
|
2969
|
-
* @param value - The value to inspect.
|
|
2970
|
-
* @returns True if every array member is a string; false otherwise.
|
|
2971
|
-
*/
|
|
2972
|
-
export function isDistributionNames(value: unknown): value is readonly string[] {
|
|
2973
|
-
return Array.isArray(value) && value.every((name) => typeof name === 'string')
|
|
2974
|
-
}
|
|
2975
|
-
|
|
2976
|
-
// A fallback list, which is what Node reads an array in an exports entry as. The
|
|
2977
|
-
// narrowing is what the following walkers need: \`Array.isArray\` widens an \`unknown\`
|
|
2978
|
-
// member to \`any\`, and an entry read that way is not read at all.
|
|
2979
|
-
/**
|
|
2980
|
-
* Checks whether a value is a fallback array.
|
|
2981
|
-
*
|
|
2982
|
-
* @param value - The value to inspect.
|
|
2983
|
-
* @returns True if the value is an array; false otherwise.
|
|
2984
|
-
*/
|
|
2985
|
-
export function isDistributionList(value: unknown): value is readonly unknown[] {
|
|
2986
|
-
return Array.isArray(value)
|
|
2987
|
-
}
|
|
2988
|
-
|
|
2989
3054
|
// Whether a string is a valid package target. Node rejects a target outside the
|
|
2990
3055
|
// package and a target containing a dot, parent, or node_modules segment during
|
|
2991
3056
|
// package-target resolution. A later module-resolution failure is not the same
|
|
@@ -3030,7 +3095,7 @@ export function readDistributionJSON(path: string): unknown {
|
|
|
3030
3095
|
*/
|
|
3031
3096
|
export function readDistributionManifestName(path: string): string {
|
|
3032
3097
|
const manifest = readDistributionJSON(path)
|
|
3033
|
-
if (!
|
|
3098
|
+
if (!isRecord(manifest) || typeof manifest.name !== 'string') {
|
|
3034
3099
|
throw new Error(\`The manifest at \${path} declares no package name\`)
|
|
3035
3100
|
}
|
|
3036
3101
|
return manifest.name
|
|
@@ -3047,19 +3112,17 @@ export function readDistributionManifestName(path: string): string {
|
|
|
3047
3112
|
*/
|
|
3048
3113
|
export function readDistributionPeers(path: string): Readonly<Record<string, string>> {
|
|
3049
3114
|
const manifest = readDistributionJSON(path)
|
|
3050
|
-
if (!
|
|
3115
|
+
if (!isRecord(manifest) || !isRecord(manifest.peerDependencies)) {
|
|
3051
3116
|
return {}
|
|
3052
3117
|
}
|
|
3053
|
-
const meta =
|
|
3054
|
-
? manifest.peerDependenciesMeta
|
|
3055
|
-
: undefined
|
|
3118
|
+
const meta = isRecord(manifest.peerDependenciesMeta) ? manifest.peerDependenciesMeta : undefined
|
|
3056
3119
|
const peers = Object.entries(manifest.peerDependencies).filter(
|
|
3057
3120
|
(entry): entry is [string, string] => typeof entry[1] === 'string',
|
|
3058
3121
|
)
|
|
3059
3122
|
return Object.fromEntries(
|
|
3060
3123
|
peers.filter(([name]) => {
|
|
3061
3124
|
const entry = meta?.[name]
|
|
3062
|
-
return !
|
|
3125
|
+
return !isRecord(entry) || entry.optional !== true
|
|
3063
3126
|
}),
|
|
3064
3127
|
)
|
|
3065
3128
|
}
|
|
@@ -3074,7 +3137,7 @@ export function createDistributionConsumerManifest(
|
|
|
3074
3137
|
peers: Readonly<Record<string, string>>,
|
|
3075
3138
|
): string {
|
|
3076
3139
|
const manifest: unknown = JSON.parse(DISTRIBUTION_CONSUMER_MANIFEST)
|
|
3077
|
-
if (Object.keys(peers).length === 0 || !
|
|
3140
|
+
if (Object.keys(peers).length === 0 || !isRecord(manifest)) {
|
|
3078
3141
|
return DISTRIBUTION_CONSUMER_MANIFEST
|
|
3079
3142
|
}
|
|
3080
3143
|
return \`\${JSON.stringify({ ...manifest, dependencies: peers })}\\n\`
|
|
@@ -3195,7 +3258,7 @@ export function resolveDistributionPackageTarget(
|
|
|
3195
3258
|
conditions: readonly string[],
|
|
3196
3259
|
): DistributionTargetResult | undefined {
|
|
3197
3260
|
if (typeof entry === 'string') return { target: entry }
|
|
3198
|
-
if (
|
|
3261
|
+
if (isArray(entry)) {
|
|
3199
3262
|
for (const member of entry) {
|
|
3200
3263
|
const resolved = resolveDistributionPackageTarget(member, conditions)
|
|
3201
3264
|
if (resolved !== undefined && matchesDistributionPackageTarget(resolved.target))
|
|
@@ -3203,7 +3266,7 @@ export function resolveDistributionPackageTarget(
|
|
|
3203
3266
|
}
|
|
3204
3267
|
return undefined
|
|
3205
3268
|
}
|
|
3206
|
-
if (!
|
|
3269
|
+
if (!isRecord(entry)) return undefined
|
|
3207
3270
|
for (const [condition, nested] of Object.entries(entry)) {
|
|
3208
3271
|
if (condition !== 'default' && !conditions.includes(condition)) continue
|
|
3209
3272
|
const resolved = resolveDistributionPackageTarget(nested, conditions)
|
|
@@ -3288,14 +3351,14 @@ export function resolveDistributionDeclaration(
|
|
|
3288
3351
|
installed: string,
|
|
3289
3352
|
): string | undefined {
|
|
3290
3353
|
if (typeof entry === 'string') return targetToDistributionDeclaration(entry, installed)
|
|
3291
|
-
if (
|
|
3354
|
+
if (isArray(entry)) {
|
|
3292
3355
|
for (const member of entry) {
|
|
3293
3356
|
const resolved = resolveDistributionDeclaration(member, conditions, installed)
|
|
3294
3357
|
if (resolved !== undefined) return resolved
|
|
3295
3358
|
}
|
|
3296
3359
|
return undefined
|
|
3297
3360
|
}
|
|
3298
|
-
if (!
|
|
3361
|
+
if (!isRecord(entry)) return undefined
|
|
3299
3362
|
for (const [condition, nested] of Object.entries(entry)) {
|
|
3300
3363
|
if (condition !== 'default' && !conditions.includes(condition)) continue
|
|
3301
3364
|
const resolved = resolveDistributionDeclaration(nested, conditions, installed)
|
|
@@ -3328,7 +3391,7 @@ export function readDistributionPackageType(installed: string, target: string):
|
|
|
3328
3391
|
if (scope === undefined) return undefined
|
|
3329
3392
|
try {
|
|
3330
3393
|
const manifest = readDistributionJSON(join(scope, 'package.json'))
|
|
3331
|
-
return
|
|
3394
|
+
return isRecord(manifest) ? manifest.type : undefined
|
|
3332
3395
|
} catch {
|
|
3333
3396
|
return undefined
|
|
3334
3397
|
}
|
|
@@ -3405,9 +3468,9 @@ export function declaresDistributionCommonJS(entry: unknown, installed: string):
|
|
|
3405
3468
|
*/
|
|
3406
3469
|
export function collectDistributionTargets(entry: unknown): readonly string[] {
|
|
3407
3470
|
if (typeof entry === 'string') return [entry]
|
|
3408
|
-
if (
|
|
3471
|
+
if (isArray(entry))
|
|
3409
3472
|
return entry.flatMap(collectDistributionTargets).filter(matchesDistributionPackageTarget)
|
|
3410
|
-
if (!
|
|
3473
|
+
if (!isRecord(entry)) return []
|
|
3411
3474
|
return Object.values(entry).flatMap((nested) => collectDistributionTargets(nested))
|
|
3412
3475
|
}
|
|
3413
3476
|
|
|
@@ -3538,7 +3601,7 @@ export function filterDistributionUntypable(
|
|
|
3538
3601
|
return entries.filter(
|
|
3539
3602
|
(entry) =>
|
|
3540
3603
|
entry.requirable &&
|
|
3541
|
-
|
|
3604
|
+
isRecord(entry.mapping) &&
|
|
3542
3605
|
Object.hasOwn(entry.mapping, 'require') &&
|
|
3543
3606
|
!declaresDistributionCommonJS(entry.mapping, installed),
|
|
3544
3607
|
)
|
|
@@ -3728,7 +3791,7 @@ export function driveDistributionRuntime(
|
|
|
3728
3791
|
)
|
|
3729
3792
|
}
|
|
3730
3793
|
const published: unknown = JSON.parse(result.stdout)
|
|
3731
|
-
if (!
|
|
3794
|
+
if (!arrayOf(isString)(published))
|
|
3732
3795
|
throw new Error(\`The driver printed no name list for \${specifier}\`)
|
|
3733
3796
|
return published
|
|
3734
3797
|
}
|
|
@@ -3774,7 +3837,7 @@ export function buildDistributionStage(scratch: string): DistributionStage {
|
|
|
3774
3837
|
const name = readDistributionManifestName(join(DISTRIBUTION_ROOT, 'package.json'))
|
|
3775
3838
|
const installed = join(consumer, 'node_modules', ...name.split('/'))
|
|
3776
3839
|
const manifest = readDistributionJSON(join(installed, 'package.json'))
|
|
3777
|
-
if (!
|
|
3840
|
+
if (!isRecord(manifest) || !isRecord(manifest.exports)) {
|
|
3778
3841
|
throw new Error('The installed manifest publishes no exports map')
|
|
3779
3842
|
}
|
|
3780
3843
|
return { consumer, installed, archives, ...classifyDistributionStage(manifest, installed, name) }
|
|
@@ -3869,7 +3932,7 @@ export function classifyDistributionStage(
|
|
|
3869
3932
|
installed: string,
|
|
3870
3933
|
name: string,
|
|
3871
3934
|
): DistributionClassification {
|
|
3872
|
-
if (!
|
|
3935
|
+
if (!isRecord(manifest.exports))
|
|
3873
3936
|
throw new Error('The installed manifest publishes no exports map')
|
|
3874
3937
|
const readings = Object.entries(manifest.exports).map(([subpath, mapping]) => {
|
|
3875
3938
|
const files = collectDistributionTargets(mapping)
|
|
@@ -3959,8 +4022,8 @@ export function readDistributionFace(installed: string, path: string): string |
|
|
|
3959
4022
|
return output === 'dist'
|
|
3960
4023
|
? axis === 'src'
|
|
3961
4024
|
? face
|
|
3962
|
-
: axis === 'bin'
|
|
3963
|
-
?
|
|
4025
|
+
: axis === 'bin' || axis === 'reporter'
|
|
4026
|
+
? axis
|
|
3964
4027
|
: undefined
|
|
3965
4028
|
: undefined
|
|
3966
4029
|
}
|
|
@@ -4048,8 +4111,8 @@ export function scanDistributionSourceMaps(installed: string): readonly string[]
|
|
|
4048
4111
|
: Buffer.from(payload[2], 'base64').toString('utf8'),
|
|
4049
4112
|
)
|
|
4050
4113
|
if (
|
|
4051
|
-
!
|
|
4052
|
-
!
|
|
4114
|
+
!isRecord(map) ||
|
|
4115
|
+
!arrayOf(isString)(map.sources) ||
|
|
4053
4116
|
(map.sourceRoot !== undefined && typeof map.sourceRoot !== 'string')
|
|
4054
4117
|
) {
|
|
4055
4118
|
throw new Error('Unreadable source map')
|
|
@@ -4215,8 +4278,7 @@ export function checkDistributionManifest(installed: string, scratch: string): r
|
|
|
4215
4278
|
if (result.status !== 0)
|
|
4216
4279
|
throw new Error(\`npm pkg fix failed: \${readDistributionOutput(result)}\`)
|
|
4217
4280
|
const after = readDistributionJSON(path)
|
|
4218
|
-
if (!
|
|
4219
|
-
throw new Error('Unreadable manifest')
|
|
4281
|
+
if (!isRecord(before) || !isRecord(after)) throw new Error('Unreadable manifest')
|
|
4220
4282
|
return [...new Set([...Object.keys(before), ...Object.keys(after)])]
|
|
4221
4283
|
.filter((key) => !isDeepStrictEqual(before[key], after[key]))
|
|
4222
4284
|
.sort()
|
|
@@ -4268,7 +4330,7 @@ export function buildDistributionCases(
|
|
|
4268
4330
|
writeDistributionFile(join(root, 'module/package.json'), '{ "type": "module" }\\n')
|
|
4269
4331
|
writeDistributionFile(join(root, 'commonjs/package.json'), '{ "type": "commonjs" }\\n')
|
|
4270
4332
|
const manifest = readDistributionJSON(join(root, 'package.json'))
|
|
4271
|
-
if (!
|
|
4333
|
+
if (!isRecord(manifest) || !isRecord(manifest.exports)) {
|
|
4272
4334
|
throw new Error('The classifier fixture declares no exports map')
|
|
4273
4335
|
}
|
|
4274
4336
|
const mappings = manifest.exports
|
|
@@ -4393,7 +4455,7 @@ export function buildDistributionCases(
|
|
|
4393
4455
|
},
|
|
4394
4456
|
expected: {
|
|
4395
4457
|
undeclared: [],
|
|
4396
|
-
partitioned:
|
|
4458
|
+
partitioned: stage.subpaths.toSorted(),
|
|
4397
4459
|
unreachable: [],
|
|
4398
4460
|
untypable: [],
|
|
4399
4461
|
},
|
|
@@ -4539,6 +4601,8 @@ describe('installed package consumer', () => {
|
|
|
4539
4601
|
})
|
|
4540
4602
|
}
|
|
4541
4603
|
{{guard}}{{drive}}})
|
|
4604
|
+
`,
|
|
4605
|
+
events: `import { once } from 'node:events'
|
|
4542
4606
|
`,
|
|
4543
4607
|
transport: `import { createServer } from 'node:http'
|
|
4544
4608
|
`,
|
|
@@ -4667,9 +4731,8 @@ export async function readDistributionBrowserExports(
|
|
|
4667
4731
|
response.end(readFileSync(path))
|
|
4668
4732
|
})
|
|
4669
4733
|
try {
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
})
|
|
4734
|
+
server.listen(0, '127.0.0.1')
|
|
4735
|
+
await once(server, 'listening')
|
|
4673
4736
|
const address = server.address()
|
|
4674
4737
|
if (address === null || typeof address === 'string') {
|
|
4675
4738
|
throw new Error('The bundle server bound no port')
|
|
@@ -4680,8 +4743,7 @@ export async function readDistributionBrowserExports(
|
|
|
4680
4743
|
await page.goto(\`http://127.0.0.1:\${String(address.port)}/\`, { waitUntil: 'load' })
|
|
4681
4744
|
const published: unknown = await page.evaluate('globalThis.subject')
|
|
4682
4745
|
if (failures.length > 0) throw new Error(\`The bundle raised \${failures.join(' | ')}\`)
|
|
4683
|
-
if (!
|
|
4684
|
-
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')
|
|
4685
4747
|
return published
|
|
4686
4748
|
} finally {
|
|
4687
4749
|
server.close()
|
|
@@ -5233,6 +5295,7 @@ var isBlueprint = recordOf({
|
|
|
5233
5295
|
engines: isString,
|
|
5234
5296
|
overrides: andOf(isCollection, arrayOf(isOverride)),
|
|
5235
5297
|
bin: isBoolean,
|
|
5298
|
+
reporter: isBoolean,
|
|
5236
5299
|
setup: andOf(isCollection, arrayOf(literalOf("node", "browser"))),
|
|
5237
5300
|
guides: isBoolean,
|
|
5238
5301
|
integration: isBoolean,
|
|
@@ -6952,9 +7015,10 @@ function blueprintToSheets(blueprint) {
|
|
|
6952
7015
|
return [...blueprint.styles ? ["styles"] : [], ...sortValues(blueprint.extensions.flatMap((extension) => extension.surface === "styles" && isSheetName(extension.name) ? [extension.name] : []))];
|
|
6953
7016
|
}
|
|
6954
7017
|
/**
|
|
6955
|
-
* Projects published environments and
|
|
7018
|
+
* Projects published environments, sheets, and the reporter entry into the manifest export map.
|
|
6956
7019
|
* @param blueprint - The workspace specification.
|
|
6957
|
-
* @returns JavaScript conditions
|
|
7020
|
+
* @returns JavaScript conditions, CSS and SCSS subpaths, and the ES-only `./reporter` subpath,
|
|
7021
|
+
* without an invented JavaScript root.
|
|
6958
7022
|
* @example
|
|
6959
7023
|
* ```ts
|
|
6960
7024
|
* import { blueprintToExports, createBlueprint } from '@orkestrel/scaffold'
|
|
@@ -6970,7 +7034,8 @@ function blueprintToExports(blueprint) {
|
|
|
6970
7034
|
const face = [`./${extension.name}`, pathToCondition(`./dist/src/${extension.name}/index`, ["es"])];
|
|
6971
7035
|
return blueprint.src.includes("browser") ? [face, ["./browser", pathToCondition("./dist/src/browser/index", ["es"])]] : [face];
|
|
6972
7036
|
})),
|
|
6973
|
-
...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"]) } : {}
|
|
6974
7039
|
};
|
|
6975
7040
|
return Object.keys(exported).length > 0 ? {
|
|
6976
7041
|
...exported,
|
|
@@ -7144,9 +7209,8 @@ function blueprintToDevDependencies(blueprint) {
|
|
|
7144
7209
|
...rendered && !BROWSE_UPSTREAM.includes(own) ? BROWSE_DEV_DEPENDENCIES : {},
|
|
7145
7210
|
...blueprint.journey && blueprint.app.includes("browser") && (blueprint.base || blueprintToFaces(blueprint).some((extension) => extension.axes.includes("app"))) && !CAPTURE_UPSTREAM.includes(own) ? CAPTURE_DEV_DEPENDENCIES : {},
|
|
7146
7211
|
...sheets ? STYLES_DEV_DEPENDENCIES : {},
|
|
7147
|
-
...blueprint.src.length > 0 || blueprint.bin ? DECLARATION_DEV_DEPENDENCIES : {},
|
|
7212
|
+
...blueprint.src.length > 0 || blueprint.bin || blueprint.reporter ? DECLARATION_DEV_DEPENDENCIES : {},
|
|
7148
7213
|
...blueprint.src.includes("browser") || blueprint.setup.includes("browser") || sheets ? SOURCE_BROWSER_DEV_DEPENDENCIES : {},
|
|
7149
|
-
...blueprint.app.length > 0 ? APP_DEV_DEPENDENCIES : {},
|
|
7150
7214
|
...blueprint.app.includes("browser") ? APP_BROWSER_DEV_DEPENDENCIES : {},
|
|
7151
7215
|
...blueprint.app.includes("server") ? APP_SERVER_DEV_DEPENDENCIES : {},
|
|
7152
7216
|
...Object.fromEntries(blueprintToMachinery(blueprint).frameworks.flatMap((framework) => Object.entries(FRAMEWORK_MATRIX[framework].dependencies))),
|
|
@@ -7338,7 +7402,7 @@ function blueprintToScripts(blueprint) {
|
|
|
7338
7402
|
const checker = application.includes("vue") ? FRAMEWORK_MATRIX.vue.checker : "tsc";
|
|
7339
7403
|
const publishes = blueprint.src.length > 0 || targets.length > 0;
|
|
7340
7404
|
const integrates = blueprint.integration;
|
|
7341
|
-
const compiles = publishes || blueprint.bin;
|
|
7405
|
+
const compiles = publishes || blueprint.bin || blueprint.reporter;
|
|
7342
7406
|
const runtime = blueprint.app.filter((environment) => environment !== "core" && (environment !== "browser" || base));
|
|
7343
7407
|
const vitest = "vitest run --config vite.config.ts --no-cache --reporter=dot";
|
|
7344
7408
|
const built = [...runtime, ...application].flatMap((environment) => environment === "server" && matchesBarrel(blueprint) ? [environment, "barrel"] : [environment]);
|
|
@@ -7346,7 +7410,8 @@ function blueprintToScripts(blueprint) {
|
|
|
7346
7410
|
...blueprint.src,
|
|
7347
7411
|
...source,
|
|
7348
7412
|
...sheets,
|
|
7349
|
-
...blueprint.bin ? ["bin"] : []
|
|
7413
|
+
...blueprint.bin ? ["bin"] : [],
|
|
7414
|
+
...blueprint.reporter ? ["reporter"] : []
|
|
7350
7415
|
].map((name) => `npm run check:src:${name}`);
|
|
7351
7416
|
const journey = `vitest run --config ${JOURNEY_CONFIG_PATH} --no-cache --reporter=dot`;
|
|
7352
7417
|
const showcase = `vite --config ${SHOWCASE_CONFIG_PATH}`;
|
|
@@ -7368,6 +7433,7 @@ function blueprintToScripts(blueprint) {
|
|
|
7368
7433
|
"check:src": checks.join(" && "),
|
|
7369
7434
|
...Object.fromEntries(Iterator.from(blueprint.src).map((environment) => [`check:src:${environment}`, `tsc --noEmit -p configs/src/tsconfig.${environment}.json`]).toArray()),
|
|
7370
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" } : {},
|
|
7371
7437
|
...Object.fromEntries([...sheets, ...source].map((name) => [`check:src:${name}`, `tsc --noEmit -p configs/src/tsconfig.${name}.json`]))
|
|
7372
7438
|
} : {},
|
|
7373
7439
|
...blueprint.app.length > 0 ? {
|
|
@@ -7392,14 +7458,16 @@ function blueprintToScripts(blueprint) {
|
|
|
7392
7458
|
...!publishes && blueprint.service ? ["npm run test:service"] : []
|
|
7393
7459
|
].join(" && "),
|
|
7394
7460
|
...compiles ? {
|
|
7395
|
-
"test:src": [...blueprint.src.length > 0 || blueprint.bin ? [[
|
|
7461
|
+
"test:src": [...blueprint.src.length > 0 || blueprint.bin || blueprint.reporter ? [[
|
|
7396
7462
|
vitest,
|
|
7397
7463
|
...blueprint.src.map((environment) => `--project ${SRC_MATRIX[environment].project}`),
|
|
7398
7464
|
...source.map((name) => `--project src:${name}`),
|
|
7399
|
-
...blueprint.bin ? ["--project src:bin"] : []
|
|
7465
|
+
...blueprint.bin ? ["--project src:bin"] : [],
|
|
7466
|
+
...blueprint.reporter ? ["--project src:reporter"] : []
|
|
7400
7467
|
].join(" ")] : [], ...targets.map((name) => `npm run test:src:${name}`)].join(" && "),
|
|
7401
7468
|
...Object.fromEntries(Iterator.from(blueprint.src).map((environment) => [`test:src:${environment}`, `${vitest} --project ${SRC_MATRIX[environment].project}`]).toArray()),
|
|
7402
7469
|
...blueprint.bin ? { "test:src:bin": `${vitest} --project src:bin` } : {},
|
|
7470
|
+
...blueprint.reporter ? { "test:src:reporter": `${vitest} --project src:reporter` } : {},
|
|
7403
7471
|
...Object.fromEntries(source.map((name) => [`test:src:${name}`, `${vitest} --project src:${name}`])),
|
|
7404
7472
|
...Object.fromEntries(targets.map((name) => [`test:src:${name}`, `npm run build:src:${name} && ${vitest} --project src:${name}`]))
|
|
7405
7473
|
} : {},
|
|
@@ -7446,10 +7514,12 @@ function blueprintToScripts(blueprint) {
|
|
|
7446
7514
|
...blueprint.src.map((environment) => `npm run build:src:${environment}`),
|
|
7447
7515
|
...source.map((name) => `npm run build:src:${name}`),
|
|
7448
7516
|
...targets.map((name) => `npm run build:src:${name}`),
|
|
7449
|
-
...blueprint.bin ? ["npm run build:src:bin"] : []
|
|
7517
|
+
...blueprint.bin ? ["npm run build:src:bin"] : [],
|
|
7518
|
+
...blueprint.reporter ? ["npm run build:src:reporter"] : []
|
|
7450
7519
|
].join(" && "),
|
|
7451
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()),
|
|
7452
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" } : {},
|
|
7453
7523
|
...Object.fromEntries(source.map((name) => [`build:src:${name}`, `vite build --config configs/src/vite.${name}.config.ts`])),
|
|
7454
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(" && ")]))
|
|
7455
7525
|
} : {},
|
|
@@ -7492,9 +7562,9 @@ function blueprintToScripts(blueprint) {
|
|
|
7492
7562
|
* Every direct `test:<project>` script is writable, together with the probe and
|
|
7493
7563
|
* benchmark workbench scripts. A workspace carrying guides adds `test:guides`,
|
|
7494
7564
|
* whose package-owned entry runs the guides project and handles explicit parity
|
|
7495
|
-
* rewrites, and one carrying skills adds `test:skills`. Publishing adds the pack and publication
|
|
7496
|
-
* Sheet and framework faces add their check and build scripts, application
|
|
7497
|
-
* 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.
|
|
7498
7568
|
* A base browser application's journey axis also adds `journey` and `capture`, and each
|
|
7499
7569
|
* app-side browser face adds `journey:<name>` and `capture:<name>`. Their generated
|
|
7500
7570
|
* commands are writable and have no predecessor forms; customized values remain caller-owned.
|
|
@@ -7511,10 +7581,10 @@ function blueprintToScripts(blueprint) {
|
|
|
7511
7581
|
* existed. The pack hook accepts the build chain emitted before it
|
|
7512
7582
|
* delegated to `build`. The publication hook accepts the same gate chain without
|
|
7513
7583
|
* {@link RELEASE_PROOF_COMMAND}. No accepted publication chain carries a study
|
|
7514
|
-
* step. `serve:build` accepts the server-only chain it ran before it delegated to
|
|
7515
|
-
*
|
|
7516
|
-
* customized, and {@link replaceManifestScripts} retains it while
|
|
7517
|
-
* 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.
|
|
7518
7588
|
*
|
|
7519
7589
|
* @example
|
|
7520
7590
|
* ```ts
|
|
@@ -7600,8 +7670,8 @@ function blueprintToManifest(blueprint) {
|
|
|
7600
7670
|
const targets = [...sheets, ...blueprint.themes ? ["styles/themes"] : []];
|
|
7601
7671
|
const publishes = blueprint.src.length > 0 || targets.length > 0;
|
|
7602
7672
|
const name = publishes ? `@orkestrel/${blueprint.name}` : blueprint.name;
|
|
7603
|
-
const dependencies = Object.fromEntries(
|
|
7604
|
-
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));
|
|
7605
7675
|
const peerDependencies = Object.fromEntries(peers.map((peer) => [peer.name, peer.range]));
|
|
7606
7676
|
const peerDependenciesMeta = Object.fromEntries(peers.filter((peer) => peer.optional === true).map((peer) => [peer.name, { optional: true }]));
|
|
7607
7677
|
const entry = srcToEntry(blueprint.src);
|
|
@@ -7624,6 +7694,7 @@ function blueprintToManifest(blueprint) {
|
|
|
7624
7694
|
files: [
|
|
7625
7695
|
blueprint.bin || publishes ? "dist/src" : "dist/app",
|
|
7626
7696
|
...blueprint.bin ? ["dist/bin"] : [],
|
|
7697
|
+
...blueprint.reporter ? ["dist/reporter"] : [],
|
|
7627
7698
|
...targets.map((face) => `!dist/src/${face}/index.js`),
|
|
7628
7699
|
...sheets.map((face) => `src/${face}/**/*.scss`),
|
|
7629
7700
|
...blueprint.themes && !blueprint.styles ? ["src/styles/themes/**/*.scss"] : [],
|
|
@@ -7680,7 +7751,7 @@ function blueprintToMachinery(blueprint) {
|
|
|
7680
7751
|
return {
|
|
7681
7752
|
browser: blueprint.src.includes("browser") || blueprint.app.includes("browser") || blueprint.setup.includes("browser") || blueprintToSheets(blueprint).length > 0 || blueprint.themes || frameworks.length > 0,
|
|
7682
7753
|
frameworks,
|
|
7683
|
-
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,
|
|
7684
7755
|
showcase: blueprint.showcase && (blueprint.base && blueprint.app.includes("browser") || blueprintToFaces(blueprint).some((extension) => extension.axes.includes("app")))
|
|
7685
7756
|
};
|
|
7686
7757
|
}
|
|
@@ -7778,6 +7849,7 @@ function blueprintToProjects(blueprint) {
|
|
|
7778
7849
|
...ENVIRONMENTS.filter((environment) => (axis !== "app" || environment !== "server") && blueprint[axis].includes(environment)).map((environment) => `${axis}:${environment}`),
|
|
7779
7850
|
...faces.filter((face) => face.axes.includes(axis)).map((face) => `${axis}:${face.name}`),
|
|
7780
7851
|
...axis === "src" && blueprint.bin ? ["src:bin"] : [],
|
|
7852
|
+
...axis === "src" && blueprint.reporter ? ["src:reporter"] : [],
|
|
7781
7853
|
...axis === "app" && blueprint.app.includes("server") ? ["app:server"] : []
|
|
7782
7854
|
]),
|
|
7783
7855
|
"policy",
|
|
@@ -7908,6 +7980,7 @@ function blueprintToRootVite(blueprint) {
|
|
|
7908
7980
|
})) : [],
|
|
7909
7981
|
...planned.has("src:vue") ? [CONFIG_TEMPLATES.factories.src.vue] : [],
|
|
7910
7982
|
...planned.has("src:bin") ? [CONFIG_TEMPLATES.factories.src.bin] : [],
|
|
7983
|
+
...planned.has("src:reporter") ? [CONFIG_TEMPLATES.factories.src.reporter] : [],
|
|
7911
7984
|
...planned.has("app:core") ? [CONFIG_TEMPLATES.factories.app.core] : [],
|
|
7912
7985
|
...planned.has("app:browser") ? [fillTemplate(CONFIG_TEMPLATES.factories.app.browser, {
|
|
7913
7986
|
vuePlugin: machinery.frameworks.includes("vue") ? ", vue()" : "",
|
|
@@ -7943,6 +8016,7 @@ function blueprintToRootVite(blueprint) {
|
|
|
7943
8016
|
...planned.has("src:server") ? ["srcServer"] : [],
|
|
7944
8017
|
...planned.has("src:vue") ? ["srcVue"] : [],
|
|
7945
8018
|
...planned.has("src:bin") ? ["srcBin"] : [],
|
|
8019
|
+
...planned.has("src:reporter") ? ["srcReporter"] : [],
|
|
7946
8020
|
...planned.has("app:core") ? ["appCore"] : [],
|
|
7947
8021
|
...planned.has("app:browser") ? ["appBrowser"] : [],
|
|
7948
8022
|
...planned.has("app:vue") ? ["appVue"] : [],
|
|
@@ -8056,7 +8130,7 @@ function blueprintToConfigArtifacts(blueprint) {
|
|
|
8056
8130
|
environment,
|
|
8057
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
|
|
8058
8132
|
}))).toArray();
|
|
8059
|
-
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',`) : [];
|
|
8060
8134
|
const renderedPaths = paths.length === 0 ? " paths: {}," : `\t\t\t\t\tpaths: {
|
|
8061
8135
|
${paths.join("\n")}
|
|
8062
8136
|
},`;
|
|
@@ -8067,6 +8141,13 @@ ${paths.join("\n")}
|
|
|
8067
8141
|
origin: "template",
|
|
8068
8142
|
content: path === "configs/src/tsconfig.bin.json" ? CONFIG_TEMPLATES.tsconfigs.bin : fillTemplate(CONFIG_TEMPLATES.vites.bin, { paths: renderedPaths })
|
|
8069
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
|
+
})) : [];
|
|
8070
8151
|
const barrels = matchesBarrel(blueprint) ? BARREL_CONFIGS.map((path) => ({
|
|
8071
8152
|
path,
|
|
8072
8153
|
group: "configs",
|
|
@@ -8179,6 +8260,7 @@ ${paths.join("\n")}
|
|
|
8179
8260
|
...sheets,
|
|
8180
8261
|
...sources,
|
|
8181
8262
|
...bins,
|
|
8263
|
+
...reporters,
|
|
8182
8264
|
...applications,
|
|
8183
8265
|
...barrels,
|
|
8184
8266
|
...faces,
|
|
@@ -8390,7 +8472,7 @@ function blueprintToTestArtifacts(blueprint) {
|
|
|
8390
8472
|
environment: "browser",
|
|
8391
8473
|
content: blueprint.journey ? ARTIFACT_TEMPLATES.tests.browser : ARTIFACT_TEMPLATES.tests.setup
|
|
8392
8474
|
}] : [];
|
|
8393
|
-
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 ? [{
|
|
8394
8476
|
path: "tests/setupServer.ts",
|
|
8395
8477
|
group: "tests",
|
|
8396
8478
|
ownership: "birth",
|
|
@@ -8454,6 +8536,13 @@ function blueprintToTestArtifacts(blueprint) {
|
|
|
8454
8536
|
origin: "template",
|
|
8455
8537
|
content: fillTemplate(ARTIFACT_TEMPLATES.tests.bin, { import: matchesPrintWidth(joinedImport) ? joinedImport : `\t\tconst entry =\n\t\t\tawait import(${binSpecifier})` })
|
|
8456
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
|
+
}] : [];
|
|
8457
8546
|
const applications = Iterator.from(blueprint.app).map((environment) => ({
|
|
8458
8547
|
path: `tests/app/${environment}/index.test.ts`,
|
|
8459
8548
|
group: "tests",
|
|
@@ -8473,6 +8562,7 @@ function blueprintToTestArtifacts(blueprint) {
|
|
|
8473
8562
|
origin: "template",
|
|
8474
8563
|
content: fillTemplate(distribution.module, {
|
|
8475
8564
|
types: browser ? distribution.types : "",
|
|
8565
|
+
events: browser ? distribution.events : "",
|
|
8476
8566
|
transport: browser ? distribution.transport : "",
|
|
8477
8567
|
launcher: browser ? distribution.launcher : "",
|
|
8478
8568
|
helpers: browser ? distribution.helpers : ""
|
|
@@ -8531,6 +8621,7 @@ function blueprintToTestArtifacts(blueprint) {
|
|
|
8531
8621
|
...journeys,
|
|
8532
8622
|
...sources,
|
|
8533
8623
|
...bins,
|
|
8624
|
+
...reporters,
|
|
8534
8625
|
...applications,
|
|
8535
8626
|
...distributions,
|
|
8536
8627
|
...integrations
|
|
@@ -8567,6 +8658,10 @@ function blueprintToGuideArtifacts(blueprint) {
|
|
|
8567
8658
|
directory: "src/bin",
|
|
8568
8659
|
test: "tests/src/bin"
|
|
8569
8660
|
}] : [],
|
|
8661
|
+
...blueprint.reporter ? [{
|
|
8662
|
+
directory: "src/reporter",
|
|
8663
|
+
test: "tests/src/reporter"
|
|
8664
|
+
}] : [],
|
|
8570
8665
|
...[...blueprint.app, ...blueprintToFaces(blueprint).filter((extension) => extension.axes.includes("app")).map((extension) => extension.name)].map((environment) => ({
|
|
8571
8666
|
directory: `app/${environment}`,
|
|
8572
8667
|
test: `tests/app/${environment}`
|
|
@@ -8961,7 +9056,7 @@ function insertManifestDependencies(manifest, additions) {
|
|
|
8961
9056
|
function insertManifestSection(manifest, section, dependencies, present) {
|
|
8962
9057
|
const tokens = scanManifestTokens(manifest);
|
|
8963
9058
|
if (tokens === void 0) return void 0;
|
|
8964
|
-
const ordered =
|
|
9059
|
+
const ordered = dependencies.toSorted((left, right) => comparePrimitives(left.name, right.name));
|
|
8965
9060
|
const lines = ordered.map(({ name, range }) => `${JSON.stringify(name)}: ${JSON.stringify(range)}`);
|
|
8966
9061
|
const sibling = section === "dependencies" ? "devDependencies" : "dependencies";
|
|
8967
9062
|
const occurrences = tokens.flatMap((token, at) => {
|
|
@@ -9693,6 +9788,7 @@ function createBlueprint(name, input) {
|
|
|
9693
9788
|
engines: input?.engines ?? ">=22.18.0",
|
|
9694
9789
|
overrides: input?.overrides ?? [],
|
|
9695
9790
|
bin: input?.bin ?? false,
|
|
9791
|
+
reporter: input?.reporter ?? false,
|
|
9696
9792
|
setup: input?.setup ?? [],
|
|
9697
9793
|
guides: input?.guides ?? false,
|
|
9698
9794
|
integration: input?.integration ?? false,
|
|
@@ -10010,6 +10106,6 @@ var Compiler = class {
|
|
|
10010
10106
|
return error;
|
|
10011
10107
|
}
|
|
10012
10108
|
};
|
|
10013
|
-
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 };
|
|
10014
10110
|
|
|
10015
10111
|
//# sourceMappingURL=index.js.map
|