@orkestrel/scaffold 0.0.11 → 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
 
@@ -227,11 +227,11 @@ var DEFAULT_VERSION = "0.0.1";
227
227
  /** The `engines.node` range the `blueprint` builder fills. */
228
228
  var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
229
229
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
230
- var SCAFFOLD_RANGE = "^0.0.11";
230
+ var SCAFFOLD_RANGE = "^0.0.12";
231
231
  /** Tooling versions shared by scaffold and every generated workspace. */
232
232
  var BASE_DEV_DEPENDENCIES = Object.freeze({
233
233
  "@microsoft/api-extractor": "^7.58.12",
234
- "@orkestrel/guide": "^0.0.7",
234
+ "@orkestrel/guide": "^0.0.8",
235
235
  "@orkestrel/scaffold": SCAFFOLD_RANGE,
236
236
  "@types/node": "^26.1.2",
237
237
  oxfmt: "^0.61.0",
@@ -610,7 +610,7 @@ function catalogNames(text) {
610
610
  *
611
611
  * @param header - The header cell strings, in column order.
612
612
  * @param rows - The body rows, each a list of cell strings matching `header`'s column count.
613
- * @param align - Optional per-column alignment; defaults every column to `'none'`.
613
+ * @param align - Optional per-column alignment; defaults every column to `null` (no alignment).
614
614
  * @remarks
615
615
  * Builds a `TableNode` (each cell parsed with `parseInline`) and serializes it
616
616
  * through `renderMarkdown`, which contributes the structure — `\|`-escaping any
@@ -629,13 +629,14 @@ function catalogNames(text) {
629
629
  */
630
630
  function alignTable(header, rows, align) {
631
631
  const columns = header.length;
632
- const alignment = align ?? header.map(() => "none");
633
- const lines = (0, _orkestrel_markdown.renderMarkdown)({
632
+ const alignment = align ?? header.map(() => null);
633
+ const node = {
634
634
  element: "table",
635
635
  header: header.map((cell) => (0, _orkestrel_markdown.parseInline)(cell)),
636
636
  rows: rows.map((row) => row.map((cell) => (0, _orkestrel_markdown.parseInline)(cell))),
637
637
  align: alignment
638
- }).split("\n");
638
+ };
639
+ const lines = (0, _orkestrel_markdown.renderMarkdown)(node).split("\n");
639
640
  const headerCells = splitTableRow(lines[0] ?? "");
640
641
  const bodyCells = lines.slice(2).map((line) => splitTableRow(line));
641
642
  const widths = [];
@@ -698,11 +699,11 @@ function padCell(text, width) {
698
699
  /**
699
700
  * Build one delimiter-row cell for a GFM table column.
700
701
  *
701
- * @param columnAlign - The column's `TableAlign`.
702
+ * @param columnAlign - The column's `TableAlign`, or `null` for no alignment.
702
703
  * @param width - The column's codepoint width.
703
704
  * @remarks
704
705
  * `'left'` prefixes `:`, `'right'` suffixes `:`, `'center'` wraps both ends,
705
- * `'none'` is plain dashes — one dash per width unit, `:` markers consuming
706
+ * `null` is plain dashes — one dash per width unit, `:` markers consuming
706
707
  * a dash slot rather than adding to `width`.
707
708
  * @returns The delimiter cell string for this column.
708
709
  *
@@ -5875,7 +5876,7 @@ ${renderedProjects}
5875
5876
  ${fitsPrintWidth(inlineRegistrations) ? inlineRegistrations : ` [
5876
5877
  ${renderedRegistrations.map((registration) => ` ${registration},`).join("\n")}
5877
5878
  ],`}
5878
- hasChromium,
5879
+ chromiumPath !== undefined,
5879
5880
  process.argv,
5880
5881
  ),`;
5881
5882
  }
@@ -7252,11 +7253,66 @@ import {
7252
7253
  fstatSync,
7253
7254
  lstatSync,
7254
7255
  openSync,
7255
- readSync,
7256
+ ${needsBrowser ? " readdirSync,\n" : ""} readSync,
7256
7257
  realpathSync,
7257
- } from 'node:fs'
7258
- import { dirname, isAbsolute, relative, resolve as resolvePath, sep } from 'node:path'
7259
- ${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
+ ` : ""}
7260
7316
  ${EXPORT_KEYWORD} function resolveWorkspacePath(relativePath: string): string {
7261
7317
  return fileURLToPath(new URL(relativePath, import.meta.url))
7262
7318
  }
@@ -7596,7 +7652,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7596
7652
  }),
7597
7653
  browser: {
7598
7654
  enabled: true,
7599
- provider: playwright(),
7655
+ provider: playwright(chromiumOptions),
7600
7656
  instances: [{ browser: 'chromium', headless: true }],
7601
7657
  },
7602
7658
  fileParallelism: false,
@@ -7729,7 +7785,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7729
7785
  }),
7730
7786
  browser: {
7731
7787
  enabled: true,
7732
- provider: playwright(),
7788
+ provider: playwright(chromiumOptions),
7733
7789
  instances: [{ browser: 'chromium', headless: true }],
7734
7790
  },
7735
7791
  fileParallelism: false,
@@ -7895,7 +7951,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7895
7951
  }),
7896
7952
  browser: {
7897
7953
  enabled: true,
7898
- provider: playwright(),
7954
+ provider: playwright(chromiumOptions),
7899
7955
  instances: [{ browser: 'chromium', headless: true }],
7900
7956
  },
7901
7957
  fileParallelism: false,
@@ -8024,7 +8080,7 @@ ${EXPORT_KEYWORD} function appBrowser(...config: readonly never[]): UserConfig {
8024
8080
  },
8025
8081
  browser: {
8026
8082
  enabled: true,
8027
- provider: playwright(),
8083
+ provider: playwright(chromiumOptions),
8028
8084
  instances: [{ browser: 'chromium', headless: true }],
8029
8085
  },
8030
8086
  fileParallelism: false,