wesl-plugin 0.6.49 → 0.6.51

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.
Files changed (28) hide show
  1. package/dist/{WeslPlugin-JYxf2uLM.js → WeslPlugin-DoZqj9KJ.mjs} +99 -51
  2. package/dist/{WeslPluginOptions-BljqDSO5.d.ts → WeslPluginOptions-DHLy1_Dm.d.mts} +1 -1
  3. package/dist/{import-meta-resolve-CUFqnZwT.js → import-meta-resolve-CfcdqZRe.mjs} +35 -0
  4. package/dist/{pluginIndex.d.ts → pluginIndex.d.mts} +1 -1
  5. package/dist/{pluginIndex.js → pluginIndex.mjs} +1 -1
  6. package/dist/plugins/astro.d.mts +7 -0
  7. package/dist/plugins/{astro.js → astro.mjs} +1 -2
  8. package/dist/plugins/{esbuild.d.ts → esbuild.d.mts} +2 -2
  9. package/dist/plugins/{esbuild.js → esbuild.mjs} +1 -2
  10. package/dist/plugins/{farm.d.ts → farm.d.mts} +2 -2
  11. package/dist/plugins/farm.mjs +8 -0
  12. package/dist/plugins/{nuxt.d.ts → nuxt.d.mts} +2 -2
  13. package/dist/plugins/{nuxt.js → nuxt.mjs} +3 -4
  14. package/dist/plugins/{rollup.d.ts → rollup.d.mts} +2 -2
  15. package/dist/plugins/{rollup.js → rollup.mjs} +1 -2
  16. package/dist/plugins/rspack.d.mts +7 -0
  17. package/dist/plugins/{rspack.js → rspack.mjs} +1 -2
  18. package/dist/plugins/{vite.d.ts → vite.d.mts} +2 -2
  19. package/dist/{vite-CE8Yhwk-.js → plugins/vite.mjs} +2 -2
  20. package/dist/plugins/{webpack.d.ts → webpack.d.mts} +2 -2
  21. package/dist/{webpack-C7YoLSyP.js → plugins/webpack.mjs} +2 -2
  22. package/package.json +11 -11
  23. package/dist/plugins/astro.d.ts +0 -7
  24. package/dist/plugins/farm.js +0 -9
  25. package/dist/plugins/rspack.d.ts +0 -7
  26. package/dist/plugins/vite.js +0 -5
  27. package/dist/plugins/webpack.js +0 -5
  28. /package/dist/{PluginExtension-DlhUTOLC.d.ts → PluginExtension-N4JBtncl.d.mts} +0 -0
@@ -1,4 +1,4 @@
1
- import { t as resolve } from "./import-meta-resolve-CUFqnZwT.js";
1
+ import { t as resolve } from "./import-meta-resolve-CfcdqZRe.mjs";
2
2
  import path, { posix, win32 } from "node:path";
3
3
  import { RecordResolver, WeslParseError, filterMap, findUnboundIdents, npmNameVariations } from "wesl";
4
4
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -17,16 +17,18 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
17
17
  var __getOwnPropNames = Object.getOwnPropertyNames;
18
18
  var __getProtoOf = Object.getPrototypeOf;
19
19
  var __hasOwnProp = Object.prototype.hasOwnProperty;
20
- var __commonJS = (cb, mod) => function() {
21
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
22
- };
20
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
23
21
  var __copyProps = (to, from, except, desc) => {
24
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
25
- key = keys[i];
26
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
27
- get: ((k) => from[k]).bind(null, key),
28
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29
- });
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
24
+ key = keys[i];
25
+ if (!__hasOwnProp.call(to, key) && key !== except) {
26
+ __defProp(to, key, {
27
+ get: ((k) => from[k]).bind(null, key),
28
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29
+ });
30
+ }
31
+ }
30
32
  }
31
33
  return to;
32
34
  };
@@ -225,7 +227,7 @@ function expand_(str, isTop) {
225
227
  }
226
228
 
227
229
  //#endregion
228
- //#region ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/assert-valid-pattern.js
230
+ //#region ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/assert-valid-pattern.js
229
231
  const MAX_PATTERN_LENGTH = 1024 * 64;
