unplugin-typegpu 0.11.6 → 0.12.1
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/{babel-B7h6V8Bs.js → babel-C62qx26_.js} +16 -5
- package/{babel-ZVrKmopN.d.cts → babel-CYu2-eXe.d.cts} +1 -1
- package/{babel--cjzbyRs.d.ts → babel-DOOIkQDL.d.ts} +1 -1
- package/{babel-C7MhY2Q5.cjs → babel-DpCnkpmi.cjs} +16 -5
- package/babel.cjs +2 -2
- package/babel.d.cts +2 -2
- package/babel.d.ts +2 -2
- package/babel.js +2 -2
- package/{bun-D_FFJG6e.cjs → bun-Bijjhb7w.cjs} +3 -3
- package/{bun-f_IcPQ-M.js → bun-CJralo3D.js} +3 -3
- package/{bun-CF67VgNO.d.ts → bun-DKuUuTVo.d.ts} +1 -1
- package/{bun-iEmr0VLQ.d.cts → bun-YVuHXBJq.d.cts} +1 -1
- package/bun.cjs +3 -3
- package/bun.d.cts +2 -2
- package/bun.d.ts +2 -2
- package/bun.js +3 -3
- package/{common-CmJ77T6N.d.cts → common-BriEOmpZ.d.cts} +10 -4
- package/{common-BZrmpQ_X.d.ts → common-CWaD5wkm.d.ts} +10 -4
- package/common-Dilxou2I.js +710 -0
- package/common-hMfUmUk0.cjs +790 -0
- package/esbuild.cjs +6 -6
- package/esbuild.d.cts +5 -5
- package/esbuild.d.ts +5 -5
- package/esbuild.js +6 -6
- package/{factory-W6dKP7m4.js → factory-BSXzHM_n.js} +10 -70
- package/{factory-BgweY_8-.cjs → factory-CXjNN-uX.cjs} +11 -71
- package/farm.cjs +6 -6
- package/farm.d.cts +5 -5
- package/farm.d.ts +5 -5
- package/farm.js +6 -6
- package/{index-zDnadEd0.d.cts → index-COouFDDA.d.cts} +7 -7
- package/{index-BkLJ1amC.d.ts → index-DaJ1nxWt.d.ts} +1 -1
- package/index.cjs +6 -6
- package/index.d.cts +5 -5
- package/index.d.ts +5 -5
- package/index.js +6 -6
- package/package.json +5 -5
- package/{rolldown-browser-DQtD9pV1.cjs → rolldown-browser-0UeIgV94.cjs} +1 -1
- package/{rolldown-browser-D3BM6oXF.d.ts → rolldown-browser-1an_WnxF.d.ts} +13 -9
- package/rolldown-browser-Da9eNbZo.d.cts +44 -0
- package/{rolldown-browser-NmW1NQnD.js → rolldown-browser-XH90sRcH.js} +1 -1
- package/rolldown-browser.cjs +3 -3
- package/rolldown-browser.d.cts +2 -2
- package/rolldown-browser.d.ts +2 -2
- package/rolldown-browser.js +3 -3
- package/rolldown.cjs +6 -6
- package/rolldown.d.cts +5 -5
- package/rolldown.d.ts +5 -5
- package/rolldown.js +6 -6
- package/rollup.cjs +6 -6
- package/rollup.d.cts +5 -5
- package/rollup.d.ts +5 -5
- package/rollup.js +6 -6
- package/rspack.cjs +6 -6
- package/rspack.d.cts +5 -5
- package/rspack.d.ts +5 -5
- package/rspack.js +6 -6
- package/{src-YdrXaMF1.js → src-BPzkBd5O.js} +1 -1
- package/{src-NN6mroxq.cjs → src-CYnpqmx5.cjs} +2 -2
- package/vite.cjs +6 -6
- package/vite.d.cts +5 -5
- package/vite.d.ts +5 -5
- package/vite.js +6 -6
- package/webpack.cjs +6 -6
- package/webpack.d.cts +5 -5
- package/webpack.d.ts +5 -5
- package/webpack.js +6 -6
- package/common-CK7zOjbK.js +0 -279
- package/common-ddv56_tk.cjs +0 -346
- package/rolldown-browser-CvOoUvEH.d.cts +0 -40
package/common-ddv56_tk.cjs
DELETED
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
let tinyest_for_wgsl = require("tinyest-for-wgsl");
|
|
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 = require("magic-string");
|
|
29
|
-
magic_string = __toESM(magic_string);
|
|
30
|
-
|
|
31
|
-
//#region src/core/common.ts
|
|
32
|
-
/**
|
|
33
|
-
* Each breaking change to the metadata format requires a bump to this number.
|
|
34
|
-
* It's used at runtime by `typegpu` to determine how to interpret a function's metadata.
|
|
35
|
-
*/
|
|
36
|
-
const METADATA_FORMAT_VERSION = 1;
|
|
37
|
-
function initPluginState(state, methods) {
|
|
38
|
-
var _state$opts$autoNamin;
|
|
39
|
-
state.tgpuAliases = new Set(state.opts.forceTgpuAlias ? [state.opts.forceTgpuAlias] : []);
|
|
40
|
-
state.autoNamingEnabled = (_state$opts$autoNamin = state.opts.autoNamingEnabled) !== null && _state$opts$autoNamin !== void 0 ? _state$opts$autoNamin : true;
|
|
41
|
-
state.inUseGpuScope = false;
|
|
42
|
-
state.alreadyTransformed = /* @__PURE__ */ new WeakSet();
|
|
43
|
-
Object.assign(state, methods);
|
|
44
|
-
}
|
|
45
|
-
/** Regular expressions used for early pruning (to avoid unnecessary parsing, which is expensive) */
|
|
46
|
-
const earlyPruneRegex = [/["']use gpu["']/, /t(ype)?gpu/];
|
|
47
|
-
const defaultOptions = {
|
|
48
|
-
include: /\.m?[jt]sx?(?:\?.*)?$/,
|
|
49
|
-
autoNamingEnabled: true,
|
|
50
|
-
earlyPruning: true
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Returns the block scope of a function declaration, if one exists.
|
|
54
|
-
* Used to hoist a function declaration to the top of the scope it's visible in.
|
|
55
|
-
*/
|
|
56
|
-
function getBlockScope(path) {
|
|
57
|
-
if (!path.node.id) return;
|
|
58
|
-
const binding = path.scope.getBinding(path.node.id.name);
|
|
59
|
-
if (!binding) return;
|
|
60
|
-
let scopePath = binding.scope.path;
|
|
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;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Checks if `node` is an alias for the 'tgpu' object, traditionally
|
|
66
|
-
* available via `import tgpu from 'typegpu'`.
|
|
67
|
-
*/
|
|
68
|
-
function isTgpu(state, node) {
|
|
69
|
-
let path = "";
|
|
70
|
-
let tail = node;
|
|
71
|
-
while (true) if (tail.type === "MemberExpression") {
|
|
72
|
-
if (tail.property.type === "StringLiteral" && tail.property.value === "~unstable") {
|
|
73
|
-
tail = tail.object;
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
if (tail.property.type !== "Identifier") break;
|
|
77
|
-
path = path ? `${tail.property.name}.${path}` : tail.property.name;
|
|
78
|
-
tail = tail.object;
|
|
79
|
-
} else if (tail.type === "Identifier") {
|
|
80
|
-
path = path ? `${tail.name}.${path}` : tail.name;
|
|
81
|
-
break;
|
|
82
|
-
} else break;
|
|
83
|
-
return state.tgpuAliases.has(path);
|
|
84
|
-
}
|
|
85
|
-
function gatherTgpuAliases(state, node) {
|
|
86
|
-
if (node.source.value !== "typegpu") return;
|
|
87
|
-
for (const spec of node.specifiers) if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportSpecifier" && spec.imported.type === "Identifier" && spec.imported.name === "tgpu") state.tgpuAliases.add(spec.local.name);
|
|
88
|
-
else if (spec.type === "ImportNamespaceSpecifier") state.tgpuAliases.add(`${spec.local.name}.tgpu`);
|
|
89
|
-
}
|
|
90
|
-
const fnShellFunctionNames = [
|
|
91
|
-
"fn",
|
|
92
|
-
"vertexFn",
|
|
93
|
-
"fragmentFn",
|
|
94
|
-
"computeFn"
|
|
95
|
-
];
|
|
96
|
-
function isShellImplementationCall(node, state) {
|
|
97
|
-
return node.callee.type === "CallExpression" && node.callee.callee.type === "MemberExpression" && node.callee.callee.property.type === "Identifier" && fnShellFunctionNames.includes(node.callee.callee.property.name) && node.arguments.length === 1 && isTgpu(state, node.callee.callee.object);
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Extracts a name and expression from nodes that contain a label and an expression,
|
|
101
|
-
* such as VariableDeclarator or PropertyDefinition.
|
|
102
|
-
* Returns a tuple of [name, expression] if found, otherwise undefined.
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* extractLabelledExpression(node`let name = tgpu.bindGroupLayout({});`)
|
|
106
|
-
* // ["name", node`tgpu.bindGroupLayout({})`]
|
|
107
|
-
*/
|
|
108
|
-
function extractLabelledExpression(path) {
|
|
109
|
-
if (path.node.type === "VariableDeclarator" && path.node.id.type === "Identifier" && path.node.init) return [path.node.id.name, path.get("init")];
|
|
110
|
-
else if (path.node.type === "AssignmentExpression") {
|
|
111
|
-
const maybeName = tryFindIdentifier(path.node.left);
|
|
112
|
-
if (maybeName) return [maybeName, path.get("right")];
|
|
113
|
-
} else if (path.node.type === "ObjectProperty" && path.node.key.type === "Identifier") return [path.node.key.name, path.get("value")];
|
|
114
|
-
else if (path.node.type === "ClassProperty" && path.node.value && path.node.key.type === "Identifier") return [path.node.key.name, path.get("value")];
|
|
115
|
-
}
|
|
116
|
-
function getFunctionName(path) {
|
|
117
|
-
var _extractLabelledExpre, _path$node$id;
|
|
118
|
-
const maybeName = path.parentPath ? (_extractLabelledExpre = extractLabelledExpression(path.parentPath)) === null || _extractLabelledExpre === void 0 ? void 0 : _extractLabelledExpre[0] : void 0;
|
|
119
|
-
return maybeName !== null && maybeName !== void 0 ? maybeName : path.node.type === "FunctionDeclaration" || path.node.type === "FunctionExpression" ? (_path$node$id = path.node.id) === null || _path$node$id === void 0 ? void 0 : _path$node$id.name : void 0;
|
|
120
|
-
}
|
|
121
|
-
const resourceConstructors = [
|
|
122
|
-
"bindGroupLayout",
|
|
123
|
-
"vertexLayout",
|
|
124
|
-
"privateVar",
|
|
125
|
-
"workgroupVar",
|
|
126
|
-
"const",
|
|
127
|
-
"slot",
|
|
128
|
-
"accessor",
|
|
129
|
-
"mutableAccessor",
|
|
130
|
-
"comptime",
|
|
131
|
-
...fnShellFunctionNames,
|
|
132
|
-
"createBuffer",
|
|
133
|
-
"createMutable",
|
|
134
|
-
"createReadonly",
|
|
135
|
-
"createUniform",
|
|
136
|
-
"createQuerySet",
|
|
137
|
-
"createPipeline",
|
|
138
|
-
"createComputePipeline",
|
|
139
|
-
"createGuardedComputePipeline",
|
|
140
|
-
"createRenderPipeline",
|
|
141
|
-
"createTexture",
|
|
142
|
-
"createSampler",
|
|
143
|
-
"createComparisonSampler",
|
|
144
|
-
"struct",
|
|
145
|
-
"unstruct",
|
|
146
|
-
"createView"
|
|
147
|
-
];
|
|
148
|
-
/**
|
|
149
|
-
* Checks if `node` should be wrapped in an autoname function.
|
|
150
|
-
* Since it is mostly for debugging and clean WGSL generation,
|
|
151
|
-
* some false positives and false negatives are admissible.
|
|
152
|
-
*/
|
|
153
|
-
function containsResourceConstructorCall(node, state) {
|
|
154
|
-
if (node.type === "CallExpression") {
|
|
155
|
-
if (isShellImplementationCall(node, state)) return true;
|
|
156
|
-
if (node.callee.type === "Identifier" && resourceConstructors.includes(node.callee.name)) return true;
|
|
157
|
-
if (node.callee.type === "MemberExpression") {
|
|
158
|
-
if (node.callee.property.type === "Identifier") {
|
|
159
|
-
if (resourceConstructors.includes(node.callee.property.name)) return true;
|
|
160
|
-
if (node.callee.property.name === "$name") return false;
|
|
161
|
-
}
|
|
162
|
-
return containsResourceConstructorCall(node.callee.object, state);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (node.type === "TaggedTemplateExpression") return containsResourceConstructorCall(node.tag, state);
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Tries to find an identifier in a node.
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* // syntax is simplified, imagine the arguments are appropriate nodes instead
|
|
173
|
-
* tryFindIdentifier('myBuffer'); // 'myBuffer'
|
|
174
|
-
* tryFindIdentifier('buffers.myBuffer'); // 'myBuffer'
|
|
175
|
-
* tryFindIdentifier('this.myBuffer'); // 'myBuffer'
|
|
176
|
-
* tryFindIdentifier('[a, b]'); // undefined
|
|
177
|
-
*/
|
|
178
|
-
function tryFindIdentifier(node) {
|
|
179
|
-
if (node.type === "Identifier") return node.name;
|
|
180
|
-
if (node.type === "PrivateName") return tryFindIdentifier(node.id);
|
|
181
|
-
if (node.type === "MemberExpression") return tryFindIdentifier(node.property);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Checks if `node` contains a label and a tgpu expression that could be named.
|
|
185
|
-
* If so, it calls the provided callback. Nodes selected for naming include:
|
|
186
|
-
*
|
|
187
|
-
* `let name = tgpu.bindGroupLayout({});` (VariableDeclarator)
|
|
188
|
-
*
|
|
189
|
-
* `name = tgpu.bindGroupLayout({});` (AssignmentExpression)
|
|
190
|
-
*
|
|
191
|
-
* `property: tgpu.bindGroupLayout({})` (Property/ObjectProperty)
|
|
192
|
-
*
|
|
193
|
-
* Since it is mostly for debugging and clean WGSL generation,
|
|
194
|
-
* some false positives and false negatives are admissible.
|
|
195
|
-
*
|
|
196
|
-
* This function is NOT used for auto-naming shell-less functions.
|
|
197
|
-
* Those are handled separately.
|
|
198
|
-
*
|
|
199
|
-
* @privateRemarks
|
|
200
|
-
* When adding new checks, you need to call this method in the corresponding node in Babel.
|
|
201
|
-
*/
|
|
202
|
-
function performExpressionNaming(state, path, namingCallback) {
|
|
203
|
-
if (!state.autoNamingEnabled) return;
|
|
204
|
-
const labelledExpression = extractLabelledExpression(path);
|
|
205
|
-
if (labelledExpression) {
|
|
206
|
-
const [label, expressionPath] = labelledExpression;
|
|
207
|
-
if (containsResourceConstructorCall(expressionPath.node, state)) namingCallback(expressionPath, label);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
const operators = {
|
|
211
|
-
"+": "__tsover_add",
|
|
212
|
-
"-": "__tsover_sub",
|
|
213
|
-
"*": "__tsover_mul",
|
|
214
|
-
"/": "__tsover_div",
|
|
215
|
-
"%": "__tsover_mod",
|
|
216
|
-
"+=": "__tsover_add",
|
|
217
|
-
"-=": "__tsover_sub",
|
|
218
|
-
"*=": "__tsover_mul",
|
|
219
|
-
"/=": "__tsover_div",
|
|
220
|
-
"%=": "__tsover_mod"
|
|
221
|
-
};
|
|
222
|
-
function containsUseGpuDirective(node) {
|
|
223
|
-
var _node$body$directives, _node$body;
|
|
224
|
-
return ("directives" in node.body ? (_node$body$directives = (_node$body = node.body) === null || _node$body === void 0 ? void 0 : _node$body.directives) !== null && _node$body$directives !== void 0 ? _node$body$directives : [] : []).map((directive) => directive.value.value).includes("use gpu");
|
|
225
|
-
}
|
|
226
|
-
const fnNodeToTranspiledMap = /* @__PURE__ */ new WeakMap();
|
|
227
|
-
function functionOnExit(path, state) {
|
|
228
|
-
const node = path.node;
|
|
229
|
-
if (!containsUseGpuDirective(node)) return;
|
|
230
|
-
state.inUseGpuScope = false;
|
|
231
|
-
if (state.alreadyTransformed.has(node)) return;
|
|
232
|
-
const ast = fnNodeToTranspiledMap.get(path.node);
|
|
233
|
-
const maybeName = getFunctionName(path);
|
|
234
|
-
if (!ast) throw new Error(`No metadata found for function ${maybeName !== null && maybeName !== void 0 ? maybeName : "<unnamed>"}`);
|
|
235
|
-
state.assignMetadata(path, maybeName, ast);
|
|
236
|
-
state.alreadyTransformed.add(node);
|
|
237
|
-
path.skip();
|
|
238
|
-
}
|
|
239
|
-
const functionVisitor = {
|
|
240
|
-
ImportDeclaration(path, state) {
|
|
241
|
-
gatherTgpuAliases(state, path.node);
|
|
242
|
-
},
|
|
243
|
-
VariableDeclarator(path, state) {
|
|
244
|
-
performExpressionNaming(state, path, (pathToName, name) => {
|
|
245
|
-
state.wrapInAutoName(pathToName, name);
|
|
246
|
-
});
|
|
247
|
-
},
|
|
248
|
-
ObjectProperty(path, state) {
|
|
249
|
-
performExpressionNaming(state, path, (pathToName, name) => state.wrapInAutoName(pathToName, name));
|
|
250
|
-
},
|
|
251
|
-
ClassProperty(path, state) {
|
|
252
|
-
performExpressionNaming(state, path, (pathToName, name) => state.wrapInAutoName(pathToName, name));
|
|
253
|
-
},
|
|
254
|
-
AssignmentExpression: { exit(path, state) {
|
|
255
|
-
const runtimeFn = operators[path.node.operator];
|
|
256
|
-
if (state.inUseGpuScope && runtimeFn) state.replaceWithAssignmentOverload(path, runtimeFn);
|
|
257
|
-
performExpressionNaming(state, path, (pathToName, name) => state.wrapInAutoName(pathToName, name));
|
|
258
|
-
path.skip();
|
|
259
|
-
} },
|
|
260
|
-
BinaryExpression: { exit(path, state) {
|
|
261
|
-
const runtimeFn = operators[path.node.operator];
|
|
262
|
-
if (state.inUseGpuScope && runtimeFn) state.replaceWithBinaryOverload(path, runtimeFn);
|
|
263
|
-
path.skip();
|
|
264
|
-
} },
|
|
265
|
-
ArrowFunctionExpression: {
|
|
266
|
-
enter(path, state) {
|
|
267
|
-
if (containsUseGpuDirective(path.node)) {
|
|
268
|
-
fnNodeToTranspiledMap.set(path.node, (0, tinyest_for_wgsl.transpileFn)(path.node));
|
|
269
|
-
if (state.inUseGpuScope) throw new Error(`Nesting 'use gpu' functions is not allowed`);
|
|
270
|
-
state.inUseGpuScope = true;
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
exit: functionOnExit
|
|
274
|
-
},
|
|
275
|
-
FunctionExpression: {
|
|
276
|
-
enter(path, state) {
|
|
277
|
-
if (containsUseGpuDirective(path.node)) {
|
|
278
|
-
fnNodeToTranspiledMap.set(path.node, (0, tinyest_for_wgsl.transpileFn)(path.node));
|
|
279
|
-
if (state.inUseGpuScope) throw new Error(`Nesting 'use gpu' functions is not allowed`);
|
|
280
|
-
state.inUseGpuScope = true;
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
exit: functionOnExit
|
|
284
|
-
},
|
|
285
|
-
FunctionDeclaration: {
|
|
286
|
-
enter(path, state) {
|
|
287
|
-
if (containsUseGpuDirective(path.node)) {
|
|
288
|
-
fnNodeToTranspiledMap.set(path.node, (0, tinyest_for_wgsl.transpileFn)(path.node));
|
|
289
|
-
if (state.inUseGpuScope) throw new Error(`Nesting 'use gpu' functions is not allowed`);
|
|
290
|
-
state.inUseGpuScope = true;
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
exit: functionOnExit
|
|
294
|
-
},
|
|
295
|
-
CallExpression: { exit(path, state) {
|
|
296
|
-
const node = path.node;
|
|
297
|
-
if (isShellImplementationCall(node, state)) {
|
|
298
|
-
const implementation = node.arguments[0];
|
|
299
|
-
if (implementation && (implementation.type === "FunctionExpression" || implementation.type === "ArrowFunctionExpression") && !containsUseGpuDirective(implementation)) state.assignMetadata(path.get("arguments.0"), getFunctionName(path.get("arguments.0")), (0, tinyest_for_wgsl.transpileFn)(implementation));
|
|
300
|
-
}
|
|
301
|
-
} }
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
//#endregion
|
|
305
|
-
Object.defineProperty(exports, 'METADATA_FORMAT_VERSION', {
|
|
306
|
-
enumerable: true,
|
|
307
|
-
get: function () {
|
|
308
|
-
return METADATA_FORMAT_VERSION;
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
Object.defineProperty(exports, '__toESM', {
|
|
312
|
-
enumerable: true,
|
|
313
|
-
get: function () {
|
|
314
|
-
return __toESM;
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
Object.defineProperty(exports, 'defaultOptions', {
|
|
318
|
-
enumerable: true,
|
|
319
|
-
get: function () {
|
|
320
|
-
return defaultOptions;
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
Object.defineProperty(exports, 'earlyPruneRegex', {
|
|
324
|
-
enumerable: true,
|
|
325
|
-
get: function () {
|
|
326
|
-
return earlyPruneRegex;
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
Object.defineProperty(exports, 'functionVisitor', {
|
|
330
|
-
enumerable: true,
|
|
331
|
-
get: function () {
|
|
332
|
-
return functionVisitor;
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
Object.defineProperty(exports, 'getBlockScope', {
|
|
336
|
-
enumerable: true,
|
|
337
|
-
get: function () {
|
|
338
|
-
return getBlockScope;
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
Object.defineProperty(exports, 'initPluginState', {
|
|
342
|
-
enumerable: true,
|
|
343
|
-
get: function () {
|
|
344
|
-
return initPluginState;
|
|
345
|
-
}
|
|
346
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { t as Options } from "./common-CmJ77T6N.cjs";
|
|
2
|
-
import * as unplugin0 from "unplugin";
|
|
3
|
-
import * as magic_string0 from "magic-string";
|
|
4
|
-
|
|
5
|
-
//#region src/rolldown-browser.d.ts
|
|
6
|
-
declare const _default: (options?: Options) => {
|
|
7
|
-
name: "unplugin-typegpu";
|
|
8
|
-
enforce: "post" | "pre" | undefined;
|
|
9
|
-
transform: {
|
|
10
|
-
filter: {
|
|
11
|
-
id: Omit<Options, "include" | "autoNamingEnabled" | "earlyPruning"> & Omit<{
|
|
12
|
-
include: RegExp;
|
|
13
|
-
autoNamingEnabled: boolean;
|
|
14
|
-
earlyPruning: boolean;
|
|
15
|
-
}, "include" | "autoNamingEnabled" | "earlyPruning"> & {
|
|
16
|
-
include: string | RegExp | unplugin0.StringOrRegExp[];
|
|
17
|
-
autoNamingEnabled: boolean;
|
|
18
|
-
earlyPruning: boolean;
|
|
19
|
-
};
|
|
20
|
-
code: RegExp[];
|
|
21
|
-
} | {
|
|
22
|
-
id: Omit<Options, "include" | "autoNamingEnabled" | "earlyPruning"> & Omit<{
|
|
23
|
-
include: RegExp;
|
|
24
|
-
autoNamingEnabled: boolean;
|
|
25
|
-
earlyPruning: boolean;
|
|
26
|
-
}, "include" | "autoNamingEnabled" | "earlyPruning"> & {
|
|
27
|
-
include: string | RegExp | unplugin0.StringOrRegExp[];
|
|
28
|
-
autoNamingEnabled: boolean;
|
|
29
|
-
earlyPruning: boolean;
|
|
30
|
-
};
|
|
31
|
-
code?: never;
|
|
32
|
-
};
|
|
33
|
-
handler(this: unplugin0.UnpluginBuildContext & unplugin0.UnpluginContext, code: string, id: string): {
|
|
34
|
-
code: string;
|
|
35
|
-
readonly map: magic_string0.SourceMap;
|
|
36
|
-
} | undefined;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
export { _default as t };
|