@orkestrel/scaffold 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -707,7 +707,6 @@ export declare function coreTsconfig(): string;
707
707
  * `configs/src/vite.core.config.ts` — inlines its own `build.lib` /
708
708
  * `rolldownOptions` (core's `srcCore` root export carries no build.lib).
709
709
  *
710
- * @param browser - Whether a declared browser environment enables the shared CSS pipeline.
711
710
  * @returns The core environment `vite.config.ts` file content, newline-terminated.
712
711
  *
713
712
  * @example
@@ -715,7 +714,7 @@ export declare function coreTsconfig(): string;
715
714
  * coreViteConfig().includes('srcCore(') // true
716
715
  * ```
717
716
  */
718
- export declare function coreViteConfig(browser?: boolean): string;
717
+ export declare function coreViteConfig(): string;
719
718
 
720
719
  /**
721
720
  * Validate and return a `Blueprint` from plain data.
@@ -2276,7 +2275,7 @@ export declare function coreViteConfig(browser?: boolean): string;
2276
2275
  export declare function rootViteConfig(src: readonly Environment[], facts?: ViteFacts): string;
2277
2276
 
2278
2277
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
2279
- export declare const SCAFFOLD_RANGE = "^0.0.14";
2278
+ export declare const SCAFFOLD_RANGE = "^0.0.16";
2280
2279
 
2281
2280
  /**
2282
2281
  * Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
@@ -2788,11 +2787,14 @@ export declare function coreViteConfig(browser?: boolean): string;
2788
2787
  * configuration emits the environment-boundary plugin, its module-graph AST
2789
2788
  * audit, and stylesheet rejection, because those enforce owner-independent
2790
2789
  * laws. Only the host-specific pipelines below are selected by the declared
2791
- * environments. `browser` covers everything a declared browser environment
2792
- * needs the CSS pipeline and the Playwright-backed browser test project;
2793
- * `vue` adds the single-file-component, HTML, and development-server
2794
- * machinery an application browser environment needs; `output` adds build
2795
- * output containment, which an application of `core` alone never builds.
2790
+ * environments. `browser` selects the shared root machinery a declared
2791
+ * browser environment needs: CSS analysis and the Playwright-backed browser
2792
+ * test project. Individual `css` configuration belongs only to the
2793
+ * `srcBrowser` and `appBrowser` factories; core and server factories never
2794
+ * inherit it. `vue` adds the single-file-component, HTML, and
2795
+ * development-server machinery an application browser environment needs;
2796
+ * `output` adds build output containment, which an application of `core`
2797
+ * alone never builds.
2796
2798
  */
2797
2799
  export declare interface ViteMachinery {
2798
2800
  readonly browser: boolean;
@@ -707,7 +707,6 @@ export declare function coreTsconfig(): string;
707
707
  * `configs/src/vite.core.config.ts` — inlines its own `build.lib` /
708
708
  * `rolldownOptions` (core's `srcCore` root export carries no build.lib).
709
709
  *
710
- * @param browser - Whether a declared browser environment enables the shared CSS pipeline.
711
710
  * @returns The core environment `vite.config.ts` file content, newline-terminated.
712
711
  *
713
712
  * @example
@@ -715,7 +714,7 @@ export declare function coreTsconfig(): string;
715
714
  * coreViteConfig().includes('srcCore(') // true
716
715
  * ```
717
716
  */
718
- export declare function coreViteConfig(browser?: boolean): string;
717
+ export declare function coreViteConfig(): string;
719
718
 
720
719
  /**
721
720
  * Validate and return a `Blueprint` from plain data.
@@ -2276,7 +2275,7 @@ export declare function coreViteConfig(browser?: boolean): string;
2276
2275
  export declare function rootViteConfig(src: readonly Environment[], facts?: ViteFacts): string;
2277
2276
 
2278
2277
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
2279
- export declare const SCAFFOLD_RANGE = "^0.0.14";
2278
+ export declare const SCAFFOLD_RANGE = "^0.0.16";
2280
2279
 
2281
2280
  /**
2282
2281
  * Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
@@ -2788,11 +2787,14 @@ export declare function coreViteConfig(browser?: boolean): string;
2788
2787
  * configuration emits the environment-boundary plugin, its module-graph AST
2789
2788
  * audit, and stylesheet rejection, because those enforce owner-independent
2790
2789
  * laws. Only the host-specific pipelines below are selected by the declared
2791
- * environments. `browser` covers everything a declared browser environment
2792
- * needs the CSS pipeline and the Playwright-backed browser test project;
2793
- * `vue` adds the single-file-component, HTML, and development-server
2794
- * machinery an application browser environment needs; `output` adds build
2795
- * output containment, which an application of `core` alone never builds.
2790
+ * environments. `browser` selects the shared root machinery a declared
2791
+ * browser environment needs: CSS analysis and the Playwright-backed browser
2792
+ * test project. Individual `css` configuration belongs only to the
2793
+ * `srcBrowser` and `appBrowser` factories; core and server factories never
2794
+ * inherit it. `vue` adds the single-file-component, HTML, and
2795
+ * development-server machinery an application browser environment needs;
2796
+ * `output` adds build output containment, which an application of `core`
2797
+ * alone never builds.
2796
2798
  */
2797
2799
  export declare interface ViteMachinery {
2798
2800
  readonly browser: boolean;
@@ -226,7 +226,7 @@ var DEFAULT_VERSION = "0.0.1";
226
226
  /** The `engines.node` range the `blueprint` builder fills. */
227
227
  var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
228
228
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
229
- var SCAFFOLD_RANGE = "^0.0.14";
229
+ var SCAFFOLD_RANGE = "^0.0.16";
230
230
  /** Tooling versions shared by scaffold and every generated workspace. */
231
231
  var BASE_DEV_DEPENDENCIES = Object.freeze({
232
232
  "@microsoft/api-extractor": "^7.58.12",
@@ -236,14 +236,14 @@ var BASE_DEV_DEPENDENCIES = Object.freeze({
236
236
  oxfmt: "^0.61.0",
237
237
  oxlint: "^1.76.0",
238
238
  typescript: "^6.0.3",
239
- vite: "^8.1.5",
239
+ vite: "~8.2.0",
240
240
  "vite-plugin-dts": "^5.0.3",
241
241
  vitest: "^4.1.10"
242
242
  });
243
243
  /** Additional development dependency required by a published browser source environment. */
244
244
  var SOURCE_BROWSER_DEV_DEPENDENCIES = Object.freeze({
245
245
  "@vitest/browser-playwright": "^4.1.10",
246
- playwright: "^1.62.0"
246
+ playwright: "^1.62.1"
247
247
  });
248
248
  /** Additional development dependencies required by a private Vue browser application. */
249
249
  var APP_BROWSER_DEV_DEPENDENCIES = Object.freeze({
@@ -4139,9 +4139,7 @@ ${EXPORT_KEYWORD} ${FUNCTION_KEYWORD} isBrowserVuePath(path: string): boolean {
4139
4139
  content: `import { globSync{{browserPolicySpecifier}} } from 'node:fs'
4140
4140
  import { describe, expect, it } from 'vitest'
4141
4141
  import { isBrowserVuePath } from './setup.js'
4142
- import { inspectCodingWorkspace } from './setupPolicy.js'
4143
- {{browserPolicyImport}}
4144
- {{vuePolicyImport}}
4142
+ import { inspectCodingWorkspace } from './setupPolicy.js'{{browserPolicyImport}}{{vuePolicyImport}}
4145
4143
 
4146
4144
  describe('repository coding law', () => {
4147
4145
  it('keeps Vue single-file components exclusively in browser environments', () => {
@@ -4152,8 +4150,7 @@ describe('repository coding law', () => {
4152
4150
 
4153
4151
  it('enforces source placement, exports, readonly contracts, and syntax law', () => {
4154
4152
  {{workspacePolicyAssertion}}
4155
- })
4156
- {{browserPolicyTest}}
4153
+ }){{browserPolicyTest}}
4157
4154
  })
4158
4155
  `
4159
4156
  }),
@@ -5936,7 +5933,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
5936
5933
  if (isCSSRequest(id)) {
5937
5934
  const config = resolvedConfig
5938
5935
  if (config === undefined) {
5939
- this.error('Environment boundary requires resolved Vite configuration')
5936
+ return this.error('Environment boundary requires resolved Vite configuration')
5940
5937
  }
5941
5938
  const stylesheet = await preprocessCSS(restored, id, config)
5942
5939
  for (const dependency of stylesheet.deps ?? []) {
@@ -5982,7 +5979,9 @@ import { parse as parseVue } from 'vue/compiler-sfc'
5982
5979
  ? undefined
5983
5980
  : packageRootOf(packageName, physicalSource)
5984
5981
  if (packageRoot === undefined || !containedPath(packageRoot, physicalSource)) {
5985
- this.error('Resolved dependencies must remain inside their physical package root')
5982
+ return this.error(
5983
+ 'Resolved dependencies must remain inside their physical package root',
5984
+ )
5986
5985
  }
5987
5986
  trustedPackageRoots.add(packageRoot)
5988
5987
  }
@@ -5990,7 +5989,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
5990
5989
  }
5991
5990
  const resolvedSource = workspacePath(physicalSource)
5992
5991
  if (resolvedSource === undefined) {
5993
- this.error('Environment modules cannot import files outside the workspace')
5992
+ return this.error('Environment modules cannot import files outside the workspace')
5994
5993
  }
5995
5994
  const assetError = environmentPathError(owner, resolvedSource)
5996
5995
  if (assetError !== undefined) this.error(assetError)
@@ -6019,7 +6018,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
6019
6018
  )
6020
6019
  const resolvedSource = workspacePath(resolution?.id ?? fallbackSource)
6021
6020
  if (resolvedSource === undefined) {
6022
- this.error('Environment modules cannot import files outside the workspace')
6021
+ return this.error('Environment modules cannot import files outside the workspace')
6023
6022
  }
6024
6023
  const pathError = environmentPathError('app/browser', resolvedSource)
6025
6024
  if (pathError !== undefined) this.error(pathError)
@@ -6037,7 +6036,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
6037
6036
  if (source === undefined) continue
6038
6037
  const decodedSource = decodeAssetSource(source)
6039
6038
  if (decodedSource === undefined) {
6040
- this.error('Vue block URLs must use valid URI encoding')
6039
+ return this.error('Vue block URLs must use valid URI encoding')
6041
6040
  }
6042
6041
  const normalizedSource = decodedSource.replaceAll('\\\\', '/')
6043
6042
  const sourceError = environmentSourceError('app/browser', normalizedSource)
@@ -6095,7 +6094,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
6095
6094
  if (isCSSRequest(id)) {
6096
6095
  const config = resolvedConfig
6097
6096
  if (config === undefined) {
6098
- this.error('Environment boundary requires resolved Vite configuration')
6097
+ return this.error('Environment boundary requires resolved Vite configuration')
6099
6098
  }
6100
6099
  const stylesheet = await preprocessCSS(code, id, config)
6101
6100
  for (const dependency of stylesheet.deps ?? []) {
@@ -6141,7 +6140,9 @@ import { parse as parseVue } from 'vue/compiler-sfc'
6141
6140
  ? undefined
6142
6141
  : packageRootOf(packageName, physicalSource)
6143
6142
  if (packageRoot === undefined || !containedPath(packageRoot, physicalSource)) {
6144
- this.error('Resolved dependencies must remain inside their physical package root')
6143
+ return this.error(
6144
+ 'Resolved dependencies must remain inside their physical package root',
6145
+ )
6145
6146
  }
6146
6147
  trustedPackageRoots.add(packageRoot)
6147
6148
  }
@@ -6149,7 +6150,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
6149
6150
  }
6150
6151
  const resolvedSource = workspacePath(physicalSource)
6151
6152
  if (resolvedSource === undefined) {
6152
- this.error('Environment modules cannot import files outside the workspace')
6153
+ return this.error('Environment modules cannot import files outside the workspace')
6153
6154
  }
6154
6155
  const assetError = environmentPathError(owner, resolvedSource)
6155
6156
  if (assetError !== undefined) this.error(assetError)
@@ -6708,7 +6709,11 @@ ${EXPORT_KEYWORD} function outputBoundary(output: string): Plugin {
6708
6709
  '[orkestrel-output-boundary] Public directories are disabled; every output must come from the audited graph',
6709
6710
  )
6710
6711
  }
6711
- if (output.endsWith('/browser') && config.build.assetsInlineLimit !== 0) {
6712
+ if (
6713
+ output.endsWith('/browser') &&
6714
+ config.build.lib === false &&
6715
+ config.build.assetsInlineLimit !== 0
6716
+ ) {
6712
6717
  throw new Error(
6713
6718
  '[orkestrel-output-boundary] Browser assets must remain external for output auditing',
6714
6719
  )
@@ -7111,7 +7116,7 @@ ${needsVue ? ` configureServer(server) {
7111
7116
  ? packageRootForResolved(physicalResolution)
7112
7117
  : undefined
7113
7118
  if (mappedPackageRoot === undefined) {
7114
- this.error(
7119
+ return this.error(
7115
7120
  'Dependency package imports must resolve inside an exact physical package root',
7116
7121
  )
7117
7122
  }
@@ -7130,7 +7135,7 @@ ${needsVue ? ` configureServer(server) {
7130
7135
  const packageRoot =
7131
7136
  packageName === undefined ? undefined : packageRootOf(packageName, physicalResolution)
7132
7137
  if (packageRoot === undefined || !containedPath(packageRoot, physicalResolution)) {
7133
- this.error('Resolved dependencies must remain inside their physical package root')
7138
+ return this.error('Resolved dependencies must remain inside their physical package root')
7134
7139
  }
7135
7140
  trustedPackageRoots.add(packageRoot)
7136
7141
  }
@@ -7161,7 +7166,7 @@ ${needsVue ? ` configureServer(server) {
7161
7166
  }
7162
7167
  const code = readBoundedFile(physicalImporter, ENVIRONMENT_MODULE_BYTES)
7163
7168
  if (code === undefined) {
7164
- this.error('Dependency module source must be a bounded regular file')
7169
+ return this.error('Dependency module source must be a bounded regular file')
7165
7170
  }
7166
7171
  for (const source of await environmentAssetSources(code, id)) {
7167
7172
  const normalizedSource = source.replaceAll('\\\\', '/')
@@ -7398,7 +7403,7 @@ ${EXPORT_KEYWORD} ${CONST_KEYWORD} ENVIRONMENT_CSS = Object.freeze({
7398
7403
  'value' in rule && rule.value !== null && 'loc' in rule.value
7399
7404
  ? sources[rule.value.loc.source_index]
7400
7405
  : undefined
7401
- if (rule.type !== 'import') return
7406
+ if (rule.type !== 'import' || rule.value === null) return
7402
7407
  const error = stylesheetAssetError(source, rule.value.url)
7403
7408
  if (error !== undefined) {
7404
7409
  throw new Error(\`[orkestrel-environment-boundary] \${error}\`)
@@ -7619,7 +7624,6 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7619
7624
  publicDir: false,
7620
7625
  plugins: [outputBoundary('dist/src/browser'), environmentBoundary('src/browser')],
7621
7626
  build: {
7622
- assetsInlineLimit: 0,
7623
7627
  emptyOutDir: true,
7624
7628
  sourcemap: true,
7625
7629
  minify: false,
@@ -7670,7 +7674,7 @@ ${renderedTest}
7670
7674
  ${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
7671
7675
  mergeConfig(
7672
7676
  {
7673
- resolve,${machinery.browser ? "\n css: ENVIRONMENT_CSS," : ""}
7677
+ resolve,
7674
7678
  publicDir: false,
7675
7679
  plugins: [outputBoundary('dist/src/server'), environmentBoundary('src/server')],
7676
7680
  build: {
@@ -7753,7 +7757,6 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7753
7757
  publicDir: false,
7754
7758
  plugins: [outputBoundary('dist/src/browser'), environmentBoundary('src/browser')],
7755
7759
  build: {
7756
- assetsInlineLimit: 0,
7757
7760
  lib: {
7758
7761
  entry: resolveWorkspacePath('src/browser/index.ts'),
7759
7762
  formats: ['es'],
@@ -7798,7 +7801,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7798
7801
  ${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
7799
7802
  srcCore(
7800
7803
  mergeConfig(
7801
- {${machinery.browser ? "\n css: ENVIRONMENT_CSS," : ""}
7804
+ {
7802
7805
  publicDir: false,
7803
7806
  plugins: [outputBoundary('dist/src/server'), environmentBoundary('src/server')],
7804
7807
  build: {
@@ -7890,7 +7893,7 @@ function applicationViteConfig(src, app, facts = {}) {
7890
7893
  ${EXPORT_KEYWORD} const srcCore = (config?: UserConfig): UserConfig =>
7891
7894
  mergeConfig(
7892
7895
  {
7893
- resolve,${machinery.browser ? "\n css: ENVIRONMENT_CSS," : ""}
7896
+ resolve,
7894
7897
  publicDir: false,
7895
7898
  plugins: [environmentBoundary('src/core')],
7896
7899
  build: { emptyOutDir: true, sourcemap: true, minify: false },
@@ -7918,7 +7921,6 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7918
7921
  publicDir: false,
7919
7922
  plugins: [outputBoundary('dist/src/browser'), environmentBoundary('src/browser')],
7920
7923
  build: {
7921
- assetsInlineLimit: 0,
7922
7924
  emptyOutDir: true,
7923
7925
  sourcemap: true,
7924
7926
  minify: false,
@@ -7980,7 +7982,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7980
7982
  ${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
7981
7983
  mergeConfig(
7982
7984
  {
7983
- resolve,${machinery.browser ? "\n css: ENVIRONMENT_CSS," : ""}
7985
+ resolve,
7984
7986
  publicDir: false,
7985
7987
  plugins: [outputBoundary('dist/src/server'), environmentBoundary('src/server')],
7986
7988
  build: {
@@ -8014,7 +8016,7 @@ ${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
8014
8016
  ${EXPORT_KEYWORD} const appCore = (config?: UserConfig): UserConfig =>
8015
8017
  mergeConfig(
8016
8018
  {
8017
- resolve,${machinery.browser ? "\n css: ENVIRONMENT_CSS," : ""}
8019
+ resolve,
8018
8020
  publicDir: false,
8019
8021
  plugins: [environmentBoundary('app/core')],
8020
8022
  test: {
@@ -8091,7 +8093,7 @@ ${EXPORT_KEYWORD} function appBrowser(...config: readonly never[]): UserConfig {
8091
8093
  ${EXPORT_KEYWORD} const appServer = (config?: UserConfig): UserConfig =>
8092
8094
  mergeConfig(
8093
8095
  {
8094
- resolve,${machinery.browser ? "\n css: ENVIRONMENT_CSS," : ""}
8096
+ resolve,
8095
8097
  publicDir: false,
8096
8098
  plugins: [outputBoundary('dist/app/server'), environmentBoundary('app/server')],
8097
8099
  build: {
@@ -8157,7 +8159,6 @@ function coreTsconfig() {
8157
8159
  * `configs/src/vite.core.config.ts` — inlines its own `build.lib` /
8158
8160
  * `rolldownOptions` (core's `srcCore` root export carries no build.lib).
8159
8161
  *
8160
- * @param browser - Whether a declared browser environment enables the shared CSS pipeline.
8161
8162
  * @returns The core environment `vite.config.ts` file content, newline-terminated.
8162
8163
  *
8163
8164
  * @example
@@ -8165,11 +8166,11 @@ function coreTsconfig() {
8165
8166
  * coreViteConfig().includes('srcCore(') // true
8166
8167
  * ```
8167
8168
  */
8168
- function coreViteConfig(browser = true) {
8169
+ function coreViteConfig() {
8169
8170
  return `import { defineConfig } from 'vite'
8170
8171
  import dts from 'vite-plugin-dts'
8171
8172
  import {
8172
- ${browser ? " ENVIRONMENT_CSS,\n" : ""} environmentBoundary,
8173
+ environmentBoundary,
8173
8174
  outputBoundary,
8174
8175
  srcCore,
8175
8176
  resolveWorkspacePath,
@@ -8177,7 +8178,7 @@ ${browser ? " ENVIRONMENT_CSS,\n" : ""} environmentBoundary,
8177
8178
 
8178
8179
  export default defineConfig(
8179
8180
  srcCore({
8180
- ${browser ? " css: ENVIRONMENT_CSS,\n" : ""} publicDir: false,
8181
+ publicDir: false,
8181
8182
  plugins: [
8182
8183
  outputBoundary('dist/src/core'),
8183
8184
  environmentBoundary('src/core'),
@@ -8466,7 +8467,6 @@ ${browser}
8466
8467
  * ```
8467
8468
  */
8468
8469
  function configArtifacts(spec) {
8469
- const machinery = viteMachinery(spec.src, spec.app, spec.bin);
8470
8470
  const artifacts = [{
8471
8471
  path: "tsconfig.json",
8472
8472
  group: "configs",
@@ -8482,7 +8482,7 @@ function configArtifacts(spec) {
8482
8482
  const row = SRC_MATRIX[environment];
8483
8483
  for (const path of row.configs) {
8484
8484
  const isTsconfig = path.endsWith(".json");
8485
- const content = environment === "core" ? isTsconfig ? coreTsconfig() : coreViteConfig(machinery.browser) : isTsconfig ? srcTsconfig(environment) : srcViteConfig(environment);
8485
+ const content = environment === "core" ? isTsconfig ? coreTsconfig() : coreViteConfig() : isTsconfig ? srcTsconfig(environment) : srcViteConfig(environment);
8486
8486
  artifacts.push({
8487
8487
  path,
8488
8488
  group: "configs",
@@ -8614,24 +8614,20 @@ function paritySpecifiers(spec) {
8614
8614
  for (const environment of spec.app) modules[`@app/${environment}`] = `app/${environment}`;
8615
8615
  const specifierItems = selfSpecifiers.map((specifier) => `'${specifier}'`);
8616
8616
  const inlineSpecifierList = `[${specifierItems.join(", ")}]`;
8617
- return `${EXPORT_KEYWORD} ${CONST_KEYWORD} SELF_SPECIFIERS = ${fitsPrintWidth(`const SELF_SPECIFIERS = ${inlineSpecifierList}`) ? inlineSpecifierList : `[
8618
- ${specifierItems.map((specifier) => `\t${specifier},`).join("\n")}
8619
- ]`}
8620
-
8621
- ${EXPORT_KEYWORD} ${CONST_KEYWORD} SPECIFIER_MODULES: Readonly<Record<string, string>> = {
8622
- ${Object.entries(modules).map(([specifier, module]) => `\t'${specifier}': '${module}',`).join("\n")}
8623
- }
8624
- ${EXPORT_KEYWORD} ${CONST_KEYWORD} SPECIFIER_SOURCES = new Map<string, ReturnType<typeof createSource>>()
8625
- ${EXPORT_KEYWORD} ${FUNCTION_KEYWORD} exportsFor(specifier: string): readonly string[] {
8626
- const module = SPECIFIER_MODULES[specifier]
8627
- if (module === undefined) return []
8628
- let source = SPECIFIER_SOURCES.get(module)
8629
- if (source === undefined) {
8630
- source = createSource({ files: GUIDE_FILES, module })
8631
- SPECIFIER_SOURCES.set(module, source)
8632
- }
8633
- return source.exports().map((symbol) => symbol.name)
8634
- }`;
8617
+ const lines = fitsPrintWidth(`const SELF_SPECIFIERS = ${inlineSpecifierList}`) ? [`${EXPORT_KEYWORD} ${CONST_KEYWORD} SELF_SPECIFIERS = ${inlineSpecifierList}`] : [
8618
+ `${EXPORT_KEYWORD} ${CONST_KEYWORD} SELF_SPECIFIERS = [`,
8619
+ ...specifierItems.map((specifier) => `\t${specifier},`),
8620
+ "]"
8621
+ ];
8622
+ lines.push("", [
8623
+ EXPORT_KEYWORD,
8624
+ CONST_KEYWORD,
8625
+ "SPECIFIER_MODULES:",
8626
+ "Readonly<Record<string, string>>",
8627
+ "=",
8628
+ "{"
8629
+ ].join(" "), ...Object.entries(modules).map(([specifier, module]) => `\t'${specifier}': '${module}',`), "}", `${EXPORT_KEYWORD} ${CONST_KEYWORD} SPECIFIER_SOURCES = new Map<string, ReturnType<typeof createSource>>()`, `${EXPORT_KEYWORD} ${FUNCTION_KEYWORD} exportsFor(specifier: string): readonly string[] {`, " const module = SPECIFIER_MODULES[specifier]", " if (module === undefined) return []", " let source = SPECIFIER_SOURCES.get(module)", " if (source === undefined) {", " source = createSource({ files: GUIDE_FILES, module })", " SPECIFIER_SOURCES.set(module, source)", " }", " return source.exports().map((symbol) => symbol.name)", "}");
8630
+ return lines.join("\n");
8635
8631
  }
8636
8632
  /**
8637
8633
  * Draft the `tests` group's `template` artifacts — the shared recorder
@@ -8653,8 +8649,8 @@ function testArtifacts(spec, pascal) {
8653
8649
  const hasBrowser = spec.src.includes("browser") || spec.app.includes("browser");
8654
8650
  const hasVue = spec.app.includes("browser");
8655
8651
  const browserPolicySpecifier = hasBrowser ? ", accessSync, constants as FS_CONSTANTS, statSync" : "";
8656
- const browserPolicyImport = hasBrowser ? "import { chromium } from 'playwright'\nimport { resolveChromium } from '../vite.config.js'" : "";
8657
- const vuePolicyImport = hasVue ? "import { parse as parseVue } from 'vue/compiler-sfc'" : "";
8652
+ const browserPolicyImport = hasBrowser ? "\nimport { chromium } from 'playwright'\nimport { resolveChromium } from '../vite.config.js'" : "";
8653
+ const vuePolicyImport = hasVue ? "\nimport { parse as parseVue } from 'vue/compiler-sfc'" : "";
8658
8654
  const workspacePolicyAssertion = hasVue ? `expect(
8659
8655
  inspectCodingWorkspace(process.cwd(), (path, content) => {
8660
8656
  const parsed = parseVue(content, { filename: path })
@@ -8665,6 +8661,7 @@ function testArtifacts(spec, pascal) {
8665
8661
  }),
8666
8662
  ).toEqual([])` : "expect(inspectCodingWorkspace(process.cwd())).toEqual([])";
8667
8663
  const browserPolicyTest = hasBrowser ? `
8664
+
8668
8665
  it('resolves Chromium only to a real executable file', () => {
8669
8666
  const chromiumPath = resolveChromium(chromium.executablePath())
8670
8667
  if (chromiumPath === undefined) return