unplugin-typegpu 0.10.1 → 0.10.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.
- package/babel.cjs +15 -17
- package/babel.d.cts +1 -1
- package/babel.d.mts +1 -1
- package/babel.mjs +1 -2
- package/bun.cjs +5 -6
- package/bun.d.cts +1 -1
- package/bun.d.mts +1 -1
- package/bun.mjs +1 -1
- package/{common.d.cts → common-CRPQ2KE6.d.mts} +1 -1
- package/{common.d.mts → common-Dpl8jppn.d.cts} +1 -1
- package/{common.cjs → filter-6T-5w4kG.mjs} +60 -9
- package/{common.mjs → filter-CKmD4HRk.cjs} +154 -1
- package/index-legacy-DRI9LQiG.d.mts +1488 -0
- package/index-legacy-xKi5C2ga.d.cts +1488 -0
- package/index.cjs +4 -5
- package/index.d.cts +2 -3
- package/index.d.mts +2 -4
- package/index.mjs +1 -2
- package/package.json +3 -3
- package/{rollup-impl.mjs → rolldown-browser-DKeiFM_e.mjs} +6 -2
- package/{rollup-impl.cjs → rolldown-browser-DUanNY-R.cjs} +29 -15
- package/rolldown-browser-JYqfNLQ8.d.mts +1247 -0
- package/rollup-impl-DqC_d-_W.d.cts +1246 -0
- package/_virtual/_rolldown/runtime.cjs +0 -29
- package/filter.cjs +0 -63
- package/filter.mjs +0 -61
- package/rolldown-browser.cjs +0 -7
- package/rolldown-browser.d.mts +0 -1
- package/rolldown-browser.mjs +0 -7
- package/rollup-impl.d.cts +0 -38
- package/rollup-impl.d.mts +0 -39
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
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") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
|
|
29
|
-
exports.__toESM = __toESM;
|
package/filter.cjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
-
let pathe = require("pathe");
|
|
3
|
-
let picomatch = require("picomatch");
|
|
4
|
-
picomatch = require_runtime.__toESM(picomatch);
|
|
5
|
-
|
|
6
|
-
//#region src/filter.ts
|
|
7
|
-
function toArray(array) {
|
|
8
|
-
const result = array || [];
|
|
9
|
-
if (Array.isArray(result)) return result;
|
|
10
|
-
return [result];
|
|
11
|
-
}
|
|
12
|
-
const BACKSLASH_REGEX = /\\/g;
|
|
13
|
-
function normalize(path) {
|
|
14
|
-
return path.replace(BACKSLASH_REGEX, "/");
|
|
15
|
-
}
|
|
16
|
-
const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Z]:)?[/\\|])/i;
|
|
17
|
-
function isAbsolute(path) {
|
|
18
|
-
return ABSOLUTE_PATH_REGEX.test(path);
|
|
19
|
-
}
|
|
20
|
-
function getMatcherString(glob, cwd) {
|
|
21
|
-
if (glob.startsWith("**") || isAbsolute(glob)) return normalize(glob);
|
|
22
|
-
return normalize((0, pathe.resolve)(cwd, glob));
|
|
23
|
-
}
|
|
24
|
-
function patternToIdFilter(pattern) {
|
|
25
|
-
if (pattern instanceof RegExp) return (id) => {
|
|
26
|
-
const normalizedId = normalize(id);
|
|
27
|
-
const result = pattern.test(normalizedId);
|
|
28
|
-
pattern.lastIndex = 0;
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
const matcher = (0, picomatch.default)(getMatcherString(pattern, process.cwd()), { dot: true });
|
|
32
|
-
return (id) => {
|
|
33
|
-
return matcher(normalize(id));
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function createFilter(exclude, include) {
|
|
37
|
-
if (!exclude && !include) return;
|
|
38
|
-
return (input) => {
|
|
39
|
-
if (exclude === null || exclude === void 0 ? void 0 : exclude.some((filter) => filter(input))) return false;
|
|
40
|
-
if (include === null || include === void 0 ? void 0 : include.some((filter) => filter(input))) return true;
|
|
41
|
-
return !(include && include.length > 0);
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function normalizeFilter(filter) {
|
|
45
|
-
if (typeof filter === "string" || filter instanceof RegExp) return { include: [filter] };
|
|
46
|
-
if (Array.isArray(filter)) return { include: filter };
|
|
47
|
-
return {
|
|
48
|
-
exclude: filter.exclude ? toArray(filter.exclude) : void 0,
|
|
49
|
-
include: filter.include ? toArray(filter.include) : void 0
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function createIdFilter(filter) {
|
|
53
|
-
if (!filter) return;
|
|
54
|
-
const { exclude, include } = normalizeFilter(filter);
|
|
55
|
-
return createFilter(exclude === null || exclude === void 0 ? void 0 : exclude.map(patternToIdFilter), include === null || include === void 0 ? void 0 : include.map(patternToIdFilter));
|
|
56
|
-
}
|
|
57
|
-
function createFilterForId(filter) {
|
|
58
|
-
const filterFunction = createIdFilter(filter);
|
|
59
|
-
return filterFunction ? (id) => !!filterFunction(id) : void 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
//#endregion
|
|
63
|
-
exports.createFilterForId = createFilterForId;
|
package/filter.mjs
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { resolve } from "pathe";
|
|
2
|
-
import picomatch from "picomatch";
|
|
3
|
-
|
|
4
|
-
//#region src/filter.ts
|
|
5
|
-
function toArray(array) {
|
|
6
|
-
const result = array || [];
|
|
7
|
-
if (Array.isArray(result)) return result;
|
|
8
|
-
return [result];
|
|
9
|
-
}
|
|
10
|
-
const BACKSLASH_REGEX = /\\/g;
|
|
11
|
-
function normalize(path) {
|
|
12
|
-
return path.replace(BACKSLASH_REGEX, "/");
|
|
13
|
-
}
|
|
14
|
-
const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Z]:)?[/\\|])/i;
|
|
15
|
-
function isAbsolute(path) {
|
|
16
|
-
return ABSOLUTE_PATH_REGEX.test(path);
|
|
17
|
-
}
|
|
18
|
-
function getMatcherString(glob, cwd) {
|
|
19
|
-
if (glob.startsWith("**") || isAbsolute(glob)) return normalize(glob);
|
|
20
|
-
return normalize(resolve(cwd, glob));
|
|
21
|
-
}
|
|
22
|
-
function patternToIdFilter(pattern) {
|
|
23
|
-
if (pattern instanceof RegExp) return (id) => {
|
|
24
|
-
const normalizedId = normalize(id);
|
|
25
|
-
const result = pattern.test(normalizedId);
|
|
26
|
-
pattern.lastIndex = 0;
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
const matcher = picomatch(getMatcherString(pattern, process.cwd()), { dot: true });
|
|
30
|
-
return (id) => {
|
|
31
|
-
return matcher(normalize(id));
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function createFilter(exclude, include) {
|
|
35
|
-
if (!exclude && !include) return;
|
|
36
|
-
return (input) => {
|
|
37
|
-
if (exclude === null || exclude === void 0 ? void 0 : exclude.some((filter) => filter(input))) return false;
|
|
38
|
-
if (include === null || include === void 0 ? void 0 : include.some((filter) => filter(input))) return true;
|
|
39
|
-
return !(include && include.length > 0);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function normalizeFilter(filter) {
|
|
43
|
-
if (typeof filter === "string" || filter instanceof RegExp) return { include: [filter] };
|
|
44
|
-
if (Array.isArray(filter)) return { include: filter };
|
|
45
|
-
return {
|
|
46
|
-
exclude: filter.exclude ? toArray(filter.exclude) : void 0,
|
|
47
|
-
include: filter.include ? toArray(filter.include) : void 0
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function createIdFilter(filter) {
|
|
51
|
-
if (!filter) return;
|
|
52
|
-
const { exclude, include } = normalizeFilter(filter);
|
|
53
|
-
return createFilter(exclude === null || exclude === void 0 ? void 0 : exclude.map(patternToIdFilter), include === null || include === void 0 ? void 0 : include.map(patternToIdFilter));
|
|
54
|
-
}
|
|
55
|
-
function createFilterForId(filter) {
|
|
56
|
-
const filterFunction = createIdFilter(filter);
|
|
57
|
-
return filterFunction ? (id) => !!filterFunction(id) : void 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
//#endregion
|
|
61
|
-
export { createFilterForId };
|
package/rolldown-browser.cjs
DELETED
package/rolldown-browser.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { rollUpImpl } from "./rollup-impl.mjs";
|
package/rolldown-browser.mjs
DELETED
package/rollup-impl.d.cts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Options } from "./common.cjs";
|
|
2
|
-
import * as unplugin from "unplugin";
|
|
3
|
-
import { UnpluginBuildContext, UnpluginContext } from "unplugin";
|
|
4
|
-
import * as magic_string_ast0 from "magic-string-ast";
|
|
5
|
-
|
|
6
|
-
//#region src/rollup-impl.d.ts
|
|
7
|
-
declare const rollUpImpl: (rawOptions: Options) => {
|
|
8
|
-
name: "unplugin-typegpu";
|
|
9
|
-
enforce: "post" | "pre" | undefined;
|
|
10
|
-
transform: {
|
|
11
|
-
filter: {
|
|
12
|
-
id: Omit<Options, "include" | "autoNamingEnabled" | "earlyPruning"> & Omit<{
|
|
13
|
-
include: RegExp;
|
|
14
|
-
autoNamingEnabled: boolean;
|
|
15
|
-
earlyPruning: boolean;
|
|
16
|
-
}, "include" | "autoNamingEnabled" | "earlyPruning"> & {
|
|
17
|
-
include: string | RegExp | unplugin.StringOrRegExp[];
|
|
18
|
-
autoNamingEnabled: boolean;
|
|
19
|
-
earlyPruning: boolean;
|
|
20
|
-
};
|
|
21
|
-
code: RegExp[];
|
|
22
|
-
} | {
|
|
23
|
-
id: Omit<Options, "include" | "autoNamingEnabled" | "earlyPruning"> & Omit<{
|
|
24
|
-
include: RegExp;
|
|
25
|
-
autoNamingEnabled: boolean;
|
|
26
|
-
earlyPruning: boolean;
|
|
27
|
-
}, "include" | "autoNamingEnabled" | "earlyPruning"> & {
|
|
28
|
-
include: string | RegExp | unplugin.StringOrRegExp[];
|
|
29
|
-
autoNamingEnabled: boolean;
|
|
30
|
-
earlyPruning: boolean;
|
|
31
|
-
};
|
|
32
|
-
code?: never;
|
|
33
|
-
};
|
|
34
|
-
handler(this: UnpluginBuildContext & UnpluginContext, code: string, id: string): magic_string_ast0.CodeTransform | undefined;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
//#endregion
|
|
38
|
-
export { rollUpImpl };
|
package/rollup-impl.d.mts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Options } from "./common.mjs";
|
|
2
|
-
import * as unplugin from "unplugin";
|
|
3
|
-
import { UnpluginBuildContext, UnpluginContext } from "unplugin";
|
|
4
|
-
import * as magic_string_ast0 from "magic-string-ast";
|
|
5
|
-
import { MagicStringAST } from "magic-string-ast";
|
|
6
|
-
|
|
7
|
-
//#region src/rollup-impl.d.ts
|
|
8
|
-
declare const rollUpImpl: (rawOptions: Options) => {
|
|
9
|
-
name: "unplugin-typegpu";
|
|
10
|
-
enforce: "post" | "pre" | undefined;
|
|
11
|
-
transform: {
|
|
12
|
-
filter: {
|
|
13
|
-
id: Omit<Options, "include" | "autoNamingEnabled" | "earlyPruning"> & Omit<{
|
|
14
|
-
include: RegExp;
|
|
15
|
-
autoNamingEnabled: boolean;
|
|
16
|
-
earlyPruning: boolean;
|
|
17
|
-
}, "include" | "autoNamingEnabled" | "earlyPruning"> & {
|
|
18
|
-
include: string | RegExp | unplugin.StringOrRegExp[];
|
|
19
|
-
autoNamingEnabled: boolean;
|
|
20
|
-
earlyPruning: boolean;
|
|
21
|
-
};
|
|
22
|
-
code: RegExp[];
|
|
23
|
-
} | {
|
|
24
|
-
id: Omit<Options, "include" | "autoNamingEnabled" | "earlyPruning"> & Omit<{
|
|
25
|
-
include: RegExp;
|
|
26
|
-
autoNamingEnabled: boolean;
|
|
27
|
-
earlyPruning: boolean;
|
|
28
|
-
}, "include" | "autoNamingEnabled" | "earlyPruning"> & {
|
|
29
|
-
include: string | RegExp | unplugin.StringOrRegExp[];
|
|
30
|
-
autoNamingEnabled: boolean;
|
|
31
|
-
earlyPruning: boolean;
|
|
32
|
-
};
|
|
33
|
-
code?: never;
|
|
34
|
-
};
|
|
35
|
-
handler(this: UnpluginBuildContext & UnpluginContext, code: string, id: string): magic_string_ast0.CodeTransform | undefined;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
//#endregion
|
|
39
|
-
export { rollUpImpl };
|