@rolldown/browser 1.0.0-beta.29-commit.fe1bea3 → 1.0.0-beta.30
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/cli.cjs +8 -8
- package/dist/cli.mjs +8 -8
- package/dist/config.cjs +3 -3
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/experimental-index.browser.mjs +2 -2
- package/dist/experimental-index.cjs +2 -3
- package/dist/experimental-index.d.cts +3 -3
- package/dist/experimental-index.d.mts +3 -3
- package/dist/experimental-index.mjs +3 -3
- package/dist/filter-index.d.cts +2 -2
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.browser.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.cjs +2 -2
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.cts +2 -2
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.d.cts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasi-browser.js +0 -1
- package/dist/rolldown-binding.wasi.cjs +0 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-BO7hG1pA.d.mts → binding-BAyrv67G.d.cts} +29 -45
- package/dist/shared/{binding-D1lW862e.d.cts → binding-DUz1Q2JW.d.mts} +29 -45
- package/dist/shared/{define-config-CKxZwWu_.d.mts → define-config-5ALh7WDx.d.mts} +67 -9
- package/dist/shared/{define-config-O6TCZLYU.d.cts → define-config-CMH1jWhX.d.cts} +67 -9
- package/dist/shared/{load-config-C2Df0pqb.mjs → load-config-Uk19Sezh.mjs} +2 -2
- package/dist/shared/{load-config-CPJ15pW3.cjs → load-config-XQT0YfAt.cjs} +2 -2
- package/dist/shared/{parse-ast-index-rwZvDBjW.mjs → parse-ast-index-Z-sG_A0I.mjs} +2 -2
- package/dist/shared/{parse-ast-index-CLjgl4c8.cjs → parse-ast-index-ZiMOspE_.cjs} +2 -2
- package/dist/shared/{src-BLxfrK6S.cjs → src-CXCXfLrc.cjs} +88 -136
- package/dist/shared/{src-BWVOVy_u.mjs → src-CkG0t1KT.mjs} +89 -131
- package/dist/{src-CVDDqNxL.js → src-DGzv-S-Z.js} +57 -46
- package/package.json +2 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { and, arraify, code, exclude, id, include, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-DvBwroyk.mjs";
|
|
2
|
-
import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-
|
|
2
|
+
import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-Z-sG_A0I.mjs";
|
|
3
3
|
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
+
import fsp from "node:fs/promises";
|
|
6
7
|
import os from "node:os";
|
|
7
8
|
import { Worker } from "node:worker_threads";
|
|
8
9
|
|
|
@@ -33,7 +34,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
34
|
|
|
34
35
|
//#endregion
|
|
35
36
|
//#region package.json
|
|
36
|
-
var version = "1.0.0-beta.
|
|
37
|
+
var version = "1.0.0-beta.30";
|
|
37
38
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
38
39
|
|
|
39
40
|
//#endregion
|
|
@@ -112,27 +113,6 @@ function viteResolvePlugin(config) {
|
|
|
112
113
|
const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
|
|
113
114
|
return makeBuiltinPluginCallable(builtinPlugin);
|
|
114
115
|
}
|
|
115
|
-
function moduleFederationPlugin(config) {
|
|
116
|
-
return new BuiltinPlugin("builtin:module-federation", {
|
|
117
|
-
...config,
|
|
118
|
-
remotes: config.remotes && Object.entries(config.remotes).map(([name, remote]) => {
|
|
119
|
-
if (typeof remote === "string") {
|
|
120
|
-
const [entryGlobalName] = remote.split("@");
|
|
121
|
-
const entry = remote.replace(entryGlobalName + "@", "");
|
|
122
|
-
return {
|
|
123
|
-
entry,
|
|
124
|
-
name,
|
|
125
|
-
entryGlobalName
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
...remote,
|
|
130
|
-
name: remote.name ?? name
|
|
131
|
-
};
|
|
132
|
-
}),
|
|
133
|
-
manifest: config.manifest === false ? void 0 : config.manifest === true ? {} : config.manifest
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
116
|
function isolatedDeclarationPlugin(config) {
|
|
137
117
|
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
138
118
|
}
|
|
@@ -1476,10 +1456,9 @@ function addError(errors, message) {
|
|
|
1476
1456
|
function handleError(message, config) {
|
|
1477
1457
|
switch (config?.errorMode) {
|
|
1478
1458
|
case "ignore": break;
|
|
1479
|
-
case "warn":
|
|
1459
|
+
case "warn":
|
|
1480
1460
|
console.warn(message);
|
|
1481
1461
|
break;
|
|
1482
|
-
}
|
|
1483
1462
|
default: throw new Error(message);
|
|
1484
1463
|
}
|
|
1485
1464
|
}
|
|
@@ -1496,10 +1475,9 @@ function convertAction(jsonSchema, valibotAction, config) {
|
|
|
1496
1475
|
if (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;
|
|
1497
1476
|
let errors;
|
|
1498
1477
|
switch (valibotAction.type) {
|
|
1499
|
-
case "base64":
|
|
1478
|
+
case "base64":
|
|
1500
1479
|
jsonSchema.contentEncoding = "base64";
|
|
1501
1480
|
break;
|
|
1502
|
-
}
|
|
1503
1481
|
case "bic":
|
|
1504
1482
|
case "cuid2":
|
|
1505
1483
|
case "decimal":
|
|
@@ -1509,57 +1487,46 @@ function convertAction(jsonSchema, valibotAction, config) {
|
|
|
1509
1487
|
case "hex_color":
|
|
1510
1488
|
case "nanoid":
|
|
1511
1489
|
case "octal":
|
|
1512
|
-
case "ulid":
|
|
1490
|
+
case "ulid":
|
|
1513
1491
|
jsonSchema.pattern = valibotAction.requirement.source;
|
|
1514
1492
|
break;
|
|
1515
|
-
|
|
1516
|
-
case "description": {
|
|
1493
|
+
case "description":
|
|
1517
1494
|
jsonSchema.description = valibotAction.description;
|
|
1518
1495
|
break;
|
|
1519
|
-
|
|
1520
|
-
case "email": {
|
|
1496
|
+
case "email":
|
|
1521
1497
|
jsonSchema.format = "email";
|
|
1522
1498
|
break;
|
|
1523
|
-
|
|
1524
|
-
case "empty": {
|
|
1499
|
+
case "empty":
|
|
1525
1500
|
if (jsonSchema.type === "array") jsonSchema.maxItems = 0;
|
|
1526
1501
|
else {
|
|
1527
1502
|
if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
|
|
1528
1503
|
jsonSchema.maxLength = 0;
|
|
1529
1504
|
}
|
|
1530
1505
|
break;
|
|
1531
|
-
|
|
1532
|
-
case "entries": {
|
|
1506
|
+
case "entries":
|
|
1533
1507
|
jsonSchema.minProperties = valibotAction.requirement;
|
|
1534
1508
|
jsonSchema.maxProperties = valibotAction.requirement;
|
|
1535
1509
|
break;
|
|
1536
|
-
|
|
1537
|
-
case "integer": {
|
|
1510
|
+
case "integer":
|
|
1538
1511
|
jsonSchema.type = "integer";
|
|
1539
1512
|
break;
|
|
1540
|
-
|
|
1541
|
-
case "ipv4": {
|
|
1513
|
+
case "ipv4":
|
|
1542
1514
|
jsonSchema.format = "ipv4";
|
|
1543
1515
|
break;
|
|
1544
|
-
|
|
1545
|
-
case "ipv6": {
|
|
1516
|
+
case "ipv6":
|
|
1546
1517
|
jsonSchema.format = "ipv6";
|
|
1547
1518
|
break;
|
|
1548
|
-
|
|
1549
|
-
case "iso_date": {
|
|
1519
|
+
case "iso_date":
|
|
1550
1520
|
jsonSchema.format = "date";
|
|
1551
1521
|
break;
|
|
1552
|
-
}
|
|
1553
1522
|
case "iso_date_time":
|
|
1554
|
-
case "iso_timestamp":
|
|
1523
|
+
case "iso_timestamp":
|
|
1555
1524
|
jsonSchema.format = "date-time";
|
|
1556
1525
|
break;
|
|
1557
|
-
|
|
1558
|
-
case "iso_time": {
|
|
1526
|
+
case "iso_time":
|
|
1559
1527
|
jsonSchema.format = "time";
|
|
1560
1528
|
break;
|
|
1561
|
-
|
|
1562
|
-
case "length": {
|
|
1529
|
+
case "length":
|
|
1563
1530
|
if (jsonSchema.type === "array") {
|
|
1564
1531
|
jsonSchema.minItems = valibotAction.requirement;
|
|
1565
1532
|
jsonSchema.maxItems = valibotAction.requirement;
|
|
@@ -1569,80 +1536,65 @@ function convertAction(jsonSchema, valibotAction, config) {
|
|
|
1569
1536
|
jsonSchema.maxLength = valibotAction.requirement;
|
|
1570
1537
|
}
|
|
1571
1538
|
break;
|
|
1572
|
-
|
|
1573
|
-
case "max_entries": {
|
|
1539
|
+
case "max_entries":
|
|
1574
1540
|
jsonSchema.maxProperties = valibotAction.requirement;
|
|
1575
1541
|
break;
|
|
1576
|
-
|
|
1577
|
-
case "max_length": {
|
|
1542
|
+
case "max_length":
|
|
1578
1543
|
if (jsonSchema.type === "array") jsonSchema.maxItems = valibotAction.requirement;
|
|
1579
1544
|
else {
|
|
1580
1545
|
if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
|
|
1581
1546
|
jsonSchema.maxLength = valibotAction.requirement;
|
|
1582
1547
|
}
|
|
1583
1548
|
break;
|
|
1584
|
-
|
|
1585
|
-
case "max_value": {
|
|
1549
|
+
case "max_value":
|
|
1586
1550
|
if (jsonSchema.type !== "number") errors = addError(errors, `The "max_value" action is not supported on type "${jsonSchema.type}".`);
|
|
1587
1551
|
jsonSchema.maximum = valibotAction.requirement;
|
|
1588
1552
|
break;
|
|
1589
|
-
|
|
1590
|
-
case "metadata": {
|
|
1553
|
+
case "metadata":
|
|
1591
1554
|
if (typeof valibotAction.metadata.title === "string") jsonSchema.title = valibotAction.metadata.title;
|
|
1592
1555
|
if (typeof valibotAction.metadata.description === "string") jsonSchema.description = valibotAction.metadata.description;
|
|
1593
1556
|
if (Array.isArray(valibotAction.metadata.examples)) jsonSchema.examples = valibotAction.metadata.examples;
|
|
1594
1557
|
break;
|
|
1595
|
-
|
|
1596
|
-
case "min_entries": {
|
|
1558
|
+
case "min_entries":
|
|
1597
1559
|
jsonSchema.minProperties = valibotAction.requirement;
|
|
1598
1560
|
break;
|
|
1599
|
-
|
|
1600
|
-
case "min_length": {
|
|
1561
|
+
case "min_length":
|
|
1601
1562
|
if (jsonSchema.type === "array") jsonSchema.minItems = valibotAction.requirement;
|
|
1602
1563
|
else {
|
|
1603
1564
|
if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
|
|
1604
1565
|
jsonSchema.minLength = valibotAction.requirement;
|
|
1605
1566
|
}
|
|
1606
1567
|
break;
|
|
1607
|
-
|
|
1608
|
-
case "min_value": {
|
|
1568
|
+
case "min_value":
|
|
1609
1569
|
if (jsonSchema.type !== "number") errors = addError(errors, `The "min_value" action is not supported on type "${jsonSchema.type}".`);
|
|
1610
1570
|
jsonSchema.minimum = valibotAction.requirement;
|
|
1611
1571
|
break;
|
|
1612
|
-
|
|
1613
|
-
case "multiple_of": {
|
|
1572
|
+
case "multiple_of":
|
|
1614
1573
|
jsonSchema.multipleOf = valibotAction.requirement;
|
|
1615
1574
|
break;
|
|
1616
|
-
|
|
1617
|
-
case "non_empty": {
|
|
1575
|
+
case "non_empty":
|
|
1618
1576
|
if (jsonSchema.type === "array") jsonSchema.minItems = 1;
|
|
1619
1577
|
else {
|
|
1620
1578
|
if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
|
|
1621
1579
|
jsonSchema.minLength = 1;
|
|
1622
1580
|
}
|
|
1623
1581
|
break;
|
|
1624
|
-
|
|
1625
|
-
case "regex": {
|
|
1582
|
+
case "regex":
|
|
1626
1583
|
if (valibotAction.requirement.flags) errors = addError(errors, "RegExp flags are not supported by JSON Schema.");
|
|
1627
1584
|
jsonSchema.pattern = valibotAction.requirement.source;
|
|
1628
1585
|
break;
|
|
1629
|
-
|
|
1630
|
-
case "title": {
|
|
1586
|
+
case "title":
|
|
1631
1587
|
jsonSchema.title = valibotAction.title;
|
|
1632
1588
|
break;
|
|
1633
|
-
|
|
1634
|
-
case "url": {
|
|
1589
|
+
case "url":
|
|
1635
1590
|
jsonSchema.format = "uri";
|
|
1636
1591
|
break;
|
|
1637
|
-
|
|
1638
|
-
case "uuid": {
|
|
1592
|
+
case "uuid":
|
|
1639
1593
|
jsonSchema.format = "uuid";
|
|
1640
1594
|
break;
|
|
1641
|
-
|
|
1642
|
-
case "value": {
|
|
1595
|
+
case "value":
|
|
1643
1596
|
jsonSchema.const = valibotAction.requirement;
|
|
1644
1597
|
break;
|
|
1645
|
-
}
|
|
1646
1598
|
default: errors = addError(errors, `The "${valibotAction.type}" action cannot be converted to JSON Schema.`);
|
|
1647
1599
|
}
|
|
1648
1600
|
if (config?.overrideAction) {
|
|
@@ -1717,31 +1669,26 @@ function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = fal
|
|
|
1717
1669
|
}
|
|
1718
1670
|
let errors;
|
|
1719
1671
|
switch (valibotSchema.type) {
|
|
1720
|
-
case "boolean":
|
|
1672
|
+
case "boolean":
|
|
1721
1673
|
jsonSchema.type = "boolean";
|
|
1722
1674
|
break;
|
|
1723
|
-
|
|
1724
|
-
case "null": {
|
|
1675
|
+
case "null":
|
|
1725
1676
|
jsonSchema.type = "null";
|
|
1726
1677
|
break;
|
|
1727
|
-
|
|
1728
|
-
case "number": {
|
|
1678
|
+
case "number":
|
|
1729
1679
|
jsonSchema.type = "number";
|
|
1730
1680
|
break;
|
|
1731
|
-
|
|
1732
|
-
case "string": {
|
|
1681
|
+
case "string":
|
|
1733
1682
|
jsonSchema.type = "string";
|
|
1734
1683
|
break;
|
|
1735
|
-
|
|
1736
|
-
case "array": {
|
|
1684
|
+
case "array":
|
|
1737
1685
|
jsonSchema.type = "array";
|
|
1738
1686
|
jsonSchema.items = convertSchema({}, valibotSchema.item, config, context);
|
|
1739
1687
|
break;
|
|
1740
|
-
}
|
|
1741
1688
|
case "tuple":
|
|
1742
1689
|
case "tuple_with_rest":
|
|
1743
1690
|
case "loose_tuple":
|
|
1744
|
-
case "strict_tuple":
|
|
1691
|
+
case "strict_tuple":
|
|
1745
1692
|
jsonSchema.type = "array";
|
|
1746
1693
|
jsonSchema.items = [];
|
|
1747
1694
|
jsonSchema.minItems = valibotSchema.items.length;
|
|
@@ -1749,11 +1696,10 @@ function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = fal
|
|
|
1749
1696
|
if (valibotSchema.type === "tuple_with_rest") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);
|
|
1750
1697
|
else if (valibotSchema.type === "strict_tuple") jsonSchema.additionalItems = false;
|
|
1751
1698
|
break;
|
|
1752
|
-
}
|
|
1753
1699
|
case "object":
|
|
1754
1700
|
case "object_with_rest":
|
|
1755
1701
|
case "loose_object":
|
|
1756
|
-
case "strict_object":
|
|
1702
|
+
case "strict_object":
|
|
1757
1703
|
jsonSchema.type = "object";
|
|
1758
1704
|
jsonSchema.properties = {};
|
|
1759
1705
|
jsonSchema.required = [];
|
|
@@ -1765,52 +1711,43 @@ function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = fal
|
|
|
1765
1711
|
if (valibotSchema.type === "object_with_rest") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);
|
|
1766
1712
|
else if (valibotSchema.type === "strict_object") jsonSchema.additionalProperties = false;
|
|
1767
1713
|
break;
|
|
1768
|
-
|
|
1769
|
-
case "record": {
|
|
1714
|
+
case "record":
|
|
1770
1715
|
if ("pipe" in valibotSchema.key) errors = addError(errors, "The \"record\" schema with a schema for the key that contains a \"pipe\" cannot be converted to JSON Schema.");
|
|
1771
1716
|
if (valibotSchema.key.type !== "string") errors = addError(errors, `The "record" schema with the "${valibotSchema.key.type}" schema for the key cannot be converted to JSON Schema.`);
|
|
1772
1717
|
jsonSchema.type = "object";
|
|
1773
1718
|
jsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);
|
|
1774
1719
|
break;
|
|
1775
|
-
}
|
|
1776
1720
|
case "any":
|
|
1777
1721
|
case "unknown": break;
|
|
1778
1722
|
case "nullable":
|
|
1779
|
-
case "nullish":
|
|
1723
|
+
case "nullish":
|
|
1780
1724
|
jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: "null" }];
|
|
1781
1725
|
if (valibotSchema.default !== void 0) jsonSchema.default = getDefault(valibotSchema);
|
|
1782
1726
|
break;
|
|
1783
|
-
}
|
|
1784
1727
|
case "exact_optional":
|
|
1785
1728
|
case "optional":
|
|
1786
|
-
case "undefinedable":
|
|
1729
|
+
case "undefinedable":
|
|
1787
1730
|
jsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);
|
|
1788
1731
|
if (valibotSchema.default !== void 0) jsonSchema.default = getDefault(valibotSchema);
|
|
1789
1732
|
break;
|
|
1790
|
-
|
|
1791
|
-
case "literal": {
|
|
1733
|
+
case "literal":
|
|
1792
1734
|
if (typeof valibotSchema.literal !== "boolean" && typeof valibotSchema.literal !== "number" && typeof valibotSchema.literal !== "string") errors = addError(errors, "The value of the \"literal\" schema is not JSON compatible.");
|
|
1793
1735
|
jsonSchema.const = valibotSchema.literal;
|
|
1794
1736
|
break;
|
|
1795
|
-
|
|
1796
|
-
case "enum": {
|
|
1737
|
+
case "enum":
|
|
1797
1738
|
jsonSchema.enum = valibotSchema.options;
|
|
1798
1739
|
break;
|
|
1799
|
-
|
|
1800
|
-
case "picklist": {
|
|
1740
|
+
case "picklist":
|
|
1801
1741
|
if (valibotSchema.options.some((option) => typeof option !== "number" && typeof option !== "string")) errors = addError(errors, "An option of the \"picklist\" schema is not JSON compatible.");
|
|
1802
1742
|
jsonSchema.enum = valibotSchema.options;
|
|
1803
1743
|
break;
|
|
1804
|
-
}
|
|
1805
1744
|
case "union":
|
|
1806
|
-
case "variant":
|
|
1745
|
+
case "variant":
|
|
1807
1746
|
jsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
|
|
1808
1747
|
break;
|
|
1809
|
-
|
|
1810
|
-
case "intersect": {
|
|
1748
|
+
case "intersect":
|
|
1811
1749
|
jsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
|
|
1812
1750
|
break;
|
|
1813
|
-
}
|
|
1814
1751
|
case "lazy": {
|
|
1815
1752
|
let wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);
|
|
1816
1753
|
if (!wrappedValibotSchema) {
|
|
@@ -1887,7 +1824,7 @@ function toJsonSchema(schema, config) {
|
|
|
1887
1824
|
|
|
1888
1825
|
//#endregion
|
|
1889
1826
|
//#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs
|
|
1890
|
-
var require_ansis = __commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs"(exports, module) {
|
|
1827
|
+
var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs": ((exports, module) => {
|
|
1891
1828
|
let e, t, r, { defineProperty: n, setPrototypeOf: l, create: o, keys: s } = Object, i$1 = "", { round: c, max: a$1 } = Math, p = (e$1) => {
|
|
1892
1829
|
let t$1 = /([a-f\d]{3,6})/i.exec(e$1)?.[1], r$1 = t$1?.length, n$1 = parseInt(6 ^ r$1 ? 3 ^ r$1 ? "0" : t$1[0] + t$1[0] + t$1[1] + t$1[1] + t$1[2] + t$1[2] : t$1, 16);
|
|
1893
1830
|
return [
|
|
@@ -1988,11 +1925,11 @@ var require_ansis = __commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modu
|
|
|
1988
1925
|
})), t$1.extend(M);
|
|
1989
1926
|
}, y = new w();
|
|
1990
1927
|
module.exports = y, y.default = y;
|
|
1991
|
-
} });
|
|
1928
|
+
}) });
|
|
1992
1929
|
|
|
1993
1930
|
//#endregion
|
|
1994
1931
|
//#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.mjs
|
|
1995
|
-
var import_ansis = __toESM(require_ansis(), 1);
|
|
1932
|
+
var import_ansis = /* @__PURE__ */ __toESM(require_ansis(), 1);
|
|
1996
1933
|
var ansis_default = import_ansis.default;
|
|
1997
1934
|
const { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, bold, dim, italic, underline, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = import_ansis.default;
|
|
1998
1935
|
|
|
@@ -2144,7 +2081,10 @@ const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
|
2144
2081
|
unknownGlobalSideEffects: optional(boolean()),
|
|
2145
2082
|
commonjs: optional(boolean())
|
|
2146
2083
|
})]);
|
|
2147
|
-
const OptimizationOptionsSchema = strictObject({
|
|
2084
|
+
const OptimizationOptionsSchema = strictObject({
|
|
2085
|
+
inlineConst: pipe(optional(boolean()), description("Enable crossmodule constant inlining")),
|
|
2086
|
+
pifeForModuleWrappers: pipe(optional(boolean()), description("Use PIFE pattern for module wrappers"))
|
|
2087
|
+
});
|
|
2148
2088
|
const OnLogSchema = pipe(function_(), args(tuple([
|
|
2149
2089
|
LogLevelSchema,
|
|
2150
2090
|
RollupLogSchema,
|
|
@@ -2299,6 +2239,7 @@ const OutputOptionsSchema = strictObject({
|
|
|
2299
2239
|
literal("inline"),
|
|
2300
2240
|
literal("hidden")
|
|
2301
2241
|
])), description(`Generate sourcemap (\`-s inline\` for inline, or ${ansis_default.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
|
|
2242
|
+
sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
|
|
2302
2243
|
sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
|
|
2303
2244
|
sourcemapIgnoreList: optional(union([boolean(), custom(() => true)])),
|
|
2304
2245
|
sourcemapPathTransform: optional(custom(() => true)),
|
|
@@ -2616,44 +2557,38 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
2616
2557
|
});
|
|
2617
2558
|
break;
|
|
2618
2559
|
}
|
|
2619
|
-
case "not":
|
|
2560
|
+
case "not":
|
|
2620
2561
|
bindingifyFilterExprImpl(expr.expr, list);
|
|
2621
2562
|
list.push({ kind: "Not" });
|
|
2622
2563
|
break;
|
|
2623
|
-
|
|
2624
|
-
case "id": {
|
|
2564
|
+
case "id":
|
|
2625
2565
|
list.push({
|
|
2626
2566
|
kind: "Id",
|
|
2627
2567
|
payload: expr.pattern
|
|
2628
2568
|
});
|
|
2629
2569
|
if (expr.params.cleanUrl) list.push({ kind: "CleanUrl" });
|
|
2630
2570
|
break;
|
|
2631
|
-
|
|
2632
|
-
case "moduleType": {
|
|
2571
|
+
case "moduleType":
|
|
2633
2572
|
list.push({
|
|
2634
2573
|
kind: "ModuleType",
|
|
2635
2574
|
payload: expr.pattern
|
|
2636
2575
|
});
|
|
2637
2576
|
break;
|
|
2638
|
-
|
|
2639
|
-
case "code": {
|
|
2577
|
+
case "code":
|
|
2640
2578
|
list.push({
|
|
2641
2579
|
kind: "Code",
|
|
2642
2580
|
payload: expr.pattern
|
|
2643
2581
|
});
|
|
2644
2582
|
break;
|
|
2645
|
-
|
|
2646
|
-
case "include": {
|
|
2583
|
+
case "include":
|
|
2647
2584
|
bindingifyFilterExprImpl(expr.expr, list);
|
|
2648
2585
|
list.push({ kind: "Include" });
|
|
2649
2586
|
break;
|
|
2650
|
-
|
|
2651
|
-
case "exclude": {
|
|
2587
|
+
case "exclude":
|
|
2652
2588
|
bindingifyFilterExprImpl(expr.expr, list);
|
|
2653
2589
|
list.push({ kind: "Exclude" });
|
|
2654
2590
|
break;
|
|
2655
|
-
|
|
2656
|
-
case "query": {
|
|
2591
|
+
case "query":
|
|
2657
2592
|
list.push({
|
|
2658
2593
|
kind: "QueryKey",
|
|
2659
2594
|
payload: expr.key
|
|
@@ -2663,7 +2598,6 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
2663
2598
|
payload: expr.pattern
|
|
2664
2599
|
});
|
|
2665
2600
|
break;
|
|
2666
|
-
}
|
|
2667
2601
|
default: throw new Error(`Unknown filter expression: ${expr}`);
|
|
2668
2602
|
}
|
|
2669
2603
|
}
|
|
@@ -2714,9 +2648,28 @@ function bindingAssetSource(source) {
|
|
|
2714
2648
|
return { inner: source };
|
|
2715
2649
|
}
|
|
2716
2650
|
|
|
2651
|
+
//#endregion
|
|
2652
|
+
//#region src/plugin/fs.ts
|
|
2653
|
+
const fsModule = {
|
|
2654
|
+
appendFile: fsp.appendFile,
|
|
2655
|
+
copyFile: fsp.copyFile,
|
|
2656
|
+
mkdir: fsp.mkdir,
|
|
2657
|
+
mkdtemp: fsp.mkdtemp,
|
|
2658
|
+
readdir: fsp.readdir,
|
|
2659
|
+
readFile: fsp.readFile,
|
|
2660
|
+
realpath: fsp.realpath,
|
|
2661
|
+
rename: fsp.rename,
|
|
2662
|
+
rmdir: fsp.rmdir,
|
|
2663
|
+
stat: fsp.stat,
|
|
2664
|
+
lstat: fsp.lstat,
|
|
2665
|
+
unlink: fsp.unlink,
|
|
2666
|
+
writeFile: fsp.writeFile
|
|
2667
|
+
};
|
|
2668
|
+
|
|
2717
2669
|
//#endregion
|
|
2718
2670
|
//#region src/plugin/plugin-context.ts
|
|
2719
2671
|
var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
2672
|
+
fs = fsModule;
|
|
2720
2673
|
getModuleInfo;
|
|
2721
2674
|
constructor(outputOptions, context, plugin, data, onLog, logLevel, watchMode, currentLoadingModule) {
|
|
2722
2675
|
super(onLog, logLevel, plugin.name, watchMode);
|
|
@@ -3634,7 +3587,7 @@ var ChunkingContextImpl = class {
|
|
|
3634
3587
|
//#endregion
|
|
3635
3588
|
//#region src/utils/bindingify-output-options.ts
|
|
3636
3589
|
function bindingifyOutputOptions(outputOptions) {
|
|
3637
|
-
const { dir, format, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
3590
|
+
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
3638
3591
|
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3639
3592
|
return {
|
|
3640
3593
|
dir,
|
|
@@ -3643,6 +3596,7 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
3643
3596
|
exports,
|
|
3644
3597
|
hashCharacters,
|
|
3645
3598
|
sourcemap: bindingifySourcemap(sourcemap),
|
|
3599
|
+
sourcemapBaseUrl,
|
|
3646
3600
|
sourcemapDebugIds,
|
|
3647
3601
|
sourcemapIgnoreList: bindingifySourcemapIgnoreList(sourcemapIgnoreList),
|
|
3648
3602
|
sourcemapPathTransform,
|
|
@@ -4377,8 +4331,12 @@ var RolldownBuild = class {
|
|
|
4377
4331
|
await this.close();
|
|
4378
4332
|
}
|
|
4379
4333
|
async generateHmrPatch(changedFiles) {
|
|
4380
|
-
const
|
|
4381
|
-
|
|
4334
|
+
const ret = await this.#bundlerImpl.impl.generateHmrPatch(changedFiles);
|
|
4335
|
+
switch (ret.type) {
|
|
4336
|
+
case "Ok": return ret.field0;
|
|
4337
|
+
case "Error": throw normalizeErrors(ret.field0);
|
|
4338
|
+
default: throw new Error("Unknown error");
|
|
4339
|
+
}
|
|
4382
4340
|
}
|
|
4383
4341
|
async hmrInvalidate(file, firstInvalidatedBy) {
|
|
4384
4342
|
const output = await this.#bundlerImpl.impl.hmrInvalidate(file, firstInvalidatedBy);
|
|
@@ -4556,4 +4514,4 @@ function defineConfig(config) {
|
|
|
4556
4514
|
const VERSION = version;
|
|
4557
4515
|
|
|
4558
4516
|
//#endregion
|
|
4559
|
-
export { BuiltinPlugin, PluginContextData, PluginDriver, VERSION, __commonJS, __toESM, ansis_default, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, createBundlerImpl, defineConfig, description$1 as description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin,
|
|
4517
|
+
export { BuiltinPlugin, PluginContextData, PluginDriver, VERSION, __commonJS, __toESM, ansis_default, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, createBundlerImpl, defineConfig, description$1 as description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
|