unplugin-typegpu 0.11.2 → 0.11.4
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-C8UzthFd.d.cts → babel-CXwXwwOE.d.ts} +2 -1
- package/{babel-B-IcpMR7.cjs → babel-D-TCImIi.cjs} +20 -18
- package/{babel-CbManzjz.js → babel-dNT1_5hS.js} +2 -1
- package/{babel-CmCnq-43.d.ts → babel-mqeTZT8y.d.cts} +2 -1
- package/babel.cjs +2 -2
- package/babel.d.cts +2 -2
- package/babel.d.ts +2 -2
- package/babel.js +2 -2
- package/{bun-ovScJ4Es.d.ts → bun-C6usJAus.d.ts} +1 -1
- package/bun-DY6XE5xi.js +33 -0
- package/{bun-cwXs2EDP.d.cts → bun-Df2nJEmj.d.cts} +1 -1
- package/bun-o6QmlVaS.cjs +39 -0
- package/bun.cjs +3 -2
- package/bun.d.cts +2 -2
- package/bun.d.ts +2 -2
- package/bun.js +3 -2
- package/{common-CElmMmuq.js → common-B8nnr-Iq.js} +2 -7
- package/{common-BlvLUwEz.d.ts → common-BLW8Fy4P.d.ts} +2 -2
- package/{common-DZ2cLtbe.d.cts → common-BaikgpzR.d.cts} +1 -1
- package/{common-B8wsLJUq.cjs → common-DPfAcXic.cjs} +2 -13
- package/esbuild.cjs +6 -4
- package/esbuild.d.cts +5 -4
- package/esbuild.d.ts +5 -4
- package/esbuild.js +6 -4
- package/factory-B0CnGO9P.cjs +208 -0
- package/{bun-CDECNeIU.js → factory-CnVNvO57.js} +109 -48
- package/farm.cjs +6 -4
- package/farm.d.cts +5 -4
- package/farm.d.ts +5 -4
- package/farm.js +6 -4
- package/index-Dq70sYN7.d.cts +15 -0
- package/index-rnHwqPEN.d.ts +15 -0
- package/index.cjs +7 -5
- package/index.d.cts +5 -4
- package/index.d.ts +5 -4
- package/index.js +6 -4
- package/package.json +3 -3
- package/rolldown-browser-BzaTpeZq.cjs +12 -0
- package/rolldown-browser-C8OHaYCP.d.ts +40 -0
- package/rolldown-browser-D0pxy7TZ.js +7 -0
- package/rolldown-browser-XXZriqjg.d.cts +40 -0
- package/rolldown-browser.cjs +6 -0
- package/rolldown-browser.d.cts +3 -0
- package/rolldown-browser.d.ts +3 -0
- package/rolldown-browser.js +5 -0
- package/rolldown.cjs +6 -4
- package/rolldown.d.cts +5 -4
- package/rolldown.d.ts +5 -4
- package/rolldown.js +6 -4
- package/rollup.cjs +6 -4
- package/rollup.d.cts +5 -4
- package/rollup.d.ts +5 -4
- package/rollup.js +6 -4
- package/rspack.cjs +6 -4
- package/rspack.d.cts +5 -4
- package/rspack.d.ts +5 -4
- package/rspack.js +6 -4
- package/{src-CDZ6lHsg.cjs → src-BljgtpqS.cjs} +3 -13
- package/{src-D84rmPxv.js → src-DZP2_1Gn.js} +2 -6
- package/vite.cjs +6 -4
- package/vite.d.cts +5 -4
- package/vite.d.ts +5 -4
- package/vite.js +6 -4
- package/webpack.cjs +6 -4
- package/webpack.d.cts +5 -4
- package/webpack.d.ts +5 -4
- package/webpack.js +6 -4
- package/bun-DU5xZoDJ.cjs +0 -152
- package/index-COIv1oYx.d.cts +0 -48
- package/index-PPreQbn5.d.ts +0 -48
|
@@ -1,12 +1,79 @@
|
|
|
1
|
-
import { a as initPluginState, i as getBlockScope, n as earlyPruneRegex,
|
|
1
|
+
import { a as initPluginState, i as getBlockScope, n as earlyPruneRegex, r as functionVisitor, t as defaultOptions } from "./common-B8nnr-Iq.js";
|
|
2
2
|
import defu from "defu";
|
|
3
3
|
import { transpileFn } from "tinyest-for-wgsl";
|
|
4
4
|
import { FORMAT_VERSION } from "tinyest";
|
|
5
|
-
import
|
|
5
|
+
import * as t from "@babel/types";
|
|
6
|
+
import MagicString from "magic-string";
|
|
6
7
|
import { getBabelParserOptions, getLang } from "ast-kit";
|
|
7
8
|
import _traverse from "@babel/traverse";
|
|
8
9
|
import * as parser from "@babel/parser";
|
|
9
10
|
|
|
11
|
+
//#region \0@oxc-project+runtime@0.95.0/helpers/typeof.js
|
|
12
|
+
function _typeof(o) {
|
|
13
|
+
"@babel/helpers - typeof";
|
|
14
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
15
|
+
return typeof o$1;
|
|
16
|
+
} : function(o$1) {
|
|
17
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
18
|
+
}, _typeof(o);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region \0@oxc-project+runtime@0.95.0/helpers/toPrimitive.js
|
|
23
|
+
function toPrimitive(t$1, r) {
|
|
24
|
+
if ("object" != _typeof(t$1) || !t$1) return t$1;
|
|
25
|
+
var e = t$1[Symbol.toPrimitive];
|
|
26
|
+
if (void 0 !== e) {
|
|
27
|
+
var i = e.call(t$1, r || "default");
|
|
28
|
+
if ("object" != _typeof(i)) return i;
|
|
29
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
30
|
+
}
|
|
31
|
+
return ("string" === r ? String : Number)(t$1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region \0@oxc-project+runtime@0.95.0/helpers/toPropertyKey.js
|
|
36
|
+
function toPropertyKey(t$1) {
|
|
37
|
+
var i = toPrimitive(t$1, "string");
|
|
38
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region \0@oxc-project+runtime@0.95.0/helpers/defineProperty.js
|
|
43
|
+
function _defineProperty(e, r, t$1) {
|
|
44
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
45
|
+
value: t$1,
|
|
46
|
+
enumerable: !0,
|
|
47
|
+
configurable: !0,
|
|
48
|
+
writable: !0
|
|
49
|
+
}) : e[r] = t$1, e;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region \0@oxc-project+runtime@0.95.0/helpers/objectSpread2.js
|
|
54
|
+
function ownKeys(e, r) {
|
|
55
|
+
var t$1 = Object.keys(e);
|
|
56
|
+
if (Object.getOwnPropertySymbols) {
|
|
57
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
58
|
+
r && (o = o.filter(function(r$1) {
|
|
59
|
+
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
60
|
+
})), t$1.push.apply(t$1, o);
|
|
61
|
+
}
|
|
62
|
+
return t$1;
|
|
63
|
+
}
|
|
64
|
+
function _objectSpread2(e) {
|
|
65
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
66
|
+
var t$1 = null != arguments[r] ? arguments[r] : {};
|
|
67
|
+
r % 2 ? ownKeys(Object(t$1), !0).forEach(function(r$1) {
|
|
68
|
+
_defineProperty(e, r$1, t$1[r$1]);
|
|
69
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t$1)) : ownKeys(Object(t$1)).forEach(function(r$1) {
|
|
70
|
+
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t$1, r$1));
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return e;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
10
77
|
//#region src/core/factory.ts
|
|
11
78
|
let traverse = _traverse;
|
|
12
79
|
if (typeof traverse.default === "function") traverse = traverse.default;
|
|
@@ -23,7 +90,7 @@ function assignMetadata(path, name, ast) {
|
|
|
23
90
|
externals: () => ({${ast.externalNames.map((e) => e === "this" ? "\"this\": this" : e).join(", ")}}),
|
|
24
91
|
}`;
|
|
25
92
|
const visibility = t.isFunctionDeclaration(path.node) ? getBlockScope(path) : void 0;
|
|
26
|
-
const fnCode = this.
|
|
93
|
+
const fnCode = this.slice(path.node);
|
|
27
94
|
let nodeToOverride = path.node;
|
|
28
95
|
let code = fnWrapperTemplate(fnCode, metadata);
|
|
29
96
|
let insertPos = (_path$node$start = path.node.start) !== null && _path$node$start !== void 0 ? _path$node$start : 0;
|
|
@@ -38,29 +105,42 @@ function assignMetadata(path, name, ast) {
|
|
|
38
105
|
}
|
|
39
106
|
if (insertPos < ((_path$node$start2 = path.node.start) !== null && _path$node$start2 !== void 0 ? _path$node$start2 : 0)) {
|
|
40
107
|
var _nodeToOverride$leadi, _nodeToOverride$leadi2;
|
|
41
|
-
for (const comment of (_nodeToOverride$leadi = (_nodeToOverride$leadi2 = nodeToOverride.leadingComments) === null || _nodeToOverride$leadi2 === void 0 ? void 0 : _nodeToOverride$leadi2.toReversed()) !== null && _nodeToOverride$leadi !== void 0 ? _nodeToOverride$leadi : []) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.magicString.removeNode(comment);
|
|
108
|
+
for (const comment of (_nodeToOverride$leadi = (_nodeToOverride$leadi2 = nodeToOverride.leadingComments) === null || _nodeToOverride$leadi2 === void 0 ? void 0 : _nodeToOverride$leadi2.toReversed()) !== null && _nodeToOverride$leadi !== void 0 ? _nodeToOverride$leadi : []) if (comment) {
|
|
109
|
+
code = `${this.slice(comment)}\n${code}`;
|
|
110
|
+
this.remove(comment);
|
|
45
111
|
}
|
|
46
|
-
this.
|
|
112
|
+
this.remove(nodeToOverride);
|
|
47
113
|
this.magicString.prependLeft(insertPos, code);
|
|
48
|
-
} else this.
|
|
114
|
+
} else this.overwrite(nodeToOverride, code);
|
|
49
115
|
}
|
|
50
116
|
function wrapInAutoName(path, name) {
|
|
51
117
|
var _path$node$start3, _path$node$end;
|
|
52
118
|
this.magicString.appendLeft((_path$node$start3 = path.node.start) !== null && _path$node$start3 !== void 0 ? _path$node$start3 : 0, "(/*#__PURE__*/(globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(").prependRight((_path$node$end = path.node.end) !== null && _path$node$end !== void 0 ? _path$node$end : 0, `, "${name}"))`);
|
|
53
119
|
}
|
|
54
120
|
function replaceWithAssignmentOverload(path, runtimeFn) {
|
|
55
|
-
const lhs = this.
|
|
56
|
-
const rhs = this.
|
|
57
|
-
this.
|
|
121
|
+
const lhs = this.slice(path.node.left);
|
|
122
|
+
const rhs = this.slice(path.node.right);
|
|
123
|
+
this.overwrite(path.node, `${lhs} = ${runtimeFn}(${lhs}, ${rhs})`);
|
|
58
124
|
}
|
|
59
125
|
function replaceWithBinaryOverload(path, runtimeFn) {
|
|
60
|
-
const lhs = this.
|
|
61
|
-
const rhs = this.
|
|
62
|
-
this.
|
|
126
|
+
const lhs = this.slice(path.node.left);
|
|
127
|
+
const rhs = this.slice(path.node.right);
|
|
128
|
+
this.overwrite(path.node, `${runtimeFn}(${lhs}, ${rhs})`);
|
|
63
129
|
}
|
|
130
|
+
const NodeUtils = {
|
|
131
|
+
slice(node) {
|
|
132
|
+
var _node$start, _node$end;
|
|
133
|
+
return this.magicString.slice((_node$start = node.start) !== null && _node$start !== void 0 ? _node$start : 0, (_node$end = node.end) !== null && _node$end !== void 0 ? _node$end : 0);
|
|
134
|
+
},
|
|
135
|
+
remove(node) {
|
|
136
|
+
var _node$start2, _node$end2;
|
|
137
|
+
this.magicString.remove((_node$start2 = node.start) !== null && _node$start2 !== void 0 ? _node$start2 : 0, (_node$end2 = node.end) !== null && _node$end2 !== void 0 ? _node$end2 : 0);
|
|
138
|
+
},
|
|
139
|
+
overwrite(node, content) {
|
|
140
|
+
var _node$start3, _node$end3;
|
|
141
|
+
this.magicString.overwrite((_node$start3 = node.start) !== null && _node$start3 !== void 0 ? _node$start3 : 0, (_node$end3 = node.end) !== null && _node$end3 !== void 0 ? _node$end3 : 0, content);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
64
144
|
const unpluginFactory = ((rawOptions, _meta) => {
|
|
65
145
|
const options = defu(rawOptions, defaultOptions);
|
|
66
146
|
return {
|
|
@@ -82,12 +162,12 @@ const unpluginFactory = ((rawOptions, _meta) => {
|
|
|
82
162
|
console.warn(`[unplugin-typegpu] Failed to parse ${id}. Cause: ${typeof cause === "object" && cause && "message" in cause ? cause.message : cause}`);
|
|
83
163
|
return;
|
|
84
164
|
}
|
|
85
|
-
const magicString = new
|
|
86
|
-
const state = {
|
|
165
|
+
const magicString = new MagicString(code);
|
|
166
|
+
const state = _objectSpread2({
|
|
87
167
|
filename: id,
|
|
88
168
|
magicString,
|
|
89
169
|
opts: options
|
|
90
|
-
};
|
|
170
|
+
}, NodeUtils);
|
|
91
171
|
initPluginState(state, {
|
|
92
172
|
warn: (message) => this.warn(message),
|
|
93
173
|
assignMetadata,
|
|
@@ -96,39 +176,20 @@ const unpluginFactory = ((rawOptions, _meta) => {
|
|
|
96
176
|
replaceWithBinaryOverload
|
|
97
177
|
});
|
|
98
178
|
traverse(ast, functionVisitor, void 0, state);
|
|
99
|
-
|
|
179
|
+
if (magicString.hasChanged()) return {
|
|
180
|
+
code: magicString.toString(),
|
|
181
|
+
get map() {
|
|
182
|
+
return magicString.generateMap({
|
|
183
|
+
source: id,
|
|
184
|
+
includeContent: true,
|
|
185
|
+
hires: "boundary"
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
};
|
|
100
189
|
}
|
|
101
190
|
}
|
|
102
191
|
};
|
|
103
192
|
});
|
|
104
193
|
|
|
105
194
|
//#endregion
|
|
106
|
-
|
|
107
|
-
var bun_default = (rawOptions) => {
|
|
108
|
-
const options = defu(rawOptions, defaultOptions);
|
|
109
|
-
const include = options.include;
|
|
110
|
-
if (!(include instanceof RegExp)) throw new Error(`Unsupported 'include' options in Bun plugin. Please provide a single regular expression`);
|
|
111
|
-
if (options.exclude) throw new Error(`Unsupported 'exclude' option in Bun plugin`);
|
|
112
|
-
const rawPlugin = unpluginFactory(rawOptions, { framework: "bun" });
|
|
113
|
-
return {
|
|
114
|
-
name: "unplugin-typegpu",
|
|
115
|
-
setup(build) {
|
|
116
|
-
build.onLoad({ filter: include }, async (args) => {
|
|
117
|
-
var _result$code;
|
|
118
|
-
const codeIn = await Bun.file(args.path).text();
|
|
119
|
-
if (earlyPruneRegex.every((pattern) => !pattern.test(codeIn))) return {
|
|
120
|
-
contents: codeIn,
|
|
121
|
-
loader: args.loader
|
|
122
|
-
};
|
|
123
|
-
const result = rawPlugin.transform.handler.apply({}, [codeIn, args.path]);
|
|
124
|
-
return {
|
|
125
|
-
contents: (_result$code = result === null || result === void 0 ? void 0 : result.code) !== null && _result$code !== void 0 ? _result$code : codeIn,
|
|
126
|
-
loader: args.loader
|
|
127
|
-
};
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
//#endregion
|
|
134
|
-
export { unpluginFactory as n, bun_default as t };
|
|
195
|
+
export { unpluginFactory as t };
|
package/farm.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./common-
|
|
3
|
-
require('./babel-
|
|
4
|
-
require('./
|
|
5
|
-
|
|
2
|
+
require('./common-DPfAcXic.cjs');
|
|
3
|
+
require('./babel-D-TCImIi.cjs');
|
|
4
|
+
require('./factory-B0CnGO9P.cjs');
|
|
5
|
+
require('./bun-o6QmlVaS.cjs');
|
|
6
|
+
require('./rolldown-browser-BzaTpeZq.cjs');
|
|
7
|
+
const require_src = require('./src-BljgtpqS.cjs');
|
|
6
8
|
|
|
7
9
|
//#region src/farm.ts
|
|
8
10
|
var farm_default = require_src.farmPlugin;
|
package/farm.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "./common-
|
|
2
|
-
import "./babel-
|
|
3
|
-
import "./bun-
|
|
4
|
-
import
|
|
1
|
+
import "./common-BaikgpzR.cjs";
|
|
2
|
+
import "./babel-mqeTZT8y.cjs";
|
|
3
|
+
import "./bun-Df2nJEmj.cjs";
|
|
4
|
+
import "./rolldown-browser-XXZriqjg.cjs";
|
|
5
|
+
import { n as farmPlugin } from "./index-Dq70sYN7.cjs";
|
|
5
6
|
export = farmPlugin;
|
package/farm.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "./common-
|
|
2
|
-
import "./babel-
|
|
3
|
-
import "./bun-
|
|
4
|
-
import
|
|
1
|
+
import "./common-BLW8Fy4P.js";
|
|
2
|
+
import "./babel-CXwXwwOE.js";
|
|
3
|
+
import "./bun-C6usJAus.js";
|
|
4
|
+
import "./rolldown-browser-C8OHaYCP.js";
|
|
5
|
+
import { n as farmPlugin } from "./index-rnHwqPEN.js";
|
|
5
6
|
export { farmPlugin as default };
|
package/farm.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import "./common-
|
|
2
|
-
import "./babel-
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
1
|
+
import "./common-B8nnr-Iq.js";
|
|
2
|
+
import "./babel-dNT1_5hS.js";
|
|
3
|
+
import "./factory-CnVNvO57.js";
|
|
4
|
+
import "./bun-DY6XE5xi.js";
|
|
5
|
+
import "./rolldown-browser-D0pxy7TZ.js";
|
|
6
|
+
import { n as farmPlugin } from "./src-DZP2_1Gn.js";
|
|
5
7
|
|
|
6
8
|
//#region src/farm.ts
|
|
7
9
|
var farm_default = farmPlugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { t as Options } from "./common-BaikgpzR.cjs";
|
|
2
|
+
import * as unplugin0 from "unplugin";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
declare const typegpu: unplugin0.UnpluginInstance<Options | undefined, boolean>;
|
|
6
|
+
declare const vitePlugin: (options?: Options | undefined) => unplugin0.VitePlugin<any> | unplugin0.VitePlugin<any>[];
|
|
7
|
+
declare const rollupPlugin: (options?: Options | undefined) => unplugin0.RollupPlugin<any> | unplugin0.RollupPlugin<any>[];
|
|
8
|
+
declare const rolldownPlugin: (options?: Options | undefined) => unplugin0.RolldownPlugin<any> | unplugin0.RolldownPlugin<any>[];
|
|
9
|
+
declare const webpackPlugin: (options?: Options | undefined) => unplugin0.WebpackPluginInstance;
|
|
10
|
+
declare const rspackPlugin: (options?: Options | undefined) => RspackPluginInstance;
|
|
11
|
+
declare const esbuildPlugin: (options?: Options | undefined) => unplugin0.EsbuildPlugin;
|
|
12
|
+
declare const farmPlugin: (options?: Options | undefined) => JsPlugin;
|
|
13
|
+
declare const unloaderPlugin: (options?: Options | undefined) => any;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { rspackPlugin as a, vitePlugin as c, rollupPlugin as i, webpackPlugin as l, farmPlugin as n, typegpu as o, rolldownPlugin as r, unloaderPlugin as s, esbuildPlugin as t };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { t as Options } from "./common-BLW8Fy4P.js";
|
|
2
|
+
import * as unplugin0 from "unplugin";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
declare const typegpu: unplugin0.UnpluginInstance<Options | undefined, boolean>;
|
|
6
|
+
declare const vitePlugin: (options?: Options | undefined) => unplugin0.VitePlugin<any> | unplugin0.VitePlugin<any>[];
|
|
7
|
+
declare const rollupPlugin: (options?: Options | undefined) => unplugin0.RollupPlugin<any> | unplugin0.RollupPlugin<any>[];
|
|
8
|
+
declare const rolldownPlugin: (options?: Options | undefined) => unplugin0.RolldownPlugin<any> | unplugin0.RolldownPlugin<any>[];
|
|
9
|
+
declare const webpackPlugin: (options?: Options | undefined) => unplugin0.WebpackPluginInstance;
|
|
10
|
+
declare const rspackPlugin: (options?: Options | undefined) => RspackPluginInstance;
|
|
11
|
+
declare const esbuildPlugin: (options?: Options | undefined) => unplugin0.EsbuildPlugin;
|
|
12
|
+
declare const farmPlugin: (options?: Options | undefined) => JsPlugin;
|
|
13
|
+
declare const unloaderPlugin: (options?: Options | undefined) => any;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { rspackPlugin as a, vitePlugin as c, rollupPlugin as i, webpackPlugin as l, farmPlugin as n, typegpu as o, rolldownPlugin as r, unloaderPlugin as s, esbuildPlugin as t };
|
package/index.cjs
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./common-
|
|
3
|
-
const require_babel = require('./babel-
|
|
4
|
-
|
|
5
|
-
const
|
|
2
|
+
require('./common-DPfAcXic.cjs');
|
|
3
|
+
const require_babel = require('./babel-D-TCImIi.cjs');
|
|
4
|
+
require('./factory-B0CnGO9P.cjs');
|
|
5
|
+
const require_bun = require('./bun-o6QmlVaS.cjs');
|
|
6
|
+
const require_rolldown_browser = require('./rolldown-browser-BzaTpeZq.cjs');
|
|
7
|
+
const require_src = require('./src-BljgtpqS.cjs');
|
|
6
8
|
|
|
7
9
|
exports.babelPlugin = require_babel.TypeGPUPlugin;
|
|
8
10
|
exports.bunPlugin = require_bun.bun_default;
|
|
9
11
|
exports.default = require_src.src_default;
|
|
10
12
|
exports.esbuildPlugin = require_src.esbuildPlugin;
|
|
11
13
|
exports.farmPlugin = require_src.farmPlugin;
|
|
12
|
-
exports.rolldownBrowserPlugin =
|
|
14
|
+
exports.rolldownBrowserPlugin = require_rolldown_browser.rolldown_browser_default;
|
|
13
15
|
exports.rolldownPlugin = require_src.rolldownPlugin;
|
|
14
16
|
exports.rollupPlugin = require_src.rollupPlugin;
|
|
15
17
|
exports.rspackPlugin = require_src.rspackPlugin;
|
package/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as Options } from "./common-
|
|
2
|
-
import { t as TypeGPUPlugin } from "./babel-
|
|
3
|
-
import { t as _default } from "./bun-
|
|
4
|
-
import {
|
|
1
|
+
import { t as Options } from "./common-BaikgpzR.cjs";
|
|
2
|
+
import { t as TypeGPUPlugin } from "./babel-mqeTZT8y.cjs";
|
|
3
|
+
import { t as _default } from "./bun-Df2nJEmj.cjs";
|
|
4
|
+
import { t as _default$1 } from "./rolldown-browser-XXZriqjg.cjs";
|
|
5
|
+
import { a as rspackPlugin, c as vitePlugin, i as rollupPlugin, l as webpackPlugin, n as farmPlugin, o as typegpu, r as rolldownPlugin, s as unloaderPlugin, t as esbuildPlugin } from "./index-Dq70sYN7.cjs";
|
|
5
6
|
export { Options, TypeGPUPlugin as babelPlugin, _default as bunPlugin, typegpu as default, esbuildPlugin, farmPlugin, _default$1 as rolldownBrowserPlugin, rolldownPlugin, rollupPlugin, rspackPlugin, unloaderPlugin, vitePlugin, webpackPlugin };
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as Options } from "./common-
|
|
2
|
-
import { t as TypeGPUPlugin } from "./babel-
|
|
3
|
-
import { t as _default } from "./bun-
|
|
4
|
-
import {
|
|
1
|
+
import { t as Options } from "./common-BLW8Fy4P.js";
|
|
2
|
+
import { t as TypeGPUPlugin } from "./babel-CXwXwwOE.js";
|
|
3
|
+
import { t as _default } from "./bun-C6usJAus.js";
|
|
4
|
+
import { t as _default$1 } from "./rolldown-browser-C8OHaYCP.js";
|
|
5
|
+
import { a as rspackPlugin, c as vitePlugin, i as rollupPlugin, l as webpackPlugin, n as farmPlugin, o as typegpu, r as rolldownPlugin, s as unloaderPlugin, t as esbuildPlugin } from "./index-rnHwqPEN.js";
|
|
5
6
|
export { Options, TypeGPUPlugin as babelPlugin, _default as bunPlugin, typegpu as default, esbuildPlugin, farmPlugin, _default$1 as rolldownBrowserPlugin, rolldownPlugin, rollupPlugin, rspackPlugin, unloaderPlugin, vitePlugin, webpackPlugin };
|
package/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import "./common-
|
|
2
|
-
import { t as TypeGPUPlugin } from "./babel-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import "./common-B8nnr-Iq.js";
|
|
2
|
+
import { t as TypeGPUPlugin } from "./babel-dNT1_5hS.js";
|
|
3
|
+
import "./factory-CnVNvO57.js";
|
|
4
|
+
import { t as bun_default } from "./bun-DY6XE5xi.js";
|
|
5
|
+
import { t as rolldown_browser_default } from "./rolldown-browser-D0pxy7TZ.js";
|
|
6
|
+
import { a as rspackPlugin, c as vitePlugin, i as rollupPlugin, l as webpackPlugin, n as farmPlugin, o as src_default, r as rolldownPlugin, s as unloaderPlugin, t as esbuildPlugin } from "./src-DZP2_1Gn.js";
|
|
5
7
|
|
|
6
8
|
export { TypeGPUPlugin as babelPlugin, bun_default as bunPlugin, src_default as default, esbuildPlugin, farmPlugin, rolldown_browser_default as rolldownBrowserPlugin, rolldownPlugin, rollupPlugin, rspackPlugin, unloaderPlugin, vitePlugin, webpackPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-typegpu",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.4",
|
|
4
4
|
"description": "Build plugins for TypeGPU, enabling seamless JavaScript -> WGSL transpilation and improved debugging.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"babel-plugin",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"@babel/types": "^7.29.0",
|
|
146
146
|
"ast-kit": "^2.2.0",
|
|
147
147
|
"defu": "^6.1.4",
|
|
148
|
-
"magic-string
|
|
148
|
+
"magic-string": "^0.30.21",
|
|
149
149
|
"pathe": "^2.0.3",
|
|
150
150
|
"picomatch": "^4.0.4",
|
|
151
151
|
"tinyest": "~0.3.1",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"unplugin": "^3.0.0"
|
|
154
154
|
},
|
|
155
155
|
"peerDependencies": {
|
|
156
|
-
"typegpu": "^0.11.
|
|
156
|
+
"typegpu": "^0.11.5"
|
|
157
157
|
},
|
|
158
158
|
"main": "./index.js",
|
|
159
159
|
"types": "./index.d.ts",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const require_factory = require('./factory-B0CnGO9P.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/rolldown-browser.ts
|
|
4
|
+
var rolldown_browser_default = (options) => require_factory.unpluginFactory(options !== null && options !== void 0 ? options : {}, { framework: "rolldown" });
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
Object.defineProperty(exports, 'rolldown_browser_default', {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return rolldown_browser_default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { t as Options } from "./common-BLW8Fy4P.js";
|
|
2
|
+
import * as magic_string0 from "magic-string";
|
|
3
|
+
import * as unplugin8 from "unplugin";
|
|
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 | unplugin8.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 | unplugin8.StringOrRegExp[];
|
|
28
|
+
autoNamingEnabled: boolean;
|
|
29
|
+
earlyPruning: boolean;
|
|
30
|
+
};
|
|
31
|
+
code?: never;
|
|
32
|
+
};
|
|
33
|
+
handler(this: unplugin8.UnpluginBuildContext & unplugin8.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 };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { t as unpluginFactory } from "./factory-CnVNvO57.js";
|
|
2
|
+
|
|
3
|
+
//#region src/rolldown-browser.ts
|
|
4
|
+
var rolldown_browser_default = (options) => unpluginFactory(options !== null && options !== void 0 ? options : {}, { framework: "rolldown" });
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
export { rolldown_browser_default as t };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { t as Options } from "./common-BaikgpzR.cjs";
|
|
2
|
+
import * as unplugin8 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 | unplugin8.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 | unplugin8.StringOrRegExp[];
|
|
28
|
+
autoNamingEnabled: boolean;
|
|
29
|
+
earlyPruning: boolean;
|
|
30
|
+
};
|
|
31
|
+
code?: never;
|
|
32
|
+
};
|
|
33
|
+
handler(this: unplugin8.UnpluginBuildContext & unplugin8.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 };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
require('./common-DPfAcXic.cjs');
|
|
3
|
+
require('./factory-B0CnGO9P.cjs');
|
|
4
|
+
const require_rolldown_browser = require('./rolldown-browser-BzaTpeZq.cjs');
|
|
5
|
+
|
|
6
|
+
exports.default = require_rolldown_browser.rolldown_browser_default;
|
package/rolldown.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./common-
|
|
3
|
-
require('./babel-
|
|
4
|
-
require('./
|
|
5
|
-
|
|
2
|
+
require('./common-DPfAcXic.cjs');
|
|
3
|
+
require('./babel-D-TCImIi.cjs');
|
|
4
|
+
require('./factory-B0CnGO9P.cjs');
|
|
5
|
+
require('./bun-o6QmlVaS.cjs');
|
|
6
|
+
require('./rolldown-browser-BzaTpeZq.cjs');
|
|
7
|
+
const require_src = require('./src-BljgtpqS.cjs');
|
|
6
8
|
|
|
7
9
|
//#region src/rolldown.ts
|
|
8
10
|
var rolldown_default = require_src.rolldownPlugin;
|
package/rolldown.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "./common-
|
|
2
|
-
import "./babel-
|
|
3
|
-
import "./bun-
|
|
4
|
-
import
|
|
1
|
+
import "./common-BaikgpzR.cjs";
|
|
2
|
+
import "./babel-mqeTZT8y.cjs";
|
|
3
|
+
import "./bun-Df2nJEmj.cjs";
|
|
4
|
+
import "./rolldown-browser-XXZriqjg.cjs";
|
|
5
|
+
import { r as rolldownPlugin } from "./index-Dq70sYN7.cjs";
|
|
5
6
|
export = rolldownPlugin;
|
package/rolldown.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "./common-
|
|
2
|
-
import "./babel-
|
|
3
|
-
import "./bun-
|
|
4
|
-
import
|
|
1
|
+
import "./common-BLW8Fy4P.js";
|
|
2
|
+
import "./babel-CXwXwwOE.js";
|
|
3
|
+
import "./bun-C6usJAus.js";
|
|
4
|
+
import "./rolldown-browser-C8OHaYCP.js";
|
|
5
|
+
import { r as rolldownPlugin } from "./index-rnHwqPEN.js";
|
|
5
6
|
export { rolldownPlugin as default };
|
package/rolldown.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import "./common-
|
|
2
|
-
import "./babel-
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
1
|
+
import "./common-B8nnr-Iq.js";
|
|
2
|
+
import "./babel-dNT1_5hS.js";
|
|
3
|
+
import "./factory-CnVNvO57.js";
|
|
4
|
+
import "./bun-DY6XE5xi.js";
|
|
5
|
+
import "./rolldown-browser-D0pxy7TZ.js";
|
|
6
|
+
import { r as rolldownPlugin } from "./src-DZP2_1Gn.js";
|
|
5
7
|
|
|
6
8
|
//#region src/rolldown.ts
|
|
7
9
|
var rolldown_default = rolldownPlugin;
|
package/rollup.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./common-
|
|
3
|
-
require('./babel-
|
|
4
|
-
require('./
|
|
5
|
-
|
|
2
|
+
require('./common-DPfAcXic.cjs');
|
|
3
|
+
require('./babel-D-TCImIi.cjs');
|
|
4
|
+
require('./factory-B0CnGO9P.cjs');
|
|
5
|
+
require('./bun-o6QmlVaS.cjs');
|
|
6
|
+
require('./rolldown-browser-BzaTpeZq.cjs');
|
|
7
|
+
const require_src = require('./src-BljgtpqS.cjs');
|
|
6
8
|
|
|
7
9
|
//#region src/rollup.ts
|
|
8
10
|
var rollup_default = require_src.rollupPlugin;
|
package/rollup.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "./common-
|
|
2
|
-
import "./babel-
|
|
3
|
-
import "./bun-
|
|
4
|
-
import
|
|
1
|
+
import "./common-BaikgpzR.cjs";
|
|
2
|
+
import "./babel-mqeTZT8y.cjs";
|
|
3
|
+
import "./bun-Df2nJEmj.cjs";
|
|
4
|
+
import "./rolldown-browser-XXZriqjg.cjs";
|
|
5
|
+
import { i as rollupPlugin } from "./index-Dq70sYN7.cjs";
|
|
5
6
|
export = rollupPlugin;
|
package/rollup.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "./common-
|
|
2
|
-
import "./babel-
|
|
3
|
-
import "./bun-
|
|
4
|
-
import
|
|
1
|
+
import "./common-BLW8Fy4P.js";
|
|
2
|
+
import "./babel-CXwXwwOE.js";
|
|
3
|
+
import "./bun-C6usJAus.js";
|
|
4
|
+
import "./rolldown-browser-C8OHaYCP.js";
|
|
5
|
+
import { i as rollupPlugin } from "./index-rnHwqPEN.js";
|
|
5
6
|
export { rollupPlugin as default };
|
package/rollup.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import "./common-
|
|
2
|
-
import "./babel-
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
1
|
+
import "./common-B8nnr-Iq.js";
|
|
2
|
+
import "./babel-dNT1_5hS.js";
|
|
3
|
+
import "./factory-CnVNvO57.js";
|
|
4
|
+
import "./bun-DY6XE5xi.js";
|
|
5
|
+
import "./rolldown-browser-D0pxy7TZ.js";
|
|
6
|
+
import { i as rollupPlugin } from "./src-DZP2_1Gn.js";
|
|
5
7
|
|
|
6
8
|
//#region src/rollup.ts
|
|
7
9
|
var rollup_default = rollupPlugin;
|