@glasshome/widget-sdk 1.2.0 → 1.3.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/data.d.ts +1 -1
- package/dist/index.js +1260 -1383
- package/dist/schemas.js +2 -15
- package/dist/vite/index.js +258 -305
- package/package.json +4 -4
package/dist/schemas.js
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import { GridSizeSchema as
|
|
2
|
-
export {
|
|
3
|
-
a as GridSizeSchema,
|
|
4
|
-
h as PublishBodySchema,
|
|
5
|
-
m as PublishConfirmSchema,
|
|
6
|
-
S as PublishRequestSchema,
|
|
7
|
-
c as WidgetManifestSchema,
|
|
8
|
-
r as capabilitiesSchema,
|
|
9
|
-
s as capabilityGrantSchema,
|
|
10
|
-
t as formatSchemaError,
|
|
11
|
-
d as parseGridSize,
|
|
12
|
-
f as publishManifestSchema,
|
|
13
|
-
l as serializeGridSize,
|
|
14
|
-
b as widgetManifestSchema
|
|
15
|
-
};
|
|
1
|
+
import { GridSizeSchema as e, PublishBodySchema as t, PublishConfirmSchema as n, PublishRequestSchema as r, capabilitiesSchema as i, capabilityGrantSchema as a, formatSchemaError as o, parseGridSize as s, publishManifestSchema as c, serializeGridSize as l, widgetManifestSchema as u, widgetManifestSchema as d } from "@glasshome/widget-contract";
|
|
2
|
+
export { e as GridSizeSchema, t as PublishBodySchema, n as PublishConfirmSchema, r as PublishRequestSchema, d as WidgetManifestSchema, i as capabilitiesSchema, a as capabilityGrantSchema, o as formatSchemaError, s as parseGridSize, c as publishManifestSchema, l as serializeGridSize, u as widgetManifestSchema };
|
package/dist/vite/index.js
CHANGED
|
@@ -1,321 +1,274 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { formatSchemaError as e, widgetManifestSchema as t } from "@glasshome/widget-contract";
|
|
2
|
+
import { createHash as n } from "node:crypto";
|
|
3
|
+
import { existsSync as r, mkdirSync as i, readFileSync as a, readdirSync as o, rmSync as s, statSync as c, writeFileSync as l } from "node:fs";
|
|
4
|
+
import { createRequire as u } from "node:module";
|
|
5
|
+
import { dirname as d, join as f, resolve as p, sep as m } from "node:path";
|
|
6
|
+
import { fileURLToPath as h } from "node:url";
|
|
7
|
+
import g from "@tailwindcss/vite";
|
|
8
|
+
//#region src/vite/index.ts
|
|
9
|
+
function _(e) {
|
|
10
|
+
let t = JSON.stringify(e, Object.keys(e).sort());
|
|
11
|
+
return n("sha256").update(t).digest("hex").slice(0, 16);
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
13
|
+
var v = "virtual:glasshome-widget", y = "\0virtual:glasshome-widget", b = "/@glasshome/preview";
|
|
14
|
+
function x(e) {
|
|
15
|
+
return m === "\\" ? e.split(m).join("/") : e;
|
|
15
16
|
}
|
|
16
17
|
function S() {
|
|
17
|
-
|
|
18
|
-
return c(y(e), "../../preview");
|
|
18
|
+
return p(d(h(import.meta.url)), "../../preview");
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
20
|
+
function C(e) {
|
|
21
|
+
return e === "solid-js" || e.startsWith("solid-js/") || e === "@glasshome/widget-sdk" || e.startsWith("@glasshome/widget-sdk/") || e === "@glasshome/ui" || e.startsWith("@glasshome/ui/");
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
23
|
+
function w() {
|
|
24
|
+
return {
|
|
25
|
+
name: "glasshome-widget:sync-layer-guard",
|
|
26
|
+
apply: "build",
|
|
27
|
+
enforce: "pre",
|
|
28
|
+
resolveId(e, t) {
|
|
29
|
+
if (e === "@glasshome/sync-layer" || e.startsWith("@glasshome/sync-layer/")) throw Error(`Widgets must not import "${e}" directly` + (t ? ` (imported by ${t})` : "") + ". Import the equivalent hook from \"@glasshome/widget-sdk\" instead (e.g. useEntity, useEntities, useService).");
|
|
30
|
+
}
|
|
31
|
+
};
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
var T = "node_modules/.cache/glasshome-widgets";
|
|
34
|
+
function E(e) {
|
|
35
|
+
try {
|
|
36
|
+
return u(f(process.cwd(), "package.json")).resolve(e);
|
|
37
|
+
} catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
43
40
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
var D = [
|
|
42
|
+
"--radius",
|
|
43
|
+
"--background",
|
|
44
|
+
"--foreground",
|
|
45
|
+
"--card",
|
|
46
|
+
"--primary",
|
|
47
|
+
"--border",
|
|
48
|
+
"--muted",
|
|
49
|
+
"--accent"
|
|
53
50
|
];
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`[glasshome-widget] "${t}.css" defines theme variable "${r}" on :host. Theme variables must inherit from the document so widgets follow the household theme — never re-scope them into the widget's shadow root.`
|
|
63
|
-
);
|
|
64
|
-
}
|
|
51
|
+
function O(e, t) {
|
|
52
|
+
let n = f(e, `${t}.css`);
|
|
53
|
+
if (!r(n)) return;
|
|
54
|
+
let i = a(n, "utf-8");
|
|
55
|
+
for (let e of i.matchAll(/:host[^{]*\{([^}]*)\}/g)) {
|
|
56
|
+
let n = e[1] ?? "", r = D.find((e) => n.includes(`${e}:`));
|
|
57
|
+
if (r) throw Error(`[glasshome-widget] "${t}.css" defines theme variable "${r}" on :host. Theme variables must inherit from the document so widgets follow the household theme — never re-scope them into the widget's shadow root.`);
|
|
58
|
+
}
|
|
65
59
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
);
|
|
95
|
-
const f = c(n, `${t}.entry.ts`);
|
|
96
|
-
return w(
|
|
97
|
-
f,
|
|
98
|
-
[
|
|
99
|
-
`import "${p(m)}";`,
|
|
100
|
-
`export { default } from "${p(i)}";`,
|
|
101
|
-
""
|
|
102
|
-
].join(`
|
|
103
|
-
`)
|
|
104
|
-
), f;
|
|
60
|
+
function k(e, t, n) {
|
|
61
|
+
let a = p(e, T);
|
|
62
|
+
i(a, { recursive: !0 });
|
|
63
|
+
let o = E("@glasshome/ui/styles");
|
|
64
|
+
if (!o) throw Error("[widget-sdk] @glasshome/ui is required to build widgets (it provides the theme every GlassHome widget ships with). Add it to your widget's dependencies.");
|
|
65
|
+
let s = p(d(o), "../.."), c = E("@glasshome/widget-sdk/tailwind-sources"), u = c ? d(c) : null, m = [
|
|
66
|
+
f(s, "src"),
|
|
67
|
+
f(s, "dist"),
|
|
68
|
+
...u ? [f(u, "src"), f(u, "dist")] : [],
|
|
69
|
+
d(n)
|
|
70
|
+
].filter((e) => r(e)), h = p(a, `${t}.tailwind.css`);
|
|
71
|
+
l(h, [
|
|
72
|
+
"@import \"tailwindcss\" source(none);",
|
|
73
|
+
"@import \"tw-animate-css\";",
|
|
74
|
+
"@import \"@glasshome/ui/styles/theme\";",
|
|
75
|
+
...m.map((e) => `@source "${x(e)}";`),
|
|
76
|
+
"@custom-variant dark {",
|
|
77
|
+
" &:is(.dark *) { @slot }",
|
|
78
|
+
" :host(.dark) & { @slot }",
|
|
79
|
+
"}",
|
|
80
|
+
""
|
|
81
|
+
].join("\n"));
|
|
82
|
+
let g = p(a, `${t}.entry.ts`);
|
|
83
|
+
return l(g, [
|
|
84
|
+
`import "${x(h)}";`,
|
|
85
|
+
`export { default } from "${x(n)}";`,
|
|
86
|
+
""
|
|
87
|
+
].join("\n")), g;
|
|
105
88
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return e;
|
|
89
|
+
function A() {
|
|
90
|
+
let e = g();
|
|
91
|
+
for (let t of e) t.apply ??= "build";
|
|
92
|
+
return e;
|
|
111
93
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
94
|
+
function j(e) {
|
|
95
|
+
let t = [];
|
|
96
|
+
if (!r(e)) return t;
|
|
97
|
+
for (let n of o(e)) {
|
|
98
|
+
let i = p(e, n);
|
|
99
|
+
if (!c(i).isDirectory()) continue;
|
|
100
|
+
let a = p(i, "index.tsx"), o = p(i, "manifest.json");
|
|
101
|
+
r(a) && r(o) && t.push({
|
|
102
|
+
name: n,
|
|
103
|
+
entry: a
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return t;
|
|
122
107
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
version: 1,
|
|
146
|
-
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
147
|
-
baseUrl: "./",
|
|
148
|
-
widgets: i
|
|
149
|
-
};
|
|
150
|
-
l(t) || D(t, { recursive: !0 }), w(u(t, "registry.json"), JSON.stringify(n, null, 2)), console.log(`[registry] Generated registry.json with ${i.length} widget(s)`);
|
|
108
|
+
function M(n, s) {
|
|
109
|
+
let u = [];
|
|
110
|
+
if (r(n)) for (let i of o(n)) {
|
|
111
|
+
if (!c(f(n, i)).isDirectory()) continue;
|
|
112
|
+
let o = f(n, i, "manifest.json");
|
|
113
|
+
if (!r(o)) continue;
|
|
114
|
+
let l = t.safeParse(JSON.parse(a(o, "utf-8")));
|
|
115
|
+
if (!l.success) throw Error(`[registry] Invalid manifest for "${i}": ${e(l.error)}`);
|
|
116
|
+
let d = r(f(s, `${i}.css`));
|
|
117
|
+
u.push({
|
|
118
|
+
...l.data,
|
|
119
|
+
bundleUrl: `./${i}.js`,
|
|
120
|
+
...d ? { cssUrl: `./${i}.css` } : {}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
let d = {
|
|
124
|
+
version: 1,
|
|
125
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
126
|
+
baseUrl: "./",
|
|
127
|
+
widgets: u
|
|
128
|
+
};
|
|
129
|
+
r(s) || i(s, { recursive: !0 }), l(f(s, "registry.json"), JSON.stringify(d, null, 2)), console.log(`[registry] Generated registry.json with ${u.length} widget(s)`);
|
|
151
130
|
}
|
|
152
|
-
async function
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}), j(o, r.name);
|
|
189
|
-
z(n, o);
|
|
131
|
+
async function N(e) {
|
|
132
|
+
let { build: t } = await import("vite"), n = process.cwd(), a = p(n, e?.srcDir ?? "src"), o = p(n, e?.outDir ?? "dist"), c = j(a);
|
|
133
|
+
if (c.length === 0) {
|
|
134
|
+
console.warn("[glasshome-widgets] No widgets found in", a);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (e?.only) {
|
|
138
|
+
let t = new Set(e.only);
|
|
139
|
+
c = c.filter((e) => t.has(e.name));
|
|
140
|
+
}
|
|
141
|
+
e?.only || r(o) && s(o, { recursive: !0 }), r(o) || i(o, { recursive: !0 });
|
|
142
|
+
for (let r of c) await t({
|
|
143
|
+
configFile: !1,
|
|
144
|
+
root: n,
|
|
145
|
+
plugins: [
|
|
146
|
+
...A(),
|
|
147
|
+
...e?.plugins ?? [],
|
|
148
|
+
w()
|
|
149
|
+
],
|
|
150
|
+
...e?.viteConfig,
|
|
151
|
+
build: {
|
|
152
|
+
lib: {
|
|
153
|
+
entry: k(n, r.name, r.entry),
|
|
154
|
+
formats: ["es"],
|
|
155
|
+
fileName: r.name,
|
|
156
|
+
cssFileName: r.name
|
|
157
|
+
},
|
|
158
|
+
rollupOptions: { external: C },
|
|
159
|
+
outDir: o,
|
|
160
|
+
emptyOutDir: !1,
|
|
161
|
+
copyPublicDir: !1,
|
|
162
|
+
...e?.viteConfig?.build
|
|
163
|
+
},
|
|
164
|
+
logLevel: "warn"
|
|
165
|
+
}), O(o, r.name);
|
|
166
|
+
M(a, o);
|
|
190
167
|
}
|
|
191
|
-
function
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const W = a.manifest?.name ?? "unknown";
|
|
269
|
-
console.warn(
|
|
270
|
-
`[widget-sdk] Schema shape changed for "${W}" — verify configVersion was bumped`
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
w(v, d);
|
|
274
|
-
} catch {
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
return [..._(), i, O(), o, n];
|
|
168
|
+
function P(e) {
|
|
169
|
+
let t = e?.entry ?? "src/index.tsx", n = {
|
|
170
|
+
name: "glasshome-widget:build",
|
|
171
|
+
apply: "build",
|
|
172
|
+
config() {
|
|
173
|
+
let e = process.cwd();
|
|
174
|
+
return { build: {
|
|
175
|
+
lib: {
|
|
176
|
+
entry: k(e, "index", p(e, t)),
|
|
177
|
+
formats: ["es"],
|
|
178
|
+
fileName: "index",
|
|
179
|
+
cssFileName: "index"
|
|
180
|
+
},
|
|
181
|
+
rollupOptions: { external: C }
|
|
182
|
+
} };
|
|
183
|
+
}
|
|
184
|
+
}, i = {
|
|
185
|
+
name: "glasshome-widget:dev",
|
|
186
|
+
apply: "serve",
|
|
187
|
+
enforce: "pre",
|
|
188
|
+
config() {
|
|
189
|
+
let e = S(), t = process.cwd();
|
|
190
|
+
return { server: { fs: { allow: [
|
|
191
|
+
e,
|
|
192
|
+
t,
|
|
193
|
+
p(t, "..", "..")
|
|
194
|
+
] } } };
|
|
195
|
+
},
|
|
196
|
+
configureServer(e) {
|
|
197
|
+
let t = f(S(), "preview.html");
|
|
198
|
+
e.middlewares.use(async (n, r, i) => {
|
|
199
|
+
if (n.url === "/" || n.url === "/index.html") try {
|
|
200
|
+
let i = a(t, "utf-8");
|
|
201
|
+
i = await e.transformIndexHtml(n.url, i), r.setHeader("Content-Type", "text/html"), r.statusCode = 200, r.end(i);
|
|
202
|
+
} catch (e) {
|
|
203
|
+
i(e);
|
|
204
|
+
}
|
|
205
|
+
else i();
|
|
206
|
+
});
|
|
207
|
+
},
|
|
208
|
+
resolveId(e) {
|
|
209
|
+
if (e === b) return x(f(S(), "host.tsx"));
|
|
210
|
+
if (e === v) return y;
|
|
211
|
+
},
|
|
212
|
+
load(e) {
|
|
213
|
+
if (e === y) return `export { default } from "${x(p(process.cwd(), t))}";`;
|
|
214
|
+
}
|
|
215
|
+
}, o = {
|
|
216
|
+
name: "glasshome-widget:schema",
|
|
217
|
+
apply: "build",
|
|
218
|
+
async closeBundle() {
|
|
219
|
+
O(p(process.cwd(), "dist"), "index");
|
|
220
|
+
let e = p(process.cwd(), "dist", "index.js");
|
|
221
|
+
if (r(e)) try {
|
|
222
|
+
let t = (await import(`${e}?t=${Date.now()}`)).default;
|
|
223
|
+
if (!t?.configSchema) return;
|
|
224
|
+
let { z: n } = await import("zod"), i = n.toJSONSchema(t.configSchema, { unrepresentable: "any" }), o = p(process.cwd(), "manifest.json");
|
|
225
|
+
if (r(o)) {
|
|
226
|
+
let e = JSON.parse(a(o, "utf-8"));
|
|
227
|
+
e.schema = i, l(o, JSON.stringify(e, null, 2));
|
|
228
|
+
}
|
|
229
|
+
let s = _(i), c = p(process.cwd(), ".schema-hash");
|
|
230
|
+
if (r(c) && a(c, "utf-8").trim() !== s) {
|
|
231
|
+
let e = t.manifest?.name ?? "unknown";
|
|
232
|
+
console.warn(`[widget-sdk] Schema shape changed for "${e}" — verify configVersion was bumped`);
|
|
233
|
+
}
|
|
234
|
+
l(c, s);
|
|
235
|
+
} catch {}
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
return [
|
|
239
|
+
...A(),
|
|
240
|
+
n,
|
|
241
|
+
w(),
|
|
242
|
+
o,
|
|
243
|
+
i
|
|
244
|
+
];
|
|
279
245
|
}
|
|
280
|
-
function
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
await M({
|
|
307
|
-
srcDir: t,
|
|
308
|
-
outDir: i,
|
|
309
|
-
plugins: n
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
}];
|
|
246
|
+
function F(e) {
|
|
247
|
+
let t = e?.srcDir ?? "src", n = e?.outDir ?? "dist", r = [];
|
|
248
|
+
return [{
|
|
249
|
+
name: "glasshome-widgets:build",
|
|
250
|
+
apply: "build",
|
|
251
|
+
config(e) {
|
|
252
|
+
return r = (e.plugins ?? []).flat().filter(Boolean).filter((e) => !e.name?.startsWith("glasshome-widgets:")), { build: {
|
|
253
|
+
rollupOptions: { input: { __glasshome_noop: "\0glasshome-noop" } },
|
|
254
|
+
outDir: n,
|
|
255
|
+
copyPublicDir: !1
|
|
256
|
+
} };
|
|
257
|
+
},
|
|
258
|
+
resolveId(e) {
|
|
259
|
+
if (e === "\0glasshome-noop") return e;
|
|
260
|
+
},
|
|
261
|
+
load(e) {
|
|
262
|
+
if (e === "\0glasshome-noop") return "export {}";
|
|
263
|
+
},
|
|
264
|
+
async closeBundle() {
|
|
265
|
+
await N({
|
|
266
|
+
srcDir: t,
|
|
267
|
+
outDir: n,
|
|
268
|
+
plugins: r
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}];
|
|
313
272
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
q as discoverWidgets,
|
|
317
|
-
z as generateRegistry,
|
|
318
|
-
te as glasshomeWidget,
|
|
319
|
-
re as glasshomeWidgets,
|
|
320
|
-
k as isWidgetExternal
|
|
321
|
-
};
|
|
273
|
+
//#endregion
|
|
274
|
+
export { N as buildWidgets, j as discoverWidgets, M as generateRegistry, P as glasshomeWidget, F as glasshomeWidgets, C as isWidgetExternal };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glasshome/widget-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "SDK for building GlassHome dashboard widgets with SolidJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"glasshome",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dev": "vite build --watch"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@glasshome/sync-layer": "0.
|
|
48
|
+
"@glasshome/sync-layer": "0.3.0",
|
|
49
49
|
"solid-js": "^1.9.11"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@types/bun": "latest",
|
|
63
63
|
"@types/node": "^25.2.2",
|
|
64
64
|
"typescript": "^5",
|
|
65
|
-
"vite": "^
|
|
66
|
-
"vite-plugin-solid": "^2.11.
|
|
65
|
+
"vite": "^8.1.0",
|
|
66
|
+
"vite-plugin-solid": "^2.11.12"
|
|
67
67
|
},
|
|
68
68
|
"repository": {
|
|
69
69
|
"type": "git",
|