@rollup/wasm-node 4.18.0 → 4.19.0
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/LICENSE.md +1 -1
- package/dist/bin/rollup +2 -2
- 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 +431 -397
- package/dist/es/shared/parseAst.js +491 -790
- package/dist/es/shared/watch.js +65 -52
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +19 -3
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +65 -52
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/parseAst.js +492 -791
- package/dist/shared/rollup.js +430 -396
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/dist/wasm-node/bindings_wasm.js +5 -5
- package/dist/wasm-node/bindings_wasm_bg.wasm +0 -0
- package/package.json +38 -33
package/dist/es/shared/watch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.19.0
|
|
4
|
+
Sat, 20 Jul 2024 05:45:44 GMT - commit 28546b5821efcb72c2eb05f422d986524647a0e3
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -704,7 +704,7 @@ var utils$3 = {};
|
|
|
704
704
|
*/
|
|
705
705
|
|
|
706
706
|
exports.escapeNode = (block, n = 0, type) => {
|
|
707
|
-
|
|
707
|
+
const node = block.nodes[n];
|
|
708
708
|
if (!node) return;
|
|
709
709
|
|
|
710
710
|
if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
|
|
@@ -773,13 +773,23 @@ var utils$3 = {};
|
|
|
773
773
|
|
|
774
774
|
exports.flatten = (...args) => {
|
|
775
775
|
const result = [];
|
|
776
|
+
|
|
776
777
|
const flat = arr => {
|
|
777
778
|
for (let i = 0; i < arr.length; i++) {
|
|
778
|
-
|
|
779
|
-
|
|
779
|
+
const ele = arr[i];
|
|
780
|
+
|
|
781
|
+
if (Array.isArray(ele)) {
|
|
782
|
+
flat(ele);
|
|
783
|
+
continue;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
if (ele !== undefined) {
|
|
787
|
+
result.push(ele);
|
|
788
|
+
}
|
|
780
789
|
}
|
|
781
790
|
return result;
|
|
782
791
|
};
|
|
792
|
+
|
|
783
793
|
flat(args);
|
|
784
794
|
return result;
|
|
785
795
|
};
|
|
@@ -788,9 +798,9 @@ var utils$3 = {};
|
|
|
788
798
|
const utils$2 = utils$3;
|
|
789
799
|
|
|
790
800
|
var stringify$4 = (ast, options = {}) => {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
801
|
+
const stringify = (node, parent = {}) => {
|
|
802
|
+
const invalidBlock = options.escapeInvalid && utils$2.isInvalidBrace(parent);
|
|
803
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
794
804
|
let output = '';
|
|
795
805
|
|
|
796
806
|
if (node.value) {
|
|
@@ -805,7 +815,7 @@ var stringify$4 = (ast, options = {}) => {
|
|
|
805
815
|
}
|
|
806
816
|
|
|
807
817
|
if (node.nodes) {
|
|
808
|
-
for (
|
|
818
|
+
for (const child of node.nodes) {
|
|
809
819
|
output += stringify(child);
|
|
810
820
|
}
|
|
811
821
|
}
|
|
@@ -1179,7 +1189,7 @@ const toMaxLen = (input, maxLength) => {
|
|
|
1179
1189
|
return negative ? ('-' + input) : input;
|
|
1180
1190
|
};
|
|
1181
1191
|
|
|
1182
|
-
const toSequence = (parts, options) => {
|
|
1192
|
+
const toSequence = (parts, options, maxLen) => {
|
|
1183
1193
|
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
1184
1194
|
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
1185
1195
|
|
|
@@ -1189,11 +1199,11 @@ const toSequence = (parts, options) => {
|
|
|
1189
1199
|
let result;
|
|
1190
1200
|
|
|
1191
1201
|
if (parts.positives.length) {
|
|
1192
|
-
positives = parts.positives.join('|');
|
|
1202
|
+
positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|');
|
|
1193
1203
|
}
|
|
1194
1204
|
|
|
1195
1205
|
if (parts.negatives.length) {
|
|
1196
|
-
negatives = `-(${prefix}${parts.negatives.join('|')})`;
|
|
1206
|
+
negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`;
|
|
1197
1207
|
}
|
|
1198
1208
|
|
|
1199
1209
|
if (positives && negatives) {
|
|
@@ -1291,7 +1301,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
|
1291
1301
|
|
|
1292
1302
|
if (options.toRegex === true) {
|
|
1293
1303
|
return step > 1
|
|
1294
|
-
? toSequence(parts, options)
|
|
1304
|
+
? toSequence(parts, options, maxLen)
|
|
1295
1305
|
: toRegex(range, null, { wrap: false, ...options });
|
|
1296
1306
|
}
|
|
1297
1307
|
|
|
@@ -1303,7 +1313,6 @@ const fillLetters = (start, end, step = 1, options = {}) => {
|
|
|
1303
1313
|
return invalidRange(start, end, options);
|
|
1304
1314
|
}
|
|
1305
1315
|
|
|
1306
|
-
|
|
1307
1316
|
let format = options.transform || (val => String.fromCharCode(val));
|
|
1308
1317
|
let a = `${start}`.charCodeAt(0);
|
|
1309
1318
|
let b = `${end}`.charCodeAt(0);
|
|
@@ -1371,30 +1380,32 @@ const fill$1 = fillRange;
|
|
|
1371
1380
|
const utils$1 = utils$3;
|
|
1372
1381
|
|
|
1373
1382
|
const compile$1 = (ast, options = {}) => {
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1383
|
+
const walk = (node, parent = {}) => {
|
|
1384
|
+
const invalidBlock = utils$1.isInvalidBrace(parent);
|
|
1385
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
1386
|
+
const invalid = invalidBlock === true || invalidNode === true;
|
|
1387
|
+
const prefix = options.escapeInvalid === true ? '\\' : '';
|
|
1379
1388
|
let output = '';
|
|
1380
1389
|
|
|
1381
1390
|
if (node.isOpen === true) {
|
|
1382
1391
|
return prefix + node.value;
|
|
1383
1392
|
}
|
|
1393
|
+
|
|
1384
1394
|
if (node.isClose === true) {
|
|
1395
|
+
console.log('node.isClose', prefix, node.value);
|
|
1385
1396
|
return prefix + node.value;
|
|
1386
1397
|
}
|
|
1387
1398
|
|
|
1388
1399
|
if (node.type === 'open') {
|
|
1389
|
-
return invalid ?
|
|
1400
|
+
return invalid ? prefix + node.value : '(';
|
|
1390
1401
|
}
|
|
1391
1402
|
|
|
1392
1403
|
if (node.type === 'close') {
|
|
1393
|
-
return invalid ?
|
|
1404
|
+
return invalid ? prefix + node.value : ')';
|
|
1394
1405
|
}
|
|
1395
1406
|
|
|
1396
1407
|
if (node.type === 'comma') {
|
|
1397
|
-
return node.prev.type === 'comma' ? '' :
|
|
1408
|
+
return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
|
|
1398
1409
|
}
|
|
1399
1410
|
|
|
1400
1411
|
if (node.value) {
|
|
@@ -1402,8 +1413,8 @@ const compile$1 = (ast, options = {}) => {
|
|
|
1402
1413
|
}
|
|
1403
1414
|
|
|
1404
1415
|
if (node.nodes && node.ranges > 0) {
|
|
1405
|
-
|
|
1406
|
-
|
|
1416
|
+
const args = utils$1.reduce(node.nodes);
|
|
1417
|
+
const range = fill$1(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
|
|
1407
1418
|
|
|
1408
1419
|
if (range.length !== 0) {
|
|
1409
1420
|
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
@@ -1411,10 +1422,11 @@ const compile$1 = (ast, options = {}) => {
|
|
|
1411
1422
|
}
|
|
1412
1423
|
|
|
1413
1424
|
if (node.nodes) {
|
|
1414
|
-
for (
|
|
1425
|
+
for (const child of node.nodes) {
|
|
1415
1426
|
output += walk(child, node);
|
|
1416
1427
|
}
|
|
1417
1428
|
}
|
|
1429
|
+
|
|
1418
1430
|
return output;
|
|
1419
1431
|
};
|
|
1420
1432
|
|
|
@@ -1428,7 +1440,7 @@ const stringify$2 = stringify$4;
|
|
|
1428
1440
|
const utils = utils$3;
|
|
1429
1441
|
|
|
1430
1442
|
const append = (queue = '', stash = '', enclose = false) => {
|
|
1431
|
-
|
|
1443
|
+
const result = [];
|
|
1432
1444
|
|
|
1433
1445
|
queue = [].concat(queue);
|
|
1434
1446
|
stash = [].concat(stash);
|
|
@@ -1438,15 +1450,15 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
1438
1450
|
return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
|
|
1439
1451
|
}
|
|
1440
1452
|
|
|
1441
|
-
for (
|
|
1453
|
+
for (const item of queue) {
|
|
1442
1454
|
if (Array.isArray(item)) {
|
|
1443
|
-
for (
|
|
1455
|
+
for (const value of item) {
|
|
1444
1456
|
result.push(append(value, stash, enclose));
|
|
1445
1457
|
}
|
|
1446
1458
|
} else {
|
|
1447
1459
|
for (let ele of stash) {
|
|
1448
1460
|
if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
|
|
1449
|
-
result.push(Array.isArray(ele) ? append(item, ele, enclose) :
|
|
1461
|
+
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
|
1450
1462
|
}
|
|
1451
1463
|
}
|
|
1452
1464
|
}
|
|
@@ -1454,9 +1466,9 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
1454
1466
|
};
|
|
1455
1467
|
|
|
1456
1468
|
const expand$1 = (ast, options = {}) => {
|
|
1457
|
-
|
|
1469
|
+
const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
|
|
1458
1470
|
|
|
1459
|
-
|
|
1471
|
+
const walk = (node, parent = {}) => {
|
|
1460
1472
|
node.queue = [];
|
|
1461
1473
|
|
|
1462
1474
|
let p = parent;
|
|
@@ -1478,7 +1490,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
1478
1490
|
}
|
|
1479
1491
|
|
|
1480
1492
|
if (node.nodes && node.ranges > 0) {
|
|
1481
|
-
|
|
1493
|
+
const args = utils.reduce(node.nodes);
|
|
1482
1494
|
|
|
1483
1495
|
if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
|
|
1484
1496
|
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
|
|
@@ -1494,7 +1506,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
1494
1506
|
return;
|
|
1495
1507
|
}
|
|
1496
1508
|
|
|
1497
|
-
|
|
1509
|
+
const enclose = utils.encloseBrace(node);
|
|
1498
1510
|
let queue = node.queue;
|
|
1499
1511
|
let block = node;
|
|
1500
1512
|
|
|
@@ -1504,7 +1516,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
1504
1516
|
}
|
|
1505
1517
|
|
|
1506
1518
|
for (let i = 0; i < node.nodes.length; i++) {
|
|
1507
|
-
|
|
1519
|
+
const child = node.nodes[i];
|
|
1508
1520
|
|
|
1509
1521
|
if (child.type === 'comma' && node.type === 'brace') {
|
|
1510
1522
|
if (i === 1) queue.push('');
|
|
@@ -1536,7 +1548,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
1536
1548
|
var expand_1 = expand$1;
|
|
1537
1549
|
|
|
1538
1550
|
var constants$1 = {
|
|
1539
|
-
MAX_LENGTH:
|
|
1551
|
+
MAX_LENGTH: 10000,
|
|
1540
1552
|
|
|
1541
1553
|
// Digits
|
|
1542
1554
|
CHAR_0: '0', /* 0 */
|
|
@@ -1624,18 +1636,18 @@ const parse$1 = (input, options = {}) => {
|
|
|
1624
1636
|
throw new TypeError('Expected a string');
|
|
1625
1637
|
}
|
|
1626
1638
|
|
|
1627
|
-
|
|
1628
|
-
|
|
1639
|
+
const opts = options || {};
|
|
1640
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1629
1641
|
if (input.length > max) {
|
|
1630
1642
|
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
1631
1643
|
}
|
|
1632
1644
|
|
|
1633
|
-
|
|
1634
|
-
|
|
1645
|
+
const ast = { type: 'root', input, nodes: [] };
|
|
1646
|
+
const stack = [ast];
|
|
1635
1647
|
let block = ast;
|
|
1636
1648
|
let prev = ast;
|
|
1637
1649
|
let brackets = 0;
|
|
1638
|
-
|
|
1650
|
+
const length = input.length;
|
|
1639
1651
|
let index = 0;
|
|
1640
1652
|
let depth = 0;
|
|
1641
1653
|
let value;
|
|
@@ -1700,6 +1712,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1700
1712
|
|
|
1701
1713
|
if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1702
1714
|
brackets++;
|
|
1715
|
+
|
|
1703
1716
|
let next;
|
|
1704
1717
|
|
|
1705
1718
|
while (index < length && (next = advance())) {
|
|
@@ -1755,7 +1768,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1755
1768
|
*/
|
|
1756
1769
|
|
|
1757
1770
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
1758
|
-
|
|
1771
|
+
const open = value;
|
|
1759
1772
|
let next;
|
|
1760
1773
|
|
|
1761
1774
|
if (options.keepQuotes !== true) {
|
|
@@ -1787,8 +1800,8 @@ const parse$1 = (input, options = {}) => {
|
|
|
1787
1800
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
1788
1801
|
depth++;
|
|
1789
1802
|
|
|
1790
|
-
|
|
1791
|
-
|
|
1803
|
+
const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
|
|
1804
|
+
const brace = {
|
|
1792
1805
|
type: 'brace',
|
|
1793
1806
|
open: true,
|
|
1794
1807
|
close: false,
|
|
@@ -1815,7 +1828,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1815
1828
|
continue;
|
|
1816
1829
|
}
|
|
1817
1830
|
|
|
1818
|
-
|
|
1831
|
+
const type = 'close';
|
|
1819
1832
|
block = stack.pop();
|
|
1820
1833
|
block.close = true;
|
|
1821
1834
|
|
|
@@ -1833,7 +1846,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1833
1846
|
if (value === CHAR_COMMA && depth > 0) {
|
|
1834
1847
|
if (block.ranges > 0) {
|
|
1835
1848
|
block.ranges = 0;
|
|
1836
|
-
|
|
1849
|
+
const open = block.nodes.shift();
|
|
1837
1850
|
block.nodes = [open, { type: 'text', value: stringify$1(block) }];
|
|
1838
1851
|
}
|
|
1839
1852
|
|
|
@@ -1847,7 +1860,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1847
1860
|
*/
|
|
1848
1861
|
|
|
1849
1862
|
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
|
1850
|
-
|
|
1863
|
+
const siblings = block.nodes;
|
|
1851
1864
|
|
|
1852
1865
|
if (depth === 0 || siblings.length === 0) {
|
|
1853
1866
|
push({ type: 'text', value });
|
|
@@ -1874,7 +1887,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1874
1887
|
if (prev.type === 'range') {
|
|
1875
1888
|
siblings.pop();
|
|
1876
1889
|
|
|
1877
|
-
|
|
1890
|
+
const before = siblings[siblings.length - 1];
|
|
1878
1891
|
before.value += prev.value + value;
|
|
1879
1892
|
prev = before;
|
|
1880
1893
|
block.ranges--;
|
|
@@ -1907,8 +1920,8 @@ const parse$1 = (input, options = {}) => {
|
|
|
1907
1920
|
});
|
|
1908
1921
|
|
|
1909
1922
|
// get the location of the block on parent.nodes (block's siblings)
|
|
1910
|
-
|
|
1911
|
-
|
|
1923
|
+
const parent = stack[stack.length - 1];
|
|
1924
|
+
const index = parent.nodes.indexOf(block);
|
|
1912
1925
|
// replace the (invalid) block with it's nodes
|
|
1913
1926
|
parent.nodes.splice(index, 1, ...block.nodes);
|
|
1914
1927
|
}
|
|
@@ -1943,8 +1956,8 @@ const braces$1 = (input, options = {}) => {
|
|
|
1943
1956
|
let output = [];
|
|
1944
1957
|
|
|
1945
1958
|
if (Array.isArray(input)) {
|
|
1946
|
-
for (
|
|
1947
|
-
|
|
1959
|
+
for (const pattern of input) {
|
|
1960
|
+
const result = braces$1.create(pattern, options);
|
|
1948
1961
|
if (Array.isArray(result)) {
|
|
1949
1962
|
output.push(...result);
|
|
1950
1963
|
} else {
|
|
@@ -2078,7 +2091,7 @@ braces$1.create = (input, options = {}) => {
|
|
|
2078
2091
|
return [input];
|
|
2079
2092
|
}
|
|
2080
2093
|
|
|
2081
|
-
|
|
2094
|
+
return options.expand !== true
|
|
2082
2095
|
? braces$1.compile(input, options)
|
|
2083
2096
|
: braces$1.expand(input, options);
|
|
2084
2097
|
};
|
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/parseAst.js
CHANGED
package/dist/rollup.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type * as estree from 'estree';
|
|
2
|
+
|
|
3
|
+
declare module 'estree' {
|
|
4
|
+
export interface Decorator extends estree.BaseNode {
|
|
5
|
+
type: 'Decorator';
|
|
6
|
+
expression: estree.Expression;
|
|
7
|
+
}
|
|
8
|
+
interface PropertyDefinition {
|
|
9
|
+
decorators: estree.Decorator[];
|
|
10
|
+
}
|
|
11
|
+
interface MethodDefinition {
|
|
12
|
+
decorators: estree.Decorator[];
|
|
13
|
+
}
|
|
14
|
+
interface BaseClass {
|
|
15
|
+
decorators: estree.Decorator[];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
2
18
|
|
|
3
19
|
export const VERSION: string;
|
|
4
20
|
|
|
@@ -996,8 +1012,8 @@ type OmittedEstreeKeys =
|
|
|
996
1012
|
| 'comments';
|
|
997
1013
|
type RollupAstNode<T> = Omit<T, OmittedEstreeKeys> & AstNodeLocation;
|
|
998
1014
|
|
|
999
|
-
type ProgramNode = RollupAstNode<Program>;
|
|
1000
|
-
export type AstNode = RollupAstNode<
|
|
1015
|
+
type ProgramNode = RollupAstNode<estree.Program>;
|
|
1016
|
+
export type AstNode = RollupAstNode<estree.Node>;
|
|
1001
1017
|
|
|
1002
1018
|
export function defineConfig(options: RollupOptions): RollupOptions;
|
|
1003
1019
|
export function defineConfig(options: RollupOptions[]): RollupOptions[];
|
package/dist/rollup.js
CHANGED