@skybridge/vite-plugin 0.0.0-dev.00d48a9

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Alpic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # @skybridge/vite-plugin
2
+
3
+ The Vite plugin behind [Skybridge](https://skybridge.tech): it discovers view
4
+ modules, serves them as virtual entries, applies the `data-llm` transform, and
5
+ tells `skybridge build` which packages to leave unbundled.
6
+
7
+ Its `evals` option wires up [`@skybridge/test`](https://www.npmjs.com/package/@skybridge/test),
8
+ which boots the server and extends vitest's assertions with chat-oriented
9
+ matchers for checking that a prompt reaches the right tool.
10
+
11
+ Projects created with `npm create skybridge` already have it wired up.
12
+
13
+ ```ts
14
+ import { defineConfig } from "vite";
15
+ import { skybridge } from "@skybridge/vite-plugin";
16
+
17
+ export default defineConfig({
18
+ plugins: [skybridge()],
19
+ });
20
+ ```
21
+
22
+ See the [documentation](https://docs.skybridge.tech) for the options it accepts.
@@ -0,0 +1,2 @@
1
+ export { type EvalsOptions, type SkybridgePluginOptions, skybridge, } from "./plugin.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,SAAS,GACV,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { skybridge, } from "./plugin.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,GACV,MAAM,aAAa,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { type Plugin } from "vite";
2
+ /**
3
+ * Options for the eval runner, wired in through the `evals` plugin option and
4
+ * consumed by `@skybridge/test`. Defined here so the runtime package can
5
+ * import the shape while this package keeps no dependency on it.
6
+ */
7
+ export interface EvalsOptions {
8
+ temperature?: number;
9
+ systemPrompt?: string;
10
+ maxSteps?: number;
11
+ /**
12
+ * Per-scenario timeout in milliseconds. Defaults to two minutes, because
13
+ * every turn in a scenario is a live model call and vitest's own 5s default
14
+ * expires mid-conversation.
15
+ */
16
+ timeout?: number;
17
+ }
18
+ /** Options for the {@link skybridge} Vite plugin. */
19
+ export interface SkybridgePluginOptions {
20
+ /** Directory scanned for view modules. Defaults to `"src/views"`. */
21
+ viewsDir?: string;
22
+ /**
23
+ * Package names to leave unbundled when `skybridge build` bundles the server
24
+ * for deployment. Use it for dependencies esbuild can't resolve or load —
25
+ * typically optional native modules pulled in by a transitive dependency.
26
+ */
27
+ serverExternal?: string[];
28
+ /**
29
+ * Registers the `expect.chat` matchers and, optionally, the defaults every
30
+ * conversation starts from (`temperature`, `systemPrompt`, `maxSteps`).
31
+ * Point vitest at this config to run the scenarios. Requires
32
+ * `@skybridge/test` as a dev dependency.
33
+ *
34
+ * Scenarios always run the app in-process via `start({ app })`, so
35
+ * `evals: {}` is enough to wire the matchers up.
36
+ */
37
+ evals?: EvalsOptions;
38
+ }
39
+ /**
40
+ * Vite plugin that wires a Skybridge project's view files into Vite.
41
+ *
42
+ * For each `.tsx` / `.jsx` file in `viewsDir` with a default export, the
43
+ * plugin:
44
+ * - exposes a virtual entry that calls {@link mountView} with the view's
45
+ * default export,
46
+ * - generates `.skybridge/views.d.ts` to augment {@link ViewNameRegistry} so
47
+ * {@link ViewName} narrows to the actual view names,
48
+ * - rewrites `<DataLLM>` JSX so the host can extract its content,
49
+ * - warns in dev if a view file is missing a default export.
50
+ *
51
+ * Add it to your `vite.config.ts` alongside `@vitejs/plugin-react`.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * // vite.config.ts
56
+ * import { defineConfig } from "vite";
57
+ * import react from "@vitejs/plugin-react";
58
+ * import { skybridge } from "@skybridge/vite-plugin";
59
+ *
60
+ * export default defineConfig({
61
+ * plugins: [react(), skybridge({ viewsDir: "src/views" })],
62
+ * });
63
+ * ```
64
+ */
65
+ export declare function skybridge(options?: SkybridgePluginOptions): Plugin;
66
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAWA,OAAO,EAAW,KAAK,MAAM,EAAsB,MAAM,MAAM,CAAC;AAOhE;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qDAAqD;AACrD,MAAM,WAAW,sBAAsB;IACrC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAElE"}
package/dist/plugin.js ADDED
@@ -0,0 +1,243 @@
1
+ import { existsSync, readdirSync } from "node:fs";
2
+ import { createRequire } from "node:module";
3
+ import { isAbsolute, relative, resolve } from "node:path";
4
+ import { assertUniqueViewNames, discoverViewsSync, hasDefaultExport, scanViewsSync, writeViewsDts, } from "skybridge/views";
5
+ import { loadEnv } from "vite";
6
+ import { transform as dataLlmTransform } from "./transform-data-llm.js";
7
+ const VIRTUAL_PREFIX = "/_skybridge/view/";
8
+ const VIRTUAL_MODULE_PREFIX = "\0skybridge:view:";
9
+ function buildVirtualEntry(viewFilePath) {
10
+ const normalized = viewFilePath.replace(/\\/g, "/");
11
+ return [
12
+ `import { mountView } from "skybridge/web";`,
13
+ `import Component from "${normalized}";`,
14
+ `import { createElement } from "react";`,
15
+ `mountView(createElement(Component));`,
16
+ ].join("\n");
17
+ }
18
+ function getViewEntryPattern(viewsDir) {
19
+ const escaped = viewsDir.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
20
+ return new RegExp(`${escaped}\\/(?:[^/]+\\.(?:jsx|tsx)|[^/]+\\/index\\.(?:tsx|jsx))(?:\\?.*)?$`);
21
+ }
22
+ /**
23
+ * Vite plugin that wires a Skybridge project's view files into Vite.
24
+ *
25
+ * For each `.tsx` / `.jsx` file in `viewsDir` with a default export, the
26
+ * plugin:
27
+ * - exposes a virtual entry that calls {@link mountView} with the view's
28
+ * default export,
29
+ * - generates `.skybridge/views.d.ts` to augment {@link ViewNameRegistry} so
30
+ * {@link ViewName} narrows to the actual view names,
31
+ * - rewrites `<DataLLM>` JSX so the host can extract its content,
32
+ * - warns in dev if a view file is missing a default export.
33
+ *
34
+ * Add it to your `vite.config.ts` alongside `@vitejs/plugin-react`.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * // vite.config.ts
39
+ * import { defineConfig } from "vite";
40
+ * import react from "@vitejs/plugin-react";
41
+ * import { skybridge } from "@skybridge/vite-plugin";
42
+ *
43
+ * export default defineConfig({
44
+ * plugins: [react(), skybridge({ viewsDir: "src/views" })],
45
+ * });
46
+ * ```
47
+ */
48
+ export function skybridge(options) {
49
+ return viewsPlugin(options);
50
+ }
51
+ const EVALS_DIR = "evals";
52
+ const DEFAULT_EVAL_TIMEOUT_MS = 120_000;
53
+ const MATCHERS_MODULE = "@skybridge/test/matchers";
54
+ function assertMatchersInstalled(projectRoot) {
55
+ try {
56
+ createRequire(resolve(projectRoot, "package.json")).resolve(MATCHERS_MODULE);
57
+ }
58
+ catch {
59
+ throw new Error(`The \`evals\` plugin option registers the \`expect.chat\` matchers from "${MATCHERS_MODULE}", which is not installed. Add it with \`npm install -D @skybridge/test@beta\`.`);
60
+ }
61
+ }
62
+ function hasEvalScenarios(projectRoot) {
63
+ const dir = resolve(projectRoot, EVALS_DIR);
64
+ if (!existsSync(dir)) {
65
+ return false;
66
+ }
67
+ return readdirSync(dir, { recursive: true }).some((entry) => /\.eval\.(c|m)?ts$/.test(entry.toString()));
68
+ }
69
+ function viewsPlugin(options) {
70
+ const rawViewsDir = options?.viewsDir ?? "src/views";
71
+ let resolvedViewsDir;
72
+ let projectRoot;
73
+ let viewMap = new Map();
74
+ let viewEntryPattern;
75
+ return {
76
+ name: "skybridge",
77
+ enforce: "pre",
78
+ // Read by `skybridge build` to resolve viewsDir before `tsc -b` runs, and
79
+ // to feed esbuild's external list when bundling the server.
80
+ api: { viewsDir: rawViewsDir, serverExternal: options?.serverExternal },
81
+ config(config, { mode }) {
82
+ projectRoot = config.root || process.cwd();
83
+ resolvedViewsDir = isAbsolute(rawViewsDir)
84
+ ? rawViewsDir
85
+ : resolve(projectRoot, rawViewsDir);
86
+ viewEntryPattern = getViewEntryPattern(resolvedViewsDir);
87
+ const views = discoverViewsSync(resolvedViewsDir);
88
+ viewMap = new Map(views.map((v) => [v.name, v]));
89
+ writeViewsDts(projectRoot, views);
90
+ const input = {};
91
+ for (const view of views) {
92
+ input[view.name] = `${VIRTUAL_PREFIX}${view.name}`;
93
+ }
94
+ const base = {
95
+ base: "/assets",
96
+ // Fixes "Invalid hook call" on createStore by forcing a single
97
+ // copy of React. Under pnpm's isolated node_modules, zustand
98
+ // inside `skybridge` resolves React from skybridge's own
99
+ // dependencies while the host app loads its own copy
100
+ resolve: {
101
+ dedupe: ["react", "react-dom"],
102
+ },
103
+ build: {
104
+ outDir: "dist/assets",
105
+ emptyOutDir: true,
106
+ manifest: true,
107
+ minify: true,
108
+ cssCodeSplit: false,
109
+ rollupOptions: {
110
+ input,
111
+ },
112
+ },
113
+ // Pre-bundle view deps at startup so the first tool invocation
114
+ // doesn't hit Vite's on-demand re-optimization path (which sends
115
+ // `full-reload` over HMR — in our iframe flow the parent host
116
+ // can't honour a reload, and the view silently never mounts).
117
+ optimizeDeps: {
118
+ // Scan view files so transitive user deps (zod, tailwind, etc.)
119
+ // get pre-bundled at startup.
120
+ entries: [
121
+ `${resolvedViewsDir}/*.{tsx,jsx}`,
122
+ `${resolvedViewsDir}/*/index.{tsx,jsx}`,
123
+ ],
124
+ include: ["react", "react-dom/client", "react/jsx-runtime"],
125
+ },
126
+ experimental: {
127
+ renderBuiltUrl: (filename, { hostType }) => {
128
+ // Views render inside a host sandbox iframe, so `import.meta.url`
129
+ // points at the sandbox domain rather than the Skybridge server.
130
+ // JS asset references have to be resolved at runtime against
131
+ // `window.skybridge.serverUrl` so they follow tunnels too.
132
+ if (hostType === "js") {
133
+ return {
134
+ runtime: `window.skybridge.serverUrl + "/assets/${filename}"`,
135
+ };
136
+ }
137
+ // CSS has nowhere to evaluate a runtime expression — `vite:css-post`
138
+ // throws on one. It doesn't need it either: the stylesheet is served
139
+ // from `${serverUrl}/assets/…` and a relative `url()` resolves
140
+ // against the stylesheet's own URL, tunnel origin included.
141
+ return { relative: true };
142
+ },
143
+ },
144
+ };
145
+ if (!options?.evals) {
146
+ if (hasEvalScenarios(projectRoot)) {
147
+ this.warn(`Found scenarios in "${EVALS_DIR}/" but the \`evals\` plugin option is not set, so they are not collected. Add \`skybridge({ evals: {} })\` to run them.`);
148
+ }
149
+ return base;
150
+ }
151
+ assertMatchersInstalled(projectRoot);
152
+ return {
153
+ ...base,
154
+ test: {
155
+ setupFiles: [MATCHERS_MODULE],
156
+ provide: { skybridgeEvals: options.evals },
157
+ include: [
158
+ "**/*.{test,spec}.?(c|m)[jt]s?(x)",
159
+ `${EVALS_DIR}/**/*.eval.?(c|m)ts`,
160
+ ],
161
+ testTimeout: options.evals.timeout ?? DEFAULT_EVAL_TIMEOUT_MS,
162
+ env: loadEnv(mode, projectRoot, ""),
163
+ },
164
+ };
165
+ },
166
+ resolveId(id) {
167
+ if (id.startsWith(VIRTUAL_PREFIX)) {
168
+ const name = id.slice(VIRTUAL_PREFIX.length);
169
+ if (viewMap.has(name)) {
170
+ return `${VIRTUAL_MODULE_PREFIX}${name}`;
171
+ }
172
+ }
173
+ return null;
174
+ },
175
+ load(id) {
176
+ if (id.startsWith(VIRTUAL_MODULE_PREFIX)) {
177
+ const name = id.slice(VIRTUAL_MODULE_PREFIX.length);
178
+ const view = viewMap.get(name);
179
+ if (view) {
180
+ return buildVirtualEntry(view.filePath);
181
+ }
182
+ }
183
+ return null;
184
+ },
185
+ configureServer(server) {
186
+ if (!resolvedViewsDir) {
187
+ const root = server.config.root || process.cwd();
188
+ resolvedViewsDir = isAbsolute(rawViewsDir)
189
+ ? rawViewsDir
190
+ : resolve(root, rawViewsDir);
191
+ projectRoot = root;
192
+ viewEntryPattern = getViewEntryPattern(resolvedViewsDir);
193
+ }
194
+ server.watcher.add(resolvedViewsDir);
195
+ // Track which view files we've already warned about so a rescan
196
+ // triggered by an unrelated edit doesn't re-emit the same warning.
197
+ let knownInvalid = new Set();
198
+ const rescan = () => {
199
+ try {
200
+ // Surface broken view files. Without this, files lacking a
201
+ // default export are silently dropped from the input and the
202
+ // user has no idea why their widget never mounts.
203
+ const { valid, invalid } = scanViewsSync(resolvedViewsDir);
204
+ const nextInvalid = new Set(invalid.map((v) => v.filePath));
205
+ for (const filePath of nextInvalid) {
206
+ if (!knownInvalid.has(filePath)) {
207
+ server.config.logger.warn(`[skybridge] view file "${relative(projectRoot, filePath)}" is missing a default export — it won't be served until fixed.`);
208
+ }
209
+ }
210
+ for (const filePath of knownInvalid) {
211
+ if (!nextInvalid.has(filePath)) {
212
+ server.config.logger.info(`[skybridge] view file "${relative(projectRoot, filePath)}" resolved.`);
213
+ }
214
+ }
215
+ knownInvalid = nextInvalid;
216
+ assertUniqueViewNames(valid);
217
+ viewMap = new Map(valid.map((v) => [v.name, v]));
218
+ writeViewsDts(projectRoot, valid);
219
+ }
220
+ catch (err) {
221
+ // assertUniqueViewNames throws on duplicate view names. Catch so
222
+ // chokidar's listener chain doesn't surface it as unhandled and
223
+ // crash the dev server — previous viewMap stays active until
224
+ // the user fixes the conflict.
225
+ const message = err instanceof Error ? err.message : String(err);
226
+ server.config.logger.error(`[skybridge] view rescan failed: ${message}`);
227
+ }
228
+ };
229
+ // Initial scan emits warnings for broken files that exist at startup.
230
+ rescan();
231
+ server.watcher.on("add", rescan);
232
+ server.watcher.on("change", rescan);
233
+ server.watcher.on("unlink", rescan);
234
+ },
235
+ async transform(code, id) {
236
+ if (viewEntryPattern?.test(id) && !hasDefaultExport(code)) {
237
+ this.warn(`View file "${id.split("/").pop()}" is missing a default export.`);
238
+ }
239
+ return await dataLlmTransform(code, id);
240
+ },
241
+ };
242
+ }
243
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.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,CAAC;gBACJ,CAAC;YACH,CAAC,CAAC;YAEF,sEAAsE;YACtE,MAAM,EAAE,CAAC;YACT,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YACjC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YACpC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACtC,CAAC;QAED,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE;YACtB,IAAI,gBAAgB,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1D,IAAI,CAAC,IAAI,CACP,cAAc,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,gCAAgC,CAClE,CAAC;YACJ,CAAC;YAED,OAAO,MAAM,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1C,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const transform: (code: string, id: string) => Promise<{
2
+ code: string;
3
+ map: {
4
+ version: number;
5
+ sources: string[];
6
+ names: string[];
7
+ sourceRoot?: string | undefined;
8
+ sourcesContent?: string[] | undefined;
9
+ mappings: string;
10
+ file: string;
11
+ } | null;
12
+ } | null>;
13
+ //# sourceMappingURL=transform-data-llm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-data-llm.d.ts","sourceRoot":"","sources":["../src/transform-data-llm.ts"],"names":[],"mappings":"AA+HA,eAAO,MAAM,SAAS,GAAU,MAAM,MAAM,EAAE,IAAI,MAAM;;;;;;;;;;;SA+BvD,CAAC"}
@@ -0,0 +1,96 @@
1
+ const LLM_IMPORT_SOURCE = "skybridge/web";
2
+ function createBabelPlugin(t) {
3
+ return {
4
+ name: "data-llm-babel",
5
+ visitor: {
6
+ Program: {
7
+ enter(path, state) {
8
+ state.hasDataLLMImport = false;
9
+ state.needsDataLLMImport = false;
10
+ for (const node of path.node.body) {
11
+ if (!t.isImportDeclaration(node)) {
12
+ continue;
13
+ }
14
+ if (node.source.value !== LLM_IMPORT_SOURCE) {
15
+ continue;
16
+ }
17
+ const hasSpecifier = node.specifiers.some((s) => t.isImportSpecifier(s) &&
18
+ t.isIdentifier(s.imported, { name: "DataLLM" }));
19
+ if (hasSpecifier) {
20
+ state.hasDataLLMImport = true;
21
+ break;
22
+ }
23
+ }
24
+ },
25
+ exit(path, state) {
26
+ if (state.needsDataLLMImport && !state.hasDataLLMImport) {
27
+ const importDecl = t.importDeclaration([
28
+ t.importSpecifier(t.identifier("DataLLM"), t.identifier("DataLLM")),
29
+ ], t.stringLiteral(LLM_IMPORT_SOURCE));
30
+ path.node.body.unshift(importDecl);
31
+ }
32
+ },
33
+ },
34
+ JSXElement(path, state) {
35
+ const opening = path.node.openingElement;
36
+ const attributes = opening.attributes;
37
+ const llmAttributeIndex = attributes.findIndex((attribute) => t.isJSXAttribute(attribute) &&
38
+ t.isJSXIdentifier(attribute.name, { name: "data-llm" }));
39
+ if (llmAttributeIndex === -1) {
40
+ return;
41
+ }
42
+ const llmAttribute = attributes[llmAttributeIndex];
43
+ let contentExpression;
44
+ if (t.isStringLiteral(llmAttribute.value)) {
45
+ contentExpression = llmAttribute.value;
46
+ }
47
+ else if (t.isJSXExpressionContainer(llmAttribute.value)) {
48
+ contentExpression = llmAttribute.value.expression;
49
+ }
50
+ else {
51
+ return;
52
+ }
53
+ const contentAttr = t.jsxAttribute(t.jsxIdentifier("content"), t.isStringLiteral(contentExpression)
54
+ ? contentExpression
55
+ : t.jsxExpressionContainer(contentExpression));
56
+ const filteredAttributes = attributes.filter((_, index) => index !== llmAttributeIndex);
57
+ const newOpening = t.jsxOpeningElement(opening.name, filteredAttributes, opening.selfClosing);
58
+ const elementWithoutLlm = t.jsxElement(newOpening, path.node.closingElement, path.node.children, path.node.selfClosing);
59
+ const llmOpening = t.jsxOpeningElement(t.jsxIdentifier("DataLLM"), [
60
+ contentAttr,
61
+ ]);
62
+ const llmClosing = t.jsxClosingElement(t.jsxIdentifier("DataLLM"));
63
+ const wrapped = t.jsxElement(llmOpening, llmClosing, [elementWithoutLlm], false);
64
+ state.needsDataLLMImport = true;
65
+ path.replaceWith(wrapped);
66
+ },
67
+ },
68
+ };
69
+ }
70
+ export const transform = async (code, id) => {
71
+ if (!/\.(jsx|tsx)$/.test(id)) {
72
+ return null;
73
+ }
74
+ if (id.includes("node_modules")) {
75
+ return null;
76
+ }
77
+ // Dynamic import to ensure @babel/core is only loaded in Node.js context
78
+ const { types: t, transformSync } = await import("@babel/core");
79
+ const babelOptions = {
80
+ plugins: [createBabelPlugin(t)],
81
+ parserOpts: {
82
+ plugins: ["jsx", "typescript"],
83
+ },
84
+ filename: id,
85
+ sourceFileName: id,
86
+ };
87
+ const result = transformSync(code, babelOptions);
88
+ if (!result?.code) {
89
+ return null;
90
+ }
91
+ return {
92
+ code: result.code,
93
+ map: result.map || null,
94
+ };
95
+ };
96
+ //# sourceMappingURL=transform-data-llm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-data-llm.js","sourceRoot":"","sources":["../src/transform-data-llm.ts"],"names":[],"mappings":"AAEA,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAO1C,SAAS,iBAAiB,CAAC,CAAe;IACxC,OAAO;QACL,IAAI,EAAE,gBAAgB;QAEtB,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,KAAK,CAAC,IAAI,EAAE,KAAK;oBACf,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC;oBAC/B,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC;oBAEjC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;wBAClC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;4BACjC,SAAS;wBACX,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GAAG,EAAE,MAAM,CAAC,GAAG,IAAI,IAAI;KACxB,CAAC;AACJ,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@skybridge/vite-plugin",
3
+ "version": "0.0.0-dev.00d48a9",
4
+ "description": "The Skybridge Vite plugin: view discovery, data-llm transforms, and eval wiring",
5
+ "license": "ISC",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/alpic-ai/skybridge.git"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "dependencies": {
21
+ "@babel/core": "^7.29.7"
22
+ },
23
+ "peerDependencies": {
24
+ "skybridge": "^2.0.0",
25
+ "vite": ">=7.3.1",
26
+ "vitest": ">=4.1.0"
27
+ },
28
+ "devDependencies": {
29
+ "@types/babel__core": "^7.20.5",
30
+ "@types/node": "^24.13.3",
31
+ "typescript": "^5.9.3",
32
+ "vite": "^8.1.5",
33
+ "vitest": "^4.1.10",
34
+ "skybridge": "0.0.0-dev.00d48a9"
35
+ },
36
+ "engines": {
37
+ "node": ">=22.23.1"
38
+ },
39
+ "peerDependenciesMeta": {
40
+ "vitest": {
41
+ "optional": true
42
+ }
43
+ },
44
+ "scripts": {
45
+ "build": "tsc -p tsconfig.json",
46
+ "format": "biome check --write --error-on-warnings",
47
+ "test": "pnpm run test:format && pnpm run test:types && pnpm run test:unit",
48
+ "test:format": "biome ci",
49
+ "test:types": "tsc --noEmit -p tsconfig.test.json",
50
+ "test:unit": "vitest run"
51
+ }
52
+ }