@marver-design/marver 0.26.0 → 0.27.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/CHANGELOG.md +158 -0
- package/README.md +10 -5
- package/dist/{anchor-check-Dg5xpNnU.mjs → anchor-check-ChdDqL5z.mjs} +1 -1
- package/dist/{audio-CmSRYFEs.mjs → audio-Dw1lfMdb.mjs} +14 -0
- package/dist/{bake-DtVlm0_F.mjs → bake-DM_uWgAA.mjs} +1 -1
- package/dist/{boards-DYG22tOe.mjs → boards-DlTcpF47.mjs} +1 -1
- package/dist/{build-C_gUgcdC.mjs → build-DZnFysGU.mjs} +4 -4
- package/dist/{capture-CrqvU_jh.mjs → capture-vadKjuCo.mjs} +2 -1
- package/dist/cli.mjs +28 -16
- package/dist/{comments-BqXua-XL.mjs → comments-DxOkCSNE.mjs} +4 -4
- package/dist/{daemon-DZo6o3rU.mjs → daemon-BSA0lV8d.mjs} +400 -274
- package/dist/detect-C0wpaePX.mjs +125 -0
- package/dist/dev-eQJhWsqg.mjs +1273 -0
- package/dist/dev-lock-C_FC70Mu.mjs +65 -0
- package/dist/exclusive-B1RtpeeP.mjs +150 -0
- package/dist/{init-D8DtrK_F.mjs → init-COD0x48i.mjs} +5 -3
- package/dist/{link-BNzLvdhI.mjs → link-DDXZVGtv.mjs} +20 -8
- package/dist/ls-D7O1G505.mjs +38 -0
- package/dist/{marks-NQi0wZJ4.mjs → marks-CWM3WJjc.mjs} +1 -1
- package/dist/perf-BWzQwZqj.mjs +369 -0
- package/dist/perf-BoDSkbEb.mjs +429 -0
- package/dist/perf-jam-D55U3FZK.mjs +242 -0
- package/dist/{plugin-CTD0rydA.mjs → plugin-C-E7omsh.mjs} +425 -66
- package/dist/{poster-ChjXGTS5.mjs → poster-Bx83ZYVK.mjs} +2 -1
- package/dist/{profile-WU9qcbIo.mjs → profile-Bh5Y5zpW.mjs} +1 -1
- package/dist/{publish-bakes-CEP_2NRc.mjs → publish-bakes-aljgm45S.mjs} +2 -2
- package/dist/{queue-BuiCKSX1.mjs → queue-CAM_vNmX.mjs} +3 -3
- package/dist/recover-t9Pno3u9.mjs +66 -0
- package/dist/{session-qZWKt_VA.mjs → session-BAaJsK5c.mjs} +1 -1
- package/dist/{share--oFJ1bCI.mjs → share-W5H3BNvP.mjs} +1 -1
- package/dist/shot-DoHLl6ig.mjs +139 -0
- package/dist/{shot-DqcxJibP.mjs → shot-LFhC-WYD.mjs} +343 -19
- package/dist/slots-DCDo3N0x.mjs +471 -0
- package/dist/speech-worker.mjs +40 -5
- package/dist/{sync-DKk-yT1V.mjs → sync-BQVlHZpx.mjs} +4 -3
- package/dist/{work-F5u-twpJ.mjs → work-Bp1p39kq.mjs} +4 -2
- package/dist/{work-VvX_JIgl.mjs → work-BroFwnup.mjs} +4 -2
- package/docs/boards-and-folders.md +3 -1
- package/docs/jam-session.md +78 -7
- package/docs/live-jam.md +8 -0
- package/docs/performance.md +262 -0
- package/package.json +2 -2
- package/src/client/content/index.tsx +3 -0
- package/src/client/content/video.tsx +6 -2
- package/src/client/frame-host/bridge.js +22 -6
- package/src/client/frame-host/inspect.js +8 -3
- package/src/client/frame-host/keys.js +6 -2
- package/src/client/frame-host/main.tsx +17 -5
- package/src/client/shell/App.tsx +188 -29
- package/src/client/shell/BoardList.tsx +5 -5
- package/src/client/shell/Comments.tsx +3 -2
- package/src/client/shell/JamSurface.tsx +13 -5
- package/src/client/shell/LockedApp.tsx +5 -5
- package/src/client/shell/Play.tsx +27 -15
- package/src/client/shell/Toolbar.tsx +17 -5
- package/src/client/shell/api.ts +206 -0
- package/src/client/shell/canvas/Canvas.tsx +30 -3
- package/src/client/shell/canvas/FrameNode.tsx +15 -5
- package/src/client/shell/canvas/admission.ts +8 -1
- package/src/client/shell/canvas/camera-broadcast.ts +15 -5
- package/src/client/shell/canvas/ctl.ts +2 -0
- package/src/client/shell/canvas/frame-registry.ts +28 -2
- package/src/client/shell/canvas/sleep.ts +4 -1
- package/src/client/shell/comments-store.ts +12 -4
- package/src/client/shell/goto.ts +22 -10
- package/src/client/shell/icons.tsx +2 -0
- package/src/client/shell/jam-capture.ts +96 -16
- package/src/client/shell/jam-keys.ts +51 -18
- package/src/client/shell/jam-lane.tsx +46 -5
- package/src/client/shell/jam-panel.tsx +66 -13
- package/src/client/shell/jam-queue.ts +3 -3
- package/src/client/shell/jam-session.tsx +14 -8
- package/src/client/shell/jam-state.ts +48 -6
- package/src/client/shell/jam-surface-parts.tsx +10 -6
- package/src/client/shell/jam-voice.ts +7 -5
- package/src/client/shell/legacy-links.ts +2 -2
- package/src/client/shell/main.tsx +4 -0
- package/src/client/shell/notes.ts +8 -1
- package/src/client/shell/perf.ts +69 -58
- package/src/client/shell/recorder-core.ts +183 -0
- package/src/client/shell/recorder.ts +565 -0
- package/src/client/shell/store.ts +268 -103
- package/src/client/shell/styles.css +54 -9
- package/src/client/stage/main.tsx +2 -0
- package/templates/AGENTS-embedded.md +22 -4
- package/templates/AGENTS-studio.md +22 -4
- package/templates/demo/dark.tsx +1 -1
- package/templates/demo/welcome.tsx +1 -1
- package/templates/instructions/jam.md +5 -3
- package/templates/instructions/welcome.md +6 -3
- package/dist/config-Cf7EjAMf.mjs +0 -292
- package/dist/dev-_Nlsc6v9.mjs +0 -742
- package/dist/dev-lock-DWSpa6nj.mjs +0 -179
- package/dist/perf-D6VmmJ2q.mjs +0 -68
- package/dist/perf-DPbLGhhO.mjs +0 -49
- package/dist/shot-CNbHoZ6H.mjs +0 -86
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
//#region src/server/detect.ts
|
|
4
|
+
function readJson(file) {
|
|
5
|
+
try {
|
|
6
|
+
return JSON.parse(stripJsonComments(readFileSync(file, "utf8")));
|
|
7
|
+
} catch {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function stripJsonComments(s) {
|
|
12
|
+
let out = "", inStr = false, inLine = false, inBlock = false;
|
|
13
|
+
for (let i = 0; i < s.length; i++) {
|
|
14
|
+
const c = s[i], n = s[i + 1];
|
|
15
|
+
if (inLine) {
|
|
16
|
+
if (c === "\n") {
|
|
17
|
+
inLine = false;
|
|
18
|
+
out += c;
|
|
19
|
+
}
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (inBlock) {
|
|
23
|
+
if (c === "*" && n === "/") {
|
|
24
|
+
inBlock = false;
|
|
25
|
+
i++;
|
|
26
|
+
}
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (inStr) {
|
|
30
|
+
out += c;
|
|
31
|
+
if (c === "\\") {
|
|
32
|
+
out += n ?? "";
|
|
33
|
+
i++;
|
|
34
|
+
} else if (c === "\"") inStr = false;
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (c === "\"") {
|
|
38
|
+
inStr = true;
|
|
39
|
+
out += c;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (c === "/" && n === "/") {
|
|
43
|
+
inLine = true;
|
|
44
|
+
i++;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (c === "/" && n === "*") {
|
|
48
|
+
inBlock = true;
|
|
49
|
+
i++;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
out += c;
|
|
53
|
+
}
|
|
54
|
+
let res = "", inS = false;
|
|
55
|
+
for (let i = 0; i < out.length; i++) {
|
|
56
|
+
const c = out[i];
|
|
57
|
+
if (inS) {
|
|
58
|
+
res += c;
|
|
59
|
+
if (c === "\\") {
|
|
60
|
+
res += out[i + 1] ?? "";
|
|
61
|
+
i++;
|
|
62
|
+
} else if (c === "\"") inS = false;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (c === "\"") {
|
|
66
|
+
inS = true;
|
|
67
|
+
res += c;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (c === ",") {
|
|
71
|
+
let j = i + 1;
|
|
72
|
+
while (j < out.length && /\s/.test(out[j])) j++;
|
|
73
|
+
if (out[j] === "}" || out[j] === "]") continue;
|
|
74
|
+
}
|
|
75
|
+
res += c;
|
|
76
|
+
}
|
|
77
|
+
return res;
|
|
78
|
+
}
|
|
79
|
+
function detectHost(root) {
|
|
80
|
+
const pkg = readJson(join(root, "package.json")) ?? {};
|
|
81
|
+
const deps = {
|
|
82
|
+
...pkg.dependencies,
|
|
83
|
+
...pkg.devDependencies
|
|
84
|
+
};
|
|
85
|
+
const twRange = deps["tailwindcss"];
|
|
86
|
+
const tailwind = !twRange ? null : /(^|[^\d])4\./.test(twRange) || twRange.startsWith("^4") || twRange.startsWith("~4") ? 4 : 3;
|
|
87
|
+
const router = deps["next"] ? "next" : deps["react-router"] || deps["react-router-dom"] ? "react-router" : null;
|
|
88
|
+
const routerPkg = deps["react-router-dom"] ? "react-router-dom" : "react-router";
|
|
89
|
+
const toaster = deps["sonner"] ? "sonner" : deps["react-hot-toast"] ? "react-hot-toast" : null;
|
|
90
|
+
let shadcn = null;
|
|
91
|
+
const comp = readJson(join(root, "components.json"));
|
|
92
|
+
if (comp?.tailwind?.css) shadcn = {
|
|
93
|
+
themeCss: comp.tailwind.css,
|
|
94
|
+
uiAlias: comp.aliases?.ui ?? "@/components/ui"
|
|
95
|
+
};
|
|
96
|
+
const themeCss = shadcn?.themeCss && existsSync(join(root, shadcn.themeCss)) ? shadcn.themeCss : firstExisting(root, [
|
|
97
|
+
"src/index.css",
|
|
98
|
+
"src/styles/theme.css",
|
|
99
|
+
"src/styles/globals.css",
|
|
100
|
+
"src/app/globals.css",
|
|
101
|
+
"app/globals.css",
|
|
102
|
+
"src/globals.css",
|
|
103
|
+
"src/style.css",
|
|
104
|
+
"styles/globals.css"
|
|
105
|
+
]);
|
|
106
|
+
const ts = readJson(join(root, "tsconfig.json"));
|
|
107
|
+
const include = ts?.include;
|
|
108
|
+
const exclude = ts?.exclude ?? [];
|
|
109
|
+
const sweeps = ts != null && !exclude.some((e) => e === "design" || e.startsWith("design/")) && (!include || include.some((i) => i === "." || i.startsWith("**") || i.startsWith("design")));
|
|
110
|
+
return {
|
|
111
|
+
tailwind,
|
|
112
|
+
router,
|
|
113
|
+
routerPkg,
|
|
114
|
+
toaster,
|
|
115
|
+
shadcn,
|
|
116
|
+
themeCss,
|
|
117
|
+
tsconfigSweepsDesign: !!sweeps
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function firstExisting(root, candidates) {
|
|
121
|
+
for (const c of candidates) if (existsSync(join(root, c))) return c;
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
export { readJson as n, detectHost as t };
|