@bud.sh/app 0.5.0 → 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-ChANGtl-.js → index-DtISWZp9.js} +2 -2
- package/dist/client/assets/pages-BJ-tNJ4J.js +1 -0
- package/dist/client/assets/{project-branches-DO897zM6.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-Lay351p4.js → project-threads-Bv7IDBgi.js} +105 -105
- package/dist/client/assets/project-work-DAE9-olg.js +1 -0
- package/dist/client/assets/{task-design-Avb2RO4w.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-V36732ER.js → canvas-AII16n9i.js} +97 -6
- package/dist/hosted/assets/{comment-data-CF2ZV_3k.js → comment-data-BXfMElfx.js} +2004 -402
- package/dist/hosted/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/hosted/assets/{files-DjSCjfU7.js → files-D_1yeAVO.js} +10 -5
- package/dist/hosted/assets/{pages-BzjzeuPu.js → pages-CN_SbKWA.js} +3 -3
- package/dist/hosted/assets/{project-branches-BT97J9i7.js → project-branches-Bxp0DCwg.js} +1 -1
- package/dist/hosted/assets/{project-thread-links-BRLgByEe.js → project-thread-links-KqQoKBLE.js} +76 -4
- package/dist/{node-host/assets/screen-CZXWJEds.js → hosted/assets/screen-DpAcDUKR.js} +29 -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 -13
- 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-Dc1mYCwQ.js → node-host/assets/canvas-BeDoufy1.js} +97 -7
- package/dist/node-host/assets/{comment-data-DyIZNpfG.js → comment-data-DE2T9yTj.js} +1980 -376
- package/dist/node-host/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/node-host/assets/{files-Dh2TiQZq.js → files-Dl-PTS09.js} +11 -6
- package/dist/node-host/assets/{pages-BxpjbYhs.js → pages-DL2sk6_U.js} +3 -3
- package/dist/node-host/assets/{project-branches-B7HUGiVK.js → project-branches-DGp5ELct.js} +1 -1
- package/dist/{server/assets/project-thread-links-CBOpf6zk.js → node-host/assets/project-thread-links-CgBV3Jcm.js} +76 -5
- package/dist/{hosted/assets/screen-CKp2C7kx.js → node-host/assets/screen-B55yyVfb.js} +29 -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-TRUfxfL5.js → server/assets/canvas-CJWQ-jjv.js} +98 -6
- package/dist/server/assets/{comment-data-CsjukwAW.js → comment-data-Rg42ToTW.js} +1666 -47
- 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-E9mSFeoc.js → files-CPJqKeMo.js} +12 -7
- package/dist/server/assets/{listener-DN5TyOjJ.js → listener-D61O6PzF.js} +708 -12
- package/dist/server/assets/{pages-BBBXyJWV.js → pages-KJY_Ba92.js} +4 -4
- package/dist/server/assets/{project-branches-B0YIK6Ur.js → project-branches-qG9ACZvo.js} +2 -2
- package/dist/{node-host/assets/project-thread-links-CauJF0Cz.js → server/assets/project-thread-links-CqK0lqCF.js} +77 -4
- package/dist/{node-host/assets/tasks-request-ZWmbc8fE.js → server/assets/project-work-DoIwxWMm.js} +87 -2
- package/dist/server/assets/run-BJ8r5jSh.js +572 -0
- package/dist/server/assets/{screen-BIQA2mr4.js → screen-CBrHPFug.js} +30 -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-Cu6R6xxT.js +0 -1
- package/dist/client/assets/difference-worker-jfTSn-Tw.js +0 -8
- package/dist/client/assets/files-js6ElfkU.js +0 -1
- package/dist/client/assets/i18n-DxqFr2mi.js +0 -1
- package/dist/client/assets/index-CFFxP0gS.css +0 -2
- package/dist/client/assets/pages-6_lhiQmz.js +0 -1
- package/dist/client/assets/project-comments-DFFKVpia.js +0 -1
- package/dist/client/assets/project-thread-links-NLFWQRD2.js +0 -1
- package/dist/client/assets/project-work-du0Y-L5Y.js +0 -1
- package/dist/client/assets/tasks-CA-E8bbK.js +0 -1
- package/dist/client/assets/tasks-request-C55IeuiP.js +0 -1
- package/dist/client/assets/workspace-Cw5HvX5d.js +0 -2
- package/dist/hosted/assets/tasks-Dj7AyBJB.js +0 -649
- package/dist/hosted/assets/tasks-request-DZob623r.js +0 -113
- package/dist/node-host/assets/tasks-Bs1IOpeU.js +0 -651
- package/dist/server/assets/project-work-qSKFO5yj.js +0 -88
- package/dist/server/assets/tasks-CiXodsLN.js +0 -652
- package/dist/server/assets/tasks-request-DhwCzpRi.js +0 -115
- package/dist/types/assets/picker-D1Bw3ndx.d.ts +0 -14
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as pageRoutes,
|
|
2
|
-
import {
|
|
1
|
+
import { g as pageRoutes, nn as MAX_CANVAS_Y } from "./events-BH_rAu7O.js";
|
|
2
|
+
import { Cn as IconButton, Fn as Text, Gt as Loader, Kt as Spinner, Nn as t, On as readPreference, Sn as Select, dt as PagesWorkspace, kn as writePreference, l as projectStore } from "./comment-data-Rg42ToTW.js";
|
|
3
3
|
import { r as workspaceTab, t as followWorkspaceTab } from "./workspace-tab-DAUjkJzZ.js";
|
|
4
|
-
import { n as createProjectPreviews, r as locatePreview, t as createProjectBranches } from "./project-branches-
|
|
5
|
-
import { n as createProjectComments, t as defineScreen } from "./screen-
|
|
4
|
+
import { n as createProjectPreviews, r as locatePreview, t as createProjectBranches } from "./project-branches-qG9ACZvo.js";
|
|
5
|
+
import { n as createProjectComments, t as defineScreen } from "./screen-CBrHPFug.js";
|
|
6
6
|
import { array, number, object, optional, parseSafe, string } from "remix/data-schema";
|
|
7
7
|
import { on, ref } from "remix/component";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "remix/component/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as routes,
|
|
2
|
-
import {
|
|
1
|
+
import { i as routes, rn as parseElementAnchor } from "./events-BH_rAu7O.js";
|
|
2
|
+
import { Nn as t, c as previewKey, l as projectStore, v as projectLive, x as writeRows, y as plainRow } from "./comment-data-Rg42ToTW.js";
|
|
3
3
|
import { c as parsePreview, l as parsePreviewBranch, p as parsePreviewPins } from "./parsers-CsiSkwTT.js";
|
|
4
4
|
import { array, boolean, enum_, nullable, number, object, parseSafe, string } from "remix/data-schema";
|
|
5
5
|
//#region app/client/project-previews.ts
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { I as parseThreadLinkInput, Sn as valueByRole, i as routes, in as parseWorkWorkspace, j as parseThread, mn as parseWorkItemRef } from "./events-BH_rAu7O.js";
|
|
2
|
+
import { C as ThreadTaskPicker, Cn as IconButton, Ct as taskHref, Nn as t, S as ThreadTaskLinks, Tt as taskRole, _ as requestComments, h as storedWorkspace, l as projectStore } from "./comment-data-Rg42ToTW.js";
|
|
3
|
+
import { r as requestTasks, t as projectWork } from "./project-work-DoIwxWMm.js";
|
|
3
4
|
import { on, ref } from "remix/component";
|
|
4
5
|
import { Fragment, jsx, jsxs } from "remix/component/jsx-runtime";
|
|
5
6
|
//#region app/client/project-task-picker.tsx
|
|
@@ -164,11 +165,77 @@ async function saveThreadLinks(thread, selected, mutate, signal) {
|
|
|
164
165
|
//#endregion
|
|
165
166
|
//#region app/client/project-thread-links.tsx
|
|
166
167
|
/**
|
|
168
|
+
* Whether a discussion offers Make task: placed on a page or code, without tasks yet, where
|
|
169
|
+
* discussions can link and tasks are stored.
|
|
170
|
+
* @param thread - The discussion.
|
|
171
|
+
* @param canMake - Whether the stores allow it.
|
|
172
|
+
* @returns Whether to offer it.
|
|
173
|
+
*/
|
|
174
|
+
function makeTaskAvailable(thread, canMake) {
|
|
175
|
+
return canMake && thread.anchor !== null && !thread.itemIds.length;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Turns a discussion into a task and opens it, when `makeTaskAvailable` allows.
|
|
179
|
+
* @param handle - The discussion, whether tasks can be made, and the store's operation.
|
|
180
|
+
* @returns The toolbar button, or nothing.
|
|
181
|
+
*/
|
|
182
|
+
function ProjectMakeTask(handle) {
|
|
183
|
+
let making = false;
|
|
184
|
+
return () => {
|
|
185
|
+
let { thread, canMake, busy } = handle.props;
|
|
186
|
+
if (!makeTaskAvailable(thread, canMake)) return null;
|
|
187
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
188
|
+
icon: "task-add",
|
|
189
|
+
label: t("app.client.projectThreadLinks.makeTask"),
|
|
190
|
+
size: "small",
|
|
191
|
+
tooltip: true,
|
|
192
|
+
disabled: busy || making,
|
|
193
|
+
"data-testid": "comment-make-task",
|
|
194
|
+
mix: on("click", async () => {
|
|
195
|
+
making = true;
|
|
196
|
+
handle.update();
|
|
197
|
+
try {
|
|
198
|
+
let task = await handle.props.onMake(thread.id);
|
|
199
|
+
window.location.assign(taskHref(task.id));
|
|
200
|
+
} catch {} finally {
|
|
201
|
+
making = false;
|
|
202
|
+
if (!handle.signal.aborted) handle.update();
|
|
203
|
+
}
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
167
209
|
* Shares task links and their revision-checked editor across task, canvas and code discussions.
|
|
168
210
|
* @param handle - The selected discussion, capability and owning view's refresh callback.
|
|
169
211
|
* @returns Linked tasks and an editor that retains its selection after failed writes.
|
|
170
212
|
*/
|
|
171
213
|
function ProjectThreadLinks(handle) {
|
|
214
|
+
let stored = null;
|
|
215
|
+
let project = handle.props.project;
|
|
216
|
+
projectStore(project).then((store) => {
|
|
217
|
+
if (handle.signal.aborted) return;
|
|
218
|
+
let read = () => {
|
|
219
|
+
let workspace = storedWorkspace(store);
|
|
220
|
+
stored = workspace && {
|
|
221
|
+
schema: workspace.schema,
|
|
222
|
+
items: new Map(workspace.snapshot.items.map((item) => [item.id, {
|
|
223
|
+
id: item.id,
|
|
224
|
+
title: taskRole(item, workspace.schema, "title") || void 0,
|
|
225
|
+
status: taskRole(item, workspace.schema, "status") || void 0
|
|
226
|
+
}])),
|
|
227
|
+
runs: Object.fromEntries(workspace.snapshot.items.flatMap((item) => item.run ? [[item.id, item.run]] : []))
|
|
228
|
+
};
|
|
229
|
+
update();
|
|
230
|
+
};
|
|
231
|
+
let subscriptions = [store.boards.subscribeChanges(read), store.work.subscribeChanges(read)];
|
|
232
|
+
handle.signal.addEventListener("abort", () => {
|
|
233
|
+
for (let subscription of subscriptions) subscription.unsubscribe();
|
|
234
|
+
});
|
|
235
|
+
let work = projectWork(project);
|
|
236
|
+
if (!store.boards.has("board") && handle.props.thread.itemIds.length && project.storage.work?.state === "ready") work.refresh().catch(() => {});
|
|
237
|
+
read();
|
|
238
|
+
});
|
|
172
239
|
let editing = null;
|
|
173
240
|
let needsReview = false;
|
|
174
241
|
let reviewed = false;
|
|
@@ -209,7 +276,13 @@ function ProjectThreadLinks(handle) {
|
|
|
209
276
|
mix: on("click", edit)
|
|
210
277
|
}) : null : /* @__PURE__ */ jsx(ThreadTaskLinks, {
|
|
211
278
|
itemIds: handle.props.thread.itemIds,
|
|
212
|
-
items: handle.props.
|
|
279
|
+
items: handle.props.thread.itemIds.map((id) => ({
|
|
280
|
+
...handle.props.items?.find((item) => item.id === id),
|
|
281
|
+
...stored?.items.get(id),
|
|
282
|
+
id
|
|
283
|
+
})),
|
|
284
|
+
schema: stored?.schema,
|
|
285
|
+
runs: stored?.runs,
|
|
213
286
|
href: taskHref,
|
|
214
287
|
busy: handle.props.busy,
|
|
215
288
|
onEdit: !handle.props.part && handle.props.canLink ? edit : void 0
|
|
@@ -238,4 +311,4 @@ function ProjectThreadLinks(handle) {
|
|
|
238
311
|
}) : null] });
|
|
239
312
|
}
|
|
240
313
|
//#endregion
|
|
241
|
-
export {
|
|
314
|
+
export { ProjectThreadLinks as n, ProjectTaskPicker as r, ProjectMakeTask as t };
|
package/dist/{node-host/assets/tasks-request-ZWmbc8fE.js → server/assets/project-work-DoIwxWMm.js}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as parseWorkChange, _n as parseWorkQuery, i as routes, in as parseWorkWorkspace, mn as parseWorkItemRef } from "./events-BH_rAu7O.js";
|
|
2
|
+
import { Nn as t, d as saveWorkspace, l as projectStore, v as projectLive, x as writeRows, y as plainRow } from "./comment-data-Rg42ToTW.js";
|
|
2
3
|
import { createMultiMatcher } from "remix/route-pattern/match";
|
|
3
4
|
//#region app/client/tasks-request.ts
|
|
4
5
|
var reads = createMultiMatcher();
|
|
@@ -111,4 +112,88 @@ var TaskRequestError = class extends Error {
|
|
|
111
112
|
}
|
|
112
113
|
};
|
|
113
114
|
//#endregion
|
|
114
|
-
|
|
115
|
+
//#region app/client/project-work.ts
|
|
116
|
+
var syncs = /* @__PURE__ */ new Map();
|
|
117
|
+
/**
|
|
118
|
+
* Keeps the project's stored board current for the page's lifetime, once a screen read it:
|
|
119
|
+
* live task changes are stored as they arrive, and lost history reads the whole board again.
|
|
120
|
+
* @param project - The project to follow.
|
|
121
|
+
* @param fetcher - Injectable transport.
|
|
122
|
+
* @returns The project's work sync.
|
|
123
|
+
*/
|
|
124
|
+
function projectWork(project, fetcher = fetch) {
|
|
125
|
+
let existing = syncs.get(project.id);
|
|
126
|
+
if (existing) return existing;
|
|
127
|
+
let reading;
|
|
128
|
+
let queued;
|
|
129
|
+
let live = null;
|
|
130
|
+
let store = projectStore(project);
|
|
131
|
+
async function read() {
|
|
132
|
+
live = {
|
|
133
|
+
items: /* @__PURE__ */ new Set(),
|
|
134
|
+
schema: false
|
|
135
|
+
};
|
|
136
|
+
try {
|
|
137
|
+
let workspace = await requestTasks(routes.tasksApi.workspace.href(), project.token, new AbortController().signal, parseWorkWorkspace, fetcher);
|
|
138
|
+
let opened = await store;
|
|
139
|
+
await saveWorkspace(opened, workspace, live);
|
|
140
|
+
return workspace;
|
|
141
|
+
} finally {
|
|
142
|
+
live = null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function refresh(signal) {
|
|
146
|
+
queued ??= (reading ?? Promise.resolve()).catch(() => {}).then(() => {
|
|
147
|
+
queued = void 0;
|
|
148
|
+
let started = read();
|
|
149
|
+
reading = started;
|
|
150
|
+
started.catch(() => {}).finally(() => {
|
|
151
|
+
if (reading === started) reading = void 0;
|
|
152
|
+
});
|
|
153
|
+
return started;
|
|
154
|
+
});
|
|
155
|
+
return abortable(queued, signal);
|
|
156
|
+
}
|
|
157
|
+
function reread() {
|
|
158
|
+
refresh().catch(() => {});
|
|
159
|
+
}
|
|
160
|
+
async function apply(opened, data) {
|
|
161
|
+
let board = opened.boards.get("board");
|
|
162
|
+
if (!board) return;
|
|
163
|
+
let change = parseWorkChange(data, board.schema);
|
|
164
|
+
if (change.type === "reset") return reread();
|
|
165
|
+
if (live) {
|
|
166
|
+
if (change.type === "schema") live.schema = true;
|
|
167
|
+
else live.items.add(change.type === "upsert" ? change.item.id : change.id);
|
|
168
|
+
}
|
|
169
|
+
if (change.type === "schema") return writeRows(opened.boards, { upsert: [{
|
|
170
|
+
...plainRow(board),
|
|
171
|
+
schema: change.schema,
|
|
172
|
+
schemaVersion: change.schema.adapter.version
|
|
173
|
+
}] });
|
|
174
|
+
await writeRows(opened.work, change.type === "upsert" ? { upsert: [change.item] } : { delete: [change.id] });
|
|
175
|
+
}
|
|
176
|
+
let applying = Promise.resolve();
|
|
177
|
+
projectLive(project.token).subscribe("work", {
|
|
178
|
+
onEvent(data) {
|
|
179
|
+
applying = applying.then(() => store).then((opened) => apply(opened, data)).catch((e) => {
|
|
180
|
+
reread();
|
|
181
|
+
});
|
|
182
|
+
},
|
|
183
|
+
onResync() {
|
|
184
|
+
store.then((opened) => opened.boards.has("board") && reread());
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
let sync = { refresh };
|
|
188
|
+
syncs.set(project.id, sync);
|
|
189
|
+
return sync;
|
|
190
|
+
}
|
|
191
|
+
function abortable(promise, signal) {
|
|
192
|
+
if (!signal) return promise;
|
|
193
|
+
return Promise.race([promise, new Promise((_resolve, reject) => {
|
|
194
|
+
signal.throwIfAborted();
|
|
195
|
+
signal.addEventListener("abort", () => reject(signal.reason), { once: true });
|
|
196
|
+
})]);
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
199
|
+
export { TaskRequestError as n, requestTasks as r, projectWork as t };
|