@base44-preview/vite-plugin 1.0.33-pr.104.c53909c → 1.0.34-pr.117.12e9018

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,IAc3B,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;AAEnC,wBAAgB,kBAAkB,IA8B3B,MAAM,CACZ"}
@@ -8,7 +8,20 @@ export function errorOverlayPlugin() {
8
8
  return;
9
9
  if (!id.includes("vite/dist/client/client.mjs"))
10
10
  return;
11
- return code.replace("class ErrorOverlay", errorOverlayCode + "\nclass OldErrorOverlay");
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 +
15
+ "\n" +
16
+ (declaration ? `${declaration}OldErrorOverlay` : "class OldErrorOverlay"));
17
+ // replace() returns the input unchanged on a miss, so a new shape would
18
+ // silently restore Vite's red overlay — as it did for every Vite >=7.
19
+ 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.");
23
+ }
24
+ return patched;
12
25
  },
13
26
  };
14
27
  }
@@ -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,OAAO,IAAI,CAAC,OAAO,CACjB,oBAAoB,EACpB,gBAAgB,GAAG,yBAAyB,CAC7C,CAAC;QACJ,CAAC;KACQ,CAAC;AACd,CAAC"}
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,CAAC;YACF,wEAAwE;YACxE,sEAAsE;YACtE,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,OAAO,CAAC,IAAI,CACV,yEAAyE;oBACvE,8DAA8D;oBAC9D,2DAA2D,CAC9D,CAAC;YACJ,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;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.33-pr.104.c53909c",
3
+ "version": "1.0.34-pr.117.12e9018",
4
4
  "description": "The Vite plugin for base44 based applications",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -10,10 +10,26 @@ export function errorOverlayPlugin() {
10
10
 
11
11
  if (!id.includes("vite/dist/client/client.mjs")) return;
12
12
 
13
- return code.replace(
14
- "class ErrorOverlay",
15
- errorOverlayCode + "\nclass OldErrorOverlay"
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")
16
22
  );
23
+ // replace() returns the input unchanged on a miss, so a new shape would
24
+ // silently restore Vite's red overlay — as it did for every Vite >=7.
25
+ if (patched === code) {
26
+ 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."
30
+ );
31
+ }
32
+ return patched;
17
33
  },
18
34
  } as Plugin;
19
35
  }