primitive-app 2.1.7 → 3.0.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/chunk-rCbxF51U.cjs +1 -0
- package/dist/components/ui/checkbox/Checkbox.vue.d.ts +1 -1
- package/dist/components/ui/native-select/NativeSelectOptGroup.vue.d.ts +2 -2
- package/dist/components/ui/native-select/NativeSelectOption.vue.d.ts +2 -2
- package/dist/components/ui/separator/Separator.vue.d.ts +1 -1
- package/dist/components/ui/switch/Switch.vue.d.ts +1 -0
- package/dist/components/ui/switch/Switch.vue.d.ts.map +1 -1
- package/dist/components/ui/tabs/Tabs.vue.d.ts +2 -2
- package/dist/composables/useJsBaoDataLoader.d.ts.map +1 -1
- package/dist/dev-tools/document-explorer/DocumentExplorerIndex.vue.d.ts.map +1 -1
- package/dist/dev-tools/document-explorer/components/DocumentListPanel.vue.d.ts +3 -15
- package/dist/dev-tools/document-explorer/components/DocumentListPanel.vue.d.ts.map +1 -1
- package/dist/dev-tools/document-explorer/components/DocumentListSection.vue.d.ts +6 -9
- package/dist/dev-tools/document-explorer/components/DocumentListSection.vue.d.ts.map +1 -1
- package/dist/dev-tools/document-explorer/components/DocumentPropertiesPanel.vue.d.ts.map +1 -1
- package/dist/dev-tools/document-explorer/components/DocumentSharingSection.vue.d.ts.map +1 -1
- package/dist/dev-tools/document-explorer/index.d.ts +1 -1
- package/dist/dev-tools/document-explorer/index.d.ts.map +1 -1
- package/dist/dev-tools/document-explorer/types.d.ts +29 -25
- package/dist/dev-tools/document-explorer/types.d.ts.map +1 -1
- package/dist/dev-tools/index.d.ts +3 -2
- package/dist/dev-tools/index.d.ts.map +1 -1
- package/dist/dev-tools/test-harness/TestRunner.vue.d.ts +5 -0
- package/dist/dev-tools/test-harness/TestRunner.vue.d.ts.map +1 -1
- package/dist/dev-tools/test-harness/index.d.ts +3 -2
- package/dist/dev-tools/test-harness/index.d.ts.map +1 -1
- package/dist/dev-tools/test-harness/lib.d.ts +38 -15
- package/dist/dev-tools/test-harness/lib.d.ts.map +1 -1
- package/dist/dev-tools/test-harness/types.d.ts +3 -13
- package/dist/dev-tools/test-harness/types.d.ts.map +1 -1
- package/dist/dev-tools/vite-plugin/DevToolsOverlay.vue.d.ts +5 -0
- package/dist/dev-tools/vite-plugin/DevToolsOverlay.vue.d.ts.map +1 -1
- package/dist/dev-tools/vite-plugin/DevToolsRoot.vue.d.ts +5 -0
- package/dist/dev-tools/vite-plugin/DevToolsRoot.vue.d.ts.map +1 -1
- package/dist/dev-tools/vite-plugin/index.cjs +23 -17
- package/dist/dev-tools/vite-plugin/index.js +61 -119
- package/dist/dev-tools/vite-plugin/plugin.d.ts.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14147 -17290
- package/dist/primitive-app.css +2 -1
- package/package.json +30 -30
- package/dist/dev-tools/document-explorer/components/InvitationPropertiesPanel.vue.d.ts +0 -14
- package/dist/dev-tools/document-explorer/components/InvitationPropertiesPanel.vue.d.ts.map +0 -1
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-rCbxF51U.cjs`);let t=require(`node:fs`),n=require(`node:module`),r=require(`glob`),i=require(`path`);i=e.i(i,1);async function a(e,t=`src/tests`,n=`**/*.primitive-test.ts`){return(await(0,r.glob)(n,{cwd:i.default.join(e,t),ignore:[`**/node_modules/**`,`**/dist/**`],absolute:!0})).map(t=>({absolutePath:t,relativePath:i.default.relative(e,t)}))}var o=`virtual:primitive-devtools`,s=`\0`+o,c=`virtual:primitive-devtools-init`,l=`\0`+c;function u(e={}){let{testsDir:r=`src/tests`,testPattern:i=`**/*.primitive-test.ts`,appName:u=`Primitive App`,enabled:d=!0,keyboardShortcut:f}=e,p,m,h=(0,t.readFileSync)((0,n.createRequire)({}.url).resolve(`vue-sonner/style.css`),`utf-8`);return{name:`primitive-devtools`,configResolved(e){p=e.root,m=e.command===`serve`},resolveId(e){if(e===o)return s;if(e===c)return l},async load(e){if(e===s)return`
|
|
2
|
+
const groups = [];
|
|
3
|
+
const loadErrors = [];
|
|
4
|
+
|
|
5
|
+
${(await a(p,r,i)).map((e,t)=>` try {
|
|
6
|
+
const mod${t} = await import('${e.absolutePath}');
|
|
7
|
+
const val${t} = mod${t}.default;
|
|
8
|
+
if (Array.isArray(val${t})) groups.push(...val${t});
|
|
9
|
+
else if (val${t}) groups.push(val${t});
|
|
10
|
+
} catch (e) {
|
|
11
|
+
console.error('[primitive-devtools] Failed to load test file: ${e.relativePath}', e);
|
|
12
|
+
loadErrors.push({ file: '${e.relativePath}', error: e });
|
|
13
|
+
}`).join(`
|
|
14
|
+
`)}
|
|
15
|
+
|
|
16
|
+
export const testGroups = groups;
|
|
17
|
+
export const testLoadErrors = loadErrors;
|
|
18
|
+
export const appName = ${JSON.stringify(u)};
|
|
19
|
+
export const keyboardShortcut = ${JSON.stringify(f)};
|
|
20
|
+
`;if(e===l)return`
|
|
13
21
|
import { createApp, h } from 'vue';
|
|
14
22
|
import { createPinia } from 'pinia';
|
|
15
23
|
import { DevToolsRoot, jsBaoClientService } from 'primitive-app';
|
|
16
|
-
import { testGroups, appName, keyboardShortcut } from 'virtual:primitive-devtools';
|
|
24
|
+
import { testGroups, testLoadErrors, appName, keyboardShortcut } from 'virtual:primitive-devtools';
|
|
17
25
|
|
|
18
26
|
// Wait for the host app to register its client on window.__primitiveAppClient
|
|
19
27
|
async function waitForAppClient() {
|
|
@@ -48,7 +56,7 @@ const observer = new MutationObserver(async (mutations, obs) => {
|
|
|
48
56
|
// The jsBaoClientService is linked to the app's client above
|
|
49
57
|
const devToolsApp = createApp({
|
|
50
58
|
render() {
|
|
51
|
-
return h(DevToolsRoot, { testGroups, appName, keyboardShortcut });
|
|
59
|
+
return h(DevToolsRoot, { testGroups, testLoadErrors, appName, keyboardShortcut });
|
|
52
60
|
}
|
|
53
61
|
});
|
|
54
62
|
devToolsApp.use(createPinia());
|
|
@@ -57,6 +65,4 @@ const observer = new MutationObserver(async (mutations, obs) => {
|
|
|
57
65
|
});
|
|
58
66
|
|
|
59
67
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
60
|
-
`},transformIndexHtml(e){if(!
|
|
61
|
-
<script type="module" src="/@id/__x00__virtual:primitive-devtools-init"><\/script>
|
|
62
|
-
</body>`)},hotUpdate({file:e,server:t}){if(e.endsWith(".primitive-test.ts")){const o=t.moduleGraph.getModuleById(c);o&&(t.moduleGraph.invalidateModule(o),t.ws.send({type:"full-reload"}))}}}}exports.primitiveDevTools=A;
|
|
68
|
+
`},transformIndexHtml(e){if(!m||!d)return e;let t=`<style data-primitive-devtools-sonner>${h}</style>`;return e.replace(`</body>`,`${t}\n<script type="module" src="/@id/__x00__virtual:primitive-devtools-init"><\/script>\n</body>`)},hotUpdate({file:e,server:t}){if(e.endsWith(`.primitive-test.ts`)){let e=t.moduleGraph.getModuleById(s);e&&(t.moduleGraph.invalidateModule(e),t.ws.send({type:`full-reload`}))}}}}exports.primitiveDevTools=u;
|
|
@@ -1,124 +1,66 @@
|
|
|
1
|
-
import { readFileSync as
|
|
2
|
-
import { createRequire as
|
|
3
|
-
import { glob as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { readFileSync as e } from "node:fs";
|
|
2
|
+
import { createRequire as t } from "node:module";
|
|
3
|
+
import { glob as n } from "glob";
|
|
4
|
+
import r from "path";
|
|
5
|
+
//#region src/dev-tools/vite-plugin/test-discovery.ts
|
|
6
|
+
async function i(e, t = "src/tests", i = "**/*.primitive-test.ts") {
|
|
7
|
+
return (await n(i, {
|
|
8
|
+
cwd: r.join(e, t),
|
|
9
|
+
ignore: ["**/node_modules/**", "**/dist/**"],
|
|
10
|
+
absolute: !0
|
|
11
|
+
})).map((t) => ({
|
|
12
|
+
absolutePath: t,
|
|
13
|
+
relativePath: r.relative(e, t)
|
|
14
|
+
}));
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return l;
|
|
35
|
-
if (t === y)
|
|
36
|
-
return f;
|
|
37
|
-
},
|
|
38
|
-
async load(t) {
|
|
39
|
-
if (t === l) {
|
|
40
|
-
const e = await C(d, n, p), o = e.map((u, i) => `import testGroup${i} from '${u.absolutePath}';`).join(`
|
|
41
|
-
`), w = e.map(
|
|
42
|
-
(u, i) => `...(Array.isArray(testGroup${i}) ? testGroup${i} : [testGroup${i}])`
|
|
43
|
-
).join(`,
|
|
44
|
-
`);
|
|
45
|
-
return `
|
|
46
|
-
${o}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/dev-tools/vite-plugin/plugin.ts
|
|
18
|
+
var a = "virtual:primitive-devtools", o = "\0" + a, s = "virtual:primitive-devtools-init", c = "\0" + s;
|
|
19
|
+
function l(n = {}) {
|
|
20
|
+
let { testsDir: r = "src/tests", testPattern: l = "**/*.primitive-test.ts", appName: u = "Primitive App", enabled: d = !0, keyboardShortcut: f } = n, p, m, h = e(t(import.meta.url).resolve("vue-sonner/style.css"), "utf-8");
|
|
21
|
+
return {
|
|
22
|
+
name: "primitive-devtools",
|
|
23
|
+
configResolved(e) {
|
|
24
|
+
p = e.root, m = e.command === "serve";
|
|
25
|
+
},
|
|
26
|
+
resolveId(e) {
|
|
27
|
+
if (e === a) return o;
|
|
28
|
+
if (e === s) return c;
|
|
29
|
+
},
|
|
30
|
+
async load(e) {
|
|
31
|
+
if (e === o) return `
|
|
32
|
+
const groups = [];
|
|
33
|
+
const loadErrors = [];
|
|
47
34
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
${(await i(p, r, l)).map((e, t) => ` try {
|
|
36
|
+
const mod${t} = await import('${e.absolutePath}');
|
|
37
|
+
const val${t} = mod${t}.default;
|
|
38
|
+
if (Array.isArray(val${t})) groups.push(...val${t});
|
|
39
|
+
else if (val${t}) groups.push(val${t});
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.error('[primitive-devtools] Failed to load test file: ${e.relativePath}', e);
|
|
42
|
+
loadErrors.push({ file: '${e.relativePath}', error: e });
|
|
43
|
+
}`).join("\n")}
|
|
51
44
|
|
|
52
|
-
export const
|
|
53
|
-
export const
|
|
45
|
+
export const testGroups = groups;
|
|
46
|
+
export const testLoadErrors = loadErrors;
|
|
47
|
+
export const appName = ${JSON.stringify(u)};
|
|
48
|
+
export const keyboardShortcut = ${JSON.stringify(f)};
|
|
54
49
|
`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} else {
|
|
70
|
-
setTimeout(check, 100);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
check();
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Wait for main app to mount, then inject dev tools
|
|
78
|
-
const observer = new MutationObserver(async (mutations, obs) => {
|
|
79
|
-
const appEl = document.getElementById('app');
|
|
80
|
-
if (appEl && appEl.children.length > 0) {
|
|
81
|
-
obs.disconnect();
|
|
82
|
-
|
|
83
|
-
// Wait for the app's client to be available and link it to the debug suite
|
|
84
|
-
const appClient = await waitForAppClient();
|
|
85
|
-
jsBaoClientService.setExternalClient(appClient);
|
|
86
|
-
|
|
87
|
-
// Create mount point for dev tools
|
|
88
|
-
const devToolsMount = document.createElement('div');
|
|
89
|
-
devToolsMount.id = 'primitive-devtools-root';
|
|
90
|
-
document.body.appendChild(devToolsMount);
|
|
91
|
-
|
|
92
|
-
// Create the dev tools app with its own Pinia instance
|
|
93
|
-
// The jsBaoClientService is linked to the app's client above
|
|
94
|
-
const devToolsApp = createApp({
|
|
95
|
-
render() {
|
|
96
|
-
return h(DevToolsRoot, { testGroups, appName, keyboardShortcut });
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
devToolsApp.use(createPinia());
|
|
100
|
-
devToolsApp.mount('#primitive-devtools-root');
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
observer.observe(document.body, { childList: true, subtree: true });
|
|
105
|
-
`;
|
|
106
|
-
},
|
|
107
|
-
transformIndexHtml(t) {
|
|
108
|
-
if (!m || !c) return t;
|
|
109
|
-
const e = `<style data-primitive-devtools-sonner>${_}</style>`;
|
|
110
|
-
return t.replace("</body>", `${e}
|
|
111
|
-
<script type="module" src="/@id/__x00__virtual:primitive-devtools-init"><\/script>
|
|
112
|
-
</body>`);
|
|
113
|
-
},
|
|
114
|
-
hotUpdate({ file: t, server: e }) {
|
|
115
|
-
if (t.endsWith(".primitive-test.ts")) {
|
|
116
|
-
const o = e.moduleGraph.getModuleById(l);
|
|
117
|
-
o && (e.moduleGraph.invalidateModule(o), e.ws.send({ type: "full-reload" }));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
};
|
|
50
|
+
if (e === c) return "\nimport { createApp, h } from 'vue';\nimport { createPinia } from 'pinia';\nimport { DevToolsRoot, jsBaoClientService } from 'primitive-app';\nimport { testGroups, testLoadErrors, appName, keyboardShortcut } from 'virtual:primitive-devtools';\n\n// Wait for the host app to register its client on window.__primitiveAppClient\nasync function waitForAppClient() {\n return new Promise((resolve) => {\n const check = () => {\n if (window.__primitiveAppClient) {\n resolve(window.__primitiveAppClient);\n } else {\n setTimeout(check, 100);\n }\n };\n check();\n });\n}\n\n// Wait for main app to mount, then inject dev tools\nconst observer = new MutationObserver(async (mutations, obs) => {\n const appEl = document.getElementById('app');\n if (appEl && appEl.children.length > 0) {\n obs.disconnect();\n\n // Wait for the app's client to be available and link it to the debug suite\n const appClient = await waitForAppClient();\n jsBaoClientService.setExternalClient(appClient);\n\n // Create mount point for dev tools\n const devToolsMount = document.createElement('div');\n devToolsMount.id = 'primitive-devtools-root';\n document.body.appendChild(devToolsMount);\n\n // Create the dev tools app with its own Pinia instance\n // The jsBaoClientService is linked to the app's client above\n const devToolsApp = createApp({\n render() {\n return h(DevToolsRoot, { testGroups, testLoadErrors, appName, keyboardShortcut });\n }\n });\n devToolsApp.use(createPinia());\n devToolsApp.mount('#primitive-devtools-root');\n }\n});\n\nobserver.observe(document.body, { childList: true, subtree: true });\n";
|
|
51
|
+
},
|
|
52
|
+
transformIndexHtml(e) {
|
|
53
|
+
if (!m || !d) return e;
|
|
54
|
+
let t = `<style data-primitive-devtools-sonner>${h}</style>`;
|
|
55
|
+
return e.replace("</body>", `${t}\n<script type="module" src="/@id/__x00__virtual:primitive-devtools-init"><\/script>\n</body>`);
|
|
56
|
+
},
|
|
57
|
+
hotUpdate({ file: e, server: t }) {
|
|
58
|
+
if (e.endsWith(".primitive-test.ts")) {
|
|
59
|
+
let e = t.moduleGraph.getModuleById(o);
|
|
60
|
+
e && (t.moduleGraph.invalidateModule(e), t.ws.send({ type: "full-reload" }));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
121
64
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { l as primitiveDevTools };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/dev-tools/vite-plugin/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,MAAM,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/dev-tools/vite-plugin/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,MAAM,CAoJR"}
|