@base44-preview/vite-plugin 1.0.34-pr.117.12e9018 → 1.0.34-pr.117.248300b

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.
@@ -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;AAEnC,wBAAgB,kBAAkB,IA8B3B,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;AASnC,wBAAgB,kBAAkB,IA2B3B,MAAM,CACZ"}
@@ -1,4 +1,9 @@
1
1
  import { errorOverlayCode } from "./ErrorOverlay.js";
2
+ // Vite <=6 emits `class ErrorOverlay extends HTMLElement`, Vite >=7
3
+ // `var ErrorOverlay = class extends HTMLElement`. This is Vite's bundled output,
4
+ // not an API, so match the shape rather than the version; `\s` so a reformatted
5
+ // or minified emit still matches.
6
+ const VITE_OVERLAY_DECL = /class ErrorOverlay(?=\s+extends)|\b(var|let|const)\s+ErrorOverlay(?=\s*=\s*class)/;
2
7
  export function errorOverlayPlugin() {
3
8
  return {
4
9
  name: "error-overlay",
@@ -8,18 +13,17 @@ export function errorOverlayPlugin() {
8
13
  return;
9
14
  if (!id.includes("vite/dist/client/client.mjs"))
10
15
  return;
11
- // Vite <=6 emits `class ErrorOverlay extends HTMLElement`, Vite >=7
12
- // `var ErrorOverlay = class extends HTMLElement`. This is Vite's bundled
13
- // output, not an API, so match the shape rather than the version.
14
- const patched = code.replace(/class ErrorOverlay(?= extends)|\b(var |let |const )ErrorOverlay(?= = class)/, (_match, declaration) => errorOverlayCode +
16
+ const patched = code.replace(VITE_OVERLAY_DECL, (_match, declaration) => errorOverlayCode +
15
17
  "\n" +
16
- (declaration ? `${declaration}OldErrorOverlay` : "class OldErrorOverlay"));
18
+ (declaration ? `${declaration} OldErrorOverlay` : "class OldErrorOverlay"));
17
19
  // replace() returns the input unchanged on a miss, so a new shape would
18
20
  // silently restore Vite's red overlay — as it did for every Vite >=7.
19
21
  if (patched === code) {
20
- console.warn("[base44] Could not find Vite's ErrorOverlay class to replace — the app " +
21
- "will show Vite's own error overlay and report no app_error. " +
22
- "@base44/vite-plugin needs updating for this Vite version.");
22
+ console.warn("[error-overlay] Could not find Vite's ErrorOverlay declaration in " +
23
+ "client.mjs — Vite's own overlay stays active and app_error will not " +
24
+ "be sent. @base44/vite-plugin needs updating for this Vite version.");
25
+ // Returning the identical string would still cost client.mjs its sourcemap.
26
+ return;
23
27
  }
24
28
  return patched;
25
29
  },
@@ -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,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,oEAAoE;YACpE,yEAAyE;YACzE,kEAAkE;YAClE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAC1B,6EAA6E,EAC7E,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,CACtB,gBAAgB;gBAChB,IAAI;gBACJ,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,iBAAiB,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAC5E,CA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AAC;KACQ,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/vite-plugin",
3
- "version": "1.0.34-pr.117.12e9018",
3
+ "version": "1.0.34-pr.117.248300b",
4
4
  "description": "The Vite plugin for base44 based applications",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,6 +1,13 @@
1
1
  import { errorOverlayCode } from "./ErrorOverlay.js";
2
2
  import type { Plugin } from "vite";
3
3
 
4
+ // Vite <=6 emits `class ErrorOverlay extends HTMLElement`, Vite >=7
5
+ // `var ErrorOverlay = class extends HTMLElement`. This is Vite's bundled output,
6
+ // not an API, so match the shape rather than the version; `\s` so a reformatted
7
+ // or minified emit still matches.
8
+ const VITE_OVERLAY_DECL =
9
+ /class ErrorOverlay(?=\s+extends)|\b(var|let|const)\s+ErrorOverlay(?=\s*=\s*class)/;
10
+
4
11
  export function errorOverlayPlugin() {
5
12
  return {
6
13
  name: "error-overlay",
@@ -10,24 +17,21 @@ export function errorOverlayPlugin() {
10
17
 
11
18
  if (!id.includes("vite/dist/client/client.mjs")) return;
12
19
 
13
- // Vite <=6 emits `class ErrorOverlay extends HTMLElement`, Vite >=7
14
- // `var ErrorOverlay = class extends HTMLElement`. This is Vite's bundled
15
- // output, not an API, so match the shape rather than the version.
16
- const patched = code.replace(
17
- /class ErrorOverlay(?= extends)|\b(var |let |const )ErrorOverlay(?= = class)/,
18
- (_match, declaration) =>
19
- errorOverlayCode +
20
- "\n" +
21
- (declaration ? `${declaration}OldErrorOverlay` : "class OldErrorOverlay")
20
+ const patched = code.replace(VITE_OVERLAY_DECL, (_match, declaration) =>
21
+ errorOverlayCode +
22
+ "\n" +
23
+ (declaration ? `${declaration} OldErrorOverlay` : "class OldErrorOverlay")
22
24
  );
23
25
  // replace() returns the input unchanged on a miss, so a new shape would
24
26
  // silently restore Vite's red overlay — as it did for every Vite >=7.
25
27
  if (patched === code) {
26
28
  console.warn(
27
- "[base44] Could not find Vite's ErrorOverlay class to replace — the app " +
28
- "will show Vite's own error overlay and report no app_error. " +
29
- "@base44/vite-plugin needs updating for this Vite version."
29
+ "[error-overlay] Could not find Vite's ErrorOverlay declaration in " +
30
+ "client.mjs — Vite's own overlay stays active and app_error will not " +
31
+ "be sent. @base44/vite-plugin needs updating for this Vite version."
30
32
  );
33
+ // Returning the identical string would still cost client.mjs its sourcemap.
34
+ return;
31
35
  }
32
36
  return patched;
33
37
  },