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