@datarails-ai/dr-appspace-cli 0.12.35 → 0.12.36

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.
Files changed (2) hide show
  1. package/dist/cli.js +41 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import { fileURLToPath as fileURLToPath6 } from "url";
13
13
  // package.json
14
14
  var package_default = {
15
15
  name: "@datarails-ai/dr-appspace-cli",
16
- version: "0.12.35",
16
+ version: "0.12.36",
17
17
  description: "Datarails App Space CLI \u2014 build, try, push and publish App Space apps",
18
18
  type: "module",
19
19
  engines: {
@@ -57,7 +57,7 @@ var package_default = {
57
57
  };
58
58
 
59
59
  // src/buildInfo.ts
60
- var BUILD_TIME = "2026-10-26T12:46:38.741Z";
60
+ var BUILD_TIME = "2026-10-26T13:45:46.965Z";
61
61
  function formatBuildTime(iso) {
62
62
  if (iso === "") return "";
63
63
  const d = new Date(iso);
@@ -10522,7 +10522,7 @@ function compile(contract, { kit, extra = {} } = {}) {
10522
10522
  for (const page of pages) {
10523
10523
  files[page.path] = pageFile(page, { contract: composed, pages, kit, problems });
10524
10524
  }
10525
- return { files, problems: problems.sort(byProblem2) };
10525
+ return { files, problems: problems.sort(byProblem2), warnings: narrativeOrderWarnings(composed, applied) };
10526
10526
  }
10527
10527
  var RUNTIME_RENDERER2 = "runtime";
10528
10528
  function dashboardHandler(composed, handlerName, extra = {}) {
@@ -10598,6 +10598,43 @@ function missingExpressions(widgets) {
10598
10598
  }
10599
10599
  return problems;
10600
10600
  }
10601
+ function narrativeOrderWarnings(composed, applied) {
10602
+ const picked = new Set(applied.filter((fill) => fill.what === "layout.order").map((fill) => fill.where));
10603
+ const elements = isPlainObject6(composed?.elements) ? composed.elements : {};
10604
+ const widgets = isPlainObject6(composed?.data?.widgets) ? composed.data.widgets : {};
10605
+ const pages = [...Array.isArray(composed?.pages) ? composed.pages : []].sort((a, b) => natural3(a.path ?? "", b.path ?? ""));
10606
+ const named13 = (value) => typeof value === "string" && value !== "";
10607
+ const quoted3 = (ids) => ids.map((id) => JSON.stringify(id)).join(", ");
10608
+ const warnings = [];
10609
+ for (const page of pages) {
10610
+ if (picked.has(page.path)) continue;
10611
+ const sections = Array.isArray(page.sections) ? page.sections : [];
10612
+ const sectionOf4 = (uid) => sections.findIndex((entry) => isPlainObject6(entry) && entry.id === elements[uid].section);
10613
+ const cards = Object.keys(elements).filter((uid) => elements[uid]?.page === page.path && elements[uid]?.type === "widget").sort((a, b) => sectionOf4(a) - sectionOf4(b) || order(elements[a]) - order(elements[b]) || natural3(a, b));
10614
+ const specOf2 = (uid) => {
10615
+ const element = elements[uid];
10616
+ const props = isPlainObject6(element.props) ? element.props : {};
10617
+ return named13(element.id) ? element.id : named13(props.card) ? props.card : named13(props.id) ? props.id : uid;
10618
+ };
10619
+ cards.forEach((uid, at) => {
10620
+ const own2 = specOf2(uid);
10621
+ const row = widgets[own2];
10622
+ const about = isPlainObject6(row) && row.kind === "narrative" && Array.isArray(row.about) ? row.about.filter((id) => named13(id) && id !== own2) : [];
10623
+ if (about.length === 0) return;
10624
+ const after = cards.slice(at + 1).filter((other) => sectionOf4(other) === sectionOf4(uid) && about.includes(specOf2(other)));
10625
+ if (after.length === 0) return;
10626
+ const later = [...new Set(after.map(specOf2))];
10627
+ const last = specOf2(after[after.length - 1]);
10628
+ const where2 = sectionOf4(uid) === -1 ? page.path : `section "${sections[sectionOf4(uid)].id}" of ${page.path}`;
10629
+ warnings.push({
10630
+ code: "narrative_before_about",
10631
+ pointer: `/elements/${escapePointer3(uid)}/order`,
10632
+ message: `narrative "${own2}" comes before ${quoted3(later)}, ${later.length === 1 ? "a card" : "cards"} it is about, on ${where2}: it reads the cards it is about as it loads, so its context gives ${quoted3(later)} as "(not loaded yet)". The page keeps the order you stated; move "${own2}" after "${last}"`
10633
+ });
10634
+ });
10635
+ }
10636
+ return warnings;
10637
+ }
10601
10638
  var DEFAULT_CAPABILITIES = { financeos: ["metrics:read", "raw:read"] };
10602
10639
  function manifestFile(contract, handlerName) {
10603
10640
  const app = contract.app ?? {};
@@ -11078,7 +11115,7 @@ function compileDashboard(contract, { kit = null, extra = {}, uiKit, charts, fmt
11078
11115
  files[handlerPath(composed, handlerName)] = handler.text;
11079
11116
  const shelf2 = { runtime: DASHBOARD_RUNTIME, widgets: DASHBOARD_WIDGETS, bar: DASHBOARD_BAR, assistant, markdown, uiKit, charts, fmt, appComponents, appControls };
11080
11117
  for (const page of whole.pages) files[page.path] = pageHtml(whole, page, elements, tree, shelf2);
11081
- return { files, problems, contract: whole, order: order2, warnings: [] };
11118
+ return { files, problems, contract: whole, order: order2, warnings: narrativeOrderWarnings(composed, applied) };
11082
11119
  }
11083
11120
  function isRefusal(problem5) {
11084
11121
  return problem5.lossy !== false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarails-ai/dr-appspace-cli",
3
- "version": "0.12.35",
3
+ "version": "0.12.36",
4
4
  "description": "Datarails App Space CLI — build, try, push and publish App Space apps",
5
5
  "type": "module",
6
6
  "engines": {