@datarails-ai/dr-appspace-cli 0.12.41 → 0.12.42

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 +20 -6
  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.41",
16
+ version: "0.12.42",
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-26T20:45:54.689Z";
60
+ var BUILD_TIME = "2026-10-26T20:49:33.152Z";
61
61
  function formatBuildTime(iso) {
62
62
  if (iso === "") return "";
63
63
  const d = new Date(iso);
@@ -24056,11 +24056,15 @@ function missingLibraries(page) {
24056
24056
  const loaded = elements.filter((el) => el.tag === "script" && el.attrs.src !== void 0).map((el) => resolveFromPlatformRoot(page.path, el.attrs.src)).filter((target) => target !== null);
24057
24057
  return RUNTIME_LIBRARIES.filter((library) => !loaded.some((target) => library.pattern.test(target)));
24058
24058
  }
24059
- function libraryOrderProblems(page) {
24059
+ function libraryOrderProblems(page, files = []) {
24060
24060
  const { elements, scripts } = parseHtml(page.text);
24061
24061
  const indexOf = (module) => elements.findIndex((el) => el.tag === "script" && el.attrs.src !== void 0 && RUNTIME_LIBRARIES.find((one) => one.module === module).pattern.test(resolveFromPlatformRoot(page.path, el.attrs.src) ?? ""));
24062
24062
  const inline = elements.filter((el) => el.tag === "script" && !("src" in el.attrs));
24063
- const mountScript = inline.find((el, index) => runsInPlace(el) && MOUNT_CALL.test(withoutRegexLiterals(executableText(scripts[index]?.text ?? ""))));
24063
+ const textOf3 = (el) => "src" in el.attrs ? files.find((file) => file.path === resolveInBundle(page.path, el.attrs.src))?.text : scripts[inline.indexOf(el)]?.text;
24064
+ const calls = (text3) => typeof text3 === "string" && MOUNT_CALL.test(withoutRegexLiterals(executableText(text3)));
24065
+ const runs = (el) => runsInPlace(el) || (el.attrs.type ?? "").trim().toLowerCase() === "module";
24066
+ const mounts = elements.filter((el) => el.tag === "script" && runs(el) && calls(textOf3(el)));
24067
+ const mountScript = mounts.find((el) => !runsAfterParsing(el));
24064
24068
  const mount = mountScript === void 0 ? -1 : elements.indexOf(mountScript);
24065
24069
  const runtime = indexOf("dr-app-runtime");
24066
24070
  const problems = [];
@@ -24082,12 +24086,21 @@ function libraryOrderProblems(page) {
24082
24086
  if (mount !== -1 && bar !== -1 && bar > mount) {
24083
24087
  problems.push(`dr-app-dashboard is loaded after the page's drApp.mount(...); the bar must be registered before the mount, or the cards load without waiting for the filters it settles`);
24084
24088
  }
24089
+ if (mounts.length === 0) {
24090
+ problems.push(`no script ${page.path} runs calls drApp.mount(...); the runtime mounts nothing by itself, so every card on the page stays an empty section \u2014 end the page with <script>drApp.mount({page: "${page.path}"})</script>, after the runtime libraries`);
24091
+ }
24085
24092
  return problems;
24086
24093
  }
24087
24094
  function runsInPlace(el) {
24088
24095
  const type = (el.attrs.type ?? "").trim().toLowerCase();
24089
24096
  return type === "" || JAVASCRIPT_TYPES.has(type);
24090
24097
  }
24098
+ function runsAfterParsing(el) {
24099
+ const module = (el.attrs.type ?? "").trim().toLowerCase() === "module";
24100
+ const loaded = "src" in el.attrs;
24101
+ if ("async" in el.attrs && (module || loaded)) return false;
24102
+ return module || loaded && "defer" in el.attrs;
24103
+ }
24091
24104
  var JAVASCRIPT_TYPES = /* @__PURE__ */ new Set([
24092
24105
  "application/ecmascript",
24093
24106
  "application/javascript",
@@ -24155,7 +24168,8 @@ function specSource(data, card) {
24155
24168
  const row = own(isPlainObject11(data?.widgets) ? data.widgets : {}, key);
24156
24169
  if (!isPlainObject11(row)) return;
24157
24170
  cite(row.source);
24158
- if (typeof row.data === "string") readsOf(row.data);
24171
+ const dataset = typeof row.data === "string" ? row.data.split(".")[0] : isPlainObject11(row.data) ? row.data.dataset : void 0;
24172
+ if (named6(dataset)) readsOf(dataset);
24159
24173
  for (const next of [...listOf2(row.depends), ...listOf2(row.about)]) visit(next);
24160
24174
  };
24161
24175
  visit(card);
@@ -24468,7 +24482,7 @@ function checkPage2(app, page, kit, runtime = null) {
24468
24482
  const missing = runtime === null ? [] : missingLibraries(page).map((one) => one.module);
24469
24483
  const library = runtime === null ? loadsModule(page.path, page.text, WIDGET_LIBRARY2) : !missing.includes("dr-app-runtime") && !missing.includes("dr-app-widgets");
24470
24484
  violations.push(...checkLibraryDraws(page, library, scripts, runtime === null ? null : missing));
24471
- if (runtime !== null) for (const problem6 of libraryOrderProblems(page)) violations.push({ rule: "R2.6", where: page.path, message: problem6 });
24485
+ if (runtime !== null) for (const problem6 of libraryOrderProblems(page, app.ui)) violations.push({ rule: "R2.6", where: page.path, message: problem6 });
24472
24486
  if (widgets.length > 0 && !library && !/drInsights\.setData\s*\(/.test(scriptText)) {
24473
24487
  violations.push({
24474
24488
  rule: "R3.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarails-ai/dr-appspace-cli",
3
- "version": "0.12.41",
3
+ "version": "0.12.42",
4
4
  "description": "Datarails App Space CLI — build, try, push and publish App Space apps",
5
5
  "type": "module",
6
6
  "engines": {