@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.
@@ -19,7 +19,7 @@ import { UnionShape } from '@orkestrel/contract';
19
19
  *
20
20
  * @param header - The header cell strings, in column order.
21
21
  * @param rows - The body rows, each a list of cell strings matching `header`'s column count.
22
- * @param align - Optional per-column alignment; defaults every column to `'none'`.
22
+ * @param align - Optional per-column alignment; defaults every column to `null` (no alignment).
23
23
  * @remarks
24
24
  * Builds a `TableNode` (each cell parsed with `parseInline`) and serializes it
25
25
  * through `renderMarkdown`, which contributes the structure — `\|`-escaping any
@@ -36,7 +36,7 @@ import { UnionShape } from '@orkestrel/contract';
36
36
  * // '| API | Kind |\n| --------------- | -------- |\n| `createRouter` | function |'
37
37
  * ```
38
38
  */
39
- export declare function alignTable(header: readonly string[], rows: readonly (readonly string[])[], align?: readonly TableAlign[]): string;
39
+ export declare function alignTable(header: readonly string[], rows: readonly (readonly string[])[], align?: readonly (TableAlign | null)[]): string;
40
40
 
41
41
  /** Additional development dependencies required by a private Vue browser application. */
42
42
  export declare const APP_BROWSER_DEV_DEPENDENCIES: Readonly<Record<string, string>>;
@@ -782,11 +782,11 @@ export declare function coreViteConfig(browser?: boolean): string;
782
782
  /**
783
783
  * Build one delimiter-row cell for a GFM table column.
784
784
  *
785
- * @param columnAlign - The column's `TableAlign`.
785
+ * @param columnAlign - The column's `TableAlign`, or `null` for no alignment.
786
786
  * @param width - The column's codepoint width.
787
787
  * @remarks
788
788
  * `'left'` prefixes `:`, `'right'` suffixes `:`, `'center'` wraps both ends,
789
- * `'none'` is plain dashes — one dash per width unit, `:` markers consuming
789
+ * `null` is plain dashes — one dash per width unit, `:` markers consuming
790
790
  * a dash slot rather than adding to `width`.
791
791
  * @returns The delimiter cell string for this column.
792
792
  *
@@ -797,7 +797,7 @@ export declare function coreViteConfig(browser?: boolean): string;
797
797
  * delimiterCell('left', 5) // ':----'
798
798
  * ```
799
799
  */
800
- export declare function delimiterCell(columnAlign: TableAlign, width: number): string;
800
+ export declare function delimiterCell(columnAlign: TableAlign | null, width: number): string;
801
801
 
802
802
  /**
803
803
  * One runtime `@orkestrel/*` dependency.
@@ -2276,7 +2276,7 @@ export declare function coreViteConfig(browser?: boolean): string;
2276
2276
  export declare function rootViteConfig(src: readonly Environment[], facts?: ViteFacts): string;
2277
2277
 
2278
2278
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
2279
- export declare const SCAFFOLD_RANGE = "^0.0.11";
2279
+ export declare const SCAFFOLD_RANGE = "^0.0.12";
2280
2280
 
2281
2281
  /**
2282
2282
  * Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
@@ -19,7 +19,7 @@ import { UnionShape } from '@orkestrel/contract';
19
19
  *
20
20
  * @param header - The header cell strings, in column order.
21
21
  * @param rows - The body rows, each a list of cell strings matching `header`'s column count.
22
- * @param align - Optional per-column alignment; defaults every column to `'none'`.
22
+ * @param align - Optional per-column alignment; defaults every column to `null` (no alignment).
23
23
  * @remarks
24
24
  * Builds a `TableNode` (each cell parsed with `parseInline`) and serializes it
25
25
  * through `renderMarkdown`, which contributes the structure — `\|`-escaping any
@@ -36,7 +36,7 @@ import { UnionShape } from '@orkestrel/contract';
36
36
  * // '| API | Kind |\n| --------------- | -------- |\n| `createRouter` | function |'
37
37
  * ```
38
38
  */
39
- export declare function alignTable(header: readonly string[], rows: readonly (readonly string[])[], align?: readonly TableAlign[]): string;
39
+ export declare function alignTable(header: readonly string[], rows: readonly (readonly string[])[], align?: readonly (TableAlign | null)[]): string;
40
40
 
41
41
  /** Additional development dependencies required by a private Vue browser application. */
42
42
  export declare const APP_BROWSER_DEV_DEPENDENCIES: Readonly<Record<string, string>>;
@@ -782,11 +782,11 @@ export declare function coreViteConfig(browser?: boolean): string;
782
782
  /**
783
783
  * Build one delimiter-row cell for a GFM table column.
784
784
  *
785
- * @param columnAlign - The column's `TableAlign`.
785
+ * @param columnAlign - The column's `TableAlign`, or `null` for no alignment.
786
786
  * @param width - The column's codepoint width.
787
787
  * @remarks
788
788
  * `'left'` prefixes `:`, `'right'` suffixes `:`, `'center'` wraps both ends,
789
- * `'none'` is plain dashes — one dash per width unit, `:` markers consuming
789
+ * `null` is plain dashes — one dash per width unit, `:` markers consuming
790
790
  * a dash slot rather than adding to `width`.
791
791
  * @returns The delimiter cell string for this column.
792
792
  *
@@ -797,7 +797,7 @@ export declare function coreViteConfig(browser?: boolean): string;
797
797
  * delimiterCell('left', 5) // ':----'
798
798
  * ```
799
799
  */
