@base44-preview/vite-plugin 1.0.35-pr.118.22dbd5b → 1.0.37-pr.121.03337a6

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.
Files changed (39) hide show
  1. package/README.md +16 -5
  2. package/dist/build-status-plugin.d.ts.map +1 -1
  3. package/dist/build-status-plugin.js +53 -6
  4. package/dist/build-status-plugin.js.map +1 -1
  5. package/dist/bundled-dev.d.ts +10 -0
  6. package/dist/bundled-dev.d.ts.map +1 -0
  7. package/dist/bundled-dev.js +14 -0
  8. package/dist/bundled-dev.js.map +1 -0
  9. package/dist/error-overlay-plugin.d.ts.map +1 -1
  10. package/dist/error-overlay-plugin.js +13 -0
  11. package/dist/error-overlay-plugin.js.map +1 -1
  12. package/dist/html-injections-plugin.d.ts +18 -2
  13. package/dist/html-injections-plugin.d.ts.map +1 -1
  14. package/dist/html-injections-plugin.js +172 -59
  15. package/dist/html-injections-plugin.js.map +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/injections/sandbox-build-error-notifier.d.ts +6 -0
  19. package/dist/injections/sandbox-build-error-notifier.d.ts.map +1 -0
  20. package/dist/injections/sandbox-build-error-notifier.js +26 -0
  21. package/dist/injections/sandbox-build-error-notifier.js.map +1 -0
  22. package/dist/injections/sandbox-hmr-socket-relay.d.ts +7 -0
  23. package/dist/injections/sandbox-hmr-socket-relay.d.ts.map +1 -0
  24. package/dist/injections/sandbox-hmr-socket-relay.js +28 -0
  25. package/dist/injections/sandbox-hmr-socket-relay.js.map +1 -0
  26. package/dist/injections/visual-edit-agent.d.ts.map +1 -1
  27. package/dist/injections/visual-edit-agent.js +14 -4
  28. package/dist/injections/visual-edit-agent.js.map +1 -1
  29. package/dist/statics/index.mjs +7 -7
  30. package/dist/statics/index.mjs.map +1 -1
  31. package/package.json +1 -1
  32. package/src/build-status-plugin.ts +55 -7
  33. package/src/bundled-dev.ts +13 -0
  34. package/src/error-overlay-plugin.ts +16 -0
  35. package/src/html-injections-plugin.ts +195 -73
  36. package/src/index.ts +1 -1
  37. package/src/injections/sandbox-build-error-notifier.ts +36 -0
  38. package/src/injections/sandbox-hmr-socket-relay.ts +39 -0
  39. package/src/injections/visual-edit-agent.ts +15 -4
