brumate 0.4.3 → 0.4.4
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.js +2 -2
- package/dist/{client-AXNULmRZ.js → client-iZ9a1Nut.js} +17 -8
- package/dist/client-iZ9a1Nut.js.map +1 -0
- package/dist/{defer-D3YMPgkX.js → defer-DP7dMS2y.js} +2 -2
- package/dist/{defer-D3YMPgkX.js.map → defer-DP7dMS2y.js.map} +1 -1
- package/dist/{devtools-BiP5fDiB.js → devtools-BJB_MMeL.js} +4 -4
- package/dist/{devtools-BiP5fDiB.js.map → devtools-BJB_MMeL.js.map} +1 -1
- package/dist/{devtools-panel-EQhLm39H.js → devtools-panel-CUV6A4ZE.js} +2 -2
- package/dist/{devtools-panel-EQhLm39H.js.map → devtools-panel-CUV6A4ZE.js.map} +1 -1
- package/dist/{files-BUjvEO_o.js → files-BZRjz9Mx.js} +2 -2
- package/dist/{files-BUjvEO_o.js.map → files-BZRjz9Mx.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{inspect-BvPTZs6k.js → inspect-BLOdfj7o.js} +2 -1
- package/dist/inspect-BLOdfj7o.js.map +1 -0
- package/dist/{loader-DgMk6p9M.js → loader-CheV6t0N.js} +2 -2
- package/dist/{loader-DgMk6p9M.js.map → loader-CheV6t0N.js.map} +1 -1
- package/dist/{rpc-Bxv7DYGe.js → rpc-DvTwGfL_.js} +2 -2
- package/dist/{rpc-Bxv7DYGe.js.map → rpc-DvTwGfL_.js.map} +1 -1
- package/dist/runtime/client.js +1 -1
- package/dist/runtime/devtools.js +1 -1
- package/dist/runtime/loader.js +2 -2
- package/dist/runtime/static-loader.js +1 -1
- package/dist/runtime/testing.js +1 -1
- package/dist/{static-loader-U_x-ctJI.js → static-loader-BLJYvTKc.js} +2 -2
- package/dist/{static-loader-U_x-ctJI.js.map → static-loader-BLJYvTKc.js.map} +1 -1
- package/dist/vite.js +2 -2
- package/package.json +1 -1
- package/skills/brumate/references/errors.md +20 -0
- package/dist/client-AXNULmRZ.js.map +0 -1
- package/dist/inspect-BvPTZs6k.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { B as getLocation, H as findError, j as analyzeProjectProps, o as CompileError, r as inspect, s as compile, w as resolveFromDisk, z as BrumateError } from "./inspect-
|
|
3
|
-
import { h as findPackages, o as findPackageServerFile, s as findServerImport, t as collectSources, v as resolveComponentPackage } from "./files-
|
|
2
|
+
import { B as getLocation, H as findError, j as analyzeProjectProps, o as CompileError, r as inspect, s as compile, w as resolveFromDisk, z as BrumateError } from "./inspect-BLOdfj7o.js";
|
|
3
|
+
import { h as findPackages, o as findPackageServerFile, s as findServerImport, t as collectSources, v as resolveComponentPackage } from "./files-BZRjz9Mx.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
6
|
import { cp } from "node:fs/promises";
|
|
@@ -967,9 +967,13 @@ function fail(scope, error) {
|
|
|
967
967
|
const entry = module?.t?.[current.k];
|
|
968
968
|
if (!entry) continue;
|
|
969
969
|
let owner = current.p;
|
|
970
|
-
|
|
970
|
+
let body = current;
|
|
971
|
+
while (owner && owner.k !== entry[0]) {
|
|
972
|
+
body = owner;
|
|
973
|
+
owner = owner.p;
|
|
974
|
+
}
|
|
971
975
|
if (owner) {
|
|
972
|
-
await catchInto(owner, module, entry, error);
|
|
976
|
+
await catchInto(owner, body, module, entry, error);
|
|
973
977
|
return;
|
|
974
978
|
}
|
|
975
979
|
}
|
|
@@ -1006,9 +1010,12 @@ function failBoundary(error) {
|
|
|
1006
1010
|
options.onError?.(error, {});
|
|
1007
1011
|
unhandled(error);
|
|
1008
1012
|
}
|
|
1009
|
-
/**
|
|
1010
|
-
|
|
1013
|
+
/**
|
|
1014
|
+
* Renders the `#catch` body of a `#try` with an error, in place of `body`, the body that failed.
|
|
1015
|
+
*/
|
|
1016
|
+
async function catchInto(owner, body, module, [, anchor, , fallback, kinds, holderKind, holderAnchor], error) {
|
|
1011
1017
|
const updates = await loadPart(module, "update");
|
|
1018
|
+
if (scopes.get(body.id) !== body) return;
|
|
1012
1019
|
const start = blockStart(owner, anchor);
|
|
1013
1020
|
if (!start) return;
|
|
1014
1021
|
const end = rangeEnd(start);
|
|
@@ -1548,7 +1555,7 @@ function queue(fn, name, target) {
|
|
|
1548
1555
|
if (!failed && scopes.get(target.id) === target) try {
|
|
1549
1556
|
if (stuck) {
|
|
1550
1557
|
failed = true;
|
|
1551
|
-
throw new Error(DEV ?
|
|
1558
|
+
throw new Error(DEV ? `The ${name[0] === "e" ? "effect" : "update"} ${name} of ${findRoot(target).m} did not settle: it writes a value that it reads, and runs again without end. Wrap the read or the write in $untrack, or write only when the value changes [BRM187]` : `Update loop ${key} [BRM187]`);
|
|
1552
1559
|
}
|
|
1553
1560
|
const before = origin;
|
|
1554
1561
|
origin = from;
|
|
@@ -1638,10 +1645,12 @@ function drain() {
|
|
|
1638
1645
|
function flushEffects() {
|
|
1639
1646
|
if (flushing) return;
|
|
1640
1647
|
flushing = true;
|
|
1648
|
+
let rounds = 0;
|
|
1641
1649
|
try {
|
|
1642
1650
|
while (pendingEffects.size > 0) {
|
|
1643
1651
|
const run = [...pendingEffects.values()];
|
|
1644
1652
|
pendingEffects.clear();
|
|
1653
|
+
if (stuck = ++rounds > 1e3) rounds = 0;
|
|
1645
1654
|
pass(() => {
|
|
1646
1655
|
for (const runEffect of run) runEffect();
|
|
1647
1656
|
});
|
|
@@ -1983,12 +1992,12 @@ function action(name, id, method, result) {
|
|
|
1983
1992
|
* call loads, so the core holds only this.
|
|
1984
1993
|
*/
|
|
1985
1994
|
function submitAction(form, submitter) {
|
|
1986
|
-
import("./rpc-
|
|
1995
|
+
import("./rpc-DvTwGfL_.js").then((module) => module.sendAction(form, submitter));
|
|
1987
1996
|
}
|
|
1988
1997
|
/** Calls a server function. */
|
|
1989
1998
|
async function rpc(id, args) {
|
|
1990
1999
|
const signal = memoSignal();
|
|
1991
|
-
return track(import("./rpc-
|
|
2000
|
+
return track(import("./rpc-DvTwGfL_.js").then((module) => module.call(rpcPrefix, id, args, signal)));
|
|
1992
2001
|
}
|
|
1993
2002
|
/** A function prop rendered on the client calls the parent's exported handler. */
|
|
1994
2003
|
function handlerProp(value, ref, scope, bound = [], modifiers) {
|
|
@@ -3558,4 +3567,4 @@ const loader = {
|
|
|
3558
3567
|
//#endregion
|
|
3559
3568
|
export { dispose as $, scopes as $t, branchNodes as A, timed as At, putText as B, descendants as Bt, dynamicNodes as C, effect as Ct, setItem as D, pending as Dt, place as E, memo as Et, keep as F, children as Ft, setSpread as G, sink as Gt, setAttrText as H, makeId as Ht, keepText as I, insert as It, fill as J, nameComment as Jt, template as K, loadModule as Kt, listNodes as L, title as Lt, fillBranch as M, update as Mt, fillList as N, updated as Nt, setSlots as O, resolve as Ot, fillSettled as P, fail as Pt, retag as Q, rpcPrefix as Qt, markBlock as R, afterInsert as Rt, dynamic as S, cells as St, foreignNodes as T, isBound as Tt, setContent as U, removeScope as Ut, setAttr as V, getScope as Vt, setOn as W, setOwner as Wt, rekey as X, build as Xt, offscreen as Y, DEVTOOLS as Yt, reset as Z, hooks as Zt, writeText as _, updateContext as _t, deferInBrowser as a, removeRoot as at, component as b, binding as bt, toList as c, handlerProp as ct, attr as d, submitAction as dt, skew as en, forget as et, attrs as f, guess as ft, text as g, setGlobal as gt, restRef as h, provideValue as ht, addStyle as i, remount as it, clone as j, unreadMemo as jt, appendText as k, set as kt, windowList as l, rpc as lt, portalTo as m, consumeContext as mt, addHead as n, leavePage as nt, setVar as o, action as ot, content as p, track as pt, branch as q, loadPart as qt, addPortal as r, leaveRoutes as rt, list as s, handle as st, loader as t, init as tt, windowStart as u, spread as ut, prop as v, updateRoute as vt, elementAt as w, get as wt, componentNodes as x, bindings as xt, spreadProps as y, asyncMemo as yt, nodes as z, createScope as zt };
|
|
3560
3569
|
|
|
3561
|
-
//# sourceMappingURL=client-
|
|
3570
|
+
//# sourceMappingURL=client-iZ9a1Nut.js.map
|