800
- export declare function delimiterCell(columnAlign: TableAlign, width: number): string;
800
+ export declare function delimiterCell(columnAlign: TableAlign | null, width: number): string;
801
801
 
802
802
  /**
803
803
  * One runtime `@orkestrel/*` dependency.
@@ -2276,7 +2276,7 @@ export declare function coreViteConfig(browser?: boolean): string;
2276
2276
  export declare function rootViteConfig(src: readonly Environment[], facts?: ViteFacts): string;
2277
2277
 
2278
2278
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
2279
- export declare const SCAFFOLD_RANGE = "^0.0.11";
2279
+ export declare const SCAFFOLD_RANGE = "^0.0.12";
2280
2280
 
2281
2281
  /**
2282
2282
  * Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
@@ -226,11 +226,11 @@ 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.11";
229
+ var SCAFFOLD_RANGE = "^0.0.12";
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",
233
- "@orkestrel/guide": "^0.0.7",
233
+ "@orkestrel/guide": "^0.0.8",
234
234
  "@orkestrel/scaffold": SCAFFOLD_RANGE,
235
235
  "@types/node": "^26.1.2",
236
236
  oxfmt: "^0.61.0",
@@ -609,7 +609,7 @@ function catalogNames(text) {
609
609
  *
610
610
  * @param header - The header cell strings, in column order.
611
611
  * @param rows - The body rows, each a list of cell strings matching `header`'s column count.
612
- * @param align - Optional per-column alignment; defaults every column to `'none'`.
612
+ * @param align - Optional per-column alignment; defaults every column to `null` (no alignment).
613
613
  * @remarks
614
614
  * Builds a `TableNode` (each cell parsed with `parseInline`) and serializes it
615
615
  * through `renderMarkdown`, which contributes the structure — `\|`-escaping any
@@ -628,13 +628,14 @@ function catalogNames(text) {
628
628
  */
