@orkestrel/scaffold 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2110,6 +2110,22 @@ export declare function coreViteConfig(browser?: boolean): string;
2110
2110
  */
2111
2111
  export declare function renderValue(entry: unknown, indent: string, prefix: string, suffix: string): string;
2112
2112
 
2113
+ /**
2114
+ * Render the root Vitest project registration, preserving browser ownership
2115
+ * supplied by the caller.
2116
+ *
2117
+ * @param registrations - Ordered project factory identifiers with optional browser labels.
2118
+ * @param browser - Whether the generated configuration carries browser machinery.
2119
+ * @returns The rendered root `test` property.
2120
+ *
2121
+ * @example
2122
+ * ```ts
2123
+ * renderViteTest([{ project: 'srcCore' }], false)
2124
+ * // '\ttest: {\n\t\tprojects: [srcCore],\n\t},'
2125
+ * ```
2126
+ */
2127
+ export declare function renderViteTest(registrations: readonly ViteProjectRegistration[], browser: boolean): string;
2128
+
2113
2129
  /**
2114
2130
  * The root `tsconfig.json` — one `@src/<environment>` path alias per declared
2115
2131
  * environment, in declared order.
@@ -2157,7 +2173,7 @@ export declare function coreViteConfig(browser?: boolean): string;
2157
2173
  export declare function rootViteConfig(src: readonly Environment[], engine?: boolean): string;
2158
2174
 
2159
2175
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
2160
- export declare const SCAFFOLD_RANGE = "^0.0.6";
2176
+ export declare const SCAFFOLD_RANGE = "^0.0.7";
2161
2177
 
2162
2178
  /**
2163
2179
  * Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
@@ -2672,4 +2688,10 @@ export declare function coreViteConfig(browser?: boolean): string;
2672
2688
  */
2673
2689
  export declare function viteMachinery(src: readonly Environment[], app?: readonly Environment[], engine?: boolean): ViteMachinery;
2674
2690
 
2691
+ /** One generated Vitest project factory and its optional browser-project label. */
2692
+ export declare interface ViteProjectRegistration {
2693
+ readonly project: string;
2694
+ readonly browser?: string;
2695
+ }
2696
+
2675
2697
  export { }
@@ -2110,6 +2110,22 @@ export declare function coreViteConfig(browser?: boolean): string;
2110
2110
  */
2111
2111
  export declare function renderValue(entry: unknown, indent: string, prefix: string, suffix: string): string;
2112
2112
 
2113
+ /**
2114
+ * Render the root Vitest project registration, preserving browser ownership
2115
+ * supplied by the caller.
2116
+ *
2117
+ * @param registrations - Ordered project factory identifiers with optional browser labels.
2118
+ * @param browser - Whether the generated configuration carries browser machinery.
2119
+ * @returns The rendered root `test` property.
2120
+ *
2121
+ * @example
2122
+ * ```ts
2123
+ * renderViteTest([{ project: 'srcCore' }], false)
2124
+ * // '\ttest: {\n\t\tprojects: [srcCore],\n\t},'
2125
+ * ```
2126
+ */
2127
+ export declare function renderViteTest(registrations: readonly ViteProjectRegistration[], browser: boolean): string;
2128
+
2113
2129
  /**
2114
2130
  * The root `tsconfig.json` — one `@src/<environment>` path alias per declared
2115
2131
  * environment, in declared order.
@@ -2157,7 +2173,7 @@ export declare function coreViteConfig(browser?: boolean): string;
2157
2173
  export declare function rootViteConfig(src: readonly Environment[], engine?: boolean): string;
2158
2174
 
2159
2175
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
2160
- export declare const SCAFFOLD_RANGE = "^0.0.6";
2176
+ export declare const SCAFFOLD_RANGE = "^0.0.7";
2161
2177
 
2162
2178
  /**
2163
2179
  * Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
@@ -2672,4 +2688,10 @@ export declare function coreViteConfig(browser?: boolean): string;
2672
2688
  */
2673
2689
  export declare function viteMachinery(src: readonly Environment[], app?: readonly Environment[], engine?: boolean): ViteMachinery;
2674
2690
 
2691
+ /** One generated Vitest project factory and its optional browser-project label. */
2692
+ export declare interface ViteProjectRegistration {
2693
+ readonly project: string;
2694
+ readonly browser?: string;
2695
+ }
2696
+
2675
2697
  export { }
@@ -220,7 +220,7 @@ var DEFAULT_VERSION = "0.0.1";
220
220
  /** The `engines.node` range the `blueprint` builder fills. */
221
221
  var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
222
222
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
223
- var SCAFFOLD_RANGE = "^0.0.6";
223
+ var SCAFFOLD_RANGE = "^0.0.7";
224
224
  /** Tooling versions shared by scaffold and every generated workspace. */
