veryfront 0.0.93 → 0.0.94
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/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAezE,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;IAC3B,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"http-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAezE,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;IAC3B,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAqVF;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOvF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA8D9F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAClD,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,EAAE,CAAC,CAiInB"}
|
|
@@ -108,9 +108,6 @@ function normalizeHttpUrl(raw) {
|
|
|
108
108
|
return raw;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
function toEsmShUrlFromNpm(specifier) {
|
|
112
|
-
return `https://esm.sh/${specifier.slice(4)}`;
|
|
113
|
-
}
|
|
114
111
|
function resolveBareSpecifier(specifier, importMap, reactVersion = REACT_VERSION) {
|
|
115
112
|
// Use esm.sh URLs for React - NO npm: specifiers per plan requirements.
|
|
116
113
|
// All packages use external=react to share the same React instance.
|
|
@@ -250,13 +247,18 @@ async function resolveSpecifier(specifier, baseUrl, options) {
|
|
|
250
247
|
if (isExternalScheme(specifier) || isInternalBare(specifier))
|
|
251
248
|
return null;
|
|
252
249
|
// For Deno: Keep npm: specifiers as-is (Deno resolves them natively with auto-dedup)
|
|
253
|
-
// For other runtimes: Convert to esm.sh and cache locally
|
|
250
|
+
// For other runtimes: Convert to esm.sh and cache locally (or return bare specifier for React)
|
|
254
251
|
if (specifier.startsWith("npm:")) {
|
|
255
252
|
if (isDeno) {
|
|
256
253
|
return specifier; // Let Deno's native npm resolution handle it
|
|
257
254
|
}
|
|
258
|
-
const
|
|
259
|
-
|
|
255
|
+
const bareSpecifier = specifier.slice(4); // Remove "npm:" prefix
|
|
256
|
+
const esmShUrl = `https://esm.sh/${bareSpecifier}`;
|
|
257
|
+
const cached = await cacheHttpModule(esmShUrl, options);
|
|
258
|
+
// For React packages, cacheHttpModule returns null to prevent multiple instances.
|
|
259
|
+
// Return the bare specifier so transformReactToLocalPaths can resolve it to a local file:// path.
|
|
260
|
+
// For non-React packages, return the cached file:// path.
|
|
261
|
+
return cached ? `file://${cached}` : bareSpecifier;
|
|
260
262
|
}
|
|
261
263
|
if (isHttpUrl(specifier)) {
|
|
262
264
|
const cached = await cacheHttpModule(specifier, options);
|
package/package.json
CHANGED
package/src/deno.js
CHANGED
|
@@ -136,10 +136,6 @@ function normalizeHttpUrl(raw: string): string {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
function toEsmShUrlFromNpm(specifier: string): string {
|
|
140
|
-
return `https://esm.sh/${specifier.slice(4)}`;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
139
|
function resolveBareSpecifier(
|
|
144
140
|
specifier: string,
|
|
145
141
|
importMap: ImportMapConfig,
|
|
@@ -310,13 +306,18 @@ async function resolveSpecifier(
|
|
|
310
306
|
if (isExternalScheme(specifier) || isInternalBare(specifier)) return null;
|
|
311
307
|
|
|
312
308
|
// For Deno: Keep npm: specifiers as-is (Deno resolves them natively with auto-dedup)
|
|
313
|
-
// For other runtimes: Convert to esm.sh and cache locally
|
|
309
|
+
// For other runtimes: Convert to esm.sh and cache locally (or return bare specifier for React)
|
|
314
310
|
if (specifier.startsWith("npm:")) {
|
|
315
311
|
if (isDeno) {
|
|
316
312
|
return specifier; // Let Deno's native npm resolution handle it
|
|
317
313
|
}
|
|
318
|
-
const
|
|
319
|
-
|
|
314
|
+
const bareSpecifier = specifier.slice(4); // Remove "npm:" prefix
|
|
315
|
+
const esmShUrl = `https://esm.sh/${bareSpecifier}`;
|
|
316
|
+
const cached = await cacheHttpModule(esmShUrl, options);
|
|
317
|
+
// For React packages, cacheHttpModule returns null to prevent multiple instances.
|
|
318
|
+
// Return the bare specifier so transformReactToLocalPaths can resolve it to a local file:// path.
|
|
319
|
+
// For non-React packages, return the cached file:// path.
|
|
320
|
+
return cached ? `file://${cached}` : bareSpecifier;
|
|
320
321
|
}
|
|
321
322
|
|
|
322
323
|
if (isHttpUrl(specifier)) {
|