@base44-preview/vite-plugin 1.0.37-pr.121.03337a6 → 1.0.37-pr.121.9ef7c71
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/README.md +1 -1
- package/dist/build-status-plugin.d.ts.map +1 -1
- package/dist/build-status-plugin.js +12 -19
- package/dist/build-status-plugin.js.map +1 -1
- package/dist/error-overlay-plugin.d.ts.map +1 -1
- package/dist/error-overlay-plugin.js +0 -9
- package/dist/error-overlay-plugin.js.map +1 -1
- package/dist/html-injections-plugin.d.ts +0 -7
- package/dist/html-injections-plugin.d.ts.map +1 -1
- package/dist/html-injections-plugin.js +7 -34
- package/dist/html-injections-plugin.js.map +1 -1
- package/dist/injections/sandbox-hmr-socket-relay.d.ts.map +1 -1
- package/dist/injections/sandbox-hmr-socket-relay.js.map +1 -1
- package/package.json +1 -1
- package/src/build-status-plugin.ts +12 -18
- package/src/error-overlay-plugin.ts +0 -11
- package/src/html-injections-plugin.ts +9 -38
- package/src/injections/sandbox-hmr-socket-relay.ts +1 -3
package/README.md
CHANGED
|
@@ -115,7 +115,7 @@ endpoint's job is **post-load HMR / compile errors**, not cold-start failures.
|
|
|
115
115
|
|
|
116
116
|
### Sandbox Injections
|
|
117
117
|
|
|
118
|
-
In **dev mode**, individual `<script type="module" src="...">` tags are injected for each feature, loaded directly from `node_modules`. Under bundled dev mode the tags are injected with `order: "pre"` instead, so they become part of the HTML entry and are folded into the bundle (with `import.meta.hot` available).
|
|
118
|
+
In **dev mode**, individual `<script type="module" src="...">` tags are injected for each feature, loaded directly from `node_modules`. Under bundled dev mode the tags are injected with `order: "pre"` instead, so they become part of the HTML entry and are folded into the bundle (with `import.meta.hot` available).
|
|
119
119
|
|
|
120
120
|
- **Error handlers** (`unhandled-errors-handlers.js`) — Global `error` and `unhandledrejection` listeners that report to the parent via `postMessage`.
|
|
121
121
|
- **Mount observer** (`sandbox-mount-observer.js`) — `MutationObserver` that detects when instrumented elements (`data-source-location`) are rendered.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-status-plugin.d.ts","sourceRoot":"","sources":["../src/build-status-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,MAAM,EAAiB,MAAM,MAAM,CAAC;AAsFnE;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CA2ClE;AAED,wBAAgB,iBAAiB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"build-status-plugin.d.ts","sourceRoot":"","sources":["../src/build-status-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,MAAM,EAAiB,MAAM,MAAM,CAAC;AAsFnE;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CA2ClE;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAmG1C"}
|
|
@@ -18,11 +18,11 @@ import { isBundledDev } from "./bundled-dev.js";
|
|
|
18
18
|
* The status is always reported in the body with HTTP `200`, even on error:
|
|
19
19
|
* a `500` here would trip the preview proxy's own error path.
|
|
20
20
|
*
|
|
21
|
-
* Cold-start caveat
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
21
|
+
* Cold-start caveat: errors thrown before any client has connected are not
|
|
22
|
+
* sent over the HMR channel, so a boot-time transform failure may briefly
|
|
23
|
+
* read `ok: true`. That window is covered server-side by the existing
|
|
24
|
+
* dev_server_error_classifier. This endpoint reports post-load
|
|
25
|
+
* HMR / compile errors.
|
|
26
26
|
*/
|
|
27
27
|
const ENDPOINT = "/__build_status";
|
|
28
28
|
/** Max characters kept per scrubbed string field. */
|
|
@@ -130,13 +130,12 @@ export function buildStatusPlugin() {
|
|
|
130
130
|
lastError = null;
|
|
131
131
|
},
|
|
132
132
|
configureServer(server) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
try {
|
|
133
|
+
try {
|
|
134
|
+
if (bundled) {
|
|
135
|
+
// Bundled dev reports build failures through the environment logger
|
|
136
|
+
// (`{ error }` option) and per-client sends, never the broadcast
|
|
137
|
+
// channel patched below. Any logged `{ error }` counts until the next
|
|
138
|
+
// successful build: the fail-safe direction for a health endpoint.
|
|
140
139
|
const logger = server.environments.client.logger;
|
|
141
140
|
if (!logger.error[PATCHED]) {
|
|
142
141
|
const origError = logger.error.bind(logger);
|
|
@@ -149,14 +148,8 @@ export function buildStatusPlugin() {
|
|
|
149
148
|
logger.error = patched;
|
|
150
149
|
}
|
|
151
150
|
}
|
|
152
|
-
catch {
|
|
153
|
-
// Build failures then surface only via buildEnd; the endpoint still mounts.
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
try {
|
|
157
151
|
// Observe the HMR channel: an `error` payload records the last
|
|
158
|
-
// error; a successful `update` / `full-reload` clears it.
|
|
159
|
-
// bundled dev too: nothing is broadcast there, so it is inert.
|
|
152
|
+
// error; a successful `update` / `full-reload` clears it.
|
|
160
153
|
const ch = (server.hot ?? server.ws);
|
|
161
154
|
if (ch && typeof ch.send === "function") {
|
|
162
155
|
const orig = ch.send.bind(ch);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-status-plugin.js","sourceRoot":"","sources":["../src/build-status-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAEnC,qDAAqD;AACrD,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,8CAA8C;AAC9C,MAAM,SAAS,GAAG,IAAI,CAAC;AAIvB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,kCA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":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAUnC,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"error-overlay-plugin.d.ts","sourceRoot":"","sources":["../src/error-overlay-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAUnC,wBAAgB,kBAAkB,IA+B3B,MAAM,CACZ"}
|
|
@@ -12,15 +12,6 @@ export function errorOverlayPlugin() {
|
|
|
12
12
|
// Bundled dev never serves client.mjs, so the swap below cannot run. Turn
|
|
13
13
|
// Vite's overlay off and let sandbox-build-error-notifier forward the error.
|
|
14
14
|
config: (config) => isBundledDev(config) ? { server: { hmr: { overlay: false } } } : null,
|
|
15
|
-
// `config` sees only the user config; a later plugin or CLI flag can still
|
|
16
|
-
// turn bundled dev on, leaving Vite's overlay up next to the notifier.
|
|
17
|
-
configResolved(config) {
|
|
18
|
-
const hmr = config.server.hmr;
|
|
19
|
-
if (isBundledDev(config) && hmr !== false && (hmr === true || hmr?.overlay !== false)) {
|
|
20
|
-
console.warn("[error-overlay] Bundled dev mode is on but server.hmr.overlay is not false — " +
|
|
21
|
-
"Vite's own overlay will show alongside the app_error sent to the parent.");
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
15
|
transform(code, id, opts = {}) {
|
|
25
16
|
if (opts?.ssr)
|
|
26
17
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-overlay-plugin.js","sourceRoot":"","sources":["../src/error-overlay-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,oEAAoE;AACpE,iFAAiF;AACjF,gFAAgF;AAChF,kCAAkC;AAClC,MAAM,iBAAiB,GACrB,mFAAmF,CAAC;AAEtF,MAAM,UAAU,kBAAkB;IAChC,OA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AAC,MAAM,EAAE,WAAW,EAAE,EAAE,CACtE,gBAAgB;gBAChB,IAAI;gBACJ,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,kBAAkB,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAC3E,CAAC;YACF,wEAAwE;YACxE,sEAAsE;YACtE,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,OAAO,CAAC,IAAI,CACV,oEAAoE;oBAClE,sEAAsE;oBACtE,oEAAoE,CACvE,CAAC;gBACF,4EAA4E;gBAC5E,OAAO;YACT,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;KACQ,CAAC;AACd,CAAC"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import type { ServerResponse } from "node:http";
|
|
2
2
|
import type { Connect, Plugin } from "vite";
|
|
3
|
-
/**
|
|
4
|
-
* Bundled dev resolves module-script `src` through the bundler instead of the
|
|
5
|
-
* dev server, so a node_modules URL would break on any non-flat install. These
|
|
6
|
-
* ids are mapped onto the plugin's own dist tree by `resolveId` below.
|
|
7
|
-
*/
|
|
8
|
-
export declare const BUNDLED_INJECTION_PREFIX = "virtual:base44-vite-plugin/";
|
|
9
3
|
/** This file lives in dist/ once built, so its directory is the served root. */
|
|
10
4
|
export declare const PLUGIN_DIST_DIR: string;
|
|
11
|
-
export declare function resolveBundledInjection(id: string, distDir?: string): string | undefined;
|
|
12
5
|
/**
|
|
13
6
|
* Bundled dev mounts no static/transform middleware, so the visual-edit agent's
|
|
14
7
|
* dynamic `import()` of dist/statics/index.mjs would fall through to the SPA
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-injections-plugin.d.ts","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAoC,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"html-injections-plugin.d.ts","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAoC,MAAM,MAAM,CAAC;AAgG9E,gFAAgF;AAChF,eAAO,MAAM,eAAe,QAA+C,CAAC;AAE5E;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,IACzC,KAAK,OAAO,CAAC,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC,YAAY,UA0BtF;AAED,wBAAgB,oBAAoB,CAAC,EACnC,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,EAAE;IACD,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,GAAG,MAAM,EAAE,CAiHX"}
|
|
@@ -36,41 +36,35 @@ if (window.self === window.top) {
|
|
|
36
36
|
}
|
|
37
37
|
`;
|
|
38
38
|
const DIST_URL_PREFIX = "/node_modules/@base44/vite-plugin/dist";
|
|
39
|
-
/**
|
|
40
|
-
* Bundled dev resolves module-script `src` through the bundler instead of the
|
|
41
|
-
* dev server, so a node_modules URL would break on any non-flat install. These
|
|
42
|
-
* ids are mapped onto the plugin's own dist tree by `resolveId` below.
|
|
43
|
-
*/
|
|
44
|
-
export const BUNDLED_INJECTION_PREFIX = "virtual:base44-vite-plugin/";
|
|
45
39
|
const INJECTIONS = {
|
|
46
40
|
unhandledErrors: {
|
|
47
|
-
|
|
41
|
+
src: `${DIST_URL_PREFIX}/injections/unhandled-errors-handlers.js`,
|
|
48
42
|
injectTo: "head",
|
|
49
43
|
mode: "dev",
|
|
50
44
|
},
|
|
51
45
|
sandboxMount: {
|
|
52
|
-
|
|
46
|
+
src: `${DIST_URL_PREFIX}/injections/sandbox-mount-observer.js`,
|
|
53
47
|
injectTo: "body",
|
|
54
48
|
mode: "dev",
|
|
55
49
|
},
|
|
56
50
|
hmrNotifier: {
|
|
57
|
-
|
|
51
|
+
src: `${DIST_URL_PREFIX}/injections/sandbox-hmr-notifier.js`,
|
|
58
52
|
injectTo: "head",
|
|
59
53
|
mode: "dev",
|
|
60
54
|
},
|
|
61
55
|
navigationNotifier: {
|
|
62
|
-
|
|
56
|
+
src: `${DIST_URL_PREFIX}/injections/navigation-notifier.js`,
|
|
63
57
|
injectTo: "head",
|
|
64
58
|
mode: "dev",
|
|
65
59
|
},
|
|
66
60
|
buildErrorNotifier: {
|
|
67
|
-
|
|
61
|
+
src: `${DIST_URL_PREFIX}/injections/sandbox-build-error-notifier.js`,
|
|
68
62
|
injectTo: "head",
|
|
69
63
|
mode: "dev",
|
|
70
64
|
bundledOnly: true,
|
|
71
65
|
},
|
|
72
66
|
hmrSocketRelay: {
|
|
73
|
-
|
|
67
|
+
src: `${DIST_URL_PREFIX}/injections/sandbox-hmr-socket-relay.js`,
|
|
74
68
|
injectTo: "head",
|
|
75
69
|
mode: "dev",
|
|
76
70
|
bundledOnly: true,
|
|
@@ -88,12 +82,6 @@ const CONTENT_TYPES = {
|
|
|
88
82
|
};
|
|
89
83
|
/** This file lives in dist/ once built, so its directory is the served root. */
|
|
90
84
|
export const PLUGIN_DIST_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
91
|
-
const VISUAL_EDIT_AGENT_FILE = "statics/index.mjs";
|
|
92
|
-
export function resolveBundledInjection(id, distDir = PLUGIN_DIST_DIR) {
|
|
93
|
-
if (!id.startsWith(BUNDLED_INJECTION_PREFIX))
|
|
94
|
-
return undefined;
|
|
95
|
-
return path.join(distDir, id.slice(BUNDLED_INJECTION_PREFIX.length));
|
|
96
|
-
}
|
|
97
85
|
/**
|
|
98
86
|
* Bundled dev mounts no static/transform middleware, so the visual-edit agent's
|
|
99
87
|
* dynamic `import()` of dist/statics/index.mjs would fall through to the SPA
|
|
@@ -129,9 +117,6 @@ export function serveDistMiddleware(distDir) {
|
|
|
129
117
|
};
|
|
130
118
|
}
|
|
131
119
|
export function htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEditAgent, analyticsTracker, }) {
|
|
132
|
-
// The two bundled-only scripts stand in for things that are unconditional in
|
|
133
|
-
// the middleware server (the error overlay swap and the preview bridge's
|
|
134
|
-
// `/@vite/client` import), so they do not follow the opt-in toggles.
|
|
135
120
|
const enabledInjections = {
|
|
136
121
|
unhandledErrors: true,
|
|
137
122
|
sandboxMount: true,
|
|
@@ -141,8 +126,6 @@ export function htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEd
|
|
|
141
126
|
hmrSocketRelay: true,
|
|
142
127
|
analyticsTracker,
|
|
143
128
|
};
|
|
144
|
-
// Written by `dev.configResolved`; the three plugins below are always
|
|
145
|
-
// registered together and read this shared state.
|
|
146
129
|
let resolvedEnv = {};
|
|
147
130
|
let isServe = false;
|
|
148
131
|
let bundled = false;
|
|
@@ -161,12 +144,9 @@ export function htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEd
|
|
|
161
144
|
injectTo: injection.injectTo,
|
|
162
145
|
};
|
|
163
146
|
}
|
|
164
|
-
const src = bundled
|
|
165
|
-
? `${BUNDLED_INJECTION_PREFIX}${injection.file}`
|
|
166
|
-
: `${DIST_URL_PREFIX}/${injection.file}`;
|
|
167
147
|
return {
|
|
168
148
|
tag: "script",
|
|
169
|
-
attrs: { src, type: "module" },
|
|
149
|
+
attrs: { src: injection.src, type: "module" },
|
|
170
150
|
injectTo: injection.injectTo,
|
|
171
151
|
};
|
|
172
152
|
});
|
|
@@ -206,10 +186,6 @@ export function htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEd
|
|
|
206
186
|
configureServer(server) {
|
|
207
187
|
if (!bundled)
|
|
208
188
|
return;
|
|
209
|
-
if (visualEditAgent && !existsSync(path.join(PLUGIN_DIST_DIR, VISUAL_EDIT_AGENT_FILE))) {
|
|
210
|
-
console.warn(`[html-injections] ${VISUAL_EDIT_AGENT_FILE} not found under ${PLUGIN_DIST_DIR}; ` +
|
|
211
|
-
"the visual edit agent will not load in bundled dev mode.");
|
|
212
|
-
}
|
|
213
189
|
server.middlewares.use(serveDistMiddleware(PLUGIN_DIST_DIR));
|
|
214
190
|
},
|
|
215
191
|
transformIndexHtml: {
|
|
@@ -224,9 +200,6 @@ export function htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEd
|
|
|
224
200
|
// injecting after its own HTML processing, exactly as before.
|
|
225
201
|
const devBundled = {
|
|
226
202
|
name: "html-injections-bundled",
|
|
227
|
-
resolveId(id) {
|
|
228
|
-
return resolveBundledInjection(id);
|
|
229
|
-
},
|
|
230
203
|
transformIndexHtml: {
|
|
231
204
|
order: "pre",
|
|
232
205
|
handler() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-injections-plugin.js","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAahD,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BhC,CAAC;AAEF,MAAM,eAAe,GAAG,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"html-injections-plugin.js","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE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;YACzE,uEAAuE;YACvE,OAAO,GAAG,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC;YACrC,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,eAAe,CAAC,MAAqB;YACnC,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;QAC/D,CAAC;QACD,kBAAkB,EAAE;YAClB,OAAO;gBACL,OAAO,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C,CAAC;SACF;KACF,CAAC;IAEF,4EAA4E;IAC5E,+EAA+E;IAC/E,8EAA8E;IAC9E,8DAA8D;IAC9D,MAAM,UAAU,GAAW;QACzB,IAAI,EAAE,yBAAyB;QAC/B,kBAAkB,EAAE;YAClB,KAAK,EAAE,KAAK;YACZ,OAAO;gBACL,OAAO,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7C,CAAC;SACF;KACF,CAAC;IAEF,MAAM,UAAU,GAAW;QACzB,IAAI,EAAE,4BAA4B;QAClC,kBAAkB,EAAE;YAClB,OAAO;gBACL,OAAO,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAC9C,CAAC;SACF;KACF,CAAC;IAEF,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-hmr-socket-relay.d.ts","sourceRoot":"","sources":["../../src/injections/sandbox-hmr-socket-relay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sandbox-hmr-socket-relay.d.ts","sourceRoot":"","sources":["../../src/injections/sandbox-hmr-socket-relay.ts"],"names":[],"mappings":"AAMA,KAAK,SAAS,GAAG;IACf,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,KAAK,IAAI,CAAC;CACjE,CAAC;AAIF,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAE5D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,GAAE,MAAe,QAkBxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-hmr-socket-relay.js","sourceRoot":"","sources":["../../src/injections/sandbox-hmr-socket-relay.ts"],"names":[],"mappings":"AAAA,qCAAqC;
|
|
1
|
+
{"version":3,"file":"sandbox-hmr-socket-relay.js","sourceRoot":"","sources":["../../src/injections/sandbox-hmr-socket-relay.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAUrC,6EAA6E;AAC7E,kFAAkF;AAClF,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE5D,MAAM,UAAU,oBAAoB,CAAC,GAAc,EAAE,MAAc,MAAM;IACtE,GAA0C,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAC1E,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG;QAAE,OAAO;IACjC,MAAM,gBAAgB,GACpB,MAAM,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,IAAI,CAAC,CAAC;IACtF,GAAG,CAAC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC7B,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,GAAG,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAChC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,GAAG,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,2EAA2E;IAC3E,4EAA4E;IAC5E,+EAA+E;IAC/E,GAAG,CAAC,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACnC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAO,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC;AAED,gFAAgF;AAChF,wEAAwE;AACxE,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG;IAAE,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -21,11 +21,11 @@ import { isBundledDev } from "./bundled-dev.js";
|
|
|
21
21
|
* The status is always reported in the body with HTTP `200`, even on error:
|
|
22
22
|
* a `500` here would trip the preview proxy's own error path.
|
|
23
23
|
*
|
|
24
|
-
* Cold-start caveat
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
24
|
+
* Cold-start caveat: errors thrown before any client has connected are not
|
|
25
|
+
* sent over the HMR channel, so a boot-time transform failure may briefly
|
|
26
|
+
* read `ok: true`. That window is covered server-side by the existing
|
|
27
|
+
* dev_server_error_classifier. This endpoint reports post-load
|
|
28
|
+
* HMR / compile errors.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
const ENDPOINT = "/__build_status";
|
|
@@ -153,13 +153,12 @@ export function buildStatusPlugin(): Plugin {
|
|
|
153
153
|
if (bundled && isClientEnvironment(this)) lastError = null;
|
|
154
154
|
},
|
|
155
155
|
configureServer(server: ViteDevServer) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
try {
|
|
156
|
+
try {
|
|
157
|
+
if (bundled) {
|
|
158
|
+
// Bundled dev reports build failures through the environment logger
|
|
159
|
+
// (`{ error }` option) and per-client sends, never the broadcast
|
|
160
|
+
// channel patched below. Any logged `{ error }` counts until the next
|
|
161
|
+
// successful build: the fail-safe direction for a health endpoint.
|
|
163
162
|
const logger = server.environments.client.logger as PatchableLogger;
|
|
164
163
|
if (!logger.error[PATCHED]) {
|
|
165
164
|
const origError = logger.error.bind(logger);
|
|
@@ -170,14 +169,9 @@ export function buildStatusPlugin(): Plugin {
|
|
|
170
169
|
patched[PATCHED] = true;
|
|
171
170
|
logger.error = patched;
|
|
172
171
|
}
|
|
173
|
-
} catch {
|
|
174
|
-
// Build failures then surface only via buildEnd; the endpoint still mounts.
|
|
175
172
|
}
|
|
176
|
-
}
|
|
177
|
-
try {
|
|
178
173
|
// Observe the HMR channel: an `error` payload records the last
|
|
179
|
-
// error; a successful `update` / `full-reload` clears it.
|
|
180
|
-
// bundled dev too: nothing is broadcast there, so it is inert.
|
|
174
|
+
// error; a successful `update` / `full-reload` clears it.
|
|
181
175
|
const ch = (server.hot ?? server.ws) as unknown as SendChannel | undefined;
|
|
182
176
|
if (ch && typeof ch.send === "function") {
|
|
183
177
|
const orig = ch.send.bind(ch);
|
|
@@ -17,17 +17,6 @@ export function errorOverlayPlugin() {
|
|
|
17
17
|
// Vite's overlay off and let sandbox-build-error-notifier forward the error.
|
|
18
18
|
config: (config) =>
|
|
19
19
|
isBundledDev(config) ? { server: { hmr: { overlay: false } } } : null,
|
|
20
|
-
// `config` sees only the user config; a later plugin or CLI flag can still
|
|
21
|
-
// turn bundled dev on, leaving Vite's overlay up next to the notifier.
|
|
22
|
-
configResolved(config) {
|
|
23
|
-
const hmr = config.server.hmr;
|
|
24
|
-
if (isBundledDev(config) && hmr !== false && (hmr === true || hmr?.overlay !== false)) {
|
|
25
|
-
console.warn(
|
|
26
|
-
"[error-overlay] Bundled dev mode is on but server.hmr.overlay is not false — " +
|
|
27
|
-
"Vite's own overlay will show alongside the app_error sent to the parent."
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
20
|
transform(code, id, opts = {}) {
|
|
32
21
|
if (opts?.ssr) return;
|
|
33
22
|
|
|
@@ -7,8 +7,8 @@ import { loadEnv } from "vite";
|
|
|
7
7
|
import { isBundledDev } from "./bundled-dev.js";
|
|
8
8
|
|
|
9
9
|
type Injection = {
|
|
10
|
-
/** Script path
|
|
11
|
-
|
|
10
|
+
/** Script src path for dev mode (served from node_modules) */
|
|
11
|
+
src?: string;
|
|
12
12
|
injectTo: "head" | "body";
|
|
13
13
|
mode: "dev" | "production";
|
|
14
14
|
/** Inline content for production builds (src paths don't work in built output) */
|
|
@@ -51,42 +51,36 @@ if (window.self === window.top) {
|
|
|
51
51
|
`;
|
|
52
52
|
|
|
53
53
|
const DIST_URL_PREFIX = "/node_modules/@base44/vite-plugin/dist";
|
|
54
|
-
/**
|
|
55
|
-
* Bundled dev resolves module-script `src` through the bundler instead of the
|
|
56
|
-
* dev server, so a node_modules URL would break on any non-flat install. These
|
|
57
|
-
* ids are mapped onto the plugin's own dist tree by `resolveId` below.
|
|
58
|
-
*/
|
|
59
|
-
export const BUNDLED_INJECTION_PREFIX = "virtual:base44-vite-plugin/";
|
|
60
54
|
|
|
61
55
|
const INJECTIONS: Record<string, Injection> = {
|
|
62
56
|
unhandledErrors: {
|
|
63
|
-
|
|
57
|
+
src: `${DIST_URL_PREFIX}/injections/unhandled-errors-handlers.js`,
|
|
64
58
|
injectTo: "head",
|
|
65
59
|
mode: "dev",
|
|
66
60
|
},
|
|
67
61
|
sandboxMount: {
|
|
68
|
-
|
|
62
|
+
src: `${DIST_URL_PREFIX}/injections/sandbox-mount-observer.js`,
|
|
69
63
|
injectTo: "body",
|
|
70
64
|
mode: "dev",
|
|
71
65
|
},
|
|
72
66
|
hmrNotifier: {
|
|
73
|
-
|
|
67
|
+
src: `${DIST_URL_PREFIX}/injections/sandbox-hmr-notifier.js`,
|
|
74
68
|
injectTo: "head",
|
|
75
69
|
mode: "dev",
|
|
76
70
|
},
|
|
77
71
|
navigationNotifier: {
|
|
78
|
-
|
|
72
|
+
src: `${DIST_URL_PREFIX}/injections/navigation-notifier.js`,
|
|
79
73
|
injectTo: "head",
|
|
80
74
|
mode: "dev",
|
|
81
75
|
},
|
|
82
76
|
buildErrorNotifier: {
|
|
83
|
-
|
|
77
|
+
src: `${DIST_URL_PREFIX}/injections/sandbox-build-error-notifier.js`,
|
|
84
78
|
injectTo: "head",
|
|
85
79
|
mode: "dev",
|
|
86
80
|
bundledOnly: true,
|
|
87
81
|
},
|
|
88
82
|
hmrSocketRelay: {
|
|
89
|
-
|
|
83
|
+
src: `${DIST_URL_PREFIX}/injections/sandbox-hmr-socket-relay.js`,
|
|
90
84
|
injectTo: "head",
|
|
91
85
|
mode: "dev",
|
|
92
86
|
bundledOnly: true,
|
|
@@ -106,12 +100,6 @@ const CONTENT_TYPES: Record<string, string> = {
|
|
|
106
100
|
|
|
107
101
|
/** This file lives in dist/ once built, so its directory is the served root. */
|
|
108
102
|
export const PLUGIN_DIST_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
109
|
-
const VISUAL_EDIT_AGENT_FILE = "statics/index.mjs";
|
|
110
|
-
|
|
111
|
-
export function resolveBundledInjection(id: string, distDir = PLUGIN_DIST_DIR): string | undefined {
|
|
112
|
-
if (!id.startsWith(BUNDLED_INJECTION_PREFIX)) return undefined;
|
|
113
|
-
return path.join(distDir, id.slice(BUNDLED_INJECTION_PREFIX.length));
|
|
114
|
-
}
|
|
115
103
|
|
|
116
104
|
/**
|
|
117
105
|
* Bundled dev mounts no static/transform middleware, so the visual-edit agent's
|
|
@@ -158,9 +146,6 @@ export function htmlInjectionsPlugin({
|
|
|
158
146
|
visualEditAgent: boolean;
|
|
159
147
|
analyticsTracker: boolean;
|
|
160
148
|
}): Plugin[] {
|
|
161
|
-
// The two bundled-only scripts stand in for things that are unconditional in
|
|
162
|
-
// the middleware server (the error overlay swap and the preview bridge's
|
|
163
|
-
// `/@vite/client` import), so they do not follow the opt-in toggles.
|
|
164
149
|
const enabledInjections: Record<string, boolean> = {
|
|
165
150
|
unhandledErrors: true,
|
|
166
151
|
sandboxMount: true,
|
|
@@ -171,8 +156,6 @@ export function htmlInjectionsPlugin({
|
|
|
171
156
|
analyticsTracker,
|
|
172
157
|
};
|
|
173
158
|
|
|
174
|
-
// Written by `dev.configResolved`; the three plugins below are always
|
|
175
|
-
// registered together and read this shared state.
|
|
176
159
|
let resolvedEnv: Record<string, string> = {};
|
|
177
160
|
let isServe = false;
|
|
178
161
|
let bundled = false;
|
|
@@ -199,12 +182,9 @@ export function htmlInjectionsPlugin({
|
|
|
199
182
|
injectTo: injection.injectTo,
|
|
200
183
|
};
|
|
201
184
|
}
|
|
202
|
-
const src = bundled
|
|
203
|
-
? `${BUNDLED_INJECTION_PREFIX}${injection.file}`
|
|
204
|
-
: `${DIST_URL_PREFIX}/${injection.file}`;
|
|
205
185
|
return {
|
|
206
186
|
tag: "script",
|
|
207
|
-
attrs: { src, type: "module" },
|
|
187
|
+
attrs: { src: injection.src, type: "module" },
|
|
208
188
|
injectTo: injection.injectTo,
|
|
209
189
|
};
|
|
210
190
|
});
|
|
@@ -245,12 +225,6 @@ export function htmlInjectionsPlugin({
|
|
|
245
225
|
},
|
|
246
226
|
configureServer(server: ViteDevServer) {
|
|
247
227
|
if (!bundled) return;
|
|
248
|
-
if (visualEditAgent && !existsSync(path.join(PLUGIN_DIST_DIR, VISUAL_EDIT_AGENT_FILE))) {
|
|
249
|
-
console.warn(
|
|
250
|
-
`[html-injections] ${VISUAL_EDIT_AGENT_FILE} not found under ${PLUGIN_DIST_DIR}; ` +
|
|
251
|
-
"the visual edit agent will not load in bundled dev mode."
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
228
|
server.middlewares.use(serveDistMiddleware(PLUGIN_DIST_DIR));
|
|
255
229
|
},
|
|
256
230
|
transformIndexHtml: {
|
|
@@ -266,9 +240,6 @@ export function htmlInjectionsPlugin({
|
|
|
266
240
|
// injecting after its own HTML processing, exactly as before.
|
|
267
241
|
const devBundled: Plugin = {
|
|
268
242
|
name: "html-injections-bundled",
|
|
269
|
-
resolveId(id) {
|
|
270
|
-
return resolveBundledInjection(id);
|
|
271
|
-
},
|
|
272
243
|
transformIndexHtml: {
|
|
273
244
|
order: "pre",
|
|
274
245
|
handler() {
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// The preview proxy's bridge watches the HMR socket by importing /@vite/client,
|
|
4
4
|
// which bundled dev mode does not serve. This module ships inside the bundle and
|
|
5
|
-
// reports the same events
|
|
6
|
-
// the bridge (builder_bridge_inject.py) polls it for a while after its import
|
|
7
|
-
// fails before reporting the socket as unreachable.
|
|
5
|
+
// reports the same events; the bridge skips its own attach when it sees the flag.
|
|
8
6
|
|
|
9
7
|
type HotEvents = {
|
|
10
8
|
on: (event: string, cb: (payload?: unknown) => unknown) => void;
|