@orkestrel/scaffold 0.0.12 → 0.0.13

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.
@@ -1098,7 +1098,7 @@ along the three `ViteMachinery` axes:
1098
1098
  | Machinery | Emitted when |
1099
1099
  | ----------------------------------------------------------------- | ------------------------------------ |
1100
1100
  | CSS pipeline (`ENVIRONMENT_CSS`, `preprocessCSS`, `isCSSRequest`) | a `src` or `app` browser environment |
1101
- | Playwright provider and `hasChromium` | a `src` or `app` browser environment |
1101
+ | Playwright provider and `resolveChromium` | a `src` or `app` browser environment |
1102
1102
  | Vue plugin, HTML boundary, browser development server | an `app` browser environment |
1103
1103
  | Output containment (`outputBoundary`, `enforceOutputPath`) | anything the workspace builds |
1104
1104
 
@@ -5876,7 +5876,7 @@ ${renderedProjects}
5876
5876
  ${fitsPrintWidth(inlineRegistrations) ? inlineRegistrations : ` [
5877
5877
  ${renderedRegistrations.map((registration) => ` ${registration},`).join("\n")}
5878
5878
  ],`}
5879
- hasChromium,
5879
+ chromiumPath !== undefined,
5880
5880
  process.argv,
5881
5881
  ),`;
5882
5882
  }
@@ -7253,11 +7253,66 @@ import {
7253
7253
  fstatSync,
7254
7254
  lstatSync,
7255
7255
  openSync,
7256
- readSync,
7256
+ ${needsBrowser ? " readdirSync,\n" : ""} readSync,
7257
7257
  realpathSync,
7258
- } from 'node:fs'
7259
- import { dirname, isAbsolute, relative, resolve as resolvePath, sep } from 'node:path'
7260
- ${playwrightImports}${vueImports}${needsBrowser ? `\n${CONST_KEYWORD} hasChromium = existsSync(chromium.executablePath())\n` : ""}
7258
+ ${needsBrowser ? " statSync,\n" : ""}} from 'node:fs'
7259
+ import { ${needsBrowser ? "basename, " : ""}dirname, isAbsolute, relative, resolve as resolvePath, sep } from 'node:path'
7260
+ ${playwrightImports}${vueImports}${needsBrowser ? `\n/** Chromium executable layouts inside a \`chromium-<revision>\` browsers-directory entry, per platform. */
7261
+ ${EXPORT_KEYWORD} ${CONST_KEYWORD} CHROMIUM_LAYOUTS = Object.freeze([
7262
+ 'chrome-linux/chrome',
7263
+ 'chrome-linux64/chrome',
7264
+ 'chrome-win/chrome.exe',
7265
+ 'chrome-win64/chrome.exe',
7266
+ 'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
7267
+ 'chrome-mac-arm64/Chromium.app/Contents/MacOS/Chromium',
7268
+ ])
7269
+
7270
+ /**
7271
+ * Resolve a launchable Chromium executable: the pinned revision when installed,
7272
+ * otherwise a \`chromium\` / \`chromium.exe\` alias or any other \`chromium-*\`
7273
+ * revision under the same Playwright browsers directory. A pinned-revision miss
7274
+ * is not Chromium absence — managed containers ship one usable build (often
7275
+ * behind a revision-agnostic alias) for many Playwright versions.
7276
+ */
7277
+ ${EXPORT_KEYWORD} function resolveChromium(pinned: string): string | undefined {
7278
+ if (existsSync(pinned)) return pinned
7279
+ let revisionRoot = dirname(pinned)
7280
+ for (;;) {
7281
+ if (/^chromium-\\d+$/.test(basename(revisionRoot))) break
7282
+ const parent = dirname(revisionRoot)
7283
+ if (parent === revisionRoot) return undefined
7284
+ revisionRoot = parent
7285
+ }
7286
+ const browsersRoot = dirname(revisionRoot)
7287
+ for (const alias of ['chromium', 'chromium.exe']) {
7288
+ const candidate = resolvePath(browsersRoot, alias)
7289
+ if (existsSync(candidate) && statSync(candidate).isFile()) return candidate
7290
+ }
7291
+ let entries: readonly string[]
7292
+ try {
7293
+ entries = readdirSync(browsersRoot)
7294
+ } catch {
7295
+ return undefined
7296
+ }
7297
+ const revisions = entries
7298
+ .filter((entry) => /^chromium-\\d+$/.test(entry))
7299
+ .sort((a, b) => Number(b.slice('chromium-'.length)) - Number(a.slice('chromium-'.length)))
7300
+ for (const revision of revisions) {
7301
+ for (const layout of CHROMIUM_LAYOUTS) {
7302
+ const candidate = resolvePath(browsersRoot, revision, layout)
7303
+ if (existsSync(candidate)) return candidate
7304
+ }
7305
+ }
7306
+ return undefined
7307
+ }
7308
+
7309
+ ${CONST_KEYWORD} chromiumPinned = chromium.executablePath()
7310
+ ${CONST_KEYWORD} chromiumPath = resolveChromium(chromiumPinned)
7311
+ ${CONST_KEYWORD} chromiumOptions =
7312
+ chromiumPath === undefined || chromiumPath === chromiumPinned
7313
+ ? {}
7314
+ : { launchOptions: { executablePath: chromiumPath } }
7315
+ ` : ""}
7261
7316
  ${EXPORT_KEYWORD} function resolveWorkspacePath(relativePath: string): string {
7262
7317
  return fileURLToPath(new URL(relativePath, import.meta.url))
7263
7318
  }
@@ -7597,7 +7652,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7597
7652
  }),
7598
7653
  browser: {
7599
7654
  enabled: true,
7600
- provider: playwright(),
7655
+ provider: playwright(chromiumOptions),
7601
7656
  instances: [{ browser: 'chromium', headless: true }],
7602
7657
  },
7603
7658
  fileParallelism: false,
@@ -7730,7 +7785,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7730
7785
  }),
7731
7786
  browser: {
7732
7787
  enabled: true,
7733
- provider: playwright(),
7788
+ provider: playwright(chromiumOptions),
7734
7789
  instances: [{ browser: 'chromium', headless: true }],
7735
7790
  },
7736
7791
  fileParallelism: false,
@@ -7896,7 +7951,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7896
7951
  }),
7897
7952
  browser: {
7898
7953
  enabled: true,
7899
- provider: playwright(),
7954
+ provider: playwright(chromiumOptions),
7900
7955
  instances: [{ browser: 'chromium', headless: true }],
7901
7956
  },
7902
7957
  fileParallelism: false,
@@ -8025,7 +8080,7 @@ ${EXPORT_KEYWORD} function appBrowser(...config: readonly never[]): UserConfig {
8025
8080
  },
8026
8081
  browser: {
8027
8082
  enabled: true,
8028
- provider: playwright(),
8083
+ provider: playwright(chromiumOptions),
8029
8084
  instances: [{ browser: 'chromium', headless: true }],
8030
8085
  },
8031
8086
  fileParallelism: false,