@base44-preview/vite-plugin 1.0.44-pr.132.49617f5 → 1.0.44-pr.132.56d48fe

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":"base44-runtime-plugin.d.ts","sourceRoot":"","sources":["../src/base44-runtime-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAsFnC,wBAAgB,mBAAmB,IAAI,MAAM,CA+B5C"}
1
+ {"version":3,"file":"base44-runtime-plugin.d.ts","sourceRoot":"","sources":["../src/base44-runtime-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAsFnC,wBAAgB,mBAAmB,IAAI,MAAM,CAiC5C"}
@@ -83,27 +83,31 @@ export function base44RuntimePlugin() {
83
83
  // Ahead of Vite's own resolution so the bare `base44:` specifier is never
84
84
  // mistaken for a URL protocol.
85
85
  enforce: "pre",
86
- resolveId(id, _importer, options) {
87
- const reason = unsupportedReason(id);
86
+ // Errors are raised in `load`, never `resolveId`: Vite's dep scanner resolves
87
+ // the raw source of server routes and server-fn handlers in the client
88
+ // environment, before TanStack strips them, and treats a virtual id as
89
+ // external without loading it. A throw at resolution fails the scan and
90
+ // Vite skips pre-bundling.
91
+ resolveId(id) {
92
+ if (id === SPECIFIER || unsupportedReason(id))
93
+ return `\0${id}`;
94
+ return null;
95
+ },
96
+ load(id) {
97
+ if (!id.startsWith(RESOLVED))
98
+ return null;
99
+ const reason = unsupportedReason(id.slice(1));
88
100
  if (reason) {
89
- this.error(`"${id}" is not available in server routes. ${reason}`);
101
+ this.error(`"${id.slice(1)}" is not available in server routes. ${reason}`);
90
102
  }
91
- if (id !== SPECIFIER)
103
+ if (id !== RESOLVED)
92
104
  return null;
93
- // The dep scanner crawls raw source in the client environment, before
94
- // TanStack strips server routes and server-fn handlers out of the client
95
- // graph. Throwing here fails the scan and Vite skips pre-bundling.
96
- if (options?.scan)
97
- return { id, external: true };
98
105
  // `cloudflare:workers` has no browser equivalent, so a client-side import
99
106
  // would bundle a module that cannot run. Fail with the reason instead.
100
107
  if (this.environment?.name === "client") {
101
108
  this.error(`"${SPECIFIER}" is server-only. Move this import into a server route.`);
102
109
  }
103
- return RESOLVED;
104
- },
105
- load(id) {
106
- return id === RESOLVED ? RUNTIME_MODULE : null;
110
+ return RUNTIME_MODULE;
107
111
  },
108
112
  };
109
113
  }
@@ -1 +1 @@
1
- {"version":3,"file":"base44-runtime-plugin.js","sourceRoot":"","sources":["../src/base44-runtime-plugin.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,SAAS,GAAG,gBAAgB,CAAC;AACnC,8EAA8E;AAC9E,gDAAgD;AAChD,MAAM,QAAQ,GAAG,kBAAkB,CAAC;AAEpC,+EAA+E;AAC/E,iFAAiF;AACjF,sEAAsE;AACtE,MAAM,aAAa,GACjB,8EAA8E,CAAC;AAEjF,SAAS,iBAAiB,CAAC,EAAU;IACnC,IAAI,EAAE,KAAK,uBAAuB;QAAE,OAAO,aAAa,CAAC;IACzD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsBtB,CAAC;AAEF,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,0EAA0E;QAC1E,+BAA+B;QAC/B,OAAO,EAAE,KAAK;QAEd,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO;YAC9B,MAAM,MAAM,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;YACrC,IAAI,MAAM,EAAE,CAAC;gBACX,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,wCAAwC,MAAM,EAAE,CAAC,CAAC;YACrE,CAAC;YACD,IAAI,EAAE,K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wEAAwE;QACxE,2BAA2B;QAC3B,SAAS,CAAC,EAAE;YACV,IAAI,EAAE,KAAK,SAAS,IAAI,iBAAiB,CAAC,EAAE,CAAC;gBAAE,OAAO,KAAK,EAAE,EAAE,CAAC;YAChE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAC;YAC1C,MAAM,MAAM,GAAG,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,MAAM,EAAE,CAAC;gBACX,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,wCAAwC,MAAM,EAAE,CAAC,CAAC;YAC9E,CAAC;YACD,IAAI,EAAE,KAAK,QAAQ;gBAAE,OAAO,IAAI,CAAC;YAEjC,0EAA0E;YAC1E,uEAAuE;YACvE,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACxC,IAAI,CAAC,KAAK,CAAC,IAAI,SAAS,yDAAyD,CAAC,CAAC;YACrF,CAAC;YACD,OAAO,cAAc,CAAC;QACxB,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/vite-plugin",
3
- "version": "1.0.44-pr.132.49617f5",
3
+ "version": "1.0.44-pr.132.56d48fe",
4
4
  "description": "The Vite plugin for base44 based applications",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -91,28 +91,30 @@ export function base44RuntimePlugin(): Plugin {
91
91
  // mistaken for a URL protocol.
92
92
  enforce: "pre",
93
93
 
94
- resolveId(id, _importer, options) {
95
- const reason = unsupportedReason(id);
94
+ // Errors are raised in `load`, never `resolveId`: Vite's dep scanner resolves
95
+ // the raw source of server routes and server-fn handlers in the client
96
+ // environment, before TanStack strips them, and treats a virtual id as
97
+ // external without loading it. A throw at resolution fails the scan and
98
+ // Vite skips pre-bundling.
99
+ resolveId(id) {
100
+ if (id === SPECIFIER || unsupportedReason(id)) return `\0${id}`;
101
+ return null;
102
+ },
103
+
104
+ load(id) {
105
+ if (!id.startsWith(RESOLVED)) return null;
106
+ const reason = unsupportedReason(id.slice(1));
96
107
  if (reason) {
97
- this.error(`"${id}" is not available in server routes. ${reason}`);
108
+ this.error(`"${id.slice(1)}" is not available in server routes. ${reason}`);
98
109
  }
99
- if (id !== SPECIFIER) return null;
100
-
101
- // The dep scanner crawls raw source in the client environment, before
102
- // TanStack strips server routes and server-fn handlers out of the client
103
- // graph. Throwing here fails the scan and Vite skips pre-bundling.
104
- if ((options as { scan?: boolean } | undefined)?.scan) return { id, external: true };
110
+ if (id !== RESOLVED) return null;
105
111
 
106
112
  // `cloudflare:workers` has no browser equivalent, so a client-side import
107
113
  // would bundle a module that cannot run. Fail with the reason instead.
108
114
  if (this.environment?.name === "client") {
109
115
  this.error(`"${SPECIFIER}" is server-only. Move this import into a server route.`);
110
116
  }
111
- return RESOLVED;
112
- },
113
-
114
- load(id) {
115
- return id === RESOLVED ? RUNTIME_MODULE : null;
117
+ return RUNTIME_MODULE;
116
118
  },
117
119
  };
118
120
  }