primitive-app 2.1.6 → 2.1.7

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.
@@ -1,10 +1,10 @@
1
- import { readFileSync as T } from "node:fs";
2
- import { createRequire as A } from "node:module";
3
- import { glob as C } from "glob";
1
+ import { readFileSync as S } from "node:fs";
2
+ import { createRequire as T } from "node:module";
3
+ import { glob as A } from "glob";
4
4
  import v from "path";
5
- async function I(r, n = "src/tests", p = "**/*.primitive-test.ts") {
5
+ async function C(r, n = "src/tests", p = "**/*.primitive-test.ts") {
6
6
  const a = v.join(r, n);
7
- return (await C(p, {
7
+ return (await A(p, {
8
8
  cwd: a,
9
9
  ignore: ["**/node_modules/**", "**/dist/**"],
10
10
  absolute: !0
@@ -14,21 +14,20 @@ async function I(r, n = "src/tests", p = "**/*.primitive-test.ts") {
14
14
  }));
15
15
  }
16
16
  const h = "virtual:primitive-devtools", l = "\0" + h, y = "virtual:primitive-devtools-init", f = "\0" + y;
17
- function G(r = {}) {
17
+ function k(r = {}) {
18
18
  const {
19
19
  testsDir: n = "src/tests",
20
20
  testPattern: p = "**/*.primitive-test.ts",
21
21
  appName: a = "Primitive App",
22
22
  enabled: c = !0,
23
- buttonStyle: s = {},
24
- keyboardShortcut: b
23
+ keyboardShortcut: s
25
24
  } = r;
26
- let u, d;
27
- const S = A(import.meta.url).resolve("vue-sonner/style.css"), _ = T(S, "utf-8");
25
+ let d, m;
26
+ const b = T(import.meta.url).resolve("vue-sonner/style.css"), _ = S(b, "utf-8");
28
27
  return {
29
28
  name: "primitive-devtools",
30
29
  configResolved(t) {
31
- u = t.root, d = t.command === "serve";
30
+ d = t.root, m = t.command === "serve";
32
31
  },
33
32
  resolveId(t) {
34
33
  if (t === h)
@@ -38,9 +37,9 @@ function G(r = {}) {
38
37
  },
39
38
  async load(t) {
40
39
  if (t === l) {
41
- const e = await I(u, n, p), o = e.map((m, i) => `import testGroup${i} from '${m.absolutePath}';`).join(`
40
+ const e = await C(d, n, p), o = e.map((u, i) => `import testGroup${i} from '${u.absolutePath}';`).join(`
42
41
  `), w = e.map(
43
- (m, i) => `...(Array.isArray(testGroup${i}) ? testGroup${i} : [testGroup${i}])`
42
+ (u, i) => `...(Array.isArray(testGroup${i}) ? testGroup${i} : [testGroup${i}])`
44
43
  ).join(`,
45
44
  `);
46
45
  return `
@@ -51,8 +50,7 @@ export const testGroups = [
51
50
  ];
52
51
 
53
52
  export const appName = ${JSON.stringify(a)};
54
- export const buttonStyle = ${JSON.stringify(s)};
55
- export const keyboardShortcut = ${JSON.stringify(b)};
53
+ export const keyboardShortcut = ${JSON.stringify(s)};
56
54
  `;
57
55
  }
58
56
  if (t === f)
@@ -60,7 +58,7 @@ export const keyboardShortcut = ${JSON.stringify(b)};
60
58
  import { createApp, h } from 'vue';
61
59
  import { createPinia } from 'pinia';
62
60
  import { DevToolsRoot, jsBaoClientService } from 'primitive-app';
63
- import { testGroups, appName, buttonStyle, keyboardShortcut } from 'virtual:primitive-devtools';
61
+ import { testGroups, appName, keyboardShortcut } from 'virtual:primitive-devtools';
64
62
 
65
63
  // Wait for the host app to register its client on window.__primitiveAppClient
66
64
  async function waitForAppClient() {
@@ -95,7 +93,7 @@ const observer = new MutationObserver(async (mutations, obs) => {
95
93
  // The jsBaoClientService is linked to the app's client above
96
94
  const devToolsApp = createApp({
97
95
  render() {
98
- return h(DevToolsRoot, { testGroups, appName, buttonStyle, keyboardShortcut });
96
+ return h(DevToolsRoot, { testGroups, appName, keyboardShortcut });
99
97
  }
100
98
  });
101
99
  devToolsApp.use(createPinia());
@@ -107,7 +105,7 @@ observer.observe(document.body, { childList: true, subtree: true });
107
105
  `;
108
106
  },
109
107
  transformIndexHtml(t) {
110
- if (!d || !c) return t;
108
+ if (!m || !c) return t;
111
109
  const e = `<style data-primitive-devtools-sonner>${_}</style>`;
112
110
  return t.replace("</body>", `${e}
113
111
  <script type="module" src="/@id/__x00__virtual:primitive-devtools-init"><\/script>
@@ -122,5 +120,5 @@ observer.observe(document.body, { childList: true, subtree: true });
122
120
  };
123
121
  }
124
122
  export {
125
- G as primitiveDevTools
123
+ k as primitiveDevTools
126
124
  };
@@ -17,12 +17,6 @@ export interface PrimitiveDevToolsOptions {
17
17
  * Whether to enable the plugin. Defaults to true in development.
18
18
  */
19
19
  enabled?: boolean;
20
- /**
21
- * Custom inline style overrides for the floating toggle button.
22
- * Use to control position and size, e.g. { bottom: '80px', right: '24px' }.
23
- * Defaults to bottom-right corner (bottom: 16px, right: 16px, width/height: 48px).
24
- */
25
- buttonStyle?: Record<string, string>;
26
20
  /**
27
21
  * Keyboard shortcut to toggle dev tools open/closed.
28
22
  * Uses "modifier+key" format: "cmd" maps to ⌘ on Mac and Ctrl elsewhere.
@@ -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;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,MAAM,CAiJR"}
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,CA+IR"}