@bud.sh/app 0.5.1 → 0.6.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/README.md +41 -31
- package/dist/client/assets/bud/design.js +1 -1
- package/dist/client/assets/canvas-Bih9EdKJ.js +1 -0
- package/dist/client/assets/difference-worker-Bzg-rizy.js +8 -0
- package/dist/client/assets/dist-CdE5wBkg.js +5 -0
- package/dist/client/assets/files-1dLuoM2f.js +1 -0
- package/dist/client/assets/i18n-CkO6VFI0.js +1 -0
- package/dist/client/assets/index-Cn2mxroU.css +2 -0
- package/dist/client/assets/{index-Dn2pfmXf.js → index-DtISWZp9.js} +2 -2
- package/dist/client/assets/pages-BJ-tNJ4J.js +1 -0
- package/dist/client/assets/{project-branches-CMGRmrqr.js → project-branches-Ce3rXrkc.js} +1 -1
- package/dist/client/assets/project-comments-CPUONfs8.js +1 -0
- package/dist/client/assets/project-thread-links-C-TGkq59.js +1 -0
- package/dist/client/assets/{project-threads-ZbKDh78d.js → project-threads-Bv7IDBgi.js} +105 -105
- package/dist/client/assets/project-work-DAE9-olg.js +1 -0
- package/dist/client/assets/{task-design-BPpc4Gd7.js → task-design-CwySIAOl.js} +3 -3
- package/dist/client/assets/tasks-KWsCLi_h.js +3 -0
- package/dist/client/assets/wasm-inline-DSUyFn1L.js +1 -0
- package/dist/client/assets/workspace-CVdcfaaB.js +2 -0
- package/dist/client/index.html +3 -3
- package/dist/hosted/assets/{canvas-BYTOp1p7.js → canvas-AII16n9i.js} +97 -6
- package/dist/hosted/assets/{comment-data-Cn5y2VxV.js → comment-data-BXfMElfx.js} +1998 -381
- package/dist/hosted/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/hosted/assets/{files-B1P2_24q.js → files-D_1yeAVO.js} +10 -5
- package/dist/hosted/assets/{pages-B0ZlVdci.js → pages-CN_SbKWA.js} +3 -3
- package/dist/hosted/assets/{project-branches-DlCWmfRo.js → project-branches-Bxp0DCwg.js} +1 -1
- package/dist/hosted/assets/{project-thread-links-BZXQ200n.js → project-thread-links-KqQoKBLE.js} +76 -4
- package/dist/{node-host/assets/screen-DapOVrga.js → hosted/assets/screen-DpAcDUKR.js} +25 -1
- package/dist/hosted/assets/tasks-D66LlwxM.js +1423 -0
- package/dist/hosted/assets/wasm-inline-Dl9tqabx.js +4 -0
- package/dist/hosted/hosted.js +7885 -6219
- package/dist/node/assets/Stream-CAm1eJ2n.js +16604 -0
- package/dist/{server/assets/bridge-B_Blt55E.js → node/assets/bridge-DQSBYHmw.js} +124 -290
- package/dist/node/assets/config-9_jWwNBh.js +1067 -0
- package/dist/node/assets/load-config.server-CMVtRVmO.js +261 -0
- package/dist/node/assets/module-3GgtT4Xs.js +308 -0
- package/dist/node/assets/server-DTQFuoX2.js +846 -0
- package/dist/node/assets/src-D-kG1GxB.js +2 -0
- package/dist/node/assets/{src-CerrKjID.js → src-Dwe9APUx.js} +93 -3
- package/dist/node/assets/src-DysjfbM8.js +8592 -0
- package/dist/node/bridge.js +1 -845
- package/dist/node/cli.js +206 -0
- package/dist/node/design.js +811 -8
- package/dist/node/index.js +2 -739
- package/dist/node/plugins.js +5711 -0
- package/dist/node/server.js +1 -6746
- package/dist/node/vite.js +121 -0
- package/dist/{server/assets/canvas-CkMK4hoN.js → node-host/assets/canvas-BeDoufy1.js} +97 -7
- package/dist/node-host/assets/{comment-data-yfWEdDQL.js → comment-data-DE2T9yTj.js} +1974 -355
- package/dist/node-host/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/node-host/assets/{files-anHi-apm.js → files-Dl-PTS09.js} +11 -6
- package/dist/node-host/assets/{pages-CW4aF6dK.js → pages-DL2sk6_U.js} +3 -3
- package/dist/node-host/assets/{project-branches-D7rVCxQX.js → project-branches-DGp5ELct.js} +1 -1
- package/dist/{server/assets/project-thread-links-lLS_rq7c.js → node-host/assets/project-thread-links-CgBV3Jcm.js} +76 -5
- package/dist/{hosted/assets/screen-CfdC3NbR.js → node-host/assets/screen-B55yyVfb.js} +25 -1
- package/dist/node-host/assets/tasks-DZRNkoxe.js +1425 -0
- package/dist/node-host/assets/wasm-inline-Dl9tqabx.js +4 -0
- package/dist/node-host/node-host.js +6127 -4438
- package/dist/server/assets/{branch-previews-ClkoJ0lM.js → branch-previews-DedrpnVR.js} +1555 -673
- package/dist/{node-host/assets/canvas-DxmcFZCh.js → server/assets/canvas-CJWQ-jjv.js} +98 -6
- package/dist/server/assets/{comment-data-NLeHG89b.js → comment-data-Rg42ToTW.js} +1660 -26
- package/dist/server/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/server/assets/{events-iHpLGr3k.js → events-BH_rAu7O.js} +155 -20
- package/dist/server/assets/{files-CRdl489E.js → files-CPJqKeMo.js} +12 -7
- package/dist/server/assets/{listener-BAYn9Q-u.js → listener-D61O6PzF.js} +708 -12
- package/dist/server/assets/{pages-DXVlJlBC.js → pages-KJY_Ba92.js} +4 -4
- package/dist/server/assets/{project-branches-CwTsf6WQ.js → project-branches-qG9ACZvo.js} +2 -2
- package/dist/{node-host/assets/project-thread-links-m-OLpsD9.js → server/assets/project-thread-links-CqK0lqCF.js} +77 -4
- package/dist/{node-host/assets/tasks-request-B0aeNocI.js → server/assets/project-work-DoIwxWMm.js} +87 -2
- package/dist/server/assets/run-BJ8r5jSh.js +572 -0
- package/dist/server/assets/{screen-B1zH_1O3.js → screen-CBrHPFug.js} +26 -2
- package/dist/server/assets/{server-DxK-UB_Z.js → server-Dkbp5stG.js} +1521 -793
- package/dist/server/assets/{services-BRrgXYlT.js → services-BTfig8A8.js} +234 -997
- package/dist/server/assets/tasks-Bgu5Lg9Y.js +1427 -0
- package/dist/server/assets/wasm-inline-Dl9tqabx.js +4 -0
- package/dist/server/capture.js +1 -2
- package/dist/server/migration.js +569 -12
- package/dist/server/runtime.js +7 -5
- package/dist/server/server.js +3 -3
- package/dist/types/assets/{config-DIC2cf_S.d.ts → config-CvcYmE2s.d.ts} +188 -50
- package/dist/types/assets/{contract-CAT-XFNq.d.ts → contract-B7yuuqSn.d.ts} +44 -2
- package/dist/types/assets/{items-CaVkByHk.d.ts → items-BQdaVksf.d.ts} +12 -1
- package/dist/types/assets/memory-state-BBW-FAVA.d.ts +236 -0
- package/dist/types/assets/picker-Be5Gx4WR.d.ts +9 -0
- package/dist/types/assets/{task-design-xJOhRNWh.d.ts → task-design-BDHKFHpp.d.ts} +3 -1
- package/dist/types/bridge.d.ts +1 -1
- package/dist/types/companion.d.ts +3 -3
- package/dist/types/design.d.ts +2 -2
- package/dist/types/hosted.d.ts +3 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/node-host.d.ts +2 -2
- package/dist/types/plugins.d.ts +445 -0
- package/dist/types/screen.d.ts +2 -2
- package/dist/types/server.d.ts +2 -228
- package/dist/types/vite.d.ts +16 -0
- package/package.json +19 -3
- package/dist/client/assets/canvas-8GXJIuDK.js +0 -1
- package/dist/client/assets/difference-worker-C99ychYw.js +0 -8
- package/dist/client/assets/files-DkWt1l9H.js +0 -1
- package/dist/client/assets/i18n-hH_Ba5QO.js +0 -1
- package/dist/client/assets/index-tpHYVXma.css +0 -2
- package/dist/client/assets/pages-BVd6MQmu.js +0 -1
- package/dist/client/assets/project-comments-D1IIQwsW.js +0 -1
- package/dist/client/assets/project-thread-links-DKwe_SYb.js +0 -1
- package/dist/client/assets/project-work-D4DZqBCZ.js +0 -1
- package/dist/client/assets/tasks-Cn0VOZ9Z.js +0 -1
- package/dist/client/assets/tasks-request-BLyOzokZ.js +0 -1
- package/dist/client/assets/workspace-DGErsSg6.js +0 -2
- package/dist/hosted/assets/tasks-_yKh2Z6q.js +0 -649
- package/dist/hosted/assets/tasks-request-CFPLvLc7.js +0 -113
- package/dist/node-host/assets/tasks-BBK_CybR.js +0 -651
- package/dist/server/assets/project-work-CSZlCwH-.js +0 -88
- package/dist/server/assets/tasks-CGdz-uox.js +0 -652
- package/dist/server/assets/tasks-request-D2NBjCTl.js +0 -115
- package/dist/types/assets/picker-D1Bw3ndx.d.ts +0 -14
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { E as parseWorkChange, an as parseWorkWorkspace, i as routes } from "./events-iHpLGr3k.js";
|
|
2
|
-
import { d as saveWorkspace, l as projectStore, v as projectLive, x as writeRows, y as plainRow } from "./comment-data-NLeHG89b.js";
|
|
3
|
-
import { n as requestTasks } from "./tasks-request-D2NBjCTl.js";
|
|
4
|
-
//#region app/client/project-work.ts
|
|
5
|
-
var syncs = /* @__PURE__ */ new Map();
|
|
6
|
-
/**
|
|
7
|
-
* Keeps the project's stored board current for the page's lifetime, once a screen read it:
|
|
8
|
-
* live task changes are stored as they arrive, and lost history reads the whole board again.
|
|
9
|
-
* @param project - The project to follow.
|
|
10
|
-
* @param fetcher - Injectable transport.
|
|
11
|
-
* @returns The project's work sync.
|
|
12
|
-
*/
|
|
13
|
-
function projectWork(project, fetcher = fetch) {
|
|
14
|
-
let existing = syncs.get(project.id);
|
|
15
|
-
if (existing) return existing;
|
|
16
|
-
let reading;
|
|
17
|
-
let queued;
|
|
18
|
-
let live = null;
|
|
19
|
-
let store = projectStore(project);
|
|
20
|
-
async function read() {
|
|
21
|
-
live = {
|
|
22
|
-
items: /* @__PURE__ */ new Set(),
|
|
23
|
-
schema: false
|
|
24
|
-
};
|
|
25
|
-
try {
|
|
26
|
-
let workspace = await requestTasks(routes.tasksApi.workspace.href(), project.token, new AbortController().signal, parseWorkWorkspace, fetcher);
|
|
27
|
-
let opened = await store;
|
|
28
|
-
await saveWorkspace(opened, workspace, live);
|
|
29
|
-
return workspace;
|
|
30
|
-
} finally {
|
|
31
|
-
live = null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function refresh(signal) {
|
|
35
|
-
queued ??= (reading ?? Promise.resolve()).catch(() => {}).then(() => {
|
|
36
|
-
queued = void 0;
|
|
37
|
-
let started = read();
|
|
38
|
-
reading = started;
|
|
39
|
-
started.catch(() => {}).finally(() => {
|
|
40
|
-
if (reading === started) reading = void 0;
|
|
41
|
-
});
|
|
42
|
-
return started;
|
|
43
|
-
});
|
|
44
|
-
return abortable(queued, signal);
|
|
45
|
-
}
|
|
46
|
-
function reread() {
|
|
47
|
-
refresh().catch(() => {});
|
|
48
|
-
}
|
|
49
|
-
async function apply(opened, data) {
|
|
50
|
-
let board = opened.boards.get("board");
|
|
51
|
-
if (!board) return;
|
|
52
|
-
let change = parseWorkChange(data, board.schema);
|
|
53
|
-
if (change.type === "reset") return reread();
|
|
54
|
-
if (live) {
|
|
55
|
-
if (change.type === "schema") live.schema = true;
|
|
56
|
-
else live.items.add(change.type === "upsert" ? change.item.id : change.id);
|
|
57
|
-
}
|
|
58
|
-
if (change.type === "schema") return writeRows(opened.boards, { upsert: [{
|
|
59
|
-
...plainRow(board),
|
|
60
|
-
schema: change.schema,
|
|
61
|
-
schemaVersion: change.schema.adapter.version
|
|
62
|
-
}] });
|
|
63
|
-
await writeRows(opened.work, change.type === "upsert" ? { upsert: [change.item] } : { delete: [change.id] });
|
|
64
|
-
}
|
|
65
|
-
let applying = Promise.resolve();
|
|
66
|
-
projectLive(project.token).subscribe("work", {
|
|
67
|
-
onEvent(data) {
|
|
68
|
-
applying = applying.then(() => store).then((opened) => apply(opened, data)).catch((e) => {
|
|
69
|
-
reread();
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
onResync() {
|
|
73
|
-
store.then((opened) => opened.boards.has("board") && reread());
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
let sync = { refresh };
|
|
77
|
-
syncs.set(project.id, sync);
|
|
78
|
-
return sync;
|
|
79
|
-
}
|
|
80
|
-
function abortable(promise, signal) {
|
|
81
|
-
if (!signal) return promise;
|
|
82
|
-
return Promise.race([promise, new Promise((_resolve, reject) => {
|
|
83
|
-
signal.throwIfAborted();
|
|
84
|
-
signal.addEventListener("abort", () => reject(signal.reason), { once: true });
|
|
85
|
-
})]);
|
|
86
|
-
}
|
|
87
|
-
//#endregion
|
|
88
|
-
export { projectWork as t };
|