package/README.md CHANGED
@@ -39,12 +39,15 @@ export default {
39
39
 
40
40
  ### Plugin Composition
41
41
 
42
- The plugin registers four sub-plugins when running in a sandbox (`MODAL_SANDBOX_ID` is set):
42
+ The plugin registers these sub-plugins when running in a sandbox (`MODAL_SANDBOX_ID` is set):
43
43
 
44
44
  1. **base44** — Core configuration: path aliases (`@/` → `/src/`), environment variables, dependency optimization, and legacy SDK import resolution.
45
45
  2. **iframe-hmr** — Sets CORS and `frame-ancestors` headers to allow iframe embedding.
46
- 3. **error-overlay** — Replaces Vite's default error overlay with a custom one that reports errors to the parent window.
47
- 4. **html-injections** — Injects sandbox-side scripts into the HTML.
46
+ 3. **error-overlay** — Replaces Vite's default error overlay with a custom one that reports errors to the parent window. Under Vite 8's bundled dev mode (`experimental.bundledDev`) Vite's client is never served, so the plugin turns the overlay off instead and `sandbox-build-error-notifier` forwards build errors to the parent in the same `app_error` shape.
47
+ 4. **html-injections** — Injects sandbox-side scripts into the HTML while serving. Under bundled dev mode its sibling **html-injections-bundled** injects them instead, before the HTML is bundled.
48
+ 5. **html-injections-production** — Injects the analytics tracker into production builds.
49
+
50
+ Dev and production are told apart by the Vite command (`serve` vs `build`), not by the presence of a dev server in the HTML transform context — bundled dev runs the HTML through the build-shaped transform, where no server is passed.
48
51
 
49
52
  Outside a sandbox, only the core plugin runs (with optional API proxy support via `VITE_BASE44_APP_BASE_URL`).
50
53
 
@@ -98,6 +101,12 @@ How it works: `configureServer` wraps the HMR send channel
98
101
  (`server.hot ?? server.ws`). An `error` payload records the last error; a
99
102
  successful `update` or `full-reload` clears it.
100
103
 
104
+ Under bundled dev mode failures never reach that channel — Vite reports them
105
+ through the client environment's logger and per-client sends — so the plugin
106
+ additionally records the error the logger is given, plus a failed `buildEnd`,
107
+ and clears it when a rebuild reaches `generateBundle`. Boot-time build
108
+ failures are therefore reported in this mode.
109
+
101
110
  **Cold-start caveat & scope.** Errors thrown *before any client has connected*
102
111
  are not sent over the HMR channel, so a boot-time transform failure may briefly
103
112
  read `ok: true`. That window is already covered server-side by the existing
@@ -106,16 +115,18 @@ endpoint's job is **post-load HMR / compile errors**, not cold-start failures.
106
115
 
107
116
  ### Sandbox Injections
108
117
 
109
- In **dev mode**, individual `<script type="module" src="...">` tags are injected for each feature, loaded directly from `node_modules`:
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). Their `src` is then a `virtual:base44-vite-plugin/...` id that the plugin resolves onto its own `dist/` directory, so the bundle does not depend on where npm placed the package.
110
119
 
111
120
  - **Error handlers** (`unhandled-errors-handlers.js`) — Global `error` and `unhandledrejection` listeners that report to the parent via `postMessage`.
112
121
  - **Mount observer** (`sandbox-mount-observer.js`) — `MutationObserver` that detects when instrumented elements (`data-source-location`) are rendered.
113
122
  - **HMR notifier** (`sandbox-hmr-notifier.js`) — Forwards Vite's `beforeUpdate`/`afterUpdate` events to the parent.
114
123
  - **Navigation notifier** (`navigation-notifier.js`) — Intercepts `pushState`, `replaceState`, and `popstate` to track URL changes.
124
+ - **Build error notifier** (`sandbox-build-error-notifier.js`, bundled dev only) — Forwards `vite:error` payloads to the parent as `app_error`, replacing the custom error overlay that cannot be installed in that mode.
125
+ - **HMR socket relay** (`sandbox-hmr-socket-relay.js`, bundled dev only) — Sets `window.__base44_bundled_dev__` and posts `SANDBOX_WS_CONNECT` / `SANDBOX_WS_DISCONNECT` / `sandbox:beforeFullReload`, the events the preview proxy's bridge otherwise collects by importing `/@vite/client`.
115
126
 
116
127
  These are self-executing scripts — they run as soon as the browser loads them, with no setup call required.
117
128
 
118
- The **visual edit agent** is the exception. It's a larger module (~560 lines) that is bundled separately via `tsup` into `dist/statics/index.mjs` and loaded via a dynamic `import()`. This allows local dev iteration: add `?sandbox-bridge=local` to load it from a local HTTPS dev server instead of `node_modules`.
129
+ The **visual edit agent** is the exception. It's a larger module (~560 lines) that is bundled separately via `tsup` into `dist/statics/index.mjs` and loaded via a dynamic `import()`. This allows local dev iteration: add `?sandbox-bridge=local` to load it from a local HTTPS dev server instead of `node_modules`. Bundled dev mode mounts no static middleware, so in that mode the plugin serves its own `dist/` tree (scripts and source maps only) for this import.
119
130
 