230
232
  const assertValidPattern = (pattern) => {
231
233
  if (typeof pattern !== "string") throw new TypeError("invalid pattern");
@@ -233,7 +235,7 @@ const assertValidPattern = (pattern) => {
233
235
  };
234
236
 
235
237
  //#endregion
236
- //#region ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/brace-expressions.js
238
+ //#region ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/brace-expressions.js
237
239
  const posixClasses = {
238
240
  "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
239
241
  "[:alpha:]": ["\\p{L}\\p{Nl}", true],
@@ -355,27 +357,33 @@ const parseClass = (glob$1, position) => {
355
357
  };
356
358
 
357
359
  //#endregion
358
- //#region ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/unescape.js
360
+ //#region ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/unescape.js
359
361
  /**
360
362
  * Un-escape a string that has been escaped with {@link escape}.
361
363
  *
362
- * If the {@link windowsPathsNoEscape} option is used, then square-brace
363
- * escapes are removed, but not backslash escapes. For example, it will turn
364
- * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
365
- * becuase `\` is a path separator in `windowsPathsNoEscape` mode.
364
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
365
+ * square-bracket escapes are removed, but not backslash escapes.
366
366
  *
367
- * When `windowsPathsNoEscape` is not set, then both brace escapes and
367
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
368
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
369
+ * `windowsPathsNoEscape` mode.
370
+ *
371
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
368
372
  * backslash escapes are removed.
369
373
  *
370
374
  * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
371
375
  * or unescaped.
376
+ *
377
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
378
+ * unescaped.
372
379
  */
373
- const unescape = (s, { windowsPathsNoEscape = false } = {}) => {
374
- return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
380
+ const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
381
+ if (magicalBraces) return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
382
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
375
383
  };
376
384
 
377
385
  //#endregion
378
- //#region ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/ast.js
386
+ //#region ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/ast.js
379
387
  const types = new Set([
380
388
  "!",
381
389
  "?",
@@ -620,7 +628,7 @@ var AST = class AST {
620
628
  const dot = allowDot ?? !!this.#options.dot;
621
629
  if (this.#root === this) this.#fillNegs();
622
630
  if (!this.type) {
623
- const noEmpty = this.isStart() && this.isEnd();
631
+ const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
624
632
  const src = this.#parts.map((p) => {
625
633
  const [re, _, hasMagic$1, uflag] = typeof p === "string" ? AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
626
634
  this.#hasMagic = this.#hasMagic || hasMagic$1;
@@ -715,8 +723,7 @@ var AST = class AST {
715
723
  }
716
724
  }
717
725
  if (c === "*") {
718
- if (noEmpty && glob$1 === "*") re += starNoEmpty;
719
- else re += star$1;
726
+ re += noEmpty && glob$1 === "*" ? starNoEmpty : star$1;
720
727
  hasMagic$1 = true;
721
728
  continue;
722
729
  }
@@ -737,22 +744,26 @@ var AST = class AST {
737
744
  };
738
745
 
739
746
  //#endregion
740
- //#region ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/escape.js
747
+ //#region ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/escape.js
741
748
  /**
742
749
  * Escape all magic characters in a glob pattern.
743
750
  *
744
- * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}
751
+ * If the {@link MinimatchOptions.windowsPathsNoEscape}
745
752
  * option is used, then characters are escaped by wrapping in `[]`, because
746
753
  * a magic character wrapped in a character class can only be satisfied by
747
754
  * that exact character. In this mode, `\` is _not_ escaped, because it is
748
755
  * not interpreted as a magic character, but instead as a path separator.
756
+ *
757
+ * If the {@link MinimatchOptions.magicalBraces} option is used,
758
+ * then braces (`{` and `}`) will be escaped.
749
759
  */
750
- const escape = (s, { windowsPathsNoEscape = false } = {}) => {
760
+ const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
761
+ if (magicalBraces) return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
751
762
  return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
752
763
  };
753
764
 
754
765
  //#endregion
755
- //#region ../../node_modules/.pnpm/minimatch@10.0.3/node_modules/minimatch/dist/esm/index.js
766
+ //#region ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/index.js
756
767
  const minimatch = (p, pattern, options = {}) => {
757
768
  assertValidPattern(pattern);
758
769
  if (!options.nocomment && pattern.charAt(0) === "#") return false;
@@ -1259,16 +1270,23 @@ var Minimatch = class {
1259
1270
  if (p !== GLOBSTAR || prev === GLOBSTAR) return;
1260
1271
  if (prev === void 0) if (next !== void 0 && next !== GLOBSTAR) pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
1261
1272
  else pp[i] = twoStar;
1262
- else if (next === void 0) pp[i - 1] = prev + "(?:\\/|" + twoStar + ")?";
1273
+ else if (next === void 0) pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
1263
1274
  else if (next !== GLOBSTAR) {
1264
1275
  pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
1265
1276
  pp[i + 1] = GLOBSTAR;
1266
1277
  }
1267
1278
  });
1268
- return pp.filter((p) => p !== GLOBSTAR).join("/");
1279
+ const filtered = pp.filter((p) => p !== GLOBSTAR);
1280
+ if (this.partial && filtered.length >= 1) {
1281
+ const prefixes = [];
1282
+ for (let i = 1; i <= filtered.length; i++) prefixes.push(filtered.slice(0, i).join("/"));
1283
+ return "(?:" + prefixes.join("|") + ")";
1284
+ }
1285
+ return filtered.join("/");
1269
1286
  }).join("|");
1270
1287
  const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
1271
1288
  re = "^" + open + re + close + "$";
1289
+ if (this.partial) re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$";
1272
1290
  if (this.negate) re = "^(?!" + re + ").+$";
1273
1291
  try {
1274
1292
  this.regexp = new RegExp(re, [...flags].join(""));
@@ -1319,7 +1337,7 @@ minimatch.escape = escape;
1319
1337
  minimatch.unescape = unescape;
1320
1338
 
1321
1339
  //#endregion
1322
- //#region ../../node_modules/.pnpm/lru-cache@11.2.2/node_modules/lru-cache/dist/esm/index.js
1340
+ //#region ../../node_modules/.pnpm/lru-cache@11.2.4/node_modules/lru-cache/dist/esm/index.js
1323
1341
  /**
1324
1342
  * @module LRUCache
1325
1343
  */
@@ -1506,6 +1524,7 @@ var LRUCache = class LRUCache {
1506
1524
  #sizes;
1507
1525
  #starts;
1508
1526
  #ttls;
1527
+ #autopurgeTimers;
1509
1528
  #hasDispose;
1510
1529
  #hasFetchMethod;
1511
1530
  #hasDisposeAfter;
@@ -1523,6 +1542,7 @@ var LRUCache = class LRUCache {
1523
1542
  return {
1524
1543
  starts: c.#starts,
1525
1544
  ttls: c.#ttls,
1545
+ autopurgeTimers: c.#autopurgeTimers,
1526
1546
  sizes: c.#sizes,
1527
1547
  keyMap: c.#keyMap,
1528
1548
  keyList: c.#keyList,
@@ -1684,15 +1704,23 @@ var LRUCache = class LRUCache {
1684
1704
  const starts = new ZeroArray(this.#max);
1685
1705
  this.#ttls = ttls;
1686
1706
  this.#starts = starts;
1707
+ const purgeTimers = this.ttlAutopurge ? new Array(this.#max) : void 0;
1708
+ this.#autopurgeTimers = purgeTimers;
1687
1709
  this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {
1688
1710
  starts[index] = ttl !== 0 ? start : 0;
1689
1711
  ttls[index] = ttl;
1690
- if (ttl !== 0 && this.ttlAutopurge) {
1712
+ if (purgeTimers?.[index]) {
1713
+ clearTimeout(purgeTimers[index]);
1714
+ purgeTimers[index] = void 0;
1715
+ }
1716
+ if (ttl !== 0 && purgeTimers) {
1691
1717
  const t = setTimeout(() => {
1692
1718
  if (this.#isStale(index)) this.#delete(this.#keyList[index], "expire");
1693
1719
  }, ttl + 1);
1694
1720
  /* c8 ignore start */
1695
1721
  if (t.unref) t.unref();
1722
+ /* c8 ignore stop */
1723
+ purgeTimers[index] = t;
1696
1724
  }
1697
1725
  };
1698
1726
  this.#updateItemAge = (index) => {
@@ -2141,6 +2169,10 @@ var LRUCache = class LRUCache {
2141
2169
  ]);
2142
2170
  }
2143
2171
  this.#removeItemSize(head);
2172
+ if (this.#autopurgeTimers?.[head]) {
2173
+ clearTimeout(this.#autopurgeTimers[head]);
2174
+ this.#autopurgeTimers[head] = void 0;
2175
+ }
2144
2176
  if (free) {
2145
2177
  this.#keyList[head] = void 0;
2146
2178
  this.#valList[head] = void 0;
@@ -2354,7 +2386,7 @@ var LRUCache = class LRUCache {
2354
2386
  memo(k, memoOptions = {}) {
2355
2387
  const memoMethod = this.#memoMethod;
2356
2388
  if (!memoMethod) throw new Error("no memoMethod provided to constructor");
2357
- const { context, forceRefresh,...options } = memoOptions;
2389
+ const { context, forceRefresh, ...options } = memoOptions;
2358
2390
  const v = this.get(k, options);
2359
2391
  if (!forceRefresh && v !== void 0) return v;
2360
2392
  const vv = memoMethod(k, v, {
@@ -2421,6 +2453,10 @@ var LRUCache = class LRUCache {
2421
2453
  if (this.#size !== 0) {
2422
2454
  const index = this.#keyMap.get(k);
2423
2455
  if (index !== void 0) {
2456
+ if (this.#autopurgeTimers?.[index]) {
2457
+ clearTimeout(this.#autopurgeTimers?.[index]);
2458
+ this.#autopurgeTimers[index] = void 0;
2459
+ }
2424
2460
  deleted = true;
2425
2461
  if (this.#size === 1) this.#clear(reason);
2426
2462
  else {
@@ -2484,6 +2520,8 @@ var LRUCache = class LRUCache {
2484
2520
  if (this.#ttls && this.#starts) {
2485
2521
  this.#ttls.fill(0);
2486
2522
  this.#starts.fill(0);
2523
+ for (const t of this.#autopurgeTimers ?? []) if (t !== void 0) clearTimeout(t);
2524
+ this.#autopurgeTimers?.fill(void 0);
2487
2525
  }
2488
2526
  if (this.#sizes) this.#sizes.fill(0);
2489
2527
  this.#head = 0;
@@ -3318,7 +3356,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length);
3318
3356
  };
3319
3357
 
3320
3358
  //#endregion
3321
- //#region ../../node_modules/.pnpm/path-scurry@2.0.0/node_modules/path-scurry/dist/esm/index.js
3359
+ //#region ../../node_modules/.pnpm/path-scurry@2.0.1/node_modules/path-scurry/dist/esm/index.js
3322
3360
  const realpathSync$2 = realpathSync$1.native;
3323
3361
  const defaultFS = {
3324
3362
  lstatSync,
@@ -3363,7 +3401,7 @@ const ENOREALPATH = 512;
3363
3401
  const ENOCHILD = ENOENT | 576;
3364
3402
  const TYPEMASK = 1023;
3365
3403
  const entToType = (s) => s.isFile() ? IFREG : s.isDirectory() ? IFDIR : s.isSymbolicLink() ? IFLNK : s.isCharacterDevice() ? IFCHR : s.isBlockDevice() ? IFBLK : s.isSocket() ? IFSOCK : s.isFIFO() ? IFIFO : UNKNOWN;
3366
- const normalizeCache = /* @__PURE__ */ new Map();
3404
+ const normalizeCache = new LRUCache({ max: 2 ** 12 });
3367
3405
  const normalize = (s) => {
3368
3406
  const c = normalizeCache.get(s);
3369
3407
  if (c) return c;
@@ -3371,7 +3409,7 @@ const normalize = (s) => {
3371
3409
  normalizeCache.set(s, n);
3372
3410
  return n;
3373
3411
  };
3374
- const normalizeNocaseCache = /* @__PURE__ */ new Map();
3412
+ const normalizeNocaseCache = new LRUCache({ max: 2 ** 12 });
3375
3413
  const normalizeNocase = (s) => {
3376
3414
  const c = normalizeNocaseCache.get(s);
3377
3415
  if (c) return c;
@@ -3545,6 +3583,7 @@ var PathBase = class {
3545
3583
  get parentPath() {
3546
3584
  return (this.parent || this).fullpath();
3547
3585
  }
3586
+ /* c8 ignore start */
3548
3587
  /**
3549
3588
  * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
3550
3589
  * this property refers to the *parent* path, not the path object itself.
@@ -3554,6 +3593,7 @@ var PathBase = class {
3554
3593
  get path() {
3555
3594
  return this.parentPath;
3556
3595
  }
3596
+ /* c8 ignore stop */
3557
3597
  /**
3558
3598
  * Do not create new Path objects directly. They should always be accessed
3559
3599
  * via the PathScurry class or other methods on the Path class.
@@ -4882,7 +4922,7 @@ const Path = process.platform === "win32" ? PathWin32 : PathPosix;
4882
4922
  const PathScurry = process.platform === "win32" ? PathScurryWin32 : process.platform === "darwin" ? PathScurryDarwin : PathScurryPosix;
4883
4923
 
4884
4924
  //#endregion
4885
- //#region ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/pattern.js
4925
+ //#region ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/pattern.js
4886
4926
  const isPatternList = (pl) => pl.length >= 1;
4887
4927
  const isGlobList = (gl) => gl.length >= 1;
4888
4928
  /**
@@ -5045,7 +5085,7 @@ var Pattern = class Pattern {
5045
5085
  };
5046
5086
 
5047
5087
  //#endregion
5048
- //#region ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/ignore.js
5088
+ //#region ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/ignore.js
5049
5089
  const defaultPlatform$1 = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
5050
5090
  /**
5051
5091
  * Class used to process ignored patterns
@@ -5117,7 +5157,7 @@ var Ignore = class {
5117
5157
  };
5118
5158
 
5119
5159
  //#endregion
5120
- //#region ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/processor.js
5160
+ //#region ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/processor.js
5121
5161
  /**
5122
5162
  * A cache of which patterns have been processed for a given Path
5123
5163
  */
@@ -5310,7 +5350,13 @@ var Processor = class Processor {
5310
5350
  };
5311
5351
 
5312
5352
  //#endregion
5313
- //#region ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/walker.js
5353
+ //#region ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/walker.js
5354
+ /**
5355
+ * Single-use utility classes to provide functionality to the {@link Glob}
5356
+ * methods.
5357
+ *
5358
+ * @module
5359
+ */
5314
5360
  const makeIgnore = (ignore, opts) => typeof ignore === "string" ? new Ignore([ignore], opts) : Array.isArray(ignore) ? new Ignore(ignore, opts) : ignore;
5315
5361
  /**
5316
5362
  * basic walking utilities that all the glob walker types use
@@ -5589,7 +5635,7 @@ var GlobStream = class extends GlobUtil {
5589
5635
  };
5590
5636
 
5591
5637
  //#endregion
5592
- //#region ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/glob.js
5638
+ //#region ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/glob.js
5593
5639
  const defaultPlatform = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
5594
5640
  /**
5595
5641
  * An object that can perform glob pattern traversals.
@@ -5776,7 +5822,7 @@ var Glob = class {
5776
5822
  };
5777
5823
 
5778
5824
  //#endregion
5779
- //#region ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/has-magic.js
5825
+ //#region ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/has-magic.js
5780
5826
  /**
5781
5827
  * Return true if the patterns provided contain any magic glob characters,
5782
5828
  * given the options provided.
@@ -5795,7 +5841,7 @@ const hasMagic = (pattern, options = {}) => {
5795
5841
  };
5796
5842
 
5797
5843
  //#endregion
5798
- //#region ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/index.js
5844
+ //#region ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/index.js
5799
5845
  function globStreamSync(pattern, options = {}) {
5800
5846
  return new Glob(pattern, options).streamSync();
5801
5847
  }
@@ -5843,7 +5889,7 @@ glob.glob = glob;
5843
5889
 
5844
5890
  //#endregion
5845
5891
  //#region ../../node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/parser.js
5846
- var require_parser = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/parser.js": ((exports, module) => {
5892
+ var require_parser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5847
5893
  module.exports = (function() {
5848
5894
  function peg$subclass(child, parent) {
5849
5895
  function ctor() {
@@ -9478,11 +9524,11 @@ var require_parser = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/toml
9478
9524
  parse
9479
9525
  };
9480
9526
  })();
9481
- }) });
9527
+ }));
9482
9528
 
9483
9529
  //#endregion
9484
9530
  //#region ../../node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/compiler.js
9485
- var require_compiler = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/compiler.js": ((exports, module) => {
9531
+ var require_compiler = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9486
9532
  function compile(nodes) {
9487
9533
  var assignedPaths = [];
9488
9534
  var valueAssignments = [];
@@ -9606,18 +9652,18 @@ var require_compiler = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/to
9606
9652
  }
9607
9653
  }
9608
9654
  module.exports = { compile };
9609
- }) });
9655
+ }));
9610
9656
 
9611
9657
  //#endregion
9612
9658
  //#region ../../node_modules/.pnpm/toml@3.0.0/node_modules/toml/index.js
9613
- var require_toml = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/toml@3.0.0/node_modules/toml/index.js": ((exports, module) => {
9659
+ var require_toml = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9614
9660
  var parser = require_parser();
9615
9661
  var compiler = require_compiler();
9616
9662
  module.exports = { parse: function(input) {
9617
9663
  var nodes = parser.parse(input.toString());
9618
9664
  return compiler.compile(nodes);
9619
9665
  } };
9620
- }) });
9666
+ }));
9621
9667
 
9622
9668
  //#endregion
9623
9669
  //#region ../wesl-tooling/src/LoadWeslToml.ts
@@ -9734,9 +9780,10 @@ function* exportSubpaths(mPath) {
9734
9780
  *
9735
9781
  * @param weslSrc - Record of WESL source files by path
9736
9782
  * @param projectDir - Project directory for resolving package imports
9783
+ * @param virtualLibNames - Virtual lib names to exclude (e.g., ['test', 'constants'])
9737
9784
  * @returns Dependency paths in npm format (e.g., 'foo/bar', 'foo')
9738
9785
  */
9739
- function parseDependencies(weslSrc, projectDir) {
9786
+ function parseDependencies(weslSrc, projectDir, virtualLibNames = []) {
9740
9787
  let resolver;
9741
9788
  try {
9742
9789
  resolver = new RecordResolver(weslSrc);
@@ -9749,7 +9796,8 @@ function parseDependencies(weslSrc, projectDir) {
9749
9796
  }
9750
9797
  const unbound = findUnboundIdents(resolver);
9751
9798
  if (!unbound) return [];
9752
- const pkgRefs = unbound.filter((modulePath) => modulePath.length > 1 && modulePath[0] !== "constants");
9799
+ const excludeRoots = new Set(["constants", ...virtualLibNames]);
9800
+ const pkgRefs = unbound.filter((modulePath) => modulePath.length > 1 && !excludeRoots.has(modulePath[0]));
9753
9801
  if (pkgRefs.length === 0) return [];
9754
9802
  const projectURL = projectDirURL(projectDir);
9755
9803
  const deps = filterMap(pkgRefs, (mPath) => npmResolveWESL(mPath, projectURL));
@@ -1,4 +1,4 @@
1
- import { n as PluginExtension } from "./PluginExtension-DlhUTOLC.js";
1
+ import { n as PluginExtension } from "./PluginExtension-N4JBtncl.mjs";
2
2
 
3
3
  //#region src/WeslPluginOptions.d.ts
4
4
  interface WeslPluginOptions {
@@ -8,6 +8,19 @@ import v8 from "node:v8";
8
8
  import { format, inspect } from "node:util";
9
9
 
10
10
  //#region ../../node_modules/.pnpm/import-meta-resolve@4.1.0/node_modules/import-meta-resolve/lib/errors.js
11
+ /**
12
+ * @typedef ErrnoExceptionFields
13
+ * @property {number | undefined} [errnode]
14
+ * @property {string | undefined} [code]
15
+ * @property {string | undefined} [path]
16
+ * @property {string | undefined} [syscall]
17
+ * @property {string | undefined} [url]
18
+ *
19
+ * @typedef {Error & ErrnoExceptionFields} ErrnoException
20
+ */
21
+ /**
22
+ * @typedef {(...parameters: Array<any>) => string} MessageFunction
23
+ */
11
24
  const own$1 = {}.hasOwnProperty;
12
25
  const classRegExp = /^([A-Z][a-z\d]*)+$/;
13
26
  const kTypes = new Set([
@@ -332,6 +345,20 @@ function determineSpecificType(value) {
332
345
 
333
346
  //#endregion
334
347
  //#region ../../node_modules/.pnpm/import-meta-resolve@4.1.0/node_modules/import-meta-resolve/lib/package-json-reader.js
348
+ /**
349
+ * @typedef {import('./errors.js').ErrnoException} ErrnoException
350
+ *
351
+ * @typedef {'commonjs' | 'module' | 'none'} PackageType
352
+ *
353
+ * @typedef PackageConfig
354
+ * @property {string} pjsonPath
355
+ * @property {boolean} exists
356
+ * @property {string | undefined} [main]
357
+ * @property {string | undefined} [name]
358
+ * @property {PackageType} type
359
+ * @property {Record<string, unknown> | undefined} [exports]
360
+ * @property {Record<string, unknown> | undefined} [imports]
361
+ */
335
362
  const hasOwnProperty$1 = {}.hasOwnProperty;
336
363
  const { ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 } = codes;
337
364
  /** @type {Map<string, PackageConfig>} */
@@ -547,6 +574,11 @@ function getConditionsSet(conditions) {
547
574
 
548
575
  //#endregion
549
576
  //#region ../../node_modules/.pnpm/import-meta-resolve@4.1.0/node_modules/import-meta-resolve/lib/resolve.js
577
+ /**
578
+ * @typedef {import('node:fs').Stats} Stats
579
+ * @typedef {import('./errors.js').ErrnoException} ErrnoException
580
+ * @typedef {import('./package-json-reader.js').PackageConfig} PackageConfig
581
+ */
550
582
  const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
551
583
  const { ERR_NETWORK_IMPORT_DISALLOWED, ERR_INVALID_MODULE_SPECIFIER, ERR_INVALID_PACKAGE_CONFIG, ERR_INVALID_PACKAGE_TARGET, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_IMPORT_NOT_DEFINED, ERR_PACKAGE_PATH_NOT_EXPORTED, ERR_UNSUPPORTED_DIR_IMPORT, ERR_UNSUPPORTED_RESOLVE_REQUEST } = codes;
552
584
  const own = {}.hasOwnProperty;
@@ -1203,6 +1235,9 @@ function defaultResolve(specifier, context = {}) {
1203
1235
  //#endregion
1204
1236
  //#region ../../node_modules/.pnpm/import-meta-resolve@4.1.0/node_modules/import-meta-resolve/index.js
1205
1237
  /**
1238
+ * @typedef {import('./lib/errors.js').ErrnoException} ErrnoException
1239
+ */
1240
+ /**
1206
1241
  * Match `import.meta.resolve` except that `parent` is required (you can pass
1207
1242
  * `import.meta.url`).
1208
1243
  *
@@ -1,4 +1,4 @@
1
- import { n as PluginExtension, r as PluginExtensionApi, t as ExtensionEmitFn } from "./PluginExtension-DlhUTOLC.js";
1
+ import { n as PluginExtension, r as PluginExtensionApi, t as ExtensionEmitFn } from "./PluginExtension-N4JBtncl.mjs";
2
2
 
3
3
  //#region src/extensions/LinkExtension.d.ts
4
4
  declare const linkBuildExtension: PluginExtension;
@@ -1,4 +1,4 @@
1
- import { t as resolve } from "./import-meta-resolve-CUFqnZwT.js";
1
+ import { t as resolve } from "./import-meta-resolve-CfcdqZRe.mjs";
2
2
  import path from "node:path";
3
3
  import { link, noSuffix } from "wesl";
4
4
  import url from "node:url";
@@ -0,0 +1,7 @@
1
+ import "../PluginExtension-N4JBtncl.mjs";
2
+ import { t as WeslPluginOptions } from "../WeslPluginOptions-DHLy1_Dm.mjs";
3
+
4
+ //#region src/plugins/astro.d.ts
5
+ declare const _default: (options: WeslPluginOptions) => any;
6
+ //#endregion
7
+ export { _default as default };
@@ -1,5 +1,4 @@
1
- import { t as WeslPlugin_default } from "../WeslPlugin-JYxf2uLM.js";
2
- import "../import-meta-resolve-CUFqnZwT.js";
1
+ import { t as WeslPlugin_default } from "../WeslPlugin-DoZqj9KJ.mjs";
3
2
 
4
3
  //#region src/plugins/astro.ts
5
4
  var astro_default = (options) => ({
@@ -1,5 +1,5 @@
1
- import "../PluginExtension-DlhUTOLC.js";
2
- import { t as WeslPluginOptions } from "../WeslPluginOptions-BljqDSO5.js";
1
+ import "../PluginExtension-N4JBtncl.mjs";
2
+ import { t as WeslPluginOptions } from "../WeslPluginOptions-DHLy1_Dm.mjs";
3
3
  import * as esbuild0 from "esbuild";
4
4
 
5
5
  //#region src/plugins/esbuild.d.ts
@@ -1,5 +1,4 @@
1
- import { n as weslPlugin } from "../WeslPlugin-JYxf2uLM.js";
2
- import "../import-meta-resolve-CUFqnZwT.js";
1
+ import { n as weslPlugin } from "../WeslPlugin-DoZqj9KJ.mjs";
3
2
  import { createEsbuildPlugin } from "unplugin";
4
3
 
5
4
  //#region src/plugins/esbuild.ts
@@ -1,5 +1,5 @@
1
- import "../PluginExtension-DlhUTOLC.js";
2
- import { t as WeslPluginOptions } from "../WeslPluginOptions-BljqDSO5.js";
1
+ import "../PluginExtension-N4JBtncl.mjs";
2
+ import { t as WeslPluginOptions } from "../WeslPluginOptions-DHLy1_Dm.mjs";
3
3
  import * as _farmfe_core0 from "@farmfe/core";
4
4
 
5
5
  //#region src/plugins/farm.d.ts
@@ -0,0 +1,8 @@
1
+ import { n as weslPlugin } from "../WeslPlugin-DoZqj9KJ.mjs";
2
+ import { createFarmPlugin } from "unplugin";
3
+
4
+ //#region src/plugins/farm.ts
5
+ var farm_default = createFarmPlugin(weslPlugin);
6
+
7
+ //#endregion
8
+ export { farm_default as default };
@@ -1,5 +1,5 @@
1
- import "../PluginExtension-DlhUTOLC.js";
2
- import { t as WeslPluginOptions } from "../WeslPluginOptions-BljqDSO5.js";
1
+ import "../PluginExtension-N4JBtncl.mjs";
2
+ import { t as WeslPluginOptions } from "../WeslPluginOptions-DHLy1_Dm.mjs";
3
3
  import * as _nuxt_schema0 from "@nuxt/schema";
4
4
 
5
5
  //#region src/plugins/nuxt.d.ts
@@ -1,7 +1,6 @@
1
- import "../WeslPlugin-JYxf2uLM.js";
2
- import "../import-meta-resolve-CUFqnZwT.js";
3
- import { t as vite_default } from "../vite-CE8Yhwk-.js";
4
- import { t as webpack_default } from "../webpack-C7YoLSyP.js";
1
+ import "../WeslPlugin-DoZqj9KJ.mjs";
2
+ import vite_default from "./vite.mjs";
3
+ import webpack_default from "./webpack.mjs";
5
4
  import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
6
5
  import "@nuxt/schema";
7
6
 
@@ -1,5 +1,5 @@
1
- import "../PluginExtension-DlhUTOLC.js";
2
- import { t as WeslPluginOptions } from "../WeslPluginOptions-BljqDSO5.js";
1
+ import "../PluginExtension-N4JBtncl.mjs";
2
+ import { t as WeslPluginOptions } from "../WeslPluginOptions-DHLy1_Dm.mjs";
3
3
  import * as rollup0 from "rollup";
4
4
 
5
5
  //#region src/plugins/rollup.d.ts
@@ -1,5 +1,4 @@
1
- import { n as weslPlugin } from "../WeslPlugin-JYxf2uLM.js";
2
- import "../import-meta-resolve-CUFqnZwT.js";
1
+ import { n as weslPlugin } from "../WeslPlugin-DoZqj9KJ.mjs";
3
2
  import { createRollupPlugin } from "unplugin";
4
3
 
5
4
  //#region src/plugins/rollup.ts
@@ -0,0 +1,7 @@
1
+ import "../PluginExtension-N4JBtncl.mjs";
2
+ import { t as WeslPluginOptions } from "../WeslPluginOptions-DHLy1_Dm.mjs";
3
+
4
+ //#region src/plugins/rspack.d.ts
5
+ declare const _default: (options: WeslPluginOptions) => RspackPluginInstance;
6
+ //#endregion
7
+ export { _default as default };
@@ -1,5 +1,4 @@
1
- import { n as weslPlugin } from "../WeslPlugin-JYxf2uLM.js";
2
- import "../import-meta-resolve-CUFqnZwT.js";
1
+ import { n as weslPlugin } from "../WeslPlugin-DoZqj9KJ.mjs";
3
2
  import { createRspackPlugin } from "unplugin";
4
3
 
5
4
  //#region src/plugins/rspack.ts
@@ -1,5 +1,5 @@
1
- import "../PluginExtension-DlhUTOLC.js";
2
- import { t as WeslPluginOptions } from "../WeslPluginOptions-BljqDSO5.js";
1
+ import "../PluginExtension-N4JBtncl.mjs";
2
+ import { t as WeslPluginOptions } from "../WeslPluginOptions-DHLy1_Dm.mjs";
3
3
  import * as vite0 from "vite";
4
4
 
5
5
  //#region src/plugins/vite.d.ts
@@ -1,8 +1,8 @@
1
- import { n as weslPlugin } from "./WeslPlugin-JYxf2uLM.js";
1
+ import { n as weslPlugin } from "../WeslPlugin-DoZqj9KJ.mjs";
2
2
  import { createVitePlugin } from "unplugin";
3
3
 
4
4
  //#region src/plugins/vite.ts
5
5
  var vite_default = createVitePlugin(weslPlugin);
6
6
 
7
7
  //#endregion
8
- export { vite_default as t };
8
+ export { vite_default as default };
@@ -1,5 +1,5 @@
1
- import "../PluginExtension-DlhUTOLC.js";
2
- import { t as WeslPluginOptions } from "../WeslPluginOptions-BljqDSO5.js";
1
+ import "../PluginExtension-N4JBtncl.mjs";
2
+ import { t as WeslPluginOptions } from "../WeslPluginOptions-DHLy1_Dm.mjs";
3
3
  import * as webpack0 from "webpack";
4
4
 
5
5
  //#region src/plugins/webpack.d.ts
@@ -1,8 +1,8 @@
1
- import { n as weslPlugin } from "./WeslPlugin-JYxf2uLM.js";
1
+ import { n as weslPlugin } from "../WeslPlugin-DoZqj9KJ.mjs";
2
2
  import { createWebpackPlugin } from "unplugin";
3
3
 
4
4
  //#region src/plugins/webpack.ts
5
5
  var webpack_default = createWebpackPlugin(weslPlugin);
6
6
 
7
7
  //#endregion
8
- export { webpack_default as t };
8
+ export { webpack_default as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wesl-plugin",
3
3
  "description": "",
4
- "version": "0.6.49",
4
+ "version": "0.6.51",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "src",
@@ -9,23 +9,23 @@
9
9
  ],
10
10
  "repository": "github:wgsl-tooling-wg/wesl-js",
11
11
  "exports": {
12
- ".": "./dist/pluginIndex.js",
12
+ ".": "./dist/pluginIndex.mjs",
13
13
  "./suffixes": {
14
14
  "types": "./src/defaultSuffixTypes.d.ts"
15
15
  },
16
- "./astro": "./dist/plugins/astro.js",
17
- "./rspack": "./dist/plugins/rspack.js",
18
- "./vite": "./dist/plugins/vite.js",
19
- "./webpack": "./dist/plugins/webpack.js",
20
- "./rollup": "./dist/plugins/rollup.js",
21
- "./esbuild": "./dist/plugins/esbuild.js",
22
- "./nuxt": "./dist/plugins/nuxt.js",
23
- "./farm": "./dist/plugins/farm.js",
16
+ "./astro": "./dist/plugins/astro.mjs",
17
+ "./rspack": "./dist/plugins/rspack.mjs",
18
+ "./vite": "./dist/plugins/vite.mjs",
19
+ "./webpack": "./dist/plugins/webpack.mjs",
20
+ "./rollup": "./dist/plugins/rollup.mjs",
21
+ "./esbuild": "./dist/plugins/esbuild.mjs",
22
+ "./nuxt": "./dist/plugins/nuxt.mjs",
23
+ "./farm": "./dist/plugins/farm.mjs",
24
24
  "./*": "./*"
25
25
  },
26
26
  "dependencies": {
27
27
  "unplugin": "^2.3.5",
28
- "wesl": "0.6.49"
28
+ "wesl": "0.7.2"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@nuxt/kit": "^3.17.6",
@@ -1,7 +0,0 @@
1
- import "../PluginExtension-DlhUTOLC.js";
2
- import { t as WeslPluginOptions } from "../WeslPluginOptions-BljqDSO5.js";
3
-
4
- //#region src/plugins/astro.d.ts
5
- declare const _default: (options: WeslPluginOptions) => any;
6
- //#endregion
7
- export { _default as default };
@@ -1,9 +0,0 @@
1
- import { n as weslPlugin } from "../WeslPlugin-JYxf2uLM.js";
2
- import "../import-meta-resolve-CUFqnZwT.js";
3
- import { createFarmPlugin } from "unplugin";
4
-
5
- //#region src/plugins/farm.ts
6
- var farm_default = createFarmPlugin(weslPlugin);
7
-
8
- //#endregion
9
- export { farm_default as default };
@@ -1,7 +0,0 @@
1
- import "../PluginExtension-DlhUTOLC.js";
2
- import { t as WeslPluginOptions } from "../WeslPluginOptions-BljqDSO5.js";
3
-
4
- //#region src/plugins/rspack.d.ts
5
- declare const _default: (options: WeslPluginOptions) => RspackPluginInstance;
6
- //#endregion
7
- export { _default as default };
@@ -1,5 +0,0 @@
1
- import "../WeslPlugin-JYxf2uLM.js";
2
- import "../import-meta-resolve-CUFqnZwT.js";
3
- import { t as vite_default } from "../vite-CE8Yhwk-.js";
4
-
5
- export { vite_default as default };
@@ -1,5 +0,0 @@
1
- import "../WeslPlugin-JYxf2uLM.js";
2
- import "../import-meta-resolve-CUFqnZwT.js";
3
- import { t as webpack_default } from "../webpack-C7YoLSyP.js";
4
-
5
- export { webpack_default as default };