225
225
  var BASE_DEV_DEPENDENCIES = Object.freeze({
226
226
  "@microsoft/api-extractor": "^7.58.12",
@@ -5601,6 +5601,7 @@ function packageManifest(spec) {
5601
5601
  }
5602
5602
  if (spec.engine) scripts["test:src:bin"] = "vitest run --config vite.config.ts --no-cache --reporter=dot --project src:bin";
5603
5603
  if (spec.engine) scripts["test:integration"] = "vitest run --config vite.config.ts --no-cache --reporter=dot --project integration";
5604
+ if (spec.engine) scripts["test:equivalence"] = "node -e \"const c=require('node:child_process'),n=process.platform==='win32'?'npm.cmd':'npm',r=c.spawnSync(n,['run','test:integration'],{stdio:'inherit',env:{...process.env,SCAFFOLD_BOUNDARY_EQUIVALENCE:'1'}});process.exit(r.status??1)\"";
5604
5605
  if (spec.app.length > 0) {
5605
5606
  scripts["test:app"] = "vitest run --config vite.config.ts --no-cache --reporter=dot " + spec.app.map((environment) => `--project ${APP_MATRIX[environment].project}`).join(" ");
5606
5607
  for (const environment of spec.app) scripts[`test:app:${environment}`] = `vitest run --config vite.config.ts --no-cache --reporter=dot --project ${APP_MATRIX[environment].project}`;
@@ -5761,6 +5762,37 @@ function viteMachinery(src, app = [], engine = false) {
5761
5762
  };
5762
5763
  }
5763
5764
  /**
5765
+ * Render the root Vitest project registration, preserving browser ownership
5766
+ * supplied by the caller.
5767
+ *
5768
+ * @param registrations - Ordered project factory identifiers with optional browser labels.
5769
+ * @param browser - Whether the generated configuration carries browser machinery.
5770
+ * @returns The rendered root `test` property.
5771
+ *
5772
+ * @example
5773
+ * ```ts
5774
+ * renderViteTest([{ project: 'srcCore' }], false)
5775
+ * // '\ttest: {\n\t\tprojects: [srcCore],\n\t},'
5776
+ * ```
5777
+ */
5778
+ function renderViteTest(registrations, browser) {
5779
+ const projects = registrations.map((registration) => registration.project);
5780
+ const inlineProjects = ` projects: [${projects.join(", ")}],`;
5781
+ const renderedProjects = computeColumnWidth(inlineProjects) <= 100 ? inlineProjects : ` projects: [
5782
+ ${projects.map((project) => ` ${project},`).join("\n")}
5783
+ ],`;
5784
+ if (!browser) return ` test: {
5785
+ ${renderedProjects}
5786
+ },`;
5787
+ return ` test: gateBrowserProjects(
5788
+ [
5789
+ ${registrations.map((registration) => registration.browser === void 0 ? `{ project: ${registration.project} }` : `{ project: ${registration.project}, browser: ${serializeTypeScriptString(registration.browser)} }`).map((registration) => ` ${registration},`).join("\n")}
5790
+ ],
5791
+ hasChromium,
5792
+ process.argv,
5793
+ ),`;
5794
+ }
5795
+ /**
5764
5796
  * The rendered import / `resolve` header block every `rootViteConfig` shape
5765
5797
  * prefixes — the environment boundary and every guarantee it enforces ship
5766
5798
  * unconditionally; `machinery` selects only the host-specific pipelines layered
@@ -5798,6 +5830,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
5798
5830
  transform: {
5799
5831
  order: 'pre',
5800
5832
  async handler(code, id) {
5833
+ if (!isWorkspaceBoundaryModule(id)) return null
5801
5834
  const restored = /[?&]html-proxy(?:[=&]|$)/.test(id) ? restoreIgnoredHtml(code) : code
5802
5835
  const target = workspacePath(id)
5803
5836
  const physicalImporter = physicalPath(id)
@@ -5957,6 +5990,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
5957
5990
  transform: {
5958
5991
  order: 'pre',
5959
5992
  async handler(code, id) {
5993
+ if (!isWorkspaceBoundaryModule(id)) return null
5960
5994
  const target = workspacePath(id)
5961
5995
  const physicalImporter = physicalPath(id)
5962
5996
  const importerPackageRoot = trustedPackageRootFor(physicalImporter, trustedPackageRoots)
@@ -6039,6 +6073,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
6039
6073
  transform: {
6040
6074
  order: 'pre',
6041
6075
  async handler(code, id) {
6076
+ if (!isWorkspaceBoundaryModule(id)) return null
6042
6077
  const target = workspacePath(id)
6043
6078
  const physicalImporter = physicalPath(id)
6044
6079
  const importerPackageRoot = trustedPackageRootFor(physicalImporter, trustedPackageRoots)
@@ -6130,6 +6165,64 @@ ${EXPORT_KEYWORD} function workspacePath(path: string): string | undefined {
6130
6165
  return relativePath
6131
6166
  }
6132
6167
 
6168
+ ${EXPORT_KEYWORD} function isBoundaryExemptModule(id: string): boolean {
6169
+ const normalizedId = id.replaceAll('\\\\', '/')
6170
+ const [path] = normalizedId.split(/[?#]/)
6171
+ if (
6172
+ path === undefined ||
6173
+ normalizedId.startsWith('\\0') ||
6174
+ normalizedId.includes('virtual:') ||
6175
+ normalizedId === '@vite/client' ||
6176
+ normalizedId === '@vite/env' ||
6177
+ normalizedId.startsWith('/@id/') ||
6178
+ normalizedId.startsWith('/@vite/') ||
6179
+ normalizedId.startsWith('/__vite') ||
6180
+ normalizedId.startsWith('/__vitest') ||
6181
+ normalizedId.startsWith('@vitest/browser') ||
6182
+ normalizedId.includes('/@vitest/browser/')
6183
+ ) {
6184
+ return true
6185
+ }
6186
+ let physicalId: string | undefined
6187
+ try {
6188
+ physicalId = physicalPath(id).replaceAll('\\\\', '/')
6189
+ } catch {
6190
+ physicalId = undefined
6191
+ }
6192
+ for (const candidate of physicalId === undefined ? [path] : [path, physicalId]) {
6193
+ if (candidate.split('/').some((segment) => segment.toLowerCase() === 'node_modules')) {
6194
+ return true
6195
+ }
6196
+ }
6197
+ return false
6198
+ }
6199
+
6200
+ ${EXPORT_KEYWORD} function isWorkspaceBoundaryModule(id: string): boolean {
6201
+ if (isBoundaryExemptModule(id)) return false
6202
+ const normalizedId = id.replaceAll('\\\\', '/')
6203
+ const [path] = normalizedId.split(/[?#]/)
6204
+ if (path === undefined) return false
6205
+ let candidate = path.startsWith('/@fs/') ? path.slice('/@fs/'.length) : path
6206
+ try {
6207
+ if (/^file:/i.test(candidate)) candidate = fileURLToPath(candidate)
6208
+ } catch {
6209
+ return false
6210
+ }
6211
+ const rootRelative = /^\\/(?:app|src)\\/(?:core|browser|server)\\//.test(candidate)
6212
+ const absoluteCandidate = rootRelative
6213
+ ? resolvePath(WORKSPACE_ROOT, candidate.slice(1))
6214
+ : isAbsolute(candidate)
6215
+ ? candidate
6216
+ : resolvePath(WORKSPACE_ROOT, candidate)
6217
+ const relativeId = relative(WORKSPACE_ROOT, absoluteCandidate).replaceAll('\\\\', '/')
6218
+ return (
6219
+ relativeId !== '..' &&
6220
+ !relativeId.startsWith('../') &&
6221
+ !isAbsolute(relativeId) &&
6222
+ /^(?:app|src)\\/(?:core|browser|server)\\//.test(relativeId)
6223
+ )
6224
+ }
6225
+
6133
6226
  ${EXPORT_KEYWORD} function isOutsideWorkspacePath(path: string): boolean {
6134
6227
  const [pathWithoutQuery] = path.split('?')
6135
6228
  if (pathWithoutQuery === undefined) return false
@@ -6768,6 +6861,7 @@ ${EXPORT_KEYWORD} function finalizeHtml(): Plugin {
6768
6861
  const transformed = await transformWithOxc(code, path)
6769
6862
  const visitor = new Visitor({
6770
6863
  ImportExpression(node) {
6864
+ if (emitted) return
6771
6865
  let value: string | undefined
6772
6866
  if (node.source.type === 'Literal' && typeof node.source.value === 'string') {
6773
6867
  value = node.source.value
@@ -6866,8 +6960,8 @@ ${needsVue ? ` configureServer(server) {
6866
6960
  })
6867
6961
  },
6868
6962
  ` : ""} async resolveId(source, importer) {
6869
- if (importer === undefined) return null
6870
- if (source.startsWith('\\0')) return null
6963
+ if (importer === undefined || !isWorkspaceBoundaryModule(importer)) return null
6964
+ if (isBoundaryExemptModule(source)) return null
6871
6965
  const normalizedSource = source.replaceAll('\\\\', '/')
6872
6966
  const sourceError = environmentSourceError(owner, normalizedSource)
6873
6967
  if (sourceError !== undefined) this.error(sourceError)
@@ -6944,6 +7038,7 @@ ${needsVue ? ` configureServer(server) {
6944
7038
  return null
6945
7039
  },
6946
7040
  async load(id) {
7041
+ if (!isWorkspaceBoundaryModule(id)) return null
6947
7042
  const physicalImporter = physicalPath(id)
6948
7043
  const trustedPackageRoot = trustedPackageRootFor(physicalImporter, trustedPackageRoots)
6949
7044
  const inferredPackageRoot =
@@ -7001,6 +7096,7 @@ ${needsVue ? ` configureServer(server) {
7001
7096
  const physical = physicalPath(
7002
7097
  isAbsolute(original) ? original : resolvePath(environmentRoot, original),
7003
7098
  )
7099
+ if (isBoundaryExemptModule(original) || isBoundaryExemptModule(physical)) continue
7004
7100
  const target = workspacePath(physical)
7005
7101
  if (target === undefined) {
7006
7102
  if (trustedPackageRootFor(physical, trustedPackageRoots) === undefined) {
@@ -7016,6 +7112,7 @@ ${needsVue ? ` configureServer(server) {
7016
7112
  buildEnd(error) {
7017
7113
  if (error !== undefined) return
7018
7114
  for (const id of this.getModuleIds()) {
7115
+ if (!isWorkspaceBoundaryModule(id)) continue
7019
7116
  const target = workspacePath(id)
7020
7117
  if (target === undefined) {
7021
7118
  if (
@@ -7072,7 +7169,58 @@ ${CONST_KEYWORD} resolve = {
7072
7169
  }, {}),
7073
7170
  }
7074
7171
 
7075
- ${needsBrowser ? `${EXPORT_KEYWORD} ${CONST_KEYWORD} ENVIRONMENT_CSS = Object.freeze({
7172
+ ${needsBrowser ? `${EXPORT_KEYWORD} function gateBrowserProjects(
7173
+ registrations: readonly {
7174
+ readonly project: () => UserConfig
7175
+ readonly browser?: string
7176
+ }[],
7177
+ available: boolean,
7178
+ argv: readonly string[],
7179
+ ): NonNullable<UserConfig['test']> {
7180
+ const projects: UserConfig[] = []
7181
+ const gated: string[] = []
7182
+ for (const registration of registrations) {
7183
+ if (registration.browser !== undefined && !available) {
7184
+ gated.push(registration.browser)
7185
+ projects.push({
7186
+ resolve,
7187
+ test: {
7188
+ name: { label: registration.browser, color: 'yellow' },
7189
+ include: [],
7190
+ environment: 'node',
7191
+ browser: { enabled: false },
7192
+ },
7193
+ })
7194
+ continue
7195
+ }
7196
+ projects.push(registration.project())
7197
+ }
7198
+ if (gated.length === 0) return { projects }
7199
+ console.warn(\`browser projects skipped: Chromium absent (\${gated.join(', ')})\`)
7200
+ const filters: string[] = []
7201
+ let readable = true
7202
+ for (let index = 0; index < argv.length; index += 1) {
7203
+ const argument = argv[index]
7204
+ if (argument === '--project') {
7205
+ const filter = argv[index + 1]
7206
+ if (filter === undefined) {
7207
+ readable = false
7208
+ continue
7209
+ }
7210
+ filters.push(filter)
7211
+ index += 1
7212
+ continue
7213
+ }
7214
+ if (argument?.startsWith('--project=') === true) {
7215
+ filters.push(argument.slice('--project='.length))
7216
+ }
7217
+ }
7218
+ return readable && filters.length > 0 && filters.every((filter) => gated.includes(filter))
7219
+ ? { passWithNoTests: true, projects }
7220
+ : { projects }
7221
+ }
7222
+
7223
+ ${EXPORT_KEYWORD} ${CONST_KEYWORD} ENVIRONMENT_CSS = Object.freeze({
7076
7224
  transformer: 'lightningcss',
7077
7225
  lightningcss: {
7078
7226
  visitor: () => {
@@ -7143,7 +7291,6 @@ function singleSrcViteConfig(environment) {
7143
7291
  const machinery = viteMachinery([environment]);
7144
7292
  const header = viteHeader(machinery);
7145
7293
  if (environment === "browser") return `${header}
7146
- if (!hasChromium) console.warn('browser projects skipped: Chromium absent (${SRC_MATRIX.browser.project})')
7147
7294
  ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7148
7295
  mergeConfig(
7149
7296
  {
@@ -7168,11 +7315,10 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7168
7315
  },
7169
7316
  test: {
7170
7317
  name: { label: 'src:browser', color: 'yellow' },
7171
- include: hasChromium ? ['tests/src/browser/**/*.test.ts'] : [],
7172
- passWithNoTests: !hasChromium,
7318
+ include: ['tests/src/browser/**/*.test.ts'],
7173
7319
  setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
7174
7320
  browser: {
7175
- enabled: hasChromium,
7321
+ enabled: true,
7176
7322
  provider: playwright(),
7177
7323
  instances: [{ browser: 'chromium', headless: true }],
7178
7324
  },
@@ -7201,9 +7347,15 @@ ${EXPORT_KEYWORD} const guides = (config?: UserConfig): UserConfig =>
7201
7347
 
7202
7348
  export default defineConfig({
7203
7349
  resolve,
7204
- test: {
7205
- projects: [...(hasChromium ? [srcBrowser] : []), policy, guides],
7206
- },
7350
+ test: gateBrowserProjects(
7351
+ [
7352
+ { project: srcBrowser, browser: 'src:browser' },
7353
+ { project: policy },
7354
+ { project: guides },
7355
+ ],
7356
+ hasChromium,
7357
+ process.argv,
7358
+ ),
7207
7359
  })
7208
7360
  `;
7209
7361
  return `${header}
@@ -7323,12 +7475,11 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7323
7475
  },
7324
7476
  test: {
7325
7477
  name: { label: 'src:browser', color: 'yellow' },
7326
- include: hasChromium ? ['tests/src/browser/**/*.test.ts'] : [],
7327
- passWithNoTests: !hasChromium,
7478
+ include: ['tests/src/browser/**/*.test.ts'],
7328
7479
  exclude: ['tests/src/core/**/*.test.ts'],
7329
7480
  setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
7330
7481
  browser: {
7331
- enabled: hasChromium,
7482
+ enabled: true,
7332
7483
  provider: playwright(),
7333
7484
  instances: [{ browser: 'chromium', headless: true }],
7334
7485
  },
@@ -7426,20 +7577,17 @@ ${EXPORT_KEYWORD} const integration = (config?: UserConfig): UserConfig =>
7426
7577
  )
7427
7578
  ` : "";
7428
7579
  const blocks = nonCore.map((environment) => environment === "browser" ? browserBlock : serverBlock).join("") + binBlock;
7429
- const projectNames = [
7430
- ...hasCore ? ["srcCore"] : [],
7431
- ...nonCore.map((environment) => environment === "browser" ? "...(hasChromium ? [srcBrowser] : [])" : `src${pascalCase(environment)}`),
7432
- "policy",
7433
- "guides",
7434
- ...engine ? ["srcBin"] : [],
7435
- ...engine ? ["integration"] : []
7436
- ];
7437
- const inlineProjects = ` projects: [${projectNames.join(", ")}],`;
7438
- const renderedProjects = computeColumnWidth(inlineProjects) <= 100 ? inlineProjects : ` projects: [
7439
- ${projectNames.map((project) => ` ${project},`).join("\n")}
7440
- ],`;
7580
+ const registrations = [];
7581
+ if (hasCore) registrations.push({ project: "srcCore" });
7582
+ for (const environment of nonCore) registrations.push(environment === "browser" ? {
7583
+ project: "srcBrowser",
7584
+ browser: SRC_MATRIX.browser.project
7585
+ } : { project: "srcServer" });
7586
+ registrations.push({ project: "policy" }, { project: "guides" });
7587
+ if (engine) registrations.push({ project: "srcBin" }, { project: "integration" });
7588
+ const renderedTest = renderViteTest(registrations, machinery.browser);
7441
7589
  return `${header}
7442
- ${machinery.browser ? `if (!hasChromium) console.warn('browser projects skipped: Chromium absent (${SRC_MATRIX.browser.project})')\n` : ""}${EXPORT_KEYWORD} const srcCore = (config?: UserConfig): UserConfig =>
7590
+ ${EXPORT_KEYWORD} const srcCore = (config?: UserConfig): UserConfig =>
7443
7591
  mergeConfig(
7444
7592
  {
7445
7593
  resolve,
@@ -7477,9 +7625,7 @@ ${EXPORT_KEYWORD} const guides = (config?: UserConfig): UserConfig =>
7477
7625
  ${blocks}
7478
7626
  export default defineConfig({
7479
7627
  resolve,
7480
- test: {
7481
- ${renderedProjects}
7482
- },
7628
+ ${renderedTest}
7483
7629
  })
7484
7630
  `;
7485
7631
  }
@@ -7501,10 +7647,10 @@ function applicationViteConfig(src, app, engine = false) {
7501
7647
  const hasSourceCore = src.includes("core");
7502
7648
  const machinery = viteMachinery(src, app, engine);
7503
7649
  const header = viteHeader(machinery);
7504
- const projects = [];
7650
+ const registrations = [];
7505
7651
  const blocks = [];
7506
7652
  if (src.includes("core")) {
7507
- projects.push("srcCore");
7653
+ registrations.push({ project: "srcCore" });
7508
7654
  blocks.push(`
7509
7655
  ${EXPORT_KEYWORD} const srcCore = (config?: UserConfig): UserConfig =>
7510
7656
  mergeConfig(
@@ -7526,7 +7672,10 @@ ${EXPORT_KEYWORD} const srcCore = (config?: UserConfig): UserConfig =>
7526
7672
  `);
7527
7673
  }
7528
7674
  if (src.includes("browser")) {
7529
- projects.push("...(hasChromium ? [srcBrowser] : [])");
7675
+ registrations.push({
7676
+ project: "srcBrowser",
7677
+ browser: SRC_MATRIX.browser.project
7678
+ });
7530
7679
  const coreOutput = hasSourceCore ? `
7531
7680
  output: { paths: { '@src/core': '../core/index.js' } },` : "";
7532
7681
  const coreExternal = hasSourceCore ? `id === '@src/core' || ` : "";
@@ -7555,11 +7704,10 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7555
7704
  },
7556
7705
  test: {
7557
7706
  name: { label: 'src:browser', color: 'yellow' },
7558
- include: hasChromium ? ['tests/src/browser/**/*.test.ts'] : [],
7559
- passWithNoTests: !hasChromium,
7707
+ include: ['tests/src/browser/**/*.test.ts'],
7560
7708
  ${hasSourceCore ? "exclude: ['tests/src/core/**/*.test.ts'],\n " : ""}setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
7561
7709
  browser: {
7562
- enabled: hasChromium,
7710
+ enabled: true,
7563
7711
  provider: playwright(),
7564
7712
  instances: [{ browser: 'chromium', headless: true }],
7565
7713
  },
@@ -7571,7 +7719,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7571
7719
  `);
7572
7720
  }
7573
7721
  if (src.includes("server")) {
7574
- projects.push("srcServer");
7722
+ registrations.push({ project: "srcServer" });
7575
7723
  const coreOutput = hasSourceCore ? `
7576
7724
  output: [
7577
7725
  {
@@ -7622,7 +7770,7 @@ ${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
7622
7770
  `);
7623
7771
  }
7624
7772
  if (app.includes("core")) {
7625
- projects.push("appCore");
7773
+ registrations.push({ project: "appCore" });
7626
7774
  blocks.push(`
7627
7775
  ${EXPORT_KEYWORD} const appCore = (config?: UserConfig): UserConfig =>
7628
7776
  mergeConfig(
@@ -7643,7 +7791,10 @@ ${EXPORT_KEYWORD} const appCore = (config?: UserConfig): UserConfig =>
7643
7791
  `);
7644
7792
  }
7645
7793
  if (app.includes("browser")) {
7646
- projects.push("...(hasChromium ? [appBrowser()] : [])");
7794
+ registrations.push({
7795
+ project: "appBrowser",
7796
+ browser: APP_MATRIX.browser.project
7797
+ });
7647
7798
  blocks.push(`
7648
7799
  ${EXPORT_KEYWORD} function appBrowser(...config: readonly never[]): UserConfig {
7649
7800
  if (config.length > 0) {
@@ -7684,11 +7835,10 @@ ${EXPORT_KEYWORD} function appBrowser(...config: readonly never[]): UserConfig {
7684
7835
  name: { label: '${APP_MATRIX.browser.project}', color: 'blue' },
7685
7836
  root: resolveWorkspacePath('.'),
7686
7837
  dir: resolveWorkspacePath('.'),
7687
- include: hasChromium ? ['tests/app/browser/**/*.test.ts'] : [],
7688
- passWithNoTests: !hasChromium,
7838
+ include: ['tests/app/browser/**/*.test.ts'],
7689
7839
  setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
7690
7840
  browser: {
7691
- enabled: hasChromium,
7841
+ enabled: true,
7692
7842
  provider: playwright(),
7693
7843
  instances: [{ browser: 'chromium', headless: true }],
7694
7844
  },
@@ -7699,7 +7849,7 @@ ${EXPORT_KEYWORD} function appBrowser(...config: readonly never[]): UserConfig {
7699
7849
  `);
7700
7850
  }
7701
7851
  if (app.includes("server")) {
7702
- projects.push("appServer");
7852
+ registrations.push({ project: "appServer" });
7703
7853
  blocks.push(`
7704
7854
  ${EXPORT_KEYWORD} const appServer = (config?: UserConfig): UserConfig =>
7705
7855
  mergeConfig(
@@ -7733,7 +7883,7 @@ ${EXPORT_KEYWORD} const appServer = (config?: UserConfig): UserConfig =>
7733
7883
  `);
7734
7884
  }
7735
7885
  if (engine) {
7736
- projects.push("srcBin", "integration");
7886
+ registrations.push({ project: "srcBin" }, { project: "integration" });
7737
7887
  blocks.push(`
7738
7888
  ${EXPORT_KEYWORD} const srcBin = (config?: UserConfig): UserConfig =>
7739
7889
  mergeConfig(
@@ -7777,22 +7927,10 @@ ${EXPORT_KEYWORD} const integration = (config?: UserConfig): UserConfig =>
7777
7927
  )
7778
7928
  `);
7779
7929
  }
7780
- const projectNames = [
7781
- ...projects,
7782
- "policy",
7783
- "guides"
7784
- ];
7785
- const inlineProjects = ` projects: [${projectNames.join(", ")}],`;
7786
- const renderedProjects = computeColumnWidth(inlineProjects) <= 100 ? inlineProjects : ` projects: [
7787
- ${projectNames.map((project) => ` ${project},`).join("\n")}
7788
- ],`;
7789
- const browserProjects = [...src.includes("browser") ? [SRC_MATRIX.browser.project] : [], ...app.includes("browser") ? [APP_MATRIX.browser.project] : []];
7790
- const browserNotice = serializeTypeScriptString(`browser projects skipped: Chromium absent (${browserProjects.join(", ")})`);
7791
- const inlineBrowserNotice = `if (!hasChromium) console.warn(${browserNotice})`;
7792
- const renderedBrowserNotice = browserProjects.length === 0 ? void 0 : computeColumnWidth(inlineBrowserNotice) <= 100 ? inlineBrowserNotice : `if (!hasChromium)
7793
- console.warn(${browserNotice})`;
7930
+ registrations.push({ project: "policy" }, { project: "guides" });
7931
+ const renderedTest = renderViteTest(registrations, machinery.browser);
7794
7932
  return `${header}
7795
- ${renderedBrowserNotice === void 0 ? "" : `${renderedBrowserNotice}\n`}${policyViteProject()}
7933
+ ${policyViteProject()}
7796
7934
  ${EXPORT_KEYWORD} const guides = (config?: UserConfig): UserConfig =>
7797
7935
  mergeConfig(
7798
7936
  {
@@ -7811,9 +7949,7 @@ ${EXPORT_KEYWORD} const guides = (config?: UserConfig): UserConfig =>
7811
7949
  ${blocks.join("")}
7812
7950
  export default defineConfig({
7813
7951
  resolve,
7814
- test: {
7815
- ${renderedProjects}
7816
- },
7952
+ ${renderedTest}
7817
7953
  })
7818
7954
  `;
7819
7955
  }