120
131
  In **production**, an inline analytics tracker script is injected instead.
121
132
 
@@ -1 +1 @@
1
- {"version":3,"file":"build-status-plugin.d.ts","sourceRoot":"","sources":["../src/build-status-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,MAAM,EAAiB,MAAM,MAAM,CAAC;AAyE3D;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CA2ClE;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAsE1C"}
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,CAyG1C"}
@@ -1,3 +1,4 @@
1
+ import { isBundledDev } from "./bundled-dev.js";
1
2
  /**
2
3
  * Opt-in, loopback-gated dev-server endpoint that reports the last
3
4
  * build / compile / HMR error observed since the dev server started.
@@ -17,17 +18,24 @@
17
18
  * The status is always reported in the body with HTTP `200`, even on error:
18
19
  * a `500` here would trip the preview proxy's own error path.
19
20
  *
20
- * Cold-start caveat: errors thrown before any client has connected are not
21
- * sent over the HMR channel, so a boot-time transform failure may briefly
22
- * read `ok: true`. That window is covered server-side by the existing
23
- * dev_server_error_classifier. This endpoint reports post-load
24
- * HMR / compile errors.
21
+ * Cold-start caveat (middleware dev server): errors thrown before any client
22
+ * has connected are not sent over the HMR channel, so a boot-time transform
23
+ * failure may briefly read `ok: true`. That window is covered server-side by
24
+ * the existing dev_server_error_classifier. Under bundled dev the build hooks
25
+ * and logger below observe boot failures too.
25
26
  */
26
27
  const ENDPOINT = "/__build_status";
27
28
  /** Max characters kept per scrubbed string field. */
28
29
  const MAX_FIELD = 4000;
29
30
  /** Max characters kept for the code frame. */
30
31
  const MAX_FRAME = 2000;
32
+ const PATCHED = Symbol.for("base44.buildStatus.loggerPatched");
33
+ // Plugin hooks run once per environment in bundled dev; only the client's
34
+ // build is the preview. Older Vite has no `this.environment`.
35
+ function isClientEnvironment(ctx) {
36
+ const name = ctx?.environment?.name;
37
+ return name === undefined || name === "client";
38
+ }
31
39
  const LOOPBACK_ADDRESSES = new Set([
32
40
  "127.0.0.1",
33
41
  "::1",
@@ -103,13 +111,52 @@ export function scrub(err) {
103
111
  }
104
112
  export function buildStatusPlugin() {
105
113
  let lastError = null;
114
+ let bundled = false;
106
115
  return {
107
116
  name: "base44-build-status",
108
117
  apply: "serve",
118
+ configResolved(config) {
119
+ bundled = isBundledDev(config);
120
+ },
121
+ // Bundled dev runs the rolldown build hooks on every rebuild of the client
122
+ // environment; a build that reaches generateBundle superseded whatever error
123
+ // was recorded before. Other environments' builds say nothing about the preview.
124
+ buildEnd(error) {
125
+ if (bundled && error && isClientEnvironment(this))
126
+ lastError = error;
127
+ },
128
+ generateBundle() {
129
+ if (bundled && isClientEnvironment(this))
130
+ lastError = null;
131
+ },
109
132
  configureServer(server) {
133
+ if (bundled) {
134
+ // Bundled dev reports build failures through the environment logger
135
+ // (`{ error }` option) and per-client sends, never the broadcast
136
+ // channel patched below. Any logged `{ error }` counts until the next
137
+ // successful build: the fail-safe direction for a health endpoint.
138
+ // Kept out of the endpoint's try so a logger surprise never unmounts it.
139
+ try {
140
+ const logger = server.environments.client.logger;
141
+ if (!logger.error[PATCHED]) {
142
+ const origError = logger.error.bind(logger);
143
+ const patched = (msg, options) => {
144
+ if (options?.error)
145
+ lastError = options.error;
146
+ return origError(msg, options);
147
+ };
148
+ patched[PATCHED] = true;
149
+ logger.error = patched;
150
+ }
151
+ }
152
+ catch {
153
+ // Build failures then surface only via buildEnd; the endpoint still mounts.
154
+ }
155
+ }
110
156
  try {
111
157
  // Observe the HMR channel: an `error` payload records the last
112
- // error; a successful `update` / `full-reload` clears it.
158
+ // error; a successful `update` / `full-reload` clears it. Left on in
159
+ // bundled dev too: nothing is broadcast there, so it is inert.
113
160
  const ch = (server.hot ?? server.ws);
114
161
  if (ch && typeof ch.send === "function") {
115
162
  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":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;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,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,WAAW;IACX,KAAK;IACL,kBAAkB;CACnB,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,aAAiC;IACnD,OAAO,aAAa,KAAK,SAAS,IAAI,kBAAkB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,IAAI,CAAC,KAAc,EAAE,GAAW;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACtE,OAAO,KAAK,CAAC,MAAM,GAAG,GAAG,CAA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AAE,CAAC;4BACP,OAAO;wBACT,CAAC;wBACD,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;4BACzB,IAAI,EAAE,CAAC;4BACP,OAAO;wBACT,CAAC;wBAED,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;4BAC1B,EAAE,EAAE,CAAC,SAAS;4BACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;yBACxB,CAAC,CAAC;wBACH,2DAA2D;wBAC3D,wDAAwD;wBACxD,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;wBACrB,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;wBAClD,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;wBAC3C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBAChB,CAAC;oBAAC,MAAM,CAAC;wBACP,yDAAyD;wBACzD,IAAI,CAAC;4BACH,IAAI,EAAE,CAAC;wBACT,CAAC;wBAAC,MAAM,CAAC;4BACP,SAAS;wBACX,CAAC;oBACH,CAAC;gBACH,CAAC,CACF,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,2DAA2D;YAC7D,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Vite 8's experimental full-bundle dev mode (`experimental.bundledDev`) serves
3
+ * the client from an in-memory rolldown build. It mounts neither the transform
4
+ * nor the static middlewares, so raw `/node_modules/...` and `/@vite/client`
5
+ * URLs stop resolving, and build errors surface through the environment logger
6
+ * instead of the websocket broadcast. Plugins that assume the middleware-based
7
+ * dev server branch on this.
8
+ */
9
+ export declare function isBundledDev(config: unknown): boolean;
10
+ //# sourceMappingURL=bundled-dev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundled-dev.d.ts","sourceRoot":"","sources":["../src/bundled-dev.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAIrD"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Vite 8's experimental full-bundle dev mode (`experimental.bundledDev`) serves
3
+ * the client from an in-memory rolldown build. It mounts neither the transform
4
+ * nor the static middlewares, so raw `/node_modules/...` and `/@vite/client`
5
+ * URLs stop resolving, and build errors surface through the environment logger
6
+ * instead of the websocket broadcast. Plugins that assume the middleware-based
7
+ * dev server branch on this.
8
+ */
9
+ export function isBundledDev(config) {
10
+ const experimental = config
11
+ ?.experimental;
12
+ return Boolean(experimental?.bundledDev);
13
+ }
14
+ //# sourceMappingURL=bundled-dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundled-dev.js","sourceRoot":"","sources":["../src/bundled-dev.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,MAAe;IAC1C,MAAM,YAAY,GAAI,MAAkE;QACtF,EAAE,YAAY,CAAC;IACjB,OAAO,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAC3C,CAAC"}
@@ -1 +1 @@
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;AASnC,wBAAgB,kBAAkB,IA2B3B,MAAM,CACZ"}
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,IA0C3B,MAAM,CACZ"}
@@ -1,4 +1,5 @@
1
1
  import { errorOverlayCode } from "./ErrorOverlay.js";
2
+ import { isBundledDev } from "./bundled-dev.js";
2
3
  // Vite <=6 emits `class ErrorOverlay extends HTMLElement`, Vite >=7
3
4
  // `var ErrorOverlay = class extends HTMLElement`. This is Vite's bundled output,
4
5
  // not an API, so match the shape rather than the version; `\s` so a reformatted
@@ -8,6 +9,18 @@ export function errorOverlayPlugin() {
8
9
  return {
9
10
  name: "error-overlay",
10
11
  apply: (config) => config.mode === "development",
12
+ // Bundled dev never serves client.mjs, so the swap below cannot run. Turn
13
+ // Vite's overlay off and let sandbox-build-error-notifier forward the error.
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
+ },
11
24
  transform(code, id, opts = {}) {
12
25
  if (opts?.ssr)
13
26
  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;AAGrD,oEAAoE;AACpE,iFAAiF;AACjF,gFAAgF;AAChF,kCAAkC;AAClC,MAAM,iBAAiB,GACrB,mFAAmF,CAAC;AAEtF,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa;QAChD,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,EAAE;YAC3B,IAAI,IAAI,EAAE,GAAG;gBAAE,OAAO;YAEtB,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;gBAAE,OAAO;YAExD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,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AAG,KAAK,KAAK,IAAI,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,EAAE,OAAO,KAAK,KAAK,CAAC,EAAE,CAAC;gBACtF,OAAO,CAAC,IAAI,CACV,+EAA+E;oBAC7E,0EAA0E,CAC7E,CAAC;YACJ,CAAC;QACH,CAAC;QACD,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,EAAE;YAC3B,IAAI,IAAI,EAAE,GAAG;gBAAE,OAAO;YAEtB,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;gBAAE,OAAO;YAExD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,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,8 +1,24 @@
1
- import type { Plugin } from "vite";
1
+ import type { ServerResponse } from "node:http";
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
+ /** This file lives in dist/ once built, so its directory is the served root. */
10
+ export declare const PLUGIN_DIST_DIR: string;
11
+ export declare function resolveBundledInjection(id: string, distDir?: string): string | undefined;
12
+ /**
13
+ * Bundled dev mounts no static/transform middleware, so the visual-edit agent's
14
+ * dynamic `import()` of dist/statics/index.mjs would fall through to the SPA
15
+ * fallback and receive index.html. Serve the plugin's own dist tree instead.
16
+ */
17
+ export declare function serveDistMiddleware(distDir: string): (req: Connect.IncomingMessage, res: ServerResponse, next: Connect.NextFunction) => void;
2
18
  export declare function htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEditAgent, analyticsTracker, }: {
3
19
  hmrNotifier: boolean;
4
20
  navigationNotifier: boolean;
5
21
  visualEditAgent: boolean;
6
22
  analyticsTracker: boolean;
7
- }): Plugin;
23
+ }): Plugin[];
8
24
  //# sourceMappingURL=html-injections-plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"html-injections-plugin.d.ts","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAqB,MAAM,MAAM,CAAC;AAyEtD,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,GAmFM,MAAM,CACZ"}
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;AAiD9E;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAgDtE,gFAAgF;AAChF,eAAO,MAAM,eAAe,QAA+C,CAAC;AAG5E,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,SAAkB,GAAG,MAAM,GAAG,SAAS,CAGjG;AAED;;;;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,CAkIX"}
@@ -1,4 +1,8 @@
1
+ import { createReadStream, existsSync, statSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
1
4
  import { loadEnv } from "vite";
5
+ import { isBundledDev } from "./bundled-dev.js";
2
6
  const ANALYTICS_TRACKER_SCRIPT = `
3
7
  if (window.self === window.top) {
4
8
  let lastPath = "";
@@ -31,104 +35,213 @@ if (window.self === window.top) {
31
35
  trackPageView();
32
36
  }
33
37
  `;
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/";
34
45
  const INJECTIONS = {
35
46
  unhandledErrors: {
36
- src: "/node_modules/@base44/vite-plugin/dist/injections/unhandled-errors-handlers.js",
47
+ file: "injections/unhandled-errors-handlers.js",
37
48
  injectTo: "head",
38
49
  mode: "dev",
39
50
  },
40
51
  sandboxMount: {
41
- src: "/node_modules/@base44/vite-plugin/dist/injections/sandbox-mount-observer.js",
52
+ file: "injections/sandbox-mount-observer.js",
42
53
  injectTo: "body",
43
54
  mode: "dev",
44
55
  },
45
56
  hmrNotifier: {
46
- src: "/node_modules/@base44/vite-plugin/dist/injections/sandbox-hmr-notifier.js",
57
+ file: "injections/sandbox-hmr-notifier.js",
47
58
  injectTo: "head",
48
59
  mode: "dev",
49
60
  },
50
61
  navigationNotifier: {
51
- src: "/node_modules/@base44/vite-plugin/dist/injections/navigation-notifier.js",
62
+ file: "injections/navigation-notifier.js",
52
63
  injectTo: "head",
53
64
  mode: "dev",
54
65
  },
66
+ buildErrorNotifier: {
67
+ file: "injections/sandbox-build-error-notifier.js",
68
+ injectTo: "head",
69
+ mode: "dev",
70
+ bundledOnly: true,
71
+ },
72
+ hmrSocketRelay: {
73
+ file: "injections/sandbox-hmr-socket-relay.js",
74
+ injectTo: "head",
75
+ mode: "dev",
76
+ bundledOnly: true,
77
+ },
55
78
  analyticsTracker: {
56
79
  injectTo: "head",
57
80
  mode: "production",
58
81
  inlineContent: ANALYTICS_TRACKER_SCRIPT,
59
82
  },
60
83
  };
84
+ const CONTENT_TYPES = {
85
+ ".js": "text/javascript",
86
+ ".mjs": "text/javascript",
87
+ ".map": "application/json",
88
+ };
89
+ /** This file lives in dist/ once built, so its directory is the served root. */
90
+ 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
+ /**
98
+ * Bundled dev mounts no static/transform middleware, so the visual-edit agent's
99
+ * dynamic `import()` of dist/statics/index.mjs would fall through to the SPA
100
+ * fallback and receive index.html. Serve the plugin's own dist tree instead.
101
+ */
102
+ export function serveDistMiddleware(distDir) {
103
+ return (req, res, next) => {
104
+ const url = (req.url ?? "").split("?")[0] ?? "";
105
+ if (!url.startsWith(`${DIST_URL_PREFIX}/`))
106
+ return next();
107
+ if (req.method !== "GET" && req.method !== "HEAD")
108
+ return next();
109
+ let relative;
110
+ try {
111
+ relative = decodeURIComponent(url.slice(DIST_URL_PREFIX.length + 1));
112
+ }
113
+ catch {
114
+ return next();
115
+ }
116
+ const filePath = path.resolve(distDir, relative);
117
+ const type = CONTENT_TYPES[path.extname(filePath)];
118
+ if (!type ||
119
+ !filePath.startsWith(distDir + path.sep) ||
120
+ !existsSync(filePath) ||
121
+ !statSync(filePath).isFile()) {
122
+ return next();
123
+ }
124
+ res.statusCode = 200;
125
+ res.setHeader("Content-Type", type);
126
+ res.setHeader("Cache-Control", "no-store");
127
+ // Headers are already out, so a read failure can only end the response.
128
+ createReadStream(filePath).on("error", () => res.end()).pipe(res);
129
+ };
130
+ }
61
131
  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.
62
135
  const enabledInjections = {
63
136
  unhandledErrors: true,
64
137
  sandboxMount: true,
65
138
  hmrNotifier,
66
139
  navigationNotifier,
140
+ buildErrorNotifier: true,
141
+ hmrSocketRelay: true,
67
142
  analyticsTracker,
68
143
  };
144
+ // Written by `dev.configResolved`; the three plugins below are always
145
+ // registered together and read this shared state.
69
146
  let resolvedEnv = {};
70
- return {
147
+ let isServe = false;
148
+ let bundled = false;
149
+ const tagsFor = (mode) => Object.entries(INJECTIONS)
150
+ .filter(([key, injection]) => enabledInjections[key] &&
151
+ injection.mode === mode &&
152
+ (!injection.bundledOnly || bundled))
153
+ .map(([, injection]) => {
154
+ if (injection.inlineContent) {
155
+ // Vite doesn't replace import.meta.env inside injected inline scripts.
156
+ const content = injection.inlineContent.replace(/import\.meta\.env\.(\w+)/g, (_, envKey) => JSON.stringify(resolvedEnv[envKey] ?? ""));
157
+ return {
158
+ tag: "script",
159
+ attrs: { type: "module" },
160
+ children: content,
161
+ injectTo: injection.injectTo,
162
+ };
163
+ }
164
+ const src = bundled
165
+ ? `${BUNDLED_INJECTION_PREFIX}${injection.file}`
166
+ : `${DIST_URL_PREFIX}/${injection.file}`;
167
+ return {
168
+ tag: "script",
169
+ attrs: { src, type: "module" },
170
+ injectTo: injection.injectTo,
171
+ };
172
+ });
173
+ const visualEditAgentTag = () => ({
174
+ tag: "script",
175
+ attrs: { type: "module" },
176
+ children: [
177
+ `if (window.self !== window.top) {`,
178
+ ` const mode = new URLSearchParams(location.search).get("sandbox-bridge");`,
179
+ ` const url = mode === "local"`,
180
+ ` ? "https://localhost:3201/index.mjs"`,
181
+ ` : "${DIST_URL_PREFIX}/statics/index.mjs";`,
182
+ ` import(url)`,
183
+ ` .then(mod => {`,
184
+ ` if (typeof mod.setupVisualEditAgent === "function") mod.setupVisualEditAgent();`,
185
+ ` })`,
186
+ ` .catch(e => console.error("[visual-edit-agent] Failed to load:", e));`,
187
+ `}`,
188
+ ].join("\n"),
189
+ injectTo: "body",
190
+ });
191
+ const devTags = () => {
192
+ const tags = tagsFor("dev");
193
+ if (visualEditAgent)
194
+ tags.push(visualEditAgentTag());
195
+ return tags;
196
+ };
197
+ const dev = {
71
198
  name: "html-injections",
72
199
  configResolved(config) {
73
- // Capture env vars for use in transformIndexHtml
74
- // loadEnv gets all env vars including VITE_ prefixed ones
75
200
  resolvedEnv = loadEnv(config.mode, config.root, "");
201
+ // `ctx.server` is absent in bundled dev, where the HTML runs through the
202
+ // build-shaped transform; the command is the only reliable dev signal.
203
+ isServe = config.command === "serve";
204
+ bundled = isBundledDev(config);
205
+ },
206
+ configureServer(server) {
207
+ if (!bundled)
208
+ 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
+ server.middlewares.use(serveDistMiddleware(PLUGIN_DIST_DIR));
214
+ },
215
+ transformIndexHtml: {
216
+ handler() {
217
+ return isServe && !bundled ? devTags() : [];
218
+ },
76
219
  },
220
+ };
221
+ // Pre-order tags are part of the HTML entry, so bundled dev folds them into
222
+ // the bundle (with `import.meta.hot`) instead of leaving raw node_modules URLs
223
+ // that nothing serves. Kept separate so the middleware-based dev server keeps
224
+ // injecting after its own HTML processing, exactly as before.
225
+ const devBundled = {
226
+ name: "html-injections-bundled",
227
+ resolveId(id) {
228
+ return resolveBundledInjection(id);
229
+ },
230
+ transformIndexHtml: {
231
+ order: "pre",
232
+ handler() {
233
+ return isServe && bundled ? devTags() : [];
234
+ },
235
+ },
236
+ };
237
+ const production = {
238
+ name: "html-injections-production",
77
239
  transformIndexHtml: {
78
- handler(_html, ctx) {
79
- const currentMode = ctx.server ? "dev" : "production";
80
- const tags = Object.entries(INJECTIONS)
81
- .filter(([key, injection]) => enabledInjections[key] && injection.mode === currentMode)
82
- .map(([, injection]) => {
83
- // Production injections use inline content (src paths don't work in built output)
84
- if (injection.inlineContent) {
85
- // Replace import.meta.env references with actual values
86
- // Vite doesn't replace these in inline script content
87
- let content = injection.inlineContent;
88
- content = content.replace(/import\.meta\.env\.(\w+)/g, (_, envKey) => JSON.stringify(resolvedEnv[envKey] ?? ""));
89
- return {
90
- tag: "script",
91
- attrs: { type: "module" },
92
- children: content,
93
- injectTo: injection.injectTo,
94
- };
95
- }
96
- // Dev injections use src path (served from node_modules)
97
- return {
98
- tag: "script",
99
- attrs: {
100
- src: injection.src,
101
- type: "module",
102
- },
103
- injectTo: injection.injectTo,
104
- };
105
- });
106
- // Visual edit agent — loaded via dynamic import to support
107
- // local dev iteration with ?sandbox-bridge=local
108
- if (currentMode === "dev" && visualEditAgent) {
109
- const dist = "/node_modules/@base44/vite-plugin/dist";
110
- tags.push({
111
- tag: "script",
112
- attrs: { type: "module" },
113
- children: [
114
- `if (window.self !== window.top) {`,
115
- ` const mode = new URLSearchParams(location.search).get("sandbox-bridge");`,
116
- ` const url = mode === "local"`,
117
- ` ? "https://localhost:3201/index.mjs"`,
118
- ` : "${dist}/statics/index.mjs";`,
119
- ` import(url)`,
120
- ` .then(mod => {`,
121
- ` if (typeof mod.setupVisualEditAgent === "function") mod.setupVisualEditAgent();`,
122
- ` })`,
123
- ` .catch(e => console.error("[visual-edit-agent] Failed to load:", e));`,
124
- `}`,
125
- ].join("\n"),
126
- injectTo: "body",
127
- });
128
- }
129
- return tags;
240
+ handler() {
241
+ return isServe ? [] : tagsFor("production");
130
242
  },
131
243
  },
132
244
  };
245
+ return [dev, devBundled, production];
133
246
  }
134
247
  //# sourceMappingURL=html-injections-plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"html-injections-plugin.js","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAW/B,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BhC,CAAC;AAEF,MAAM,UAAU,GAA8B;IAC5C,eAAe,EAAE;QACf,GAAG,EAAE,gFAAgF;QACrF,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK;KACZ;IACD,YAAY,EAAE;QACZ,GAAG,EAAE,6EAA6E;QAClF,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK;KACZ;IACD,WAAW,EAAE;QACX,GAAG,EAAE,2EAA2E;QAChF,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK;KACZ;IACD,kBAAkB,EAAE;QAClB,GAAG,EAAE,0EAA0E;QAC/E,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK;KACZ;IACD,gBAAgB,EAAE;QAChB,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,YAAY;QAClB,aAAa,EAAE,wBAAwB;KACxC;CACF,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,EACnC,WAAW,EACX,kBAA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QACrC,CAAC;QACD,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"}
package/dist/index.js CHANGED
@@ -207,7 +207,7 @@ export default function vitePlugin(opts = {}) {
207
207
  ]
208
208
  : []),
209
209
  // HTML injections - handles both dev (sandbox) and production injections
210
- htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEditAgent, analyticsTracker }),
210
+ ...htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEditAgent, analyticsTracker }),
211
211
  // Opt-in, loopback-gated dev-server build-status endpoint. Gated here on
212
212
  // the BASE44_BUILD_STATUS_ENABLED env var so the generated app's
213
213
  // vite.config.js doesn't need to change and the sub-plugin isn't even