629
629
  function alignTable(header, rows, align) {
630
630
  const columns = header.length;
631
- const alignment = align ?? header.map(() => "none");
632
- const lines = renderMarkdown({
631
+ const alignment = align ?? header.map(() => null);
632
+ const node = {
633
633
  element: "table",
634
634
  header: header.map((cell) => parseInline(cell)),
635
635
  rows: rows.map((row) => row.map((cell) => parseInline(cell))),
636
636
  align: alignment
637
- }).split("\n");
637
+ };
638
+ const lines = renderMarkdown(node).split("\n");
638
639
  const headerCells = splitTableRow(lines[0] ?? "");
639
640
  const bodyCells = lines.slice(2).map((line) => splitTableRow(line));
640
641
  const widths = [];
@@ -697,11 +698,11 @@ function padCell(text, width) {
697
698
  /**
698
699
  * Build one delimiter-row cell for a GFM table column.
699
700
  *
700
- * @param columnAlign - The column's `TableAlign`.
701
+ * @param columnAlign - The column's `TableAlign`, or `null` for no alignment.
701
702
  * @param width - The column's codepoint width.
702
703
  * @remarks
703
704
  * `'left'` prefixes `:`, `'right'` suffixes `:`, `'center'` wraps both ends,
704
- * `'none'` is plain dashes — one dash per width unit, `:` markers consuming
705
+ * `null` is plain dashes — one dash per width unit, `:` markers consuming
705
706
  * a dash slot rather than adding to `width`.
706
707
  * @returns The delimiter cell string for this column.
707
708
  *
@@ -5874,7 +5875,7 @@ ${renderedProjects}
5874
5875
  ${fitsPrintWidth(inlineRegistrations) ? inlineRegistrations : ` [
5875
5876
  ${renderedRegistrations.map((registration) => ` ${registration},`).join("\n")}
5876
5877
  ],`}
5877
- hasChromium,
5878
+ chromiumPath !== undefined,
5878
5879
  process.argv,
5879
5880
  ),`;
5880
5881
  }
@@ -7251,11 +7252,66 @@ import {
7251
7252
  fstatSync,
7252
7253
  lstatSync,
7253
7254
  openSync,
7254
- readSync,
7255
+ ${needsBrowser ? " readdirSync,\n" : ""} readSync,
7255
7256
  realpathSync,
7256
- } from 'node:fs'
7257
- import { dirname, isAbsolute, relative, resolve as resolvePath, sep } from 'node:path'
7258
- ${playwrightImports}${vueImports}${needsBrowser ? `\n${CONST_KEYWORD} hasChromium = existsSync(chromium.executablePath())\n` : ""}
7257
+ ${needsBrowser ? " statSync,\n" : ""}} from 'node:fs'
7258
+ import { ${needsBrowser ? "basename, " : ""}dirname, isAbsolute, relative, resolve as resolvePath, sep } from 'node:path'
7259
+ ${playwrightImports}${vueImports}${needsBrowser ? `\n/** Chromium executable layouts inside a \`chromium-<revision>\` browsers-directory entry, per platform. */
7260
+ ${EXPORT_KEYWORD} ${CONST_KEYWORD} CHROMIUM_LAYOUTS = Object.freeze([
7261
+ 'chrome-linux/chrome',
7262
+ 'chrome-linux64/chrome',
7263
+ 'chrome-win/chrome.exe',
7264
+ 'chrome-win64/chrome.exe',
7265
+ 'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
7266
+ 'chrome-mac-arm64/Chromium.app/Contents/MacOS/Chromium',
7267
+ ])
7268
+
7269
+ /**
7270
+ * Resolve a launchable Chromium executable: the pinned revision when installed,
7271
+ * otherwise a \`chromium\` / \`chromium.exe\` alias or any other \`chromium-*\`
7272
+ * revision under the same Playwright browsers directory. A pinned-revision miss
7273
+ * is not Chromium absence — managed containers ship one usable build (often
7274
+ * behind a revision-agnostic alias) for many Playwright versions.
7275
+ */
7276
+ ${EXPORT_KEYWORD} function resolveChromium(pinned: string): string | undefined {
7277
+ if (existsSync(pinned)) return pinned
7278
+ let revisionRoot = dirname(pinned)
7279
+ for (;;) {
7280
+ if (/^chromium-\\d+$/.test(basename(revisionRoot))) break
7281
+ const parent = dirname(revisionRoot)
7282
+ if (parent === revisionRoot) return undefined
7283
+ revisionRoot = parent
7284
+ }
7285
+ const browsersRoot = dirname(revisionRoot)
7286
+ for (const alias of ['chromium', 'chromium.exe']) {
7287
+ const candidate = resolvePath(browsersRoot, alias)
7288
+ if (existsSync(candidate) && statSync(candidate).isFile()) return candidate
7289
+ }
7290
+ let entries: readonly string[]
7291
+ try {
7292
+ entries = readdirSync(browsersRoot)
7293
+ } catch {
7294
+ return undefined
7295
+ }
7296
+ const revisions = entries
7297
+ .filter((entry) => /^chromium-\\d+$/.test(entry))
7298
+ .sort((a, b) => Number(b.slice('chromium-'.length)) - Number(a.slice('chromium-'.length)))
7299
+ for (const revision of revisions) {
7300
+ for (const layout of CHROMIUM_LAYOUTS) {
7301
+ const candidate = resolvePath(browsersRoot, revision, layout)
7302
+ if (existsSync(candidate)) return candidate
7303
+ }
7304
+ }
7305
+ return undefined
7306
+ }
7307
+
7308
+ ${CONST_KEYWORD} chromiumPinned = chromium.executablePath()
7309
+ ${CONST_KEYWORD} chromiumPath = resolveChromium(chromiumPinned)
7310
+ ${CONST_KEYWORD} chromiumOptions =
7311
+ chromiumPath === undefined || chromiumPath === chromiumPinned
7312
+ ? {}
7313
+ : { launchOptions: { executablePath: chromiumPath } }
7314
+ ` : ""}
7259
7315
  ${EXPORT_KEYWORD} function resolveWorkspacePath(relativePath: string): string {
7260
7316
  return fileURLToPath(new URL(relativePath, import.meta.url))
7261
7317
  }
@@ -7595,7 +7651,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7595
7651
  }),
7596
7652
  browser: {
7597
7653
  enabled: true,
7598
- provider: playwright(),
7654
+ provider: playwright(chromiumOptions),
7599
7655
  instances: [{ browser: 'chromium', headless: true }],
7600
7656
  },
7601
7657
  fileParallelism: false,
@@ -7728,7 +7784,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7728
7784
  }),
7729
7785
  browser: {
7730
7786
  enabled: true,
7731
- provider: playwright(),
7787
+ provider: playwright(chromiumOptions),
7732
7788
  instances: [{ browser: 'chromium', headless: true }],
7733
7789
  },
7734
7790
  fileParallelism: false,
@@ -7894,7 +7950,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7894
7950
  }),
7895
7951
  browser: {
7896
7952
  enabled: true,
7897
- provider: playwright(),
7953
+ provider: playwright(chromiumOptions),
7898
7954
  instances: [{ browser: 'chromium', headless: true }],
7899
7955
  },
7900
7956
  fileParallelism: false,
@@ -8023,7 +8079,7 @@ ${EXPORT_KEYWORD} function appBrowser(...config: readonly never[]): UserConfig {
8023
8079
  },
8024
8080
  browser: {
8025
8081
  enabled: true,
8026
- provider: playwright(),
8082
+ provider: playwright(chromiumOptions),
8027
8083
  instances: [{ browser: 'chromium', headless: true }],
8028
8084
  },
8029
8085
  fileParallelism: false,