@glasshome/widget-sdk 1.10.2 → 1.10.3

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/index.js CHANGED
@@ -1451,7 +1451,7 @@ function Un() {
1451
1451
  //#region src/version.ts
1452
1452
  var Wn = {
1453
1453
  name: "@glasshome/widget-sdk",
1454
- version: "1.10.2",
1454
+ version: "1.10.3",
1455
1455
  description: "SDK for building GlassHome dashboard widgets with SolidJS",
1456
1456
  keywords: [
1457
1457
  "glasshome",
@@ -1514,7 +1514,6 @@ var Wn = {
1514
1514
  "@glasshome/ui": "1.3.0",
1515
1515
  "solid-js": "^1.9.11"
1516
1516
  },
1517
- peerDependenciesMeta: { "@glasshome/ui": { optional: !0 } },
1518
1517
  dependencies: {
1519
1518
  "@glasshome/widget-contract": "0.2.0",
1520
1519
  "@modular-forms/solid": "^0.25.1",
@@ -1,16 +1,17 @@
1
+ import { pathToFileURL as e } from "node:url";
1
2
  //#region src/vite/introspect.ts
2
- function e(e) {
3
+ function t(e) {
3
4
  return typeof e?.safeParse == "function";
4
5
  }
5
- function t(t, n) {
6
- if (!e(t) || !Array.isArray(n)) return [];
6
+ function n(e, n) {
7
+ if (!t(e) || !Array.isArray(n)) return [];
7
8
  let r = [];
8
- for (let [e, i] of n.entries()) {
9
+ for (let [t, i] of n.entries()) {
9
10
  let n = i?.config;
10
11
  if (typeof n != "object" || !n) continue;
11
- let a = t.safeParse(n);
12
+ let a = e.safeParse(n);
12
13
  a.success || r.push({
13
- index: e,
14
+ index: t,
14
15
  label: i.label,
15
16
  problems: (a.error?.issues ?? []).map((e) => {
16
17
  let t = e.path.map(String).join(".");
@@ -20,7 +21,7 @@ function t(t, n) {
20
21
  }
21
22
  return r;
22
23
  }
23
- async function n() {
24
+ async function r() {
24
25
  let { Window: e } = await import("happy-dom"), t = new e({ url: "http://localhost" });
25
26
  for (let e of [
26
27
  "window",
@@ -38,22 +39,22 @@ async function n() {
38
39
  "matchMedia"
39
40
  ]) globalThis[e] === void 0 && (globalThis[e] = t[e]);
40
41
  }
41
- async function r() {
42
- let e = process.argv[2];
43
- e || (process.stderr.write("introspect: no bundle path given\n"), process.exit(2)), await n();
44
- let r = (await import(e)).default, i = null;
45
- if (r?.configSchema) {
42
+ async function i() {
43
+ let t = process.argv[2];
44
+ t || (process.stderr.write("introspect: no bundle path given\n"), process.exit(2)), await r();
45
+ let i = (await import(e(t).href)).default, a = null;
46
+ if (i?.configSchema) {
46
47
  let { z: e } = await import("zod");
47
- i = e.toJSONSchema(r.configSchema, { unrepresentable: "any" });
48
+ a = e.toJSONSchema(i.configSchema, { unrepresentable: "any" });
48
49
  }
49
- let a = {
50
- manifest: r?.manifest ?? null,
51
- jsonSchema: i,
52
- exampleConfigIssues: t(r?.configSchema, r?.manifest?.examples)
50
+ let o = {
51
+ manifest: i?.manifest ?? null,
52
+ jsonSchema: a,
53
+ exampleConfigIssues: n(i?.configSchema, i?.manifest?.examples)
53
54
  };
54
- process.stdout.write(JSON.stringify(a));
55
+ process.stdout.write(JSON.stringify(o));
55
56
  }
56
- r().catch((e) => {
57
+ i().catch((e) => {
57
58
  process.stderr.write(`${e instanceof Error ? e.message : String(e)}\n`), process.exit(1);
58
59
  });
59
60
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glasshome/widget-sdk",
3
- "version": "1.10.2",
3
+ "version": "1.10.3",
4
4
  "description": "SDK for building GlassHome dashboard widgets with SolidJS",
5
5
  "keywords": [
6
6
  "glasshome",
@@ -63,11 +63,6 @@
63
63
  "@glasshome/ui": "1.3.0",
64
64
  "solid-js": "^1.9.11"
65
65
  },
66
- "peerDependenciesMeta": {
67
- "@glasshome/ui": {
68
- "optional": true
69
- }
70
- },
71
66
  "dependencies": {
72
67
  "@glasshome/widget-contract": "0.2.0",
73
68
  "@modular-forms/solid": "^0.25.1",