@datarails-ai/dr-appspace-cli 0.12.48 → 0.12.50

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 (3) hide show
  1. package/README.md +8 -0
  2. package/dist/cli.js +44 -10
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -385,6 +385,14 @@ the tenant's rows, so a page can lay out differently with real data. Without
385
385
  `--screenshot-budget`, so they never cost a picture; one with less than 5 s
386
386
  left is skipped and its row says why in `lookSkipped`.
387
387
 
388
+ **The same check on the kit goldens, in CI.** The "Golden look" job in
389
+ `pr-checks.yml` draws every kit golden and test app the same way, offline, at
390
+ the kit's pins and at the newest `dr-app-*` release on the shelf, and fails on
391
+ `band-underfilled` or `page-overflow`. That gates a shelf release or a pin
392
+ move, not a builder. To try a release by hand, from `cli/`:
393
+ `pnpm exec tsx src/scripts/look-goldens.ts --runtime 1.13.1` (on 1.13.1 it
394
+ fails on B6).
395
+
388
396
  Chrome is found through `CHROME_PATH`, then `google-chrome`, `chromium` or
389
397
  `chrome` on `PATH`, then the macOS app bundle and the usual Linux paths. With
390
398
  none, the command exits 2 before anything runs. No browser is ever
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.48",
16
+ version: "0.12.50",
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-28T22:46:44.664Z";
60
+ var BUILD_TIME = "2026-10-29T06:56:17.374Z";
61
61
  function formatBuildTime(iso) {
62
62
  if (iso === "") return "";
63
63
  const d = new Date(iso);
@@ -3222,9 +3222,12 @@ function isSkipped(value) {
3222
3222
  async function fromInventory(client, { fields = false, tableCap = 40 } = {}) {
3223
3223
  const fetched_at = (/* @__PURE__ */ new Date()).toISOString();
3224
3224
  const body = await client.request("/financeos/inventory");
3225
+ const said2 = body.dashboard_renderer;
3226
+ const renderer = said2 === "runtime" || said2 === "widgets" ? { dashboard_renderer: said2 } : {};
3225
3227
  if (body.reachable !== true) {
3226
3228
  return {
3227
3229
  ...NO_CATALOG,
3230
+ ...renderer,
3228
3231
  server: client.serverKey,
3229
3232
  fetched_at,
3230
3233
  checks_skipped: [
@@ -3301,7 +3304,8 @@ async function fromInventory(client, { fields = false, tableCap = 40 } = {}) {
3301
3304
  })) : [],
3302
3305
  tables,
3303
3306
  fields_fetched,
3304
- checks_skipped: skipped
3307
+ checks_skipped: skipped,
3308
+ ...renderer
3305
3309
  };
3306
3310
  }
3307
3311
  function toCatalogField(field) {
@@ -23199,13 +23203,14 @@ import { join as join9 } from "path";
23199
23203
  function reportPath(dir) {
23200
23204
  return join9(dir, ".appspace", "compile.json");
23201
23205
  }
23202
- function emptyReport(kind, kit, renderer) {
23206
+ function emptyReport(kind, kit, renderer, rendererSource) {
23203
23207
  return {
23204
23208
  v: 1,
23205
23209
  app_id: null,
23206
23210
  kind,
23207
23211
  kit,
23208
23212
  ...renderer === void 0 ? {} : { renderer },
23213
+ ...rendererSource === void 0 ? {} : { renderer_source: rendererSource },
23209
23214
  validate: {
23210
23215
  problems: [],
23211
23216
  checks_skipped: [],
@@ -23241,6 +23246,15 @@ async function ownedFiles(dir) {
23241
23246
  return /* @__PURE__ */ new Set();
23242
23247
  }
23243
23248
  }
23249
+ async function recordedRenderer(dir) {
23250
+ try {
23251
+ const parsed2 = JSON.parse(await readFile8(reportPath(dir), "utf8"));
23252
+ if (parsed2.kind !== "dashboard") return null;
23253
+ return parsed2.renderer === "runtime" || parsed2.renderer === "widgets" ? parsed2.renderer : null;
23254
+ } catch {
23255
+ return null;
23256
+ }
23257
+ }
23244
23258
  function digestOf(text3) {
23245
23259
  return createHash3("sha256").update(text3, "utf8").digest("hex");
23246
23260
  }
@@ -31115,12 +31129,14 @@ var TRANSFORM_FIXES = {
31115
31129
  };
31116
31130
  var DECLARED_LOSS = "library_not_recorded";
31117
31131
  async function runCompile(dir, opts) {
31132
+ const recorded = await recordedRenderer(dir);
31118
31133
  const loaded = await loadContract(dir, opts);
31119
31134
  if ("exit" in loaded) return loaded.exit;
31120
- const { contract } = loaded;
31135
+ let { contract } = loaded;
31121
31136
  const kind = kindOf2(contract);
31122
31137
  const kit = kind === "dashboard" ? kit_default : kit_default2;
31123
- const report = emptyReport(kind, String(kit["name"] ?? "unknown"), rendererFor(contract));
31138
+ const offline = decideRenderer(contract, void 0, recorded);
31139
+ const report = emptyReport(kind, String(kit["name"] ?? "unknown"), offline.renderer, offline.source);
31124
31140
  report.app_id = appIdOf(contract);
31125
31141
  report.assemble = loaded.assemble;
31126
31142
  report.headline = loaded.headline;
@@ -31146,6 +31162,10 @@ async function runCompile(dir, opts) {
31146
31162
  } finally {
31147
31163
  client?.cleanup();
31148
31164
  }
31165
+ const decided = decideRenderer(contract, catalog.dashboard_renderer, recorded);
31166
+ contract = withRenderer(contract, decided.renderer);
31167
+ report.renderer = decided.renderer;
31168
+ report.renderer_source = decided.source;
31149
31169
  const { problems, skipped, warnings } = validateContract(contract, catalog);
31150
31170
  report.validate = {
31151
31171
  problems,
@@ -31946,7 +31966,9 @@ async function loadContract(dir, opts) {
31946
31966
  written: false
31947
31967
  };
31948
31968
  if (assembled.contract === null) {
31949
- const report = emptyReport("dashboard", String(kit_default["name"] ?? "dashboard-kit"));
31969
+ const recorded = await recordedRenderer(dir);
31970
+ const kitName = String(kit_default["name"] ?? "dashboard-kit");
31971
+ const report = recorded === null ? emptyReport("dashboard", kitName) : emptyReport("dashboard", kitName, recorded, "recorded");
31950
31972
  report.files = [...await ownedFiles(dir)].sort();
31951
31973
  const digests = await recordedDigests(dir);
31952
31974
  if (Object.keys(digests).length > 0) report.digests = digests;
@@ -32042,8 +32064,19 @@ function appIdOf(contract) {
32042
32064
  function composeOf(contract) {
32043
32065
  return composeLayout(contract).contract;
32044
32066
  }
32045
- function rendererFor(contract) {
32046
- return kindOf2(contract) === "dashboard" ? rendererOf2(contract) : null;
32067
+ function decideRenderer(contract, server, recorded) {
32068
+ if (kindOf2(contract) !== "dashboard") return { renderer: null, source: null };
32069
+ const app = isPlain(contract) && isPlain(contract["app"]) ? contract["app"] : {};
32070
+ if (app["renderer"] !== void 0) return { renderer: rendererOf2(contract), source: "contract" };
32071
+ if (server !== void 0) return { renderer: server, source: "server" };
32072
+ if (recorded !== null) return { renderer: recorded, source: "recorded" };
32073
+ return { renderer: "widgets", source: "legacy" };
32074
+ }
32075
+ function withRenderer(contract, renderer) {
32076
+ if (renderer !== "runtime" || kindOf2(contract) !== "dashboard" || !isPlain(contract)) return contract;
32077
+ const app = isPlain(contract["app"]) ? contract["app"] : {};
32078
+ if (app["renderer"] !== void 0) return contract;
32079
+ return { ...contract, app: { ...app, renderer: "runtime" } };
32047
32080
  }
32048
32081
  function layoutFills(contract) {
32049
32082
  const applied = composeLayout(
@@ -32088,7 +32121,8 @@ async function recordPulled(dir, contractWritten) {
32088
32121
  return forget();
32089
32122
  }
32090
32123
  const custom = ownedPaths(contract);
32091
- const report = emptyReport(kind, String(kit["name"] ?? "unknown"), rendererFor(contract));
32124
+ const pulledRenderer = decideRenderer(contract, void 0, null);
32125
+ const report = emptyReport(kind, String(kit["name"] ?? "unknown"), pulledRenderer.renderer, pulledRenderer.source);
32092
32126
  report.app_id = appIdOf(contract);
32093
32127
  report.origin = "get";
32094
32128
  const marked2 = kind === "app" || isRuntimeDashboard(contract);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarails-ai/dr-appspace-cli",
3
- "version": "0.12.48",
3
+ "version": "0.12.50",
4
4
  "description": "Datarails App Space CLI — build, try, push and publish App Space apps",
5
5
  "type": "module",
6
6
  "engines": {