unplugin-typegpu 0.11.0 → 0.11.2

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 (77) hide show
  1. package/{babel-izRcz0Uk.cjs → babel-B-IcpMR7.cjs} +31 -27
  2. package/{babel-C0RyQRMk.d.mts → babel-C8UzthFd.d.cts} +1 -2
  3. package/{babel-Bnfeonoo.mjs → babel-CbManzjz.js} +7 -5
  4. package/{babel-C1TaJd38.d.cts → babel-CmCnq-43.d.ts} +1 -2
  5. package/babel.cjs +5 -6
  6. package/babel.d.cts +2 -1
  7. package/babel.d.ts +3 -0
  8. package/babel.js +4 -0
  9. package/{bun-DFr_PiLh.mjs → bun-CDECNeIU.js} +7 -5
  10. package/{bun-CUGitP44.cjs → bun-DU5xZoDJ.cjs} +30 -25
  11. package/{bun-9JrHWE4u.d.mts → bun-cwXs2EDP.d.cts} +1 -1
  12. package/{bun-ChNeklBe.d.cts → bun-ovScJ4Es.d.ts} +1 -1
  13. package/bun.cjs +5 -6
  14. package/bun.d.cts +2 -1
  15. package/bun.d.ts +3 -0
  16. package/bun.js +4 -0
  17. package/{common-Ccx_dEqH.cjs → common-B8wsLJUq.cjs} +53 -36
  18. package/{common-BvAFT5IV.d.mts → common-BlvLUwEz.d.ts} +4 -4
  19. package/{common-e08X6w0a.mjs → common-CElmMmuq.js} +9 -2
  20. package/{common-BKqBivuE.d.cts → common-DZ2cLtbe.d.cts} +2 -2
  21. package/esbuild.cjs +9 -6
  22. package/esbuild.d.cts +4 -1
  23. package/esbuild.d.ts +5 -0
  24. package/esbuild.js +10 -0
  25. package/farm.cjs +9 -6
  26. package/farm.d.cts +4 -1
  27. package/farm.d.ts +5 -0
  28. package/farm.js +10 -0
  29. package/{index-HrLja1mV.d.cts → index-COIv1oYx.d.cts} +14 -14
  30. package/{index-BuKVXaph.d.mts → index-PPreQbn5.d.ts} +14 -14
  31. package/index.cjs +8 -9
  32. package/index.d.cts +4 -4
  33. package/{index.d.mts → index.d.ts} +4 -4
  34. package/index.js +6 -0
  35. package/package.json +26 -27
  36. package/rolldown.cjs +9 -6
  37. package/rolldown.d.cts +4 -1
  38. package/rolldown.d.ts +5 -0
  39. package/rolldown.js +10 -0
  40. package/rollup.cjs +9 -6
  41. package/rollup.d.cts +4 -1
  42. package/rollup.d.ts +5 -0
  43. package/rollup.js +10 -0
  44. package/rspack.cjs +9 -6
  45. package/rspack.d.cts +4 -1
  46. package/rspack.d.ts +5 -0
  47. package/rspack.js +10 -0
  48. package/src-CDZ6lHsg.cjs +82 -0
  49. package/{src-BV9Uh6WO.mjs → src-D84rmPxv.js} +6 -2
  50. package/vite.cjs +9 -6
  51. package/vite.d.cts +4 -1
  52. package/vite.d.ts +5 -0
  53. package/vite.js +10 -0
  54. package/webpack.cjs +9 -6
  55. package/webpack.d.cts +4 -1
  56. package/webpack.d.ts +5 -0
  57. package/webpack.js +10 -0
  58. package/babel.d.mts +0 -2
  59. package/babel.mjs +0 -2
  60. package/bun.d.mts +0 -2
  61. package/bun.mjs +0 -2
  62. package/esbuild.d.mts +0 -2
  63. package/esbuild.mjs +0 -5
  64. package/farm.d.mts +0 -2
  65. package/farm.mjs +0 -5
  66. package/index.mjs +0 -4
  67. package/rolldown.d.mts +0 -2
  68. package/rolldown.mjs +0 -5
  69. package/rollup.d.mts +0 -2
  70. package/rollup.mjs +0 -5
  71. package/rspack.d.mts +0 -2
  72. package/rspack.mjs +0 -5
  73. package/src-2vvPp2dY.cjs +0 -77
  74. package/vite.d.mts +0 -2
  75. package/vite.mjs +0 -5
  76. package/webpack.d.mts +0 -2
  77. package/webpack.mjs +0 -5
@@ -1,13 +1,15 @@
1
- const require_common = require("./common-Ccx_dEqH.cjs");
1
+ const require_common = require('./common-B8wsLJUq.cjs');
2
2
  let defu = require("defu");
