@datarails-ai/dr-appspace-cli 0.12.43 → 0.12.44

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 +50 -15
  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.43",
16
+ version: "0.12.44",
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-26T22:09:35.276Z";
60
+ var BUILD_TIME = "2026-10-28T20:53:49.012Z";
61
61
  function formatBuildTime(iso) {
62
62
  if (iso === "") return "";
63
63
  const d = new Date(iso);
@@ -6518,6 +6518,17 @@ function readMount(scripts, problems) {
6518
6518
  }
6519
6519
  return null;
6520
6520
  }
6521
+ function pinsOfPages(pages) {
6522
+ const byPath = /* @__PURE__ */ new Map();
6523
+ for (const page of pages) {
6524
+ for (const pin of pinsOf(page, decodedTree(page.text))) {
6525
+ const found = byPath.get(pin.path);
6526
+ if (found) found.pages.push(page.path);
6527
+ else byPath.set(pin.path, { ...pin, pages: [page.path], order: byPath.size });
6528
+ }
6529
+ }
6530
+ return [...byPath.values()].map((pin) => ({ ...pin, pages: [...new Set(pin.pages)].sort() })).sort((a, b) => a.order - b.order);
6531
+ }
6521
6532
  function pinsOf(page, tree) {
6522
6533
  const pins = [];
6523
6534
  for (const element of tree.nodes) {
@@ -12210,16 +12221,16 @@ function metricFormatProblem(format) {
12210
12221
  }
12211
12222
 
12212
12223
  // ../flows/insights-builder/kit/contract/compileApp.mjs
12213
- var RUNTIME = "dr-app-runtime@1.13.1";
12224
+ var RUNTIME = "dr-app-runtime@1.13.2";
12214
12225
  var UI_KIT2 = "ui-kit/v4";
12215
12226
  var CHARTS = "echarts@5.6.0";
12216
12227
  var FMT = "dr-fmt@2.1.0";
12217
12228
  var TOKENS = "dr-tokens@1.0.0";
12218
- var WIDGETS = "dr-app-widgets@1.6.0";
12229
+ var WIDGETS = "dr-app-widgets@1.6.1";
12219
12230
  var COMPONENTS = "dr-components@1.6.0";
12220
12231
  var CONTROLS = "dr-components-controls@1.2.0";
12221
- var DASHBOARD_RUNTIME = "dr-app-runtime@1.13.1";
12222
- var DASHBOARD_WIDGETS = "dr-app-widgets@1.6.0";
12232
+ var DASHBOARD_RUNTIME = "dr-app-runtime@1.13.2";
12233
+ var DASHBOARD_WIDGETS = "dr-app-widgets@1.6.1";
12223
12234
  var DASHBOARD_BAR = "dr-app-dashboard@1.0.0";
12224
12235
  var ASSISTANT = "dr-insights@1.4.1";
12225
12236
  var MARKDOWN = "dr-md@1.0.0";
@@ -13802,7 +13813,7 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
13802
13813
  const order2 = emittedOrder(contract, elements, pages, tree);
13803
13814
  problems.push(...placementProblems(elements, pages, tree, order2));
13804
13815
  if (problems.length > 0) return { files: {}, problems, contract, warnings };
13805
- const whole = restate(contract, elements, pages, typed, order2);
13816
+ let whole = restate(contract, elements, pages, typed, order2);
13806
13817
  const served = servedSources({ ...elements, ...owned.readers }, sources);
13807
13818
  const transforms = transformTexts2(sources, extra);
13808
13819
  const files = {};
@@ -13818,14 +13829,31 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
13818
13829
  if (theme !== null) files[THEME_FILE4] = themeCss(theme);
13819
13830
  files[PALETTE_FILE] = paletteCss();
13820
13831
  if (pages.some((page) => page.owned !== true && tokensOn(page, elements))) files[BADGES_FILE] = badgesCss();
13821
- for (const page of pages) {
13822
- if (page.owned === true) continue;
13823
- files[page.path] = pageHtml2(whole, page, elements, tree, model, { runtime, uiKit, charts, fmt, appWidgets, appComponents, appControls, theme: theme !== null, extra });
13832
+ const pageOpts = { runtime, uiKit, charts, fmt, appWidgets, appComponents, appControls, theme: theme !== null, extra };
13833
+ const compiled = pages.filter((page) => page.owned !== true);
13834
+ for (const page of compiled) files[page.path] = pageHtml2(whole, page, elements, tree, model, pageOpts);
13835
+ const refreshed = refreshPins(whole, compiled, files);
13836
+ if (refreshed !== whole) {
13837
+ whole = refreshed;
13838
+ for (const page of compiled) files[page.path] = pageHtml2(whole, page, elements, tree, model, pageOpts);
13824
13839
  }
13825
13840
  if (typeof extra["seed.json"] === "string") files["seed.json"] = extra["seed.json"];
13826
13841
  files["tests.json"] = typeof extra["tests.json"] === "string" ? extra["tests.json"] : json(testsOf(handlers, names, sources, served));
13827
13842
  return { files, problems, contract: whole, order: order2, warnings };
13828
13843
  }
13844
+ function refreshPins(contract, compiled, files) {
13845
+ if (!Array.isArray(contract.pins)) return contract;
13846
+ const fresh = pinsOfPages(compiled.map((page) => ({ path: page.path, text: files[page.path] })));
13847
+ const written = new Set(compiled.map((page) => page.path));
13848
+ const kept = contract.pins.map((pin) => ({ ...pin, pages: (Array.isArray(pin.pages) ? pin.pages : []).filter((path3) => !written.has(path3)) })).filter((pin) => pin.pages.length > 0);
13849
+ const merged = fresh.map((pin) => ({ ...pin }));
13850
+ for (const old of kept) {
13851
+ const found = merged.find((pin) => pin.path === old.path);
13852
+ if (found) found.pages = [.../* @__PURE__ */ new Set([...found.pages, ...old.pages])].sort();
13853
+ else merged.push({ ...old, order: merged.length });
13854
+ }
13855
+ return { ...contract, pins: merged };
13856
+ }
13829
13857
  function restate(contract, elements, pages, typed, order2) {
13830
13858
  const data = dropEmptyDashboardData(contract.data);
13831
13859
  const unchanged = elements === typed && pages === contract.pages && data === contract.data;
@@ -23494,13 +23522,20 @@ async function runGet(appId, opts) {
23494
23522
  function registerGetCommand(parent) {
23495
23523
  withJsonOption(
23496
23524
  withServerOptions(
23497
- parent.command("get <app-id>").description("Write an app into a folder you can edit.").option(
23525
+ parent.command("get <app-id> [dir]").description("Write an app into a folder you can edit.").option(
23498
23526
  "--dir <path>",
23499
- "Where to write it. Defaults to a fresh temporary directory."
23527
+ "Where to write it (the same as the [dir] argument). Defaults to a fresh temporary directory."
23500
23528
  ).option("--force", "Replace files the compile record lists as yours even when they were never pushed.")
23501
23529
  )
23502
- ).action(async (appId, opts) => {
23503
- const code = await runGet(appId, opts);
23530
+ ).action(async (appId, dir, opts) => {
23531
+ const flag = (opts.dir ?? "").trim();
23532
+ if (dir !== void 0 && flag !== "" && flag !== dir) {
23533
+ process.stderr.write(`two folders were named (${dir} and --dir ${flag}). Name one.
23534
+ `);
23535
+ process.exitCode = 1;
23536
+ return;
23537
+ }
23538
+ const code = await runGet(appId, { ...opts, dir: dir ?? opts.dir });
23504
23539
  if (code !== 0) process.exitCode = code;
23505
23540
  });
23506
23541
  }
@@ -30904,7 +30939,7 @@ var kit_default2 = {
30904
30939
  checks: "checks/run.mjs",
30905
30940
  contract: "contract/extract.mjs",
30906
30941
  charts: "echarts@5.6.0",
30907
- appWidgets: "dr-app-widgets@1.6.0",
30942
+ appWidgets: "dr-app-widgets@1.6.1",
30908
30943
  appComponents: "dr-components@1.6.0",
30909
30944
  appControls: "dr-components-controls@1.2.0"
30910
30945
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarails-ai/dr-appspace-cli",
3
- "version": "0.12.43",
3
+ "version": "0.12.44",
4
4
  "description": "Datarails App Space CLI — build, try, push and publish App Space apps",
5
5
  "type": "module",
6
6
  "engines": {