@orkestrel/scaffold 0.0.38 → 0.0.39

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.
@@ -2851,21 +2851,43 @@ var Materializer = class Materializer {
2851
2851
  const layers = (0, _src_core.catalogToLayers)(entries);
2852
2852
  const placed = /* @__PURE__ */ new Map();
2853
2853
  for (const [index, layer] of layers.entries()) for (const name of layer) placed.set(name, index);
2854
+ const rows = entries.map((entry) => {
2855
+ if (entry.lookup !== "found") return [
2856
+ `\`${entry.name}\``,
2857
+ this.#cell(entry.note),
2858
+ "",
2859
+ ""
2860
+ ];
2861
+ const layer = placed.get(entry.name);
2862
+ const edges = entry.dependencies.map((dependency) => `\`${dependency.name}\` \`${dependency.range}\``).join(", ");
2863
+ return [
2864
+ `\`${entry.name}\``,
2865
+ `\`${entry.version}\``,
2866
+ layer === void 0 ? "" : `L${String(layer)}`,
2867
+ edges
2868
+ ];
2869
+ });
2870
+ const headers = [
2871
+ "Package",
2872
+ "Version",
2873
+ "Layer",
2874
+ "Runtime dependencies"
2875
+ ];
2876
+ const widths = headers.map((header, column) => {
2877
+ let width = Math.max(3, header.length);
2878
+ for (const row of rows) width = Math.max(width, row[column]?.length ?? 0);
2879
+ return width;
2880
+ });
2854
2881
  const table = [
2855
- "| Package | Version | Layer | Runtime dependencies |",
2856
- "| --- | --- | --- | --- |",
2857
- ...entries.map((entry) => {
2858
- if (entry.lookup !== "found") return `| \`${entry.name}\` | ${this.#cell(entry.note)} | | |`;
2859
- const layer = placed.get(entry.name);
2860
- const edges = entry.dependencies.map((dependency) => `\`${dependency.name}\` \`${dependency.range}\``).join(", ");
2861
- return `| \`${entry.name}\` | \`${entry.version}\` | ${layer === void 0 ? "" : `L${String(layer)}`} | ${edges} |`;
2862
- })
2863
- ].join("\n");
2882
+ headers,
2883
+ widths.map((width) => "-".repeat(width)),
2884
+ ...rows
2885
+ ].map((row) => `| ${row.map((cell, column) => cell.padEnd(widths[column] ?? cell.length)).join(" | ")} |`).join("\n");
2864
2886
  return (text) => {
2865
2887
  const opening = text.indexOf(Materializer.#opening);
2866
2888
  const closing = text.indexOf(Materializer.#closing, opening + Materializer.#opening.length);
2867
2889
  if (opening < 0 || closing < 0) throw this.#error("TARGET", "The catalog agent file carries no marked region.", { path: _src_core.CATALOG_AGENT_PATH });
2868
- return `${text.slice(0, opening + Materializer.#opening.length)}\n${table}\n${text.slice(closing)}`;
2890
+ return `${text.slice(0, opening + Materializer.#opening.length)}\n\n${table}\n\n${text.slice(closing)}`;
2869
2891
  };
2870
2892
  }
2871
2893
  #cell(note) {