wesl-fetch 0.0.11 → 0.0.12
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/dist/index.js +1 -7
- package/package.json +2 -2
- package/tsdown.config.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import { gunzipSync } from "fflate";
|
|
|
2
2
|
import { parseTar } from "nanotar";
|
|
3
3
|
import { RecordResolver, fileToModulePath, findUnboundIdents, modulePartsToRelativePath, npmNameVariations, parseSrcModule, partition } from "wesl";
|
|
4
4
|
import { resolve } from "resolve.exports";
|
|
5
|
-
|
|
6
5
|
//#region src/BundleHydrator.ts
|
|
7
6
|
const importPattern = /import\s+(?:\*\s+as\s+)?(\w+)\s+from\s+["']([^"']+)["']/g;
|
|
8
7
|
const nestedBundlePattern = /package\/dist\/(.+)\/weslBundle\.js$/;
|
|
@@ -79,7 +78,6 @@ async function hydrateBundle(path, registry, hydrated, fetcher) {
|
|
|
79
78
|
Object.assign(placeholder, bundle);
|
|
80
79
|
return placeholder;
|
|
81
80
|
}
|
|
82
|
-
|
|
83
81
|
//#endregion
|
|
84
82
|
//#region src/BundleLoader.ts
|
|
85
83
|
/** Fetch and extract tgz file, returning tar entries (cached). */
|
|
@@ -173,7 +171,6 @@ function extractPackageName(bundleContent) {
|
|
|
173
171
|
if (!nameMatch) throw new Error("Could not extract package name from bundle");
|
|
174
172
|
return nameMatch[1];
|
|
175
173
|
}
|
|
176
|
-
|
|
177
174
|
//#endregion
|
|
178
175
|
//#region src/FetchingResolver.ts
|
|
179
176
|
/** Resolver with sync interface for findUnboundIdents and async API for fetching. */
|
|
@@ -257,7 +254,6 @@ async function fetchWithExtensions(baseUrl) {
|
|
|
257
254
|
if (response.ok) return response.text();
|
|
258
255
|
} catch {}
|
|
259
256
|
}
|
|
260
|
-
|
|
261
257
|
//#endregion
|
|
262
258
|
//#region src/HttpPackageLoader.ts
|
|
263
259
|
const packageJsonCache = /* @__PURE__ */ new Map();
|
|
@@ -396,7 +392,6 @@ async function fetchBundleFile(pkgName, bundlePath, packageBase) {
|
|
|
396
392
|
function normalizeUrl(url) {
|
|
397
393
|
return url.replace(/([^:])\/+/g, "$1/");
|
|
398
394
|
}
|
|
399
|
-
|
|
400
395
|
//#endregion
|
|
401
396
|
//#region src/PackageLoader.ts
|
|
402
397
|
const virtualModules = ["constants", "env"];
|
|
@@ -502,6 +497,5 @@ async function fetchOnePackage(pkgId, loaded) {
|
|
|
502
497
|
} catch {}
|
|
503
498
|
throw new Error(`Package not found: ${pkgId}`);
|
|
504
499
|
}
|
|
505
|
-
|
|
506
500
|
//#endregion
|
|
507
|
-
export { FetchingResolver, bundleRegistry, clearHttpCache, fetchBundleFilesFromNpm, fetchDependencies, fetchPackagesByName, fetchPackagesFromHttp, hydrateBundleRegistry, loadBundlesFromFiles, loadBundlesFromTgz, loadBundlesWithPackageName, loadShaderFromUrl };
|
|
501
|
+
export { FetchingResolver, bundleRegistry, clearHttpCache, fetchBundleFilesFromNpm, fetchDependencies, fetchPackagesByName, fetchPackagesFromHttp, hydrateBundleRegistry, loadBundlesFromFiles, loadBundlesFromTgz, loadBundlesWithPackageName, loadShaderFromUrl };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wesl-fetch",
|
|
3
3
|
"description": "Browser-based HTTP fetching for WESL packages from npm",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "github:wgsl-tooling-wg/wesl-js",
|
|
7
7
|
"exports": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"fflate": "^0.8.2",
|
|
12
12
|
"nanotar": "^0.2.0",
|
|
13
13
|
"resolve.exports": "^2.0.3",
|
|
14
|
-
"wesl": "0.7.
|
|
14
|
+
"wesl": "0.7.24"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "tsdown",
|
package/tsdown.config.ts
CHANGED