wesl-fetch 0.0.10 → 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 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,10 +392,9 @@ 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
- const virtualModules = ["constants", "test"];
397
+ const virtualModules = ["constants", "env"];
403
398
  /** Resolve dependencies: internal modules via HTTP, external packages from npm. */
404
399
  async function fetchDependencies(rootModuleSource, options) {
405
400
  const shaderRoot = options?.shaderRoot ?? "/shaders";
@@ -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.10",
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.22"
14
+ "wesl": "0.7.24"
15
15
  },
16
16
  "scripts": {
17
17
  "build": "tsdown",
@@ -51,7 +51,7 @@ export interface FetchOptions {
51
51
  skipExternal?: boolean;
52
52
  }
53
53
 
54
- const virtualModules = ["constants", "test"];
54
+ const virtualModules = ["constants", "env"];
55
55
 
56
56
  /** Resolve dependencies: internal modules via HTTP, external packages from npm. */
57
57
  export async function fetchDependencies(
package/tsdown.config.ts CHANGED
@@ -5,5 +5,5 @@ export default defineConfig({
5
5
  target: "es2024",
6
6
  clean: true,
7
7
  platform: "browser",
8
- external: ["wesl"],
8
+ deps: { neverBundle: ["wesl"] },
9
9
  });