@wix/himalaya-cli 0.892.0 → 0.894.0
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.
- package/dist/cli.mjs +32 -7
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -28784,6 +28784,7 @@ __export(widgets_exports, {
|
|
|
28784
28784
|
MAX_PRODUCE_CACHE_ENTRIES: () => MAX_PRODUCE_CACHE_ENTRIES,
|
|
28785
28785
|
PRODUCE_CACHE_TTL_MS: () => PRODUCE_CACHE_TTL_MS,
|
|
28786
28786
|
WIDGET_BUDGET_MS: () => WIDGET_BUDGET_MS,
|
|
28787
|
+
WidgetRealmUnavailableError: () => WidgetRealmUnavailableError,
|
|
28787
28788
|
buildViewSnapshot: () => buildViewSnapshot,
|
|
28788
28789
|
buildWidgetSnapshot: () => buildWidgetSnapshot,
|
|
28789
28790
|
describeThrown: () => describeThrown,
|
|
@@ -28811,9 +28812,7 @@ async function widgetRealm() {
|
|
|
28811
28812
|
try {
|
|
28812
28813
|
return await realmPromise;
|
|
28813
28814
|
} catch (err) {
|
|
28814
|
-
throw new
|
|
28815
|
-
"the widget producer's isolated realm (QuickJS-in-WASM) could not be loaded, so widget bundles would have been evaluated in node:vm (which is not a security boundary): " + (err instanceof Error ? err.message : String(err))
|
|
28816
|
-
);
|
|
28815
|
+
throw new WidgetRealmUnavailableError(err);
|
|
28817
28816
|
}
|
|
28818
28817
|
}
|
|
28819
28818
|
function resetWidgetRealm() {
|
|
@@ -29433,7 +29432,7 @@ function freezeOverrideSnapshot(input, opts = {}) {
|
|
|
29433
29432
|
}
|
|
29434
29433
|
return snapshot2;
|
|
29435
29434
|
}
|
|
29436
|
-
var MAX_TIMELINE_FRAMES, WIDGET_BUDGET_MS, realmPromise, PRODUCE_CACHE_TTL_MS, MAX_PRODUCE_CACHE_ENTRIES, MAX_PRODUCE_ENTRY_BYTES, MAX_PRODUCE_CACHE_BYTES, produceCache, produceCacheGeneration, CAPTURE_SLOT, READBACK_SERVICE;
|
|
29435
|
+
var MAX_TIMELINE_FRAMES, WIDGET_BUDGET_MS, realmPromise, WidgetRealmUnavailableError, PRODUCE_CACHE_TTL_MS, MAX_PRODUCE_CACHE_ENTRIES, MAX_PRODUCE_ENTRY_BYTES, MAX_PRODUCE_CACHE_BYTES, produceCache, produceCacheGeneration, CAPTURE_SLOT, READBACK_SERVICE;
|
|
29437
29436
|
var init_widgets = __esm({
|
|
29438
29437
|
"../../core/dev-server/src/widgets.ts"() {
|
|
29439
29438
|
init_validator();
|
|
@@ -29441,6 +29440,15 @@ var init_widgets = __esm({
|
|
|
29441
29440
|
MAX_TIMELINE_FRAMES = 48;
|
|
29442
29441
|
WIDGET_BUDGET_MS = 5e3;
|
|
29443
29442
|
realmPromise = null;
|
|
29443
|
+
WidgetRealmUnavailableError = class extends Error {
|
|
29444
|
+
constructor(cause) {
|
|
29445
|
+
super(
|
|
29446
|
+
"the widget producer's isolated realm (QuickJS-in-WASM) could not be loaded, so widget bundles would have been evaluated in node:vm (which is not a security boundary): " + describeThrown(cause)
|
|
29447
|
+
);
|
|
29448
|
+
this.cause = cause;
|
|
29449
|
+
this.name = "WidgetRealmUnavailableError";
|
|
29450
|
+
}
|
|
29451
|
+
};
|
|
29444
29452
|
PRODUCE_CACHE_TTL_MS = 6e4;
|
|
29445
29453
|
MAX_PRODUCE_CACHE_ENTRIES = 2048;
|
|
29446
29454
|
MAX_PRODUCE_ENTRY_BYTES = 4 * 1024 * 1024;
|
|
@@ -31871,18 +31879,32 @@ async function scanWidgets(dir) {
|
|
|
31871
31879
|
out.push({ ...e, bundle: name });
|
|
31872
31880
|
}
|
|
31873
31881
|
} catch (err) {
|
|
31882
|
+
if (err instanceof WidgetRealmUnavailableError) throw err;
|
|
31874
31883
|
console.warn(`[widgets] skipped bundle "${name}": ${describeThrown(err)}`);
|
|
31875
31884
|
}
|
|
31876
31885
|
}
|
|
31877
31886
|
return out;
|
|
31878
31887
|
}
|
|
31879
31888
|
async function handleWidgetList(res, dir) {
|
|
31880
|
-
|
|
31889
|
+
try {
|
|
31890
|
+
sendJson(res, 200, { widgets: await scanWidgets(dir) });
|
|
31891
|
+
} catch (err) {
|
|
31892
|
+
if (!(err instanceof WidgetRealmUnavailableError)) throw err;
|
|
31893
|
+
console.error(`[widgets] ${err.message}`);
|
|
31894
|
+
sendJson(res, 503, { error: "widget_realm_unavailable", message: err.message });
|
|
31895
|
+
}
|
|
31881
31896
|
}
|
|
31882
31897
|
async function buildSnapshotForId(widgetId, dir) {
|
|
31883
31898
|
const override = widgetOverrides.get(widgetId);
|
|
31884
31899
|
if (override) return { ok: true, snapshot: override };
|
|
31885
|
-
|
|
31900
|
+
let entry;
|
|
31901
|
+
try {
|
|
31902
|
+
entry = (await scanWidgets(dir)).find((w) => w.widgetId === widgetId);
|
|
31903
|
+
} catch (err) {
|
|
31904
|
+
if (!(err instanceof WidgetRealmUnavailableError)) throw err;
|
|
31905
|
+
console.error(`[widgets] ${err.message}`);
|
|
31906
|
+
return { ok: false, status: 503, error: "widget_realm_unavailable", message: err.message };
|
|
31907
|
+
}
|
|
31886
31908
|
if (!entry) return { ok: false, status: 404, error: "widget_not_found" };
|
|
31887
31909
|
const loaded = await readBundleFile(entry.bundle, dir);
|
|
31888
31910
|
if (!loaded) return { ok: false, status: 404, error: "widget_not_found" };
|
|
@@ -55581,7 +55603,10 @@ async function producedWidgetFamilies(dir) {
|
|
|
55581
55603
|
let extracted;
|
|
55582
55604
|
try {
|
|
55583
55605
|
extracted = await widgetsModule.extractWidgets(js);
|
|
55584
|
-
} catch {
|
|
55606
|
+
} catch (err) {
|
|
55607
|
+
if (err instanceof widgetsModule.WidgetRealmUnavailableError) {
|
|
55608
|
+
return { families: void 0, source: "producer-unavailable" };
|
|
55609
|
+
}
|
|
55585
55610
|
continue;
|
|
55586
55611
|
}
|
|
55587
55612
|
for (const [widgetId, def] of Object.entries(extracted.widgets)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.894.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"artifactId": "himalaya-cli"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
"falconPackageHash": "
|
|
67
|
+
"falconPackageHash": "affa459271349fb75d39f363707412430dc0902c842942e21e921614"
|
|
68
68
|
}
|