@@ -9259,6 +9395,6 @@ function createBlueprint(data) {
9259
9395
  return candidate;
9260
9396
  }
9261
9397
  //#endregion
9262
- export { APP_BROWSER_DEV_DEPENDENCIES, APP_MATRIX, BASE_DEV_DEPENDENCIES, CATEGORIES, CHECKOUT_ACTION_SHA, COMPILER_ID, COMPILE_STAGES, CONST_KEYWORD, CONTROL_CHARACTER_PATTERN, Compiler, DEFAULT_ENGINES, DEFAULT_VERSION, DEPENDENCY_NAME_PATTERN, ENGINES_PATTERN, ENVIRONMENTS, EXPORT_KEYWORD, EXTRA_NAME_PATTERN, EXTRA_RANGE_PATTERN, FRESHNESS, FUNCTION_KEYWORD, GROUPS, HEX_PATTERN, HOST_PATHS, IMPORT_KEYWORD, INVALID_PATH_CHARACTER_PATTERN, JSON_PRINT_WIDTH, JSON_TAB_WIDTH, MAX_ARTIFACT_BYTES, MAX_ARTIFACT_HEX_LENGTH, MAX_COLLECTION_ITEMS, MAX_DATA_GRAPH_KEYS, MAX_DATA_GRAPH_NODES, MAX_DEPENDENCY_NAME_LENGTH, MAX_MANIFEST_BYTES, MAX_NAME_LENGTH, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, MAX_SERIALIZED_INPUT_BYTES, MAX_TOTAL_ARTIFACT_BYTES, MINIMUM_NODE_VERSION, NAME_PATTERN, ORIGINS, ORKESTREL_RANGE_PATTERN, PlanManager, SCAFFOLD_RANGE, SETUP_NODE_ACTION_SHA, SOURCE_BROWSER_DEV_DEPENDENCIES, SRC_MATRIX, SYNC_BASELINE_PATTERN, ScaffoldError, TEMPLATES, TYPESCRIPT_EXTENSIONS, VERSION_PATTERN, alignTable, appTsconfig, appViteConfig, applicationArtifacts, applicationViteConfig, applyOverrides, artifactShape, auditToReview, blueprint, blueprintShape, blueprintToMembers, blueprintToPlan, bytesToHex, catalogNames, catalogToBlock, ciWorkflow, compareCodeUnit, computeColumnWidth, computeHash, configArtifacts, contentByteLength, contentCodePoint, contentToBytes, contentToHex, coreTsconfig, coreViteConfig, createBlueprint, createCompiler, createPlanManager, delimiterCell, dependency, dependencyShape, devDependenciesFor, diffPlan, dualCondition, entryFields, escapeHtmlText, exportsMap, fillArtifact, findFileConflict, findPathConflict, formatJson, guideArtifacts, guideMemberTable, guideMethods, guideTests, guideUsage, hasBlueprintEnvironment, hasOnlyDataProperties, hasValidArtifactBytes, hasValidArtifactHex, hasValidAuditBytes, hasValidBlueprintBytes, hasValidOverrideBytes, hasValidPlanBytes, hasValidPlanHex, hasValidSnapshotBytes, hasValidSyncReportBytes, hostGroup, inferGroup, isArtifact, isBehind, isBlueprint, isCompilerEventHooks, isDenseDataArray, isDependency, isEmitterErrorHandler, isMember, isOverride, isPlan, isPlanManagerEventHooks, isScaffoldError, isSyncReport, isWorkspaceName, manifestToDependencies, manifestToName, member, memberShape, override, overrideShape, ownDataValue, packageManifest, padCell, paritySpecifiers, parseBlueprint, parseBoundedJSON, parseCompilerOptions, parsePlan, parsePlanIds, parsePlanManagerOptions, parseSyncReport, pascalCase, pinPlan, planPayload, planShape, planToReview, planToSummary, policyViteProject, rangeToFreshness, renderArray, renderObject, renderValue, rootTsconfig, rootViteConfig, selectHostPaths, serializeTypeScriptString, singleSrcViteConfig, snapshotOf, snapshotPlan, sourceArtifacts, splitTableRow, srcTsconfig, srcVariant, srcViteConfig, stableStringify, syncReportShape, syncToReview, testArtifacts, validateBlueprint, validateDependencyArray, validatePlan, viteHeader, viteMachinery };
9398
+ export { APP_BROWSER_DEV_DEPENDENCIES, APP_MATRIX, BASE_DEV_DEPENDENCIES, CATEGORIES, CHECKOUT_ACTION_SHA, COMPILER_ID, COMPILE_STAGES, CONST_KEYWORD, CONTROL_CHARACTER_PATTERN, Compiler, DEFAULT_ENGINES, DEFAULT_VERSION, DEPENDENCY_NAME_PATTERN, ENGINES_PATTERN, ENVIRONMENTS, EXPORT_KEYWORD, EXTRA_NAME_PATTERN, EXTRA_RANGE_PATTERN, FRESHNESS, FUNCTION_KEYWORD, GROUPS, HEX_PATTERN, HOST_PATHS, IMPORT_KEYWORD, INVALID_PATH_CHARACTER_PATTERN, JSON_PRINT_WIDTH, JSON_TAB_WIDTH, MAX_ARTIFACT_BYTES, MAX_ARTIFACT_HEX_LENGTH, MAX_COLLECTION_ITEMS, MAX_DATA_GRAPH_KEYS, MAX_DATA_GRAPH_NODES, MAX_DEPENDENCY_NAME_LENGTH, MAX_MANIFEST_BYTES, MAX_NAME_LENGTH, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, MAX_SERIALIZED_INPUT_BYTES, MAX_TOTAL_ARTIFACT_BYTES, MINIMUM_NODE_VERSION, NAME_PATTERN, ORIGINS, ORKESTREL_RANGE_PATTERN, PlanManager, SCAFFOLD_RANGE, SETUP_NODE_ACTION_SHA, SOURCE_BROWSER_DEV_DEPENDENCIES, SRC_MATRIX, SYNC_BASELINE_PATTERN, ScaffoldError, TEMPLATES, TYPESCRIPT_EXTENSIONS, VERSION_PATTERN, alignTable, appTsconfig, appViteConfig, applicationArtifacts, applicationViteConfig, applyOverrides, artifactShape, auditToReview, blueprint, blueprintShape, blueprintToMembers, blueprintToPlan, bytesToHex, catalogNames, catalogToBlock, ciWorkflow, compareCodeUnit, computeColumnWidth, computeHash, configArtifacts, contentByteLength, contentCodePoint, contentToBytes, contentToHex, coreTsconfig, coreViteConfig, createBlueprint, createCompiler, createPlanManager, delimiterCell, dependency, dependencyShape, devDependenciesFor, diffPlan, dualCondition, entryFields, escapeHtmlText, exportsMap, fillArtifact, findFileConflict, findPathConflict, formatJson, guideArtifacts, guideMemberTable, guideMethods, guideTests, guideUsage, hasBlueprintEnvironment, hasOnlyDataProperties, hasValidArtifactBytes, hasValidArtifactHex, hasValidAuditBytes, hasValidBlueprintBytes, hasValidOverrideBytes, hasValidPlanBytes, hasValidPlanHex, hasValidSnapshotBytes, hasValidSyncReportBytes, hostGroup, inferGroup, isArtifact, isBehind, isBlueprint, isCompilerEventHooks, isDenseDataArray, isDependency, isEmitterErrorHandler, isMember, isOverride, isPlan, isPlanManagerEventHooks, isScaffoldError, isSyncReport, isWorkspaceName, manifestToDependencies, manifestToName, member, memberShape, override, overrideShape, ownDataValue, packageManifest, padCell, paritySpecifiers, parseBlueprint, parseBoundedJSON, parseCompilerOptions, parsePlan, parsePlanIds, parsePlanManagerOptions, parseSyncReport, pascalCase, pinPlan, planPayload, planShape, planToReview, planToSummary, policyViteProject, rangeToFreshness, renderArray, renderObject, renderValue, renderViteTest, rootTsconfig, rootViteConfig, selectHostPaths, serializeTypeScriptString, singleSrcViteConfig, snapshotOf, snapshotPlan, sourceArtifacts, splitTableRow, srcTsconfig, srcVariant, srcViteConfig, stableStringify, syncReportShape, syncToReview, testArtifacts, validateBlueprint, validateDependencyArray, validatePlan, viteHeader, viteMachinery };
9263
9399
 
9264
9400
  //# sourceMappingURL=index.js.map