3
3
  defu = require_common.__toESM(defu);
4
+ let tinyest_for_wgsl = require("tinyest-for-wgsl");
5
+ tinyest_for_wgsl = require_common.__toESM(tinyest_for_wgsl);
4
6
  let tinyest = require("tinyest");
5
- require("tinyest-for-wgsl");
6
- let _babel_types = require("@babel/types");
7
- _babel_types = require_common.__toESM(_babel_types);
7
+ tinyest = require_common.__toESM(tinyest);
8
8
  let pathe = require("pathe");
9
+ pathe = require_common.__toESM(pathe);
9
10
  let picomatch = require("picomatch");
10
11
  picomatch = require_common.__toESM(picomatch);
12
+
11
13
  //#region src/core/filter.ts
12
14
  function toArray(array) {
13
15
  const result = array || [];
@@ -63,28 +65,29 @@ function createFilterForId(filter) {
63
65
  const filterFunction = createIdFilter(filter);
64
66
  return filterFunction ? (id) => !!filterFunction(id) : void 0;
65
67
  }
68
+
66
69
  //#endregion
67
70
  //#region src/babel.ts
68
71
  function i(identifier) {
69
- return _babel_types.identifier(identifier);
72
+ return require_common.t.identifier(identifier);
70
73
  }
71
74
  function assignMetadata(path, name, ast) {
72
- const metadata = _babel_types.objectExpression([
73
- _babel_types.objectProperty(i("v"), _babel_types.numericLiteral(tinyest.FORMAT_VERSION)),
74
- _babel_types.objectProperty(i("name"), _babel_types.valueToNode(name)),
75
- _babel_types.objectProperty(i("ast"), _babel_types.valueToNode(ast)),
76
- _babel_types.objectProperty(i("externals"), _babel_types.arrowFunctionExpression([], _babel_types.blockStatement([_babel_types.returnStatement(_babel_types.objectExpression(ast.externalNames.map((name) => name === "this" ? _babel_types.objectProperty(i("this"), _babel_types.thisExpression()) : _babel_types.objectProperty(i(name), i(name), false, name !== "this"))))])))
75
+ const metadata = require_common.t.objectExpression([
76
+ require_common.t.objectProperty(i("v"), require_common.t.numericLiteral(tinyest.FORMAT_VERSION)),
77
+ require_common.t.objectProperty(i("name"), require_common.t.valueToNode(name)),
78
+ require_common.t.objectProperty(i("ast"), require_common.t.valueToNode(ast)),
79
+ require_common.t.objectProperty(i("externals"), require_common.t.arrowFunctionExpression([], require_common.t.blockStatement([require_common.t.returnStatement(require_common.t.objectExpression(ast.externalNames.map((name$1) => name$1 === "this" ? require_common.t.objectProperty(i("this"), require_common.t.thisExpression()) : require_common.t.objectProperty(i(name$1), i(name$1), false, name$1 !== "this"))))])))
77
80
  ]);
78
81
  let expression;
79
- const visibility = _babel_types.isFunctionDeclaration(path.node) ? require_common.getBlockScope(path) : void 0;
80
- if (_babel_types.isFunctionDeclaration(path.node)) expression = _babel_types.functionExpression(path.node.id, path.node.params, path.node.body);
82
+ const visibility = require_common.t.isFunctionDeclaration(path.node) ? require_common.getBlockScope(path) : void 0;
83
+ if (require_common.t.isFunctionDeclaration(path.node)) expression = require_common.t.functionExpression(path.node.id, path.node.params, path.node.body);
81
84
  else expression = path.node;
82
- const callExpr = _babel_types.callExpression(_babel_types.arrowFunctionExpression([i("$")], _babel_types.logicalExpression("&&", _babel_types.callExpression(_babel_types.memberExpression(_babel_types.assignmentExpression("??=", _babel_types.memberExpression(i("globalThis"), i("__TYPEGPU_META__")), _babel_types.newExpression(i("WeakMap"), [])), i("set")), [_babel_types.assignmentExpression("=", _babel_types.memberExpression(i("$"), i("f")), expression), metadata]), _babel_types.memberExpression(i("$"), i("f")))), [_babel_types.objectExpression([])]);
83
- _babel_types.addComment(callExpr, "leading", "#__PURE__");
85
+ const callExpr = require_common.t.callExpression(require_common.t.arrowFunctionExpression([i("$")], require_common.t.logicalExpression("&&", require_common.t.callExpression(require_common.t.memberExpression(require_common.t.assignmentExpression("??=", require_common.t.memberExpression(i("globalThis"), i("__TYPEGPU_META__")), require_common.t.newExpression(i("WeakMap"), [])), i("set")), [require_common.t.assignmentExpression("=", require_common.t.memberExpression(i("$"), i("f")), expression), metadata]), require_common.t.memberExpression(i("$"), i("f")))), [require_common.t.objectExpression([])]);
86
+ require_common.t.addComment(callExpr, "leading", "#__PURE__");
84
87
  let replacement = callExpr;
85
- if (_babel_types.isFunctionDeclaration(path.node) && path.node.id) {
86
- const declaration = _babel_types.variableDeclaration("const", [_babel_types.variableDeclarator(path.node.id, callExpr)]);
87
- _babel_types.inheritLeadingComments(declaration, path.node);
88
+ if (require_common.t.isFunctionDeclaration(path.node) && path.node.id) {
89
+ const declaration = require_common.t.variableDeclaration("const", [require_common.t.variableDeclarator(path.node.id, callExpr)]);
90
+ require_common.t.inheritLeadingComments(declaration, path.node);
88
91
  replacement = declaration;
89
92
  }
90
93
  if (visibility) {
@@ -95,15 +98,15 @@ function assignMetadata(path, name, ast) {
95
98
  path.skip();
96
99
  }
97
100
  function wrapInAutoName(path, name) {
98
- const callExpr = _babel_types.callExpression(_babel_types.logicalExpression("??", _babel_types.memberExpression(i("globalThis"), i("__TYPEGPU_AUTONAME__")), _babel_types.arrowFunctionExpression([i("a")], i("a"))), [path.node, _babel_types.stringLiteral(name)]);
99
- _babel_types.addComment(callExpr, "leading", "#__PURE__");
101
+ const callExpr = require_common.t.callExpression(require_common.t.logicalExpression("??", require_common.t.memberExpression(i("globalThis"), i("__TYPEGPU_AUTONAME__")), require_common.t.arrowFunctionExpression([i("a")], i("a"))), [path.node, require_common.t.stringLiteral(name)]);
102
+ require_common.t.addComment(callExpr, "leading", "#__PURE__");
100
103
  path.replaceWith(callExpr);
101
104
  }
102
105
  function replaceWithAssignmentOverload(path, runtimeFn) {
103
- path.replaceWith(_babel_types.assignmentExpression("=", path.node.left, _babel_types.callExpression(i(runtimeFn), [path.node.left, path.node.right])));
106
+ path.replaceWith(require_common.t.assignmentExpression("=", path.node.left, require_common.t.callExpression(i(runtimeFn), [path.node.left, path.node.right])));
104
107
  }
105
108
  function replaceWithBinaryOverload(path, runtimeFn) {
106
- path.replaceWith(_babel_types.callExpression(i(runtimeFn), [path.node.left, path.node.right]));
109
+ path.replaceWith(require_common.t.callExpression(i(runtimeFn), [path.node.left, path.node.right]));
107
110
  }
108
111
  function TypeGPUPlugin() {
109
112
  return {
@@ -125,10 +128,11 @@ function TypeGPUPlugin() {
125
128
  } }
126
129
  };
127
130
  }
131
+
128
132
  //#endregion
129
- Object.defineProperty(exports, "TypeGPUPlugin", {
130
- enumerable: true,
131
- get: function() {
132
- return TypeGPUPlugin;
133
- }
134
- });
133
+ Object.defineProperty(exports, 'TypeGPUPlugin', {
134
+ enumerable: true,
135
+ get: function () {
136
+ return TypeGPUPlugin;
137
+ }
138
+ });
@@ -1,6 +1,5 @@
1
- import { n as PluginState } from "./common-BvAFT5IV.mjs";
1
+ import { n as PluginState, r as t } from "./common-DZ2cLtbe.cjs";
2
2
  import { NodePath } from "@babel/traverse";
3
- import * as t from "@babel/types";
4
3
 
5
4
  //#region src/babel.d.ts
6
5
  declare function TypeGPUPlugin(): {
@@ -1,10 +1,10 @@
1
- import { a as initPluginState, i as getBlockScope, r as functionVisitor, t as defaultOptions } from "./common-e08X6w0a.mjs";
1
+ import { a as initPluginState, i as getBlockScope, o as t, r as functionVisitor, t as defaultOptions } from "./common-CElmMmuq.js";
2
2
  import defu from "defu";
3
+ import { transpileFn } from "tinyest-for-wgsl";
3
4
  import { FORMAT_VERSION } from "tinyest";
4
- import "tinyest-for-wgsl";
5
- import * as t from "@babel/types";
6
5
  import { resolve } from "pathe";
7
6
  import picomatch from "picomatch";
7
+
8
8
  //#region src/core/filter.ts
9
9
  function toArray(array) {
10
10
  const result = array || [];
@@ -60,6 +60,7 @@ function createFilterForId(filter) {
60
60
  const filterFunction = createIdFilter(filter);
61
61
  return filterFunction ? (id) => !!filterFunction(id) : void 0;
62
62
  }
63
+
63
64
  //#endregion
64
65
  //#region src/babel.ts
65
66
  function i(identifier) {
@@ -70,7 +71,7 @@ function assignMetadata(path, name, ast) {
70
71
  t.objectProperty(i("v"), t.numericLiteral(FORMAT_VERSION)),
71
72
  t.objectProperty(i("name"), t.valueToNode(name)),
72
73
  t.objectProperty(i("ast"), t.valueToNode(ast)),
73
- t.objectProperty(i("externals"), t.arrowFunctionExpression([], t.blockStatement([t.returnStatement(t.objectExpression(ast.externalNames.map((name) => name === "this" ? t.objectProperty(i("this"), t.thisExpression()) : t.objectProperty(i(name), i(name), false, name !== "this"))))])))
74
+ t.objectProperty(i("externals"), t.arrowFunctionExpression([], t.blockStatement([t.returnStatement(t.objectExpression(ast.externalNames.map((name$1) => name$1 === "this" ? t.objectProperty(i("this"), t.thisExpression()) : t.objectProperty(i(name$1), i(name$1), false, name$1 !== "this"))))])))
74
75
  ]);
75
76
  let expression;
76
77
  const visibility = t.isFunctionDeclaration(path.node) ? getBlockScope(path) : void 0;
@@ -122,5 +123,6 @@ function TypeGPUPlugin() {
122
123
  } }
123
124
  };
124
125
  }
126
+
125
127
  //#endregion
126
- export { TypeGPUPlugin as t };
128
+ export { TypeGPUPlugin as t };
@@ -1,5 +1,4 @@
1
- import { n as PluginState } from "./common-BKqBivuE.cjs";
2
- import * as t from "@babel/types";
1
+ import { n as PluginState, r as t } from "./common-BlvLUwEz.js";
3
2
  import { NodePath } from "@babel/traverse";
4
3
 
5
4
  //#region src/babel.d.ts
package/babel.cjs CHANGED
@@ -1,6 +1,5 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_babel = require("./babel-izRcz0Uk.cjs");
6
- exports.default = require_babel.TypeGPUPlugin;
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ require('./common-B8wsLJUq.cjs');
3
+ const require_babel = require('./babel-B-IcpMR7.cjs');
4
+
5
+ exports.default = require_babel.TypeGPUPlugin;
package/babel.d.cts CHANGED
@@ -1,2 +1,3 @@
1
- import { t as TypeGPUPlugin } from "./babel-C1TaJd38.cjs";
1
+ import "./common-DZ2cLtbe.cjs";
2
+ import { t as TypeGPUPlugin } from "./babel-C8UzthFd.cjs";
2
3
  export = TypeGPUPlugin;
package/babel.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import "./common-BlvLUwEz.js";
2
+ import { t as TypeGPUPlugin } from "./babel-CmCnq-43.js";
3
+ export { TypeGPUPlugin as default };
package/babel.js ADDED
@@ -0,0 +1,4 @@
1
+ import "./common-CElmMmuq.js";
2
+ import { t as TypeGPUPlugin } from "./babel-CbManzjz.js";
3
+
4
+ export { TypeGPUPlugin as default };
@@ -1,12 +1,12 @@
1
- import { a as initPluginState, i as getBlockScope, n as earlyPruneRegex, r as functionVisitor, t as defaultOptions } from "./common-e08X6w0a.mjs";
1
+ import { a as initPluginState, i as getBlockScope, n as earlyPruneRegex, o as t, r as functionVisitor, t as defaultOptions } from "./common-CElmMmuq.js";
2
2
  import defu from "defu";
3
+ import { transpileFn } from "tinyest-for-wgsl";
4
+ import { FORMAT_VERSION } from "tinyest";
3
5
  import { MagicStringAST, generateTransform } from "magic-string-ast";
4
6
  import { getBabelParserOptions, getLang } from "ast-kit";
5
7
  import _traverse from "@babel/traverse";
6
- import { FORMAT_VERSION } from "tinyest";
7
- import "tinyest-for-wgsl";
8
8
  import * as parser from "@babel/parser";
9
- import * as t from "@babel/types";
9
+
10
10
  //#region src/core/factory.ts
11
11
  let traverse = _traverse;
12
12
  if (typeof traverse.default === "function") traverse = traverse.default;
@@ -101,6 +101,7 @@ const unpluginFactory = ((rawOptions, _meta) => {
101
101
  }
102
102
  };
103
103
  });
104
+
104
105
  //#endregion
105
106
  //#region src/bun.ts
106
107
  var bun_default = (rawOptions) => {
@@ -128,5 +129,6 @@ var bun_default = (rawOptions) => {
128
129
  }
129
130
  };
130
131
  };
132
+
131
133
  //#endregion
132
- export { unpluginFactory as n, bun_default as t };
134
+ export { unpluginFactory as n, bun_default as t };
@@ -1,18 +1,21 @@
1
- const require_common = require("./common-Ccx_dEqH.cjs");
1
+ const require_common = require('./common-B8wsLJUq.cjs');
2
2
  let defu = require("defu");
3
3
  defu = require_common.__toESM(defu);
4
+ let tinyest_for_wgsl = require("tinyest-for-wgsl");
5
+ tinyest_for_wgsl = require_common.__toESM(tinyest_for_wgsl);
6
+ let tinyest = require("tinyest");
7
+ tinyest = require_common.__toESM(tinyest);
4
8
  let magic_string_ast = require("magic-string-ast");
9
+ magic_string_ast = require_common.__toESM(magic_string_ast);
5
10
  let ast_kit = require("ast-kit");
6
- let _babel_traverse = require("@babel/traverse");
7
- _babel_traverse = require_common.__toESM(_babel_traverse);
8
- let tinyest = require("tinyest");
9
- require("tinyest-for-wgsl");
10
- let _babel_parser = require("@babel/parser");
11
- _babel_parser = require_common.__toESM(_babel_parser);
12
- let _babel_types = require("@babel/types");
13
- _babel_types = require_common.__toESM(_babel_types);
11
+ ast_kit = require_common.__toESM(ast_kit);
12
+ let __babel_traverse = require("@babel/traverse");
13
+ __babel_traverse = require_common.__toESM(__babel_traverse);
14
+ let __babel_parser = require("@babel/parser");
15
+ __babel_parser = require_common.__toESM(__babel_parser);
16
+
14
17
  //#region src/core/factory.ts
15
- let traverse = _babel_traverse.default;
18
+ let traverse = __babel_traverse.default;
16
19
  if (typeof traverse.default === "function") traverse = traverse.default;
17
20
  const fnWrapperTemplate = (fnCode, metadata) => `(/*#__PURE__*/($ => (globalThis.__TYPEGPU_META__ ??= new WeakMap()).set($.f = (${fnCode}), ${metadata}) && $.f)({}))`;
18
21
  function embedJSON(jsValue) {
@@ -26,16 +29,16 @@ function assignMetadata(path, name, ast) {
26
29
  ast: ${embedJSON(ast)},
27
30
  externals: () => ({${ast.externalNames.map((e) => e === "this" ? "\"this\": this" : e).join(", ")}}),
28
31
  }`;
29
- const visibility = _babel_types.isFunctionDeclaration(path.node) ? require_common.getBlockScope(path) : void 0;
32
+ const visibility = require_common.t.isFunctionDeclaration(path.node) ? require_common.getBlockScope(path) : void 0;
30
33
  const fnCode = this.magicString.sliceNode(path.node);
31
34
  let nodeToOverride = path.node;
32
35
  let code = fnWrapperTemplate(fnCode, metadata);
33
36
  let insertPos = (_path$node$start = path.node.start) !== null && _path$node$start !== void 0 ? _path$node$start : 0;
34
- if (_babel_types.isFunctionDeclaration(path.node) && path.node.id) code = `const ${path.node.id.name} = ${code};\n\n`;
37
+ if (require_common.t.isFunctionDeclaration(path.node) && path.node.id) code = `const ${path.node.id.name} = ${code};\n\n`;
35
38
  if (visibility) {
36
39
  var _visibility$node$body, _visibility$node$body2;
37
40
  insertPos = (_visibility$node$body = (_visibility$node$body2 = visibility.node.body[0]) === null || _visibility$node$body2 === void 0 ? void 0 : _visibility$node$body2.start) !== null && _visibility$node$body !== void 0 ? _visibility$node$body : insertPos;
38
- if (_babel_types.isExportNamedDeclaration(path.parent)) {
41
+ if (require_common.t.isExportNamedDeclaration(path.parent)) {
39
42
  nodeToOverride = path.parent;
40
43
  code = `export ${code}`;
41
44
  }
@@ -78,7 +81,7 @@ const unpluginFactory = ((rawOptions, _meta) => {
78
81
  handler(code, id) {
79
82
  let ast;
80
83
  try {
81
- ast = _babel_parser.parse(code, (0, ast_kit.getBabelParserOptions)((0, ast_kit.getLang)(id), {
84
+ ast = __babel_parser.parse(code, (0, ast_kit.getBabelParserOptions)((0, ast_kit.getLang)(id), {
82
85
  sourceType: "module",
83
86
  allowReturnOutsideFunction: true
84
87
  }));
@@ -105,6 +108,7 @@ const unpluginFactory = ((rawOptions, _meta) => {
105
108
  }
106
109
  };
107
110
  });
111
+
108
112
  //#endregion
109
113
  //#region src/bun.ts
110
114
  var bun_default = (rawOptions) => {
@@ -132,16 +136,17 @@ var bun_default = (rawOptions) => {
132
136
  }
133
137
  };
134
138
  };
139
+
135
140
  //#endregion
136
- Object.defineProperty(exports, "bun_default", {
137
- enumerable: true,
138
- get: function() {
139
- return bun_default;
140
- }
141
- });
142
- Object.defineProperty(exports, "unpluginFactory", {
143
- enumerable: true,
144
- get: function() {
145
- return unpluginFactory;
146
- }
141
+ Object.defineProperty(exports, 'bun_default', {
142
+ enumerable: true,
143
+ get: function () {
144
+ return bun_default;
145
+ }
147
146
  });
147
+ Object.defineProperty(exports, 'unpluginFactory', {
148
+ enumerable: true,
149
+ get: function () {
150
+ return unpluginFactory;
151
+ }
152
+ });
@@ -1,4 +1,4 @@
1
- import { t as Options } from "./common-BvAFT5IV.mjs";
1
+ import { t as Options } from "./common-DZ2cLtbe.cjs";
2
2
 
3
3
  //#region src/bun.d.ts
4
4
  declare const _default: (rawOptions?: Options) => Bun.BunPlugin;
@@ -1,4 +1,4 @@
1
- import { t as Options } from "./common-BKqBivuE.cjs";
1
+ import { t as Options } from "./common-BlvLUwEz.js";
2
2
 
3
3
  //#region src/bun.d.ts
4
4
  declare const _default: (rawOptions?: Options) => Bun.BunPlugin;
package/bun.cjs CHANGED
@@ -1,6 +1,5 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_bun = require("./bun-CUGitP44.cjs");
6
- exports.default = require_bun.bun_default;
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ require('./common-B8wsLJUq.cjs');
3
+ const require_bun = require('./bun-DU5xZoDJ.cjs');
4
+
5
+ exports.default = require_bun.bun_default;
package/bun.d.cts CHANGED
@@ -1,2 +1,3 @@
1
- import { t as _default } from "./bun-ChNeklBe.cjs";
1
+ import "./common-DZ2cLtbe.cjs";
2
+ import { t as _default } from "./bun-cwXs2EDP.cjs";
2
3
  export = _default;
package/bun.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import "./common-BlvLUwEz.js";
2
+ import { t as _default } from "./bun-ovScJ4Es.js";
3
+ export { _default as default };
package/bun.js ADDED
@@ -0,0 +1,4 @@
1
+ import "./common-CElmMmuq.js";
2
+ import { t as bun_default } from "./bun-CDECNeIU.js";
3
+
4
+ export { bun_default as default };
@@ -1,4 +1,4 @@
1
- //#region \0rolldown/runtime.js
1
+ //#region rolldown:runtime
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -19,10 +19,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
19
19
  value: mod,
20
20
  enumerable: true
21
21
  }) : target, mod));
22
- require("magic-string-ast");
22
+
23
+ //#endregion
23
24
  let tinyest_for_wgsl = require("tinyest-for-wgsl");
24
- let _babel_types = require("@babel/types");
25
- _babel_types = __toESM(_babel_types);
25
+ tinyest_for_wgsl = __toESM(tinyest_for_wgsl);
26
+ let __babel_types = require("@babel/types");
27
+ __babel_types = __toESM(__babel_types);
28
+ let magic_string_ast = require("magic-string-ast");
29
+ magic_string_ast = __toESM(magic_string_ast);
30
+
31
+ //#region src/core/polyfill-process.ts
32
+ if (typeof globalThis.process === "undefined") globalThis.process = {};
33
+ if (typeof globalThis.process.env === "undefined") globalThis.process.env = {};
34
+
35
+ //#endregion
26
36
  //#region src/core/common.ts
27
37
  function initPluginState(state, methods) {
28
38
  var _state$opts$autoNamin;
@@ -48,8 +58,8 @@ function getBlockScope(path) {
48
58
  const binding = path.scope.getBinding(path.node.id.name);
49
59
  if (!binding) return;
50
60
  let scopePath = binding.scope.path;
51
- if (_babel_types.isNode(scopePath.node.body)) scopePath = scopePath.get("body");
52
- if (_babel_types.isBlockStatement(scopePath.node) || _babel_types.isProgram(scopePath.node)) return scopePath;
61
+ if (__babel_types.isNode(scopePath.node.body)) scopePath = scopePath.get("body");
62
+ if (__babel_types.isBlockStatement(scopePath.node) || __babel_types.isProgram(scopePath.node)) return scopePath;
53
63
  }
54
64
  /**
55
65
  * Checks if `node` is an alias for the 'tgpu' object, traditionally
@@ -290,40 +300,47 @@ const functionVisitor = {
290
300
  }
291
301
  } }
292
302
  };
303
+
293
304
  //#endregion
294
- Object.defineProperty(exports, "__toESM", {
295
- enumerable: true,
296
- get: function() {
297
- return __toESM;
298
- }
305
+ Object.defineProperty(exports, '__toESM', {
306
+ enumerable: true,
307
+ get: function () {
308
+ return __toESM;
309
+ }
299
310
  });
300
- Object.defineProperty(exports, "defaultOptions", {
301
- enumerable: true,
302
- get: function() {
303
- return defaultOptions;
304
- }
311
+ Object.defineProperty(exports, 'defaultOptions', {
312
+ enumerable: true,
313
+ get: function () {
314
+ return defaultOptions;
315
+ }
305
316
  });
306
- Object.defineProperty(exports, "earlyPruneRegex", {
307
- enumerable: true,
308
- get: function() {
309
- return earlyPruneRegex;
310
- }
317
+ Object.defineProperty(exports, 'earlyPruneRegex', {
318
+ enumerable: true,
319
+ get: function () {
320
+ return earlyPruneRegex;
321
+ }
311
322
  });
312
- Object.defineProperty(exports, "functionVisitor", {
313
- enumerable: true,
314
- get: function() {
315
- return functionVisitor;
316
- }
323
+ Object.defineProperty(exports, 'functionVisitor', {
324
+ enumerable: true,
325
+ get: function () {
326
+ return functionVisitor;
327
+ }
317
328
  });
318
- Object.defineProperty(exports, "getBlockScope", {
319
- enumerable: true,
320
- get: function() {
321
- return getBlockScope;
322
- }
329
+ Object.defineProperty(exports, 'getBlockScope', {
330
+ enumerable: true,
331
+ get: function () {
332
+ return getBlockScope;
333
+ }
323
334
  });
324
- Object.defineProperty(exports, "initPluginState", {
325
- enumerable: true,
326
- get: function() {
327
- return initPluginState;
328
- }
335
+ Object.defineProperty(exports, 'initPluginState', {
336
+ enumerable: true,
337
+ get: function () {
338
+ return initPluginState;
339
+ }
329
340
  });
341
+ Object.defineProperty(exports, 't', {
342
+ enumerable: true,
343
+ get: function () {
344
+ return t;
345
+ }
346
+ });
@@ -1,8 +1,8 @@
1
- import { FilterPattern } from "unplugin";
2
- import { MagicStringAST } from "magic-string-ast";
3
- import { NodePath } from "@babel/traverse";
4
1
  import { transpileFn } from "tinyest-for-wgsl";
5
2
  import * as t from "@babel/types";
3
+ import { MagicStringAST } from "magic-string-ast";
4
+ import { NodePath } from "@babel/traverse";
5
+ import { FilterPattern } from "unplugin";
6
6
 
7
7
  //#region src/core/common.d.ts
8
8
  interface Options {
@@ -82,4 +82,4 @@ interface PluginState extends TransformMethods {
82
82
  alreadyTransformed: WeakSet<t.Node>;
83
83
  }
84
84
  //#endregion
85
- export { PluginState as n, Options as t };
85
+ export { PluginState as n, t as r, Options as t };
@@ -1,6 +1,12 @@
1
- import "magic-string-ast";
2
1
  import { transpileFn } from "tinyest-for-wgsl";
3
2
  import * as t from "@babel/types";
3
+ import { MagicStringAST } from "magic-string-ast";
4
+
5
+ //#region src/core/polyfill-process.ts
6
+ if (typeof globalThis.process === "undefined") globalThis.process = {};
7
+ if (typeof globalThis.process.env === "undefined") globalThis.process.env = {};
8
+
9
+ //#endregion
4
10
  //#region src/core/common.ts
5
11
  function initPluginState(state, methods) {
6
12
  var _state$opts$autoNamin;
@@ -268,5 +274,6 @@ const functionVisitor = {
268
274
  }
269
275
  } }
270
276
  };
277
+
271
278
  //#endregion
272
- export { initPluginState as a, getBlockScope as i, earlyPruneRegex as n, functionVisitor as r, defaultOptions as t };
279
+ export { initPluginState as a, getBlockScope as i, earlyPruneRegex as n, t as o, functionVisitor as r, defaultOptions as t };
@@ -1,5 +1,5 @@
1
- import * as t from "@babel/types";
2
1
  import { NodePath } from "@babel/traverse";
2
+ import * as t from "@babel/types";
3
3
  import { FilterPattern } from "unplugin";
4
4
  import { transpileFn } from "tinyest-for-wgsl";
5
5
 
@@ -81,4 +81,4 @@ interface PluginState extends TransformMethods {
81
81
  alreadyTransformed: WeakSet<t.Node>;
82
82
  }
83
83
  //#endregion
84
- export { PluginState as n, Options as t };
84
+ export { PluginState as n, t as r, Options as t };
package/esbuild.cjs CHANGED
@@ -1,8 +1,11 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ require('./common-B8wsLJUq.cjs');
3
+ require('./babel-B-IcpMR7.cjs');
4
+ require('./bun-DU5xZoDJ.cjs');
5
+ const require_src = require('./src-CDZ6lHsg.cjs');
6
+
5
7
  //#region src/esbuild.ts
6
- var esbuild_default = require("./src-2vvPp2dY.cjs").esbuildPlugin;
8
+ var esbuild_default = require_src.esbuildPlugin;
9
+
7
10
  //#endregion
8
- exports.default = esbuild_default;
11
+ exports.default = esbuild_default;
package/esbuild.d.cts CHANGED
@@ -1,2 +1,5 @@
1
- import { t as esbuildPlugin } from "./index-HrLja1mV.cjs";
1
+ import "./common-DZ2cLtbe.cjs";
2
+ import "./babel-C8UzthFd.cjs";
3
+ import "./bun-cwXs2EDP.cjs";
4
+ import { t as esbuildPlugin } from "./index-COIv1oYx.cjs";
2
5
  export = esbuildPlugin;
package/esbuild.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import "./common-BlvLUwEz.js";
2
+ import "./babel-CmCnq-43.js";
3
+ import "./bun-ovScJ4Es.js";
4
+ import { t as esbuildPlugin } from "./index-PPreQbn5.js";
5
+ export { esbuildPlugin as default };
package/esbuild.js ADDED
@@ -0,0 +1,10 @@
1
+ import "./common-CElmMmuq.js";
2
+ import "./babel-CbManzjz.js";
3
+ import "./bun-CDECNeIU.js";
4
+ import { t as esbuildPlugin } from "./src-D84rmPxv.js";
5
+
6
+ //#region src/esbuild.ts
7
+ var esbuild_default = esbuildPlugin;
8
+
9
+ //#endregion
10
+ export { esbuild_default as default };
package/farm.cjs CHANGED
@@ -1,8 +1,11 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ require('./common-B8wsLJUq.cjs');
3
+ require('./babel-B-IcpMR7.cjs');
4
+ require('./bun-DU5xZoDJ.cjs');
5
+ const require_src = require('./src-CDZ6lHsg.cjs');
6
+
5
7
  //#region src/farm.ts
6
- var farm_default = require("./src-2vvPp2dY.cjs").farmPlugin;
8
+ var farm_default = require_src.farmPlugin;
9
+
7
10
  //#endregion
8
- exports.default = farm_default;
11
+ exports.default = farm_default;
package/farm.d.cts CHANGED
@@ -1,2 +1,5 @@
1
- import { n as farmPlugin } from "./index-HrLja1mV.cjs";
1
+ import "./common-DZ2cLtbe.cjs";
2
+ import "./babel-C8UzthFd.cjs";
3
+ import "./bun-cwXs2EDP.cjs";
4
+ import { n as farmPlugin } from "./index-COIv1oYx.cjs";
2
5
  export = farmPlugin;
package/farm.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import "./common-BlvLUwEz.js";
2
+ import "./babel-CmCnq-43.js";
3
+ import "./bun-ovScJ4Es.js";
4
+ import { n as farmPlugin } from "./index-PPreQbn5.js";
5
+ export { farmPlugin as default };
package/farm.js ADDED
@@ -0,0 +1,10 @@
1
+ import "./common-CElmMmuq.js";
2
+ import "./babel-CbManzjz.js";
3
+ import "./bun-CDECNeIU.js";
4
+ import { n as farmPlugin } from "./src-D84rmPxv.js";
5
+
6
+ //#region src/farm.ts
7
+ var farm_default = farmPlugin;
8
+
9
+ //#endregion
10
+ export { farm_default as default };