@rollup/wasm-node 4.18.0 → 4.18.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/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 +256 -287
- package/dist/es/shared/parseAst.js +479 -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.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 +480 -791
- package/dist/shared/rollup.js +255 -286
- 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 +35 -31
package/dist/shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.18.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.18.1
|
|
4
|
+
Mon, 08 Jul 2024 15:24:39 GMT - commit 21f9a4949358b60801c948cd4777d7a39d9e6de0
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -699,7 +699,7 @@ var utils$3 = {};
|
|
|
699
699
|
*/
|
|
700
700
|
|
|
701
701
|
exports.escapeNode = (block, n = 0, type) => {
|
|
702
|
-
|
|
702
|
+
const node = block.nodes[n];
|
|
703
703
|
if (!node) return;
|
|
704
704
|
|
|
705
705
|
if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
|
|
@@ -768,13 +768,23 @@ var utils$3 = {};
|
|
|
768
768
|
|
|
769
769
|
exports.flatten = (...args) => {
|
|
770
770
|
const result = [];
|
|
771
|
+
|
|
771
772
|
const flat = arr => {
|
|
772
773
|
for (let i = 0; i < arr.length; i++) {
|
|
773
|
-
|
|
774
|
-
|
|
774
|
+
const ele = arr[i];
|
|
775
|
+
|
|
776
|
+
if (Array.isArray(ele)) {
|
|
777
|
+
flat(ele);
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
if (ele !== undefined) {
|
|
782
|
+
result.push(ele);
|
|
783
|
+
}
|
|
775
784
|
}
|
|
776
785
|
return result;
|
|
777
786
|
};
|
|
787
|
+
|
|
778
788
|
flat(args);
|
|
779
789
|
return result;
|
|
780
790
|
};
|
|
@@ -783,9 +793,9 @@ var utils$3 = {};
|
|
|
783
793
|
const utils$2 = utils$3;
|
|
784
794
|
|
|
785
795
|
var stringify$4 = (ast, options = {}) => {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
796
|
+
const stringify = (node, parent = {}) => {
|
|
797
|
+
const invalidBlock = options.escapeInvalid && utils$2.isInvalidBrace(parent);
|
|
798
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
789
799
|
let output = '';
|
|
790
800
|
|
|
791
801
|
if (node.value) {
|
|
@@ -800,7 +810,7 @@ var stringify$4 = (ast, options = {}) => {
|
|
|
800
810
|
}
|
|
801
811
|
|
|
802
812
|
if (node.nodes) {
|
|
803
|
-
for (
|
|
813
|
+
for (const child of node.nodes) {
|
|
804
814
|
output += stringify(child);
|
|
805
815
|
}
|
|
806
816
|
}
|
|
@@ -1174,7 +1184,7 @@ const toMaxLen = (input, maxLength) => {
|
|
|
1174
1184
|
return negative ? ('-' + input) : input;
|
|
1175
1185
|
};
|
|
1176
1186
|
|
|
1177
|
-
const toSequence = (parts, options) => {
|
|
1187
|
+
const toSequence = (parts, options, maxLen) => {
|
|
1178
1188
|
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
1179
1189
|
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
1180
1190
|
|
|
@@ -1184,11 +1194,11 @@ const toSequence = (parts, options) => {
|
|
|
1184
1194
|
let result;
|
|
1185
1195
|
|
|
1186
1196
|
if (parts.positives.length) {
|
|
1187
|
-
positives = parts.positives.join('|');
|
|
1197
|
+
positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|');
|
|
1188
1198
|
}
|
|
1189
1199
|
|
|
1190
1200
|
if (parts.negatives.length) {
|
|
1191
|
-
negatives = `-(${prefix}${parts.negatives.join('|')})`;
|
|
1201
|
+
negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`;
|
|
1192
1202
|
}
|
|
1193
1203
|
|
|
1194
1204
|
if (positives && negatives) {
|
|
@@ -1286,7 +1296,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
|
1286
1296
|
|
|
1287
1297
|
if (options.toRegex === true) {
|
|
1288
1298
|
return step > 1
|
|
1289
|
-
? toSequence(parts, options)
|
|
1299
|
+
? toSequence(parts, options, maxLen)
|
|
1290
1300
|
: toRegex(range, null, { wrap: false, ...options });
|
|
1291
1301
|
}
|
|
1292
1302
|
|
|
@@ -1298,7 +1308,6 @@ const fillLetters = (start, end, step = 1, options = {}) => {
|
|
|
1298
1308
|
return invalidRange(start, end, options);
|
|
1299
1309
|
}
|
|
1300
1310
|
|
|
1301
|
-
|
|
1302
1311
|
let format = options.transform || (val => String.fromCharCode(val));
|
|
1303
1312
|
let a = `${start}`.charCodeAt(0);
|
|
1304
1313
|
let b = `${end}`.charCodeAt(0);
|
|
@@ -1366,30 +1375,32 @@ const fill$1 = fillRange;
|
|
|
1366
1375
|
const utils$1 = utils$3;
|
|
1367
1376
|
|
|
1368
1377
|
const compile$1 = (ast, options = {}) => {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1378
|
+
const walk = (node, parent = {}) => {
|
|
1379
|
+
const invalidBlock = utils$1.isInvalidBrace(parent);
|
|
1380
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
1381
|
+
const invalid = invalidBlock === true || invalidNode === true;
|
|
1382
|
+
const prefix = options.escapeInvalid === true ? '\\' : '';
|
|
1374
1383
|
let output = '';
|
|
1375
1384
|
|
|
1376
1385
|
if (node.isOpen === true) {
|
|
1377
1386
|
return prefix + node.value;
|
|
1378
1387
|
}
|
|
1388
|
+
|
|
1379
1389
|
if (node.isClose === true) {
|
|
1390
|
+
console.log('node.isClose', prefix, node.value);
|
|
1380
1391
|
return prefix + node.value;
|
|
1381
1392
|
}
|
|
1382
1393
|
|
|
1383
1394
|
if (node.type === 'open') {
|
|
1384
|
-
return invalid ?
|
|
1395
|
+
return invalid ? prefix + node.value : '(';
|
|
1385
1396
|
}
|
|
1386
1397
|
|
|
1387
1398
|
if (node.type === 'close') {
|
|
1388
|
-
return invalid ?
|
|
1399
|
+
return invalid ? prefix + node.value : ')';
|
|
1389
1400
|
}
|
|
1390
1401
|
|
|
1391
1402
|
if (node.type === 'comma') {
|
|
1392
|
-
return node.prev.type === 'comma' ? '' :
|
|
1403
|
+
return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
|
|
1393
1404
|
}
|
|
1394
1405
|
|
|
1395
1406
|
if (node.value) {
|
|
@@ -1397,8 +1408,8 @@ const compile$1 = (ast, options = {}) => {
|
|
|
1397
1408
|
}
|
|
1398
1409
|
|
|
1399
1410
|
if (node.nodes && node.ranges > 0) {
|
|
1400
|
-
|
|
1401
|
-
|
|
1411
|
+
const args = utils$1.reduce(node.nodes);
|
|
1412
|
+
const range = fill$1(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
|
|
1402
1413
|
|
|
1403
1414
|
if (range.length !== 0) {
|
|
1404
1415
|
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
@@ -1406,10 +1417,11 @@ const compile$1 = (ast, options = {}) => {
|
|
|
1406
1417
|
}
|
|
1407
1418
|
|
|
1408
1419
|
if (node.nodes) {
|
|
1409
|
-
for (
|
|
1420
|
+
for (const child of node.nodes) {
|
|
1410
1421
|
output += walk(child, node);
|
|
1411
1422
|
}
|
|
1412
1423
|
}
|
|
1424
|
+
|
|
1413
1425
|
return output;
|
|
1414
1426
|
};
|
|
1415
1427
|
|
|
@@ -1423,7 +1435,7 @@ const stringify$2 = stringify$4;
|
|
|
1423
1435
|
const utils = utils$3;
|
|
1424
1436
|
|
|
1425
1437
|
const append = (queue = '', stash = '', enclose = false) => {
|
|
1426
|
-
|
|
1438
|
+
const result = [];
|
|
1427
1439
|
|
|
1428
1440
|
queue = [].concat(queue);
|
|
1429
1441
|
stash = [].concat(stash);
|
|
@@ -1433,15 +1445,15 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
1433
1445
|
return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
|
|
1434
1446
|
}
|
|
1435
1447
|
|
|
1436
|
-
for (
|
|
1448
|
+
for (const item of queue) {
|
|
1437
1449
|
if (Array.isArray(item)) {
|
|
1438
|
-
for (
|
|
1450
|
+
for (const value of item) {
|
|
1439
1451
|
result.push(append(value, stash, enclose));
|
|
1440
1452
|
}
|
|
1441
1453
|
} else {
|
|
1442
1454
|
for (let ele of stash) {
|
|
1443
1455
|
if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
|
|
1444
|
-
result.push(Array.isArray(ele) ? append(item, ele, enclose) :
|
|
1456
|
+
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
|
1445
1457
|
}
|
|
1446
1458
|
}
|
|
1447
1459
|
}
|
|
@@ -1449,9 +1461,9 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
1449
1461
|
};
|
|
1450
1462
|
|
|
1451
1463
|
const expand$1 = (ast, options = {}) => {
|
|
1452
|
-
|
|
1464
|
+
const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
|
|
1453
1465
|
|
|
1454
|
-
|
|
1466
|
+
const walk = (node, parent = {}) => {
|
|
1455
1467
|
node.queue = [];
|
|
1456
1468
|
|
|
1457
1469
|
let p = parent;
|
|
@@ -1473,7 +1485,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
1473
1485
|
}
|
|
1474
1486
|
|
|
1475
1487
|
if (node.nodes && node.ranges > 0) {
|
|
1476
|
-
|
|
1488
|
+
const args = utils.reduce(node.nodes);
|
|
1477
1489
|
|
|
1478
1490
|
if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
|
|
1479
1491
|
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
|
|
@@ -1489,7 +1501,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
1489
1501
|
return;
|
|
1490
1502
|
}
|
|
1491
1503
|
|
|
1492
|
-
|
|
1504
|
+
const enclose = utils.encloseBrace(node);
|
|
1493
1505
|
let queue = node.queue;
|
|
1494
1506
|
let block = node;
|
|
1495
1507
|
|
|
@@ -1499,7 +1511,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
1499
1511
|
}
|
|
1500
1512
|
|
|
1501
1513
|
for (let i = 0; i < node.nodes.length; i++) {
|
|
1502
|
-
|
|
1514
|
+
const child = node.nodes[i];
|
|
1503
1515
|
|
|
1504
1516
|
if (child.type === 'comma' && node.type === 'brace') {
|
|
1505
1517
|
if (i === 1) queue.push('');
|
|
@@ -1531,7 +1543,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
1531
1543
|
var expand_1 = expand$1;
|
|
1532
1544
|
|
|
1533
1545
|
var constants$1 = {
|
|
1534
|
-
MAX_LENGTH:
|
|
1546
|
+
MAX_LENGTH: 10000,
|
|
1535
1547
|
|
|
1536
1548
|
// Digits
|
|
1537
1549
|
CHAR_0: '0', /* 0 */
|
|
@@ -1619,18 +1631,18 @@ const parse$1 = (input, options = {}) => {
|
|
|
1619
1631
|
throw new TypeError('Expected a string');
|
|
1620
1632
|
}
|
|
1621
1633
|
|
|
1622
|
-
|
|
1623
|
-
|
|
1634
|
+
const opts = options || {};
|
|
1635
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1624
1636
|
if (input.length > max) {
|
|
1625
1637
|
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
1626
1638
|
}
|
|
1627
1639
|
|
|
1628
|
-
|
|
1629
|
-
|
|
1640
|
+
const ast = { type: 'root', input, nodes: [] };
|
|
1641
|
+
const stack = [ast];
|
|
1630
1642
|
let block = ast;
|
|
1631
1643
|
let prev = ast;
|
|
1632
1644
|
let brackets = 0;
|
|
1633
|
-
|
|
1645
|
+
const length = input.length;
|
|
1634
1646
|
let index = 0;
|
|
1635
1647
|
let depth = 0;
|
|
1636
1648
|
let value;
|
|
@@ -1695,6 +1707,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1695
1707
|
|
|
1696
1708
|
if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1697
1709
|
brackets++;
|
|
1710
|
+
|
|
1698
1711
|
let next;
|
|
1699
1712
|
|
|
1700
1713
|
while (index < length && (next = advance())) {
|
|
@@ -1750,7 +1763,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1750
1763
|
*/
|
|
1751
1764
|
|
|
1752
1765
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
1753
|
-
|
|
1766
|
+
const open = value;
|
|
1754
1767
|
let next;
|
|
1755
1768
|
|
|
1756
1769
|
if (options.keepQuotes !== true) {
|
|
@@ -1782,8 +1795,8 @@ const parse$1 = (input, options = {}) => {
|
|
|
1782
1795
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
1783
1796
|
depth++;
|
|
1784
1797
|
|
|
1785
|
-
|
|
1786
|
-
|
|
1798
|
+
const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
|
|
1799
|
+
const brace = {
|
|
1787
1800
|
type: 'brace',
|
|
1788
1801
|
open: true,
|
|
1789
1802
|
close: false,
|
|
@@ -1810,7 +1823,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1810
1823
|
continue;
|
|
1811
1824
|
}
|
|
1812
1825
|
|
|
1813
|
-
|
|
1826
|
+
const type = 'close';
|
|
1814
1827
|
block = stack.pop();
|
|
1815
1828
|
block.close = true;
|
|
1816
1829
|
|
|
@@ -1828,7 +1841,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1828
1841
|
if (value === CHAR_COMMA && depth > 0) {
|
|
1829
1842
|
if (block.ranges > 0) {
|
|
1830
1843
|
block.ranges = 0;
|
|
1831
|
-
|
|
1844
|
+
const open = block.nodes.shift();
|
|
1832
1845
|
block.nodes = [open, { type: 'text', value: stringify$1(block) }];
|
|
1833
1846
|
}
|
|
1834
1847
|
|
|
@@ -1842,7 +1855,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1842
1855
|
*/
|
|
1843
1856
|
|
|
1844
1857
|
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
|
1845
|
-
|
|
1858
|
+
const siblings = block.nodes;
|
|
1846
1859
|
|
|
1847
1860
|
if (depth === 0 || siblings.length === 0) {
|
|
1848
1861
|
push({ type: 'text', value });
|
|
@@ -1869,7 +1882,7 @@ const parse$1 = (input, options = {}) => {
|
|
|
1869
1882
|
if (prev.type === 'range') {
|
|
1870
1883
|
siblings.pop();
|
|
1871
1884
|
|
|
1872
|
-
|
|
1885
|
+
const before = siblings[siblings.length - 1];
|
|
1873
1886
|
before.value += prev.value + value;
|
|
1874
1887
|
prev = before;
|
|
1875
1888
|
block.ranges--;
|
|
@@ -1902,8 +1915,8 @@ const parse$1 = (input, options = {}) => {
|
|
|
1902
1915
|
});
|
|
1903
1916
|
|
|
1904
1917
|
// get the location of the block on parent.nodes (block's siblings)
|
|
1905
|
-
|
|
1906
|
-
|
|
1918
|
+
const parent = stack[stack.length - 1];
|
|
1919
|
+
const index = parent.nodes.indexOf(block);
|
|
1907
1920
|
// replace the (invalid) block with it's nodes
|
|
1908
1921
|
parent.nodes.splice(index, 1, ...block.nodes);
|
|
1909
1922
|
}
|
|
@@ -1938,8 +1951,8 @@ const braces$1 = (input, options = {}) => {
|
|
|
1938
1951
|
let output = [];
|
|
1939
1952
|
|
|
1940
1953
|
if (Array.isArray(input)) {
|
|
1941
|
-
for (
|
|
1942
|
-
|
|
1954
|
+
for (const pattern of input) {
|
|
1955
|
+
const result = braces$1.create(pattern, options);
|
|
1943
1956
|
if (Array.isArray(result)) {
|
|
1944
1957
|
output.push(...result);
|
|
1945
1958
|
} else {
|
|
@@ -2073,7 +2086,7 @@ braces$1.create = (input, options = {}) => {
|
|
|
2073
2086
|
return [input];
|
|
2074
2087
|
}
|
|
2075
2088
|
|
|
2076
|
-
|
|
2089
|
+
return options.expand !== true
|
|
2077
2090
|
? braces$1.compile(input, options)
|
|
2078
2091
|
: braces$1.expand(input, options);
|
|
2079
2092
|
};
|