@rollup/wasm-node 5.0.0-0 → 5.0.0-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/dist/bin/rollup +3 -3
- package/dist/es/getLogFilter.js +2 -2
- package/dist/es/parseAst.js +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/node-entry.js +893 -689
- package/dist/es/shared/parseAst.js +113 -29
- package/dist/es/shared/watch.js +2 -2
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/native.js +19 -3
- package/dist/parseAst.js +2 -2
- package/dist/rollup.android-arm-eabi.node +0 -0
- package/dist/rollup.android-arm64.node +0 -0
- package/dist/rollup.darwin-arm64.node +0 -0
- package/dist/rollup.darwin-x64.node +0 -0
- package/dist/rollup.freebsd-arm64.node +0 -0
- package/dist/rollup.freebsd-x64.node +0 -0
- package/dist/rollup.js +2 -2
- package/dist/rollup.linux-arm-gnueabihf.node +0 -0
- package/dist/rollup.linux-arm-musleabihf.node +0 -0
- package/dist/rollup.linux-arm64-gnu.node +0 -0
- package/dist/rollup.linux-arm64-musl.node +0 -0
- package/dist/rollup.linux-loong64-gnu.node +0 -0
- package/dist/rollup.linux-loong64-musl.node +0 -0
- package/dist/rollup.linux-ppc64-gnu.node +0 -0
- package/dist/rollup.linux-ppc64-musl.node +0 -0
- package/dist/rollup.linux-riscv64-gnu.node +0 -0
- package/dist/rollup.linux-riscv64-musl.node +0 -0
- package/dist/rollup.linux-s390x-gnu.node +0 -0
- package/dist/rollup.linux-x64-gnu.node +0 -0
- package/dist/rollup.linux-x64-musl.node +0 -0
- package/dist/rollup.openbsd-x64.node +0 -0
- package/dist/rollup.openharmony-arm64.node +0 -0
- package/dist/rollup.win32-arm64-msvc.node +0 -0
- package/dist/rollup.win32-ia32-msvc.node +0 -0
- package/dist/rollup.win32-x64-gnu.node +0 -0
- package/dist/rollup.win32-x64-msvc.node +0 -0
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/node-entry.js +2 -2
- package/dist/shared/parseAst.js +119 -35
- package/dist/shared/rollup.js +892 -688
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/dist/wasm-node/bindings_wasm.js +2 -18
- package/dist/wasm-node/bindings_wasm_bg.wasm +0 -0
- package/package.json +16 -16
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v5.0.0-
|
|
4
|
-
|
|
3
|
+
Rollup.js v5.0.0-1
|
|
4
|
+
Sun, 18 Oct 2026 06:06:25 GMT - commit ed75a6895d5bc62fdbff91b9d48e22e6e281e3bc
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -12,22 +12,40 @@ import { resolve, dirname, basename, extname } from 'node:path';
|
|
|
12
12
|
|
|
13
13
|
// Replaces node:path in the browser build. Keep the behavior consistent with
|
|
14
14
|
// the Node build so that both builds handle paths the same way.
|
|
15
|
+
const ABSOLUTE_PATH_REGEX$1 = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/;
|
|
15
16
|
const ANY_SLASH_REGEX = /[/\\]/;
|
|
17
|
+
const DRIVE_REGEX = /^[A-Za-z]:$/;
|
|
18
|
+
function isAbsolute$1(path) {
|
|
19
|
+
return ABSOLUTE_PATH_REGEX$1.test(path);
|
|
20
|
+
}
|
|
21
|
+
function normalizePathSegments(parts, absolute) {
|
|
22
|
+
const normalized = [];
|
|
23
|
+
// A drive like "C:" is the root of the path, so ".." cannot climb above it
|
|
24
|
+
const root = DRIVE_REGEX.test(parts[0]) ? 1 : 0;
|
|
25
|
+
for (const part of parts) {
|
|
26
|
+
if (part === '..') {
|
|
27
|
+
if (normalized.length > root && normalized[normalized.length - 1] !== '..') {
|
|
28
|
+
normalized.pop();
|
|
29
|
+
}
|
|
30
|
+
else if (!absolute && root === 0) {
|
|
31
|
+
normalized.push('..');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else if (part !== '.' && part !== '') {
|
|
35
|
+
normalized.push(part);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return normalized;
|
|
39
|
+
}
|
|
16
40
|
function relative(from, to) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (toParts[0] === '.')
|
|
22
|
-
toParts.shift();
|
|
41
|
+
// "." and ".." segments are collapsed on both sides first, as node:path
|
|
42
|
+
// does, so that "/a/./b" and "/a/b" describe the same location.
|
|
43
|
+
const fromParts = normalizePathSegments(from.split(ANY_SLASH_REGEX), isAbsolute$1(from));
|
|
44
|
+
const toParts = normalizePathSegments(to.split(ANY_SLASH_REGEX), isAbsolute$1(to));
|
|
23
45
|
while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) {
|
|
24
46
|
fromParts.shift();
|
|
25
47
|
toParts.shift();
|
|
26
48
|
}
|
|
27
|
-
while (toParts[0] === '..' && fromParts.length > 0) {
|
|
28
|
-
toParts.shift();
|
|
29
|
-
fromParts.pop();
|
|
30
|
-
}
|
|
31
49
|
while (fromParts.pop()) {
|
|
32
50
|
toParts.unshift('..');
|
|
33
51
|
}
|
|
@@ -2260,7 +2278,7 @@ const nodeConverters$1 = [
|
|
|
2260
2278
|
return result;
|
|
2261
2279
|
},
|
|
2262
2280
|
get value() {
|
|
2263
|
-
const result =
|
|
2281
|
+
const result = buffer.convertFloat64(position + 3);
|
|
2264
2282
|
Object.defineProperty(node, 'value', { value: result });
|
|
2265
2283
|
return result;
|
|
2266
2284
|
}
|
|
@@ -2859,13 +2877,61 @@ function convertNodeList$1(position, buffer) {
|
|
|
2859
2877
|
return list;
|
|
2860
2878
|
}
|
|
2861
2879
|
|
|
2880
|
+
// Buffers hold 32-bit words in host byte order. For words that represent
|
|
2881
|
+
// strings, the four string bytes are packed LSB-first into the word, which on
|
|
2882
|
+
// little-endian hosts leaves the raw encoded string bytes in memory while
|
|
2883
|
+
// big-endian hosts need the byte order of each word reversed.
|
|
2884
|
+
const isBigEndianHost = new Uint8Array(new Uint32Array([1]).buffer)[0] === 0;
|
|
2885
|
+
const scratchFloat64 = new DataView(new ArrayBuffer(8));
|
|
2886
|
+
let scratchStringBytes = new Uint8Array(0);
|
|
2887
|
+
const writeFloat64 = function (value, wordPosition) {
|
|
2888
|
+
scratchFloat64.setFloat64(0, value, true);
|
|
2889
|
+
this[wordPosition] = scratchFloat64.getUint32(0, true);
|
|
2890
|
+
this[wordPosition + 1] = scratchFloat64.getUint32(4, true);
|
|
2891
|
+
};
|
|
2892
|
+
function writeStringWordsBigEndian(buffer, byteBuffer, bytePosition, byteLength) {
|
|
2893
|
+
const firstWordPosition = bytePosition >> 2;
|
|
2894
|
+
const wordCount = (byteLength + 3) >> 2;
|
|
2895
|
+
for (let index = 0; index < wordCount; index++) {
|
|
2896
|
+
const offset = bytePosition + (index << 2);
|
|
2897
|
+
buffer[firstWordPosition + index] =
|
|
2898
|
+
byteBuffer[offset] |
|
|
2899
|
+
(byteBuffer[offset + 1] << 8) |
|
|
2900
|
+
(byteBuffer[offset + 2] << 16) |
|
|
2901
|
+
(byteBuffer[offset + 3] << 24);
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
const expandPackedString = (array, position, length) => {
|
|
2905
|
+
const paddedByteLength = ((length + 3) >> 2) << 2;
|
|
2906
|
+
if (scratchStringBytes.length < paddedByteLength) {
|
|
2907
|
+
scratchStringBytes = new Uint8Array(paddedByteLength);
|
|
2908
|
+
}
|
|
2909
|
+
const firstStringWord = position + 1;
|
|
2910
|
+
for (let index = 0; index < paddedByteLength >> 2; index++) {
|
|
2911
|
+
const word = array[firstStringWord + index];
|
|
2912
|
+
scratchStringBytes[index << 2] = word & 0xff;
|
|
2913
|
+
scratchStringBytes[(index << 2) + 1] = (word >>> 8) & 0xff;
|
|
2914
|
+
scratchStringBytes[(index << 2) + 2] = (word >>> 16) & 0xff;
|
|
2915
|
+
scratchStringBytes[(index << 2) + 3] = (word >>> 24) & 0xff;
|
|
2916
|
+
}
|
|
2917
|
+
return scratchStringBytes.subarray(0, length);
|
|
2918
|
+
};
|
|
2919
|
+
const decodePackedString = (array, position, length) => {
|
|
2920
|
+
const bytes = expandPackedString(array, position, length);
|
|
2921
|
+
return typeof Buffer !== 'undefined'
|
|
2922
|
+
? Buffer.from(bytes.buffer, bytes.byteOffset, bytes.length).toString('utf8')
|
|
2923
|
+
: new TextDecoder().decode(bytes);
|
|
2924
|
+
};
|
|
2862
2925
|
function getAstBuffer(byteBuffer) {
|
|
2863
2926
|
// Create an aligned copy for misaligned views, e.g. buffers restored by
|
|
2864
2927
|
// v8.deserialize, as the Uint32Array below requires a 4-byte aligned offset
|
|
2865
2928
|
const alignedByteBuffer = byteBuffer.byteOffset & 3 ? new Uint8Array(byteBuffer) : byteBuffer;
|
|
2866
2929
|
const array = new Uint32Array(alignedByteBuffer.buffer, alignedByteBuffer.byteOffset, alignedByteBuffer.byteLength >> 2);
|
|
2867
2930
|
let convertString;
|
|
2868
|
-
if (
|
|
2931
|
+
if (isBigEndianHost) {
|
|
2932
|
+
convertString = position => decodePackedString(array, position, array[position]);
|
|
2933
|
+
}
|
|
2934
|
+
else if (typeof Buffer !== 'undefined' && byteBuffer instanceof Buffer) {
|
|
2869
2935
|
convertString = position => {
|
|
2870
2936
|
const length = array[position];
|
|
2871
2937
|
const bytePosition = (position + 1) << 2;
|
|
@@ -2880,11 +2946,19 @@ function getAstBuffer(byteBuffer) {
|
|
|
2880
2946
|
return textDecoder.decode(byteBuffer.subarray(bytePosition, bytePosition + length));
|
|
2881
2947
|
};
|
|
2882
2948
|
}
|
|
2883
|
-
return Object.assign(array, {
|
|
2949
|
+
return Object.assign(array, {
|
|
2950
|
+
convertFloat64(position) {
|
|
2951
|
+
scratchFloat64.setUint32(0, this[position], true);
|
|
2952
|
+
scratchFloat64.setUint32(4, this[position + 1], true);
|
|
2953
|
+
return scratchFloat64.getFloat64(0, true);
|
|
2954
|
+
},
|
|
2955
|
+
convertString
|
|
2956
|
+
});
|
|
2884
2957
|
}
|
|
2885
2958
|
function createAstBufferUint8(uInt32Size) {
|
|
2886
2959
|
const buffer = new Uint32Array(uInt32Size);
|
|
2887
2960
|
const encoder = new TextEncoder();
|
|
2961
|
+
const byteBuffer = new Uint8Array(buffer.buffer);
|
|
2888
2962
|
return Object.assign(buffer, {
|
|
2889
2963
|
addStringToBuffer(text, referencePosition) {
|
|
2890
2964
|
const insertPosition = buffer.position;
|
|
@@ -2895,10 +2969,14 @@ function createAstBufferUint8(uInt32Size) {
|
|
|
2895
2969
|
const reservedSize = 1 + ((encodedByteLength + 3) >> 2);
|
|
2896
2970
|
const extendedBuffer = buffer.reserve(reservedSize);
|
|
2897
2971
|
extendedBuffer[insertPosition] = encodedByteLength;
|
|
2898
|
-
|
|
2972
|
+
const stringBytePosition = (insertPosition + 1) << 2;
|
|
2973
|
+
extendedBuffer.byteBuffer.set(encoded, stringBytePosition);
|
|
2974
|
+
if (isBigEndianHost) {
|
|
2975
|
+
writeStringWordsBigEndian(extendedBuffer, extendedBuffer.byteBuffer, stringBytePosition, encodedByteLength);
|
|
2976
|
+
}
|
|
2899
2977
|
return extendedBuffer;
|
|
2900
2978
|
},
|
|
2901
|
-
byteBuffer
|
|
2979
|
+
byteBuffer,
|
|
2902
2980
|
position: 0,
|
|
2903
2981
|
reserve(size) {
|
|
2904
2982
|
const newPosition = buffer.position + size;
|
|
@@ -2913,12 +2991,14 @@ function createAstBufferUint8(uInt32Size) {
|
|
|
2913
2991
|
},
|
|
2914
2992
|
toOutput() {
|
|
2915
2993
|
const byteSize = buffer.position << 2;
|
|
2916
|
-
return
|
|
2917
|
-
}
|
|
2994
|
+
return byteBuffer.slice(0, byteSize);
|
|
2995
|
+
},
|
|
2996
|
+
writeFloat64
|
|
2918
2997
|
});
|
|
2919
2998
|
}
|
|
2920
2999
|
function createAstBufferNode(uInt32Size) {
|
|
2921
3000
|
const buffer = new Uint32Array(uInt32Size);
|
|
3001
|
+
const byteBuffer = Buffer.from(buffer.buffer);
|
|
2922
3002
|
return Object.assign(buffer, {
|
|
2923
3003
|
addStringToBuffer(text, referencePosition) {
|
|
2924
3004
|
let extendedBuffer = buffer;
|
|
@@ -2926,19 +3006,22 @@ function createAstBufferNode(uInt32Size) {
|
|
|
2926
3006
|
if (requiredSize > buffer.length) {
|
|
2927
3007
|
// Reserve more space if needed
|
|
2928
3008
|
extendedBuffer = createAstBufferNode(requiredSize * 2);
|
|
2929
|
-
|
|
3009
|
+
byteBuffer.copy(extendedBuffer.byteBuffer, 0, 0, buffer.position << 2);
|
|
2930
3010
|
extendedBuffer.position = buffer.position;
|
|
2931
3011
|
}
|
|
2932
3012
|
const insertPosition = extendedBuffer.position;
|
|
2933
3013
|
extendedBuffer[referencePosition] = insertPosition;
|
|
2934
|
-
const
|
|
2935
|
-
const encodedLength = extendedBuffer.byteBuffer.write(text,
|
|
3014
|
+
const stringBytePosition = (insertPosition + 1) << 2;
|
|
3015
|
+
const encodedLength = extendedBuffer.byteBuffer.write(text, stringBytePosition);
|
|
2936
3016
|
extendedBuffer[insertPosition] = encodedLength;
|
|
3017
|
+
if (isBigEndianHost) {
|
|
3018
|
+
writeStringWordsBigEndian(extendedBuffer, extendedBuffer.byteBuffer, stringBytePosition, encodedLength);
|
|
3019
|
+
}
|
|
2937
3020
|
// Round up to the next 4-byte boundary
|
|
2938
|
-
extendedBuffer.position = (
|
|
3021
|
+
extendedBuffer.position = (stringBytePosition + encodedLength + 3) >> 2;
|
|
2939
3022
|
return extendedBuffer;
|
|
2940
3023
|
},
|
|
2941
|
-
byteBuffer
|
|
3024
|
+
byteBuffer,
|
|
2942
3025
|
position: 0,
|
|
2943
3026
|
reserve(size) {
|
|
2944
3027
|
const newPosition = buffer.position + size;
|
|
@@ -2947,7 +3030,7 @@ function createAstBufferNode(uInt32Size) {
|
|
|
2947
3030
|
return buffer;
|
|
2948
3031
|
}
|
|
2949
3032
|
const newBuffer = createAstBufferNode(newPosition * 2);
|
|
2950
|
-
|
|
3033
|
+
byteBuffer.copy(newBuffer.byteBuffer, 0, 0, buffer.position << 2);
|
|
2951
3034
|
newBuffer.position = newPosition;
|
|
2952
3035
|
return newBuffer;
|
|
2953
3036
|
},
|
|
@@ -2956,9 +3039,10 @@ function createAstBufferNode(uInt32Size) {
|
|
|
2956
3039
|
// The "slow" version will allocate exactly the needed size and is preferable
|
|
2957
3040
|
// for long-term memory usage.
|
|
2958
3041
|
const truncatedBuffer = Buffer.allocUnsafeSlow(byteSize);
|
|
2959
|
-
|
|
3042
|
+
byteBuffer.copy(truncatedBuffer, 0, 0, byteSize);
|
|
2960
3043
|
return truncatedBuffer;
|
|
2961
|
-
}
|
|
3044
|
+
},
|
|
3045
|
+
writeFloat64
|
|
2962
3046
|
});
|
|
2963
3047
|
}
|
|
2964
3048
|
|
|
@@ -3689,7 +3773,7 @@ const nodeConverters = [
|
|
|
3689
3773
|
start: buffer[position],
|
|
3690
3774
|
end: buffer[position + 1],
|
|
3691
3775
|
raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition),
|
|
3692
|
-
value:
|
|
3776
|
+
value: buffer.convertFloat64(position + 3)
|
|
3693
3777
|
};
|
|
3694
3778
|
},
|
|
3695
3779
|
function literalRegExp(position, buffer) {
|
|
@@ -5113,7 +5197,7 @@ const serializeLiteralNumber = (node, buffer) => {
|
|
|
5113
5197
|
if (node.raw != null) {
|
|
5114
5198
|
buffer = buffer.addStringToBuffer(node.raw, nodePosition + 3);
|
|
5115
5199
|
}
|
|
5116
|
-
|
|
5200
|
+
buffer.writeFloat64(node.value, nodePosition + 4);
|
|
5117
5201
|
return buffer;
|
|
5118
5202
|
};
|
|
5119
5203
|
const serializeLiteralRegExp = (node, buffer) => {
|
package/dist/es/shared/watch.js
CHANGED
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/native.js
CHANGED
|
@@ -6,16 +6,32 @@ const {
|
|
|
6
6
|
xxhashBase16
|
|
7
7
|
} = require('./wasm-node/bindings_wasm.js');
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// WebAssembly always emits little-endian words while all words of the returned
|
|
10
|
+
// buffers are read in host byte order, so on big-endian hosts swap each whole
|
|
11
|
+
// buffer once here. The wasm-bindgen glue hands over a fresh JS-owned copy,
|
|
12
|
+
// which is always 32-bit aligned, making this in-place swap safe.
|
|
13
|
+
const isBigEndianHost = new Uint8Array(new Uint32Array([1]).buffer)[0] === 0;
|
|
14
|
+
const toHostByteOrder = result => {
|
|
15
|
+
if (isBigEndianHost) {
|
|
16
|
+
Buffer.from(result.buffer, result.byteOffset, result.byteLength).swap32();
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.parse = (code, allowReturnOutsideFunction, jsx) =>
|
|
22
|
+
toHostByteOrder(parse(code, allowReturnOutsideFunction, jsx));
|
|
10
23
|
exports.parseAsync = async (code, allowReturnOutsideFunction, jsx) =>
|
|
11
|
-
parse(code, allowReturnOutsideFunction, jsx);
|
|
24
|
+
toHostByteOrder(parse(code, allowReturnOutsideFunction, jsx));
|
|
12
25
|
exports.parseAndWalk = async (
|
|
13
26
|
code,
|
|
14
27
|
allowReturnOutsideFunction,
|
|
15
28
|
jsx,
|
|
16
29
|
walkedNodesBitset,
|
|
17
30
|
collectScopes
|
|
18
|
-
) =>
|
|
31
|
+
) =>
|
|
32
|
+
toHostByteOrder(
|
|
33
|
+
parseAndWalkSync(code, allowReturnOutsideFunction, jsx, walkedNodesBitset, collectScopes)
|
|
34
|
+
);
|
|
19
35
|
exports.xxhashBase64Url = xxhashBase64Url;
|
|
20
36
|
exports.xxhashBase36 = xxhashBase36;
|
|
21
37
|
exports.xxhashBase16 = xxhashBase16;
|
package/dist/parseAst.js
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/rollup.js
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/shared/index.js
CHANGED