@rolldown/browser 1.0.0-rc.1 → 1.0.0-rc.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/dist/cli.mjs +8 -8
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +5 -5
- package/dist/experimental-index.browser.mjs +1 -1
- package/dist/experimental-index.d.mts +41 -41
- package/dist/experimental-index.mjs +3 -3
- package/dist/filter-index.d.mts +1 -1
- package/dist/get-log-filter.d.mts +1 -1
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +5 -5
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.mts +3 -3
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-C4tDS_XC.js → rolldown-build-BntP6Bjl.js} +115 -107
- package/dist/shared/{bindingify-input-options-Bp2kpiI8.mjs → bindingify-input-options-CObJx_Uj.mjs} +10 -5
- package/dist/shared/define-config-C-sO_cLw.d.mts +3679 -0
- package/dist/shared/{load-config-BBZgIUGN.mjs → load-config-hx3WBhLe.mjs} +1 -1
- package/dist/shared/{logging-Nvu645a7.d.mts → logging-RB67zQ4N.d.mts} +6 -6
- package/dist/shared/{parse-ast-index-2ahkCVK6.mjs → parse-ast-index-BQpfNG1v.mjs} +1 -1
- package/dist/shared/{prompt-B6NrDD1-.mjs → prompt-CYPmuhh-.mjs} +3 -3
- package/dist/shared/{rolldown-C0_W0QdY.mjs → rolldown-D2E0YTeB.mjs} +1 -1
- package/dist/shared/{rolldown-build-DLuUhuNw.mjs → rolldown-build-Do6WlRGM.mjs} +106 -103
- package/dist/shared/{types-CIYK49jr.d.mts → types-CIhJMr1h.d.mts} +2 -2
- package/dist/shared/{watch-eIop0yN6.mjs → watch-BsneBCNP.mjs} +4 -4
- package/package.json +1 -1
- package/dist/shared/define-config-CDlEOpr1.d.mts +0 -3531
|
@@ -9,9 +9,9 @@ interface RolldownLog {
|
|
|
9
9
|
binding?: string;
|
|
10
10
|
cause?: unknown;
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* The log code for this log object.
|
|
13
|
+
* @example 'PLUGIN_ERROR'
|
|
14
|
+
*/
|
|
15
15
|
code?: string;
|
|
16
16
|
exporter?: string;
|
|
17
17
|
frame?: string;
|
|
@@ -24,9 +24,9 @@ interface RolldownLog {
|
|
|
24
24
|
line: number;
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
* The message for this log object.
|
|
28
|
+
* @example 'The "transform" hook used by the output plugin "rolldown-plugin-foo" is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.'
|
|
29
|
+
*/
|
|
30
30
|
message: string;
|
|
31
31
|
meta?: any;
|
|
32
32
|
names?: string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./logs-B2CASPcx.mjs";
|
|
2
2
|
import { parse, parseSync } from "../rolldown-binding.wasi.cjs";
|
|
3
3
|
|
|
4
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
4
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.111.0/node_modules/oxc-parser/src-js/wrap.js
|
|
5
5
|
function wrap$1(result) {
|
|
6
6
|
let program, module, comments, errors;
|
|
7
7
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import process$1, { stdin, stdout } from "node:process";
|
|
2
2
|
import { WriteStream } from "node:tty";
|
|
3
|
-
import f
|
|
3
|
+
import f from "node:readline";
|
|
4
4
|
|
|
5
5
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/chunks/prompt.mjs
|
|
6
6
|
function getDefaultExportFromCjs(x) {
|
|
@@ -481,13 +481,13 @@ var x = class {
|
|
|
481
481
|
const e = new WriteStream(0);
|
|
482
482
|
e._write = (s, i, D) => {
|
|
483
483
|
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
|
|
484
|
-
}, this.input.pipe(e), this.rl = f
|
|
484
|
+
}, this.input.pipe(e), this.rl = f.createInterface({
|
|
485
485
|
input: this.input,
|
|
486
486
|
output: e,
|
|
487
487
|
tabSize: 2,
|
|
488
488
|
prompt: "",
|
|
489
489
|
escapeCodeTimeout: 50
|
|
490
|
-
}), f
|
|
490
|
+
}), f.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), d$1(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
491
491
|
this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d$1(this.input, false), u(this.value);
|
|
492
492
|
}), this.once("cancel", () => {
|
|
493
493
|
this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d$1(this.input, false), u(S);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as logInputHookInOutputPlugin, n as error } from "./logs-B2CASPcx.mjs";
|
|
2
2
|
import { n as BuiltinPlugin } from "./normalize-string-or-regex-DIwprzLy.mjs";
|
|
3
|
-
import { S as VERSION, _ as LOG_LEVEL_DEBUG, b as LOG_LEVEL_WARN, c as transformToRollupOutput, d as transformAssetSource, f as lazyProp, g as normalizeLog, h as normalizeHook, i as transformModuleInfo, l as transformRenderedChunk, m as MinimalPluginContextImpl, p as PlainObjectLike, s as unwrapBindingResult, t as bindingifyInputOptions, u as __decorate, v as LOG_LEVEL_ERROR, x as logLevelPriority, y as LOG_LEVEL_INFO } from "./bindingify-input-options-
|
|
3
|
+
import { S as VERSION, _ as LOG_LEVEL_DEBUG, b as LOG_LEVEL_WARN, c as transformToRollupOutput, d as transformAssetSource, f as lazyProp, g as normalizeLog, h as normalizeHook, i as transformModuleInfo, l as transformRenderedChunk, m as MinimalPluginContextImpl, p as PlainObjectLike, s as unwrapBindingResult, t as bindingifyInputOptions, u as __decorate, v as LOG_LEVEL_ERROR, x as logLevelPriority, y as LOG_LEVEL_INFO } from "./bindingify-input-options-CObJx_Uj.mjs";
|
|
4
4
|
import { v as unimplemented } from "./composable-filters-CIxSuZSM.mjs";
|
|
5
5
|
import { Worker } from "node:worker_threads";
|
|
6
6
|
import { BindingBundler, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
@@ -537,6 +537,19 @@ function getDefault(schema, dataset, config$1) {
|
|
|
537
537
|
return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
|
|
538
538
|
}
|
|
539
539
|
/**
|
|
540
|
+
* Checks if the input matches the schema. By using a type predicate, this
|
|
541
|
+
* function can be used as a type guard.
|
|
542
|
+
*
|
|
543
|
+
* @param schema The schema to be used.
|
|
544
|
+
* @param input The input to be tested.
|
|
545
|
+
*
|
|
546
|
+
* @returns Whether the input matches the schema.
|
|
547
|
+
*/
|
|
548
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
549
|
+
function is(schema, input) {
|
|
550
|
+
return !schema["~run"]({ value: input }, { abortEarly: true }).issues;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
540
553
|
* Creates an any schema.
|
|
541
554
|
*
|
|
542
555
|
* Hint: This schema function exists only for completeness and is not
|
|
@@ -709,74 +722,6 @@ function literal(literal_, message$1) {
|
|
|
709
722
|
};
|
|
710
723
|
}
|
|
711
724
|
/* @__NO_SIDE_EFFECTS__ */
|
|
712
|
-
function looseObject(entries$1, message$1) {
|
|
713
|
-
return {
|
|
714
|
-
kind: "schema",
|
|
715
|
-
type: "loose_object",
|
|
716
|
-
reference: looseObject,
|
|
717
|
-
expects: "Object",
|
|
718
|
-
async: false,
|
|
719
|
-
entries: entries$1,
|
|
720
|
-
message: message$1,
|
|
721
|
-
get "~standard"() {
|
|
722
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
723
|
-
},
|
|
724
|
-
"~run"(dataset, config$1) {
|
|
725
|
-
const input = dataset.value;
|
|
726
|
-
if (input && typeof input === "object") {
|
|
727
|
-
dataset.typed = true;
|
|
728
|
-
dataset.value = {};
|
|
729
|
-
for (const key in this.entries) {
|
|
730
|
-
const valueSchema = this.entries[key];
|
|
731
|
-
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
732
|
-
const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
733
|
-
const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
|
|
734
|
-
if (valueDataset.issues) {
|
|
735
|
-
const pathItem = {
|
|
736
|
-
type: "object",
|
|
737
|
-
origin: "value",
|
|
738
|
-
input,
|
|
739
|
-
key,
|
|
740
|
-
value: value$1
|
|
741
|
-
};
|
|
742
|
-
for (const issue of valueDataset.issues) {
|
|
743
|
-
if (issue.path) issue.path.unshift(pathItem);
|
|
744
|
-
else issue.path = [pathItem];
|
|
745
|
-
dataset.issues?.push(issue);
|
|
746
|
-
}
|
|
747
|
-
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
748
|
-
if (config$1.abortEarly) {
|
|
749
|
-
dataset.typed = false;
|
|
750
|
-
break;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
if (!valueDataset.typed) dataset.typed = false;
|
|
754
|
-
dataset.value[key] = valueDataset.value;
|
|
755
|
-
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
756
|
-
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
757
|
-
_addIssue(this, "key", dataset, config$1, {
|
|
758
|
-
input: void 0,
|
|
759
|
-
expected: `"${key}"`,
|
|
760
|
-
path: [{
|
|
761
|
-
type: "object",
|
|
762
|
-
origin: "key",
|
|
763
|
-
input,
|
|
764
|
-
key,
|
|
765
|
-
value: input[key]
|
|
766
|
-
}]
|
|
767
|
-
});
|
|
768
|
-
if (config$1.abortEarly) break;
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
if (!dataset.issues || !config$1.abortEarly) {
|
|
772
|
-
for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
|
|
773
|
-
}
|
|
774
|
-
} else _addIssue(this, "type", dataset, config$1);
|
|
775
|
-
return dataset;
|
|
776
|
-
}
|
|
777
|
-
};
|
|
778
|
-
}
|
|
779
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
780
725
|
function never(message$1) {
|
|
781
726
|
return {
|
|
782
727
|
kind: "schema",
|
|
@@ -1491,7 +1436,9 @@ function styleText$1(...args) {
|
|
|
1491
1436
|
|
|
1492
1437
|
//#endregion
|
|
1493
1438
|
//#region src/utils/validator.ts
|
|
1439
|
+
function isTypeTrue() {}
|
|
1494
1440
|
const StringOrRegExpSchema = union([string(), instance(RegExp)]);
|
|
1441
|
+
isTypeTrue();
|
|
1495
1442
|
function vFunction() {
|
|
1496
1443
|
return function_();
|
|
1497
1444
|
}
|
|
@@ -1500,25 +1447,32 @@ const LogLevelSchema = union([
|
|
|
1500
1447
|
literal("info"),
|
|
1501
1448
|
literal("warn")
|
|
1502
1449
|
]);
|
|
1450
|
+
isTypeTrue();
|
|
1503
1451
|
const LogLevelOptionSchema = union([LogLevelSchema, literal("silent")]);
|
|
1452
|
+
isTypeTrue();
|
|
1504
1453
|
const LogLevelWithErrorSchema = union([LogLevelSchema, literal("error")]);
|
|
1454
|
+
isTypeTrue();
|
|
1505
1455
|
const RollupLogSchema = any();
|
|
1506
1456
|
const RollupLogWithStringSchema = union([RollupLogSchema, string()]);
|
|
1457
|
+
isTypeTrue();
|
|
1507
1458
|
const InputOptionSchema = union([
|
|
1508
1459
|
string(),
|
|
1509
1460
|
array(string()),
|
|
1510
1461
|
record(string(), string())
|
|
1511
1462
|
]);
|
|
1463
|
+
isTypeTrue();
|
|
1512
1464
|
const ExternalOptionFunctionSchema = pipe(vFunction(), args(tuple([
|
|
1513
1465
|
string(),
|
|
1514
1466
|
optional(string()),
|
|
1515
1467
|
boolean()
|
|
1516
1468
|
])), returns(nullish(boolean())));
|
|
1469
|
+
isTypeTrue();
|
|
1517
1470
|
const ExternalOptionSchema = union([
|
|
1518
1471
|
StringOrRegExpSchema,
|
|
1519
1472
|
array(StringOrRegExpSchema),
|
|
1520
1473
|
ExternalOptionFunctionSchema
|
|
1521
1474
|
]);
|
|
1475
|
+
isTypeTrue();
|
|
1522
1476
|
const ModuleTypesSchema = record(string(), union([
|
|
1523
1477
|
literal("asset"),
|
|
1524
1478
|
literal("base64"),
|
|
@@ -1533,21 +1487,26 @@ const ModuleTypesSchema = record(string(), union([
|
|
|
1533
1487
|
literal("ts"),
|
|
1534
1488
|
literal("tsx")
|
|
1535
1489
|
]));
|
|
1490
|
+
isTypeTrue();
|
|
1536
1491
|
const JsxOptionsSchema = strictObject({
|
|
1537
1492
|
runtime: pipe(optional(union([literal("classic"), literal("automatic")])), description("Which runtime to use")),
|
|
1538
1493
|
development: pipe(optional(boolean()), description("Development specific information")),
|
|
1539
1494
|
throwIfNamespace: pipe(optional(boolean()), description("Toggles whether to throw an error when a tag name uses an XML namespace")),
|
|
1495
|
+
pure: pipe(optional(boolean()), description("Mark JSX elements and top-level React method calls as pure for tree shaking.")),
|
|
1540
1496
|
importSource: pipe(optional(string()), description("Import the factory of element and fragment if mode is classic")),
|
|
1541
1497
|
pragma: pipe(optional(string()), description("Jsx element transformation")),
|
|
1542
1498
|
pragmaFrag: pipe(optional(string()), description("Jsx fragment transformation")),
|
|
1543
|
-
refresh: pipe(optional(boolean()), description("Enable react fast refresh"))
|
|
1499
|
+
refresh: pipe(optional(union([boolean(), any()])), description("Enable react fast refresh"))
|
|
1544
1500
|
});
|
|
1501
|
+
isTypeTrue();
|
|
1545
1502
|
const HelperModeSchema = union([literal("Runtime"), literal("External")]);
|
|
1546
1503
|
const DecoratorOptionSchema = object({
|
|
1547
1504
|
legacy: optional(boolean()),
|
|
1548
1505
|
emitDecoratorMetadata: optional(boolean())
|
|
1549
1506
|
});
|
|
1507
|
+
isTypeTrue();
|
|
1550
1508
|
const HelpersSchema = object({ mode: optional(HelperModeSchema) });
|
|
1509
|
+
isTypeTrue();
|
|
1551
1510
|
const RewriteImportExtensionsSchema = union([
|
|
1552
1511
|
literal("rewrite"),
|
|
1553
1512
|
literal("remove"),
|
|
@@ -1559,12 +1518,14 @@ const TypescriptSchema = object({
|
|
|
1559
1518
|
onlyRemoveTypeImports: optional(boolean()),
|
|
1560
1519
|
allowNamespaces: optional(boolean()),
|
|
1561
1520
|
allowDeclareFields: optional(boolean()),
|
|
1521
|
+
removeClassFieldsWithoutInitializer: optional(boolean()),
|
|
1562
1522
|
declaration: optional(object({
|
|
1563
1523
|
stripInternal: optional(boolean()),
|
|
1564
1524
|
sourcemap: optional(boolean())
|
|
1565
1525
|
})),
|
|
1566
1526
|
rewriteImportExtensions: optional(RewriteImportExtensionsSchema)
|
|
1567
1527
|
});
|
|
1528
|
+
isTypeTrue();
|
|
1568
1529
|
const AssumptionsSchema = object({
|
|
1569
1530
|
ignoreFunctionLength: optional(boolean()),
|
|
1570
1531
|
noDocumentAll: optional(boolean()),
|
|
@@ -1572,11 +1533,17 @@ const AssumptionsSchema = object({
|
|
|
1572
1533
|
pureGetters: optional(boolean()),
|
|
1573
1534
|
setPublicClassFields: optional(boolean())
|
|
1574
1535
|
});
|
|
1536
|
+
isTypeTrue();
|
|
1537
|
+
const TransformPluginsSchema = object({
|
|
1538
|
+
styledComponents: optional(any()),
|
|
1539
|
+
taggedTemplateEscape: optional(boolean())
|
|
1540
|
+
});
|
|
1541
|
+
isTypeTrue();
|
|
1575
1542
|
const TransformOptionsSchema = object({
|
|
1576
1543
|
assumptions: optional(AssumptionsSchema),
|
|
1577
1544
|
typescript: optional(TypescriptSchema),
|
|
1578
1545
|
helpers: optional(HelpersSchema),
|
|
1579
|
-
|
|
1546
|
+
decorator: optional(DecoratorOptionSchema),
|
|
1580
1547
|
jsx: optional(union([
|
|
1581
1548
|
literal(false),
|
|
1582
1549
|
literal("preserve"),
|
|
@@ -1587,9 +1554,11 @@ const TransformOptionsSchema = object({
|
|
|
1587
1554
|
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment")),
|
|
1588
1555
|
define: pipe(optional(record(string(), string())), description("Define global variables (syntax: key=value,key2=value2)")),
|
|
1589
1556
|
inject: pipe(optional(record(string(), union([string(), tuple([string(), string()])]))), description("Inject import statements on demand")),
|
|
1590
|
-
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names"))
|
|
1557
|
+
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names")),
|
|
1558
|
+
plugins: pipe(optional(TransformPluginsSchema), description("Third-party plugins to use"))
|
|
1591
1559
|
});
|
|
1592
|
-
|
|
1560
|
+
isTypeTrue();
|
|
1561
|
+
const WatcherOptionsSchema = strictObject({
|
|
1593
1562
|
chokidar: optional(never(`The "watch.chokidar" option is deprecated, please use "watch.notify" instead of it`)),
|
|
1594
1563
|
exclude: optional(union([StringOrRegExpSchema, array(StringOrRegExpSchema)])),
|
|
1595
1564
|
include: optional(union([StringOrRegExpSchema, array(StringOrRegExpSchema)])),
|
|
@@ -1600,8 +1569,9 @@ const WatchOptionsSchema = strictObject({
|
|
|
1600
1569
|
skipWrite: pipe(optional(boolean()), description("Skip the bundle.write() step")),
|
|
1601
1570
|
buildDelay: pipe(optional(number()), description("Throttle watch rebuilds")),
|
|
1602
1571
|
clearScreen: pipe(optional(boolean()), description("Whether to clear the screen when a rebuild is triggered")),
|
|
1603
|
-
onInvalidate: pipe(optional(
|
|
1572
|
+
onInvalidate: pipe(optional(vFunction()), description("An optional function that will be called immediately every time a module changes that is part of the build."))
|
|
1604
1573
|
});
|
|
1574
|
+
isTypeTrue();
|
|
1605
1575
|
const ChecksOptionsSchema = strictObject({
|
|
1606
1576
|
circularDependency: pipe(optional(boolean()), description("Whether to emit warnings when detecting circular dependency")),
|
|
1607
1577
|
eval: pipe(optional(boolean()), description("Whether to emit warnings when detecting uses of direct `eval`s")),
|
|
@@ -1619,46 +1589,55 @@ const ChecksOptionsSchema = strictObject({
|
|
|
1619
1589
|
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warnings when a config value is overridden by another config value with a higher priority")),
|
|
1620
1590
|
preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warnings when a plugin that is covered by a built-in feature is used")),
|
|
1621
1591
|
couldNotCleanDirectory: pipe(optional(boolean()), description("Whether to emit warnings when Rolldown could not clean the output directory")),
|
|
1622
|
-
pluginTimings: pipe(optional(boolean()), description("Whether to emit warnings when plugins take significant time during the build process"))
|
|
1592
|
+
pluginTimings: pipe(optional(boolean()), description("Whether to emit warnings when plugins take significant time during the build process")),
|
|
1593
|
+
duplicateShebang: pipe(optional(boolean()), description("Whether to emit warnings when both the code and postBanner contain shebang"))
|
|
1623
1594
|
});
|
|
1595
|
+
isTypeTrue();
|
|
1624
1596
|
const CompressOptionsKeepNamesSchema = strictObject({
|
|
1625
1597
|
function: boolean(),
|
|
1626
1598
|
class: boolean()
|
|
1627
1599
|
});
|
|
1600
|
+
isTypeTrue();
|
|
1601
|
+
const CompressTreeshakeOptionsSchema = strictObject({
|
|
1602
|
+
annotations: optional(boolean()),
|
|
1603
|
+
manualPureFunctions: optional(array(string())),
|
|
1604
|
+
propertyReadSideEffects: optional(union([boolean(), literal("always")])),
|
|
1605
|
+
unknownGlobalSideEffects: optional(boolean()),
|
|
1606
|
+
invalidImportSideEffects: optional(boolean())
|
|
1607
|
+
});
|
|
1608
|
+
isTypeTrue();
|
|
1628
1609
|
const CompressOptionsSchema = strictObject({
|
|
1629
|
-
target: optional(union([
|
|
1630
|
-
literal("esnext"),
|
|
1631
|
-
literal("es2015"),
|
|
1632
|
-
literal("es2016"),
|
|
1633
|
-
literal("es2017"),
|
|
1634
|
-
literal("es2018"),
|
|
1635
|
-
literal("es2019"),
|
|
1636
|
-
literal("es2020"),
|
|
1637
|
-
literal("es2021"),
|
|
1638
|
-
literal("es2022"),
|
|
1639
|
-
literal("es2023"),
|
|
1640
|
-
literal("es2024")
|
|
1641
|
-
])),
|
|
1610
|
+
target: optional(union([string(), array(string())])),
|
|
1642
1611
|
dropConsole: optional(boolean()),
|
|
1643
1612
|
dropDebugger: optional(boolean()),
|
|
1644
1613
|
keepNames: optional(CompressOptionsKeepNamesSchema),
|
|
1645
|
-
unused: optional(union([boolean(), literal("keep_assign")]))
|
|
1614
|
+
unused: optional(union([boolean(), literal("keep_assign")])),
|
|
1615
|
+
joinVars: optional(boolean()),
|
|
1616
|
+
sequences: optional(boolean()),
|
|
1617
|
+
dropLabels: optional(array(string())),
|
|
1618
|
+
maxIterations: optional(number()),
|
|
1619
|
+
treeshake: optional(CompressTreeshakeOptionsSchema)
|
|
1646
1620
|
});
|
|
1621
|
+
isTypeTrue();
|
|
1647
1622
|
const MangleOptionsKeepNamesSchema = strictObject({
|
|
1648
1623
|
function: boolean(),
|
|
1649
1624
|
class: boolean()
|
|
1650
1625
|
});
|
|
1626
|
+
isTypeTrue();
|
|
1651
1627
|
const MangleOptionsSchema = strictObject({
|
|
1652
1628
|
toplevel: optional(boolean()),
|
|
1653
1629
|
keepNames: optional(union([boolean(), MangleOptionsKeepNamesSchema])),
|
|
1654
1630
|
debug: optional(boolean())
|
|
1655
1631
|
});
|
|
1632
|
+
isTypeTrue();
|
|
1656
1633
|
const CodegenOptionsSchema = strictObject({ removeWhitespace: optional(boolean()) });
|
|
1634
|
+
isTypeTrue();
|
|
1657
1635
|
const MinifyOptionsSchema = strictObject({
|
|
1658
1636
|
compress: optional(union([boolean(), CompressOptionsSchema])),
|
|
1659
1637
|
mangle: optional(union([boolean(), MangleOptionsSchema])),
|
|
1660
1638
|
codegen: optional(union([boolean(), CodegenOptionsSchema]))
|
|
1661
1639
|
});
|
|
1640
|
+
isTypeTrue();
|
|
1662
1641
|
const ResolveOptionsSchema = strictObject({
|
|
1663
1642
|
alias: optional(record(string(), union([
|
|
1664
1643
|
literal(false),
|
|
@@ -1674,17 +1653,20 @@ const ResolveOptionsSchema = strictObject({
|
|
|
1674
1653
|
mainFiles: optional(array(string())),
|
|
1675
1654
|
modules: optional(array(string())),
|
|
1676
1655
|
symlinks: optional(boolean()),
|
|
1677
|
-
|
|
1656
|
+
tsconfigFilename: optional(string())
|
|
1678
1657
|
});
|
|
1679
|
-
|
|
1658
|
+
isTypeTrue();
|
|
1659
|
+
const TreeshakingOptionsSchema = strictObject({
|
|
1660
|
+
moduleSideEffects: optional(any()),
|
|
1680
1661
|
annotations: optional(boolean()),
|
|
1681
|
-
manualPureFunctions: optional(array(string())),
|
|
1662
|
+
manualPureFunctions: optional(custom((input) => is(array(string()), input), "string array")),
|
|
1682
1663
|
unknownGlobalSideEffects: optional(boolean()),
|
|
1683
1664
|
invalidImportSideEffects: optional(boolean()),
|
|
1684
1665
|
commonjs: optional(boolean()),
|
|
1685
1666
|
propertyReadSideEffects: optional(union([literal(false), literal("always")])),
|
|
1686
1667
|
propertyWriteSideEffects: optional(union([literal(false), literal("always")]))
|
|
1687
|
-
})
|
|
1668
|
+
});
|
|
1669
|
+
isTypeTrue();
|
|
1688
1670
|
const OptimizationOptionsSchema = strictObject({
|
|
1689
1671
|
inlineConst: pipe(optional(union([boolean(), strictObject({
|
|
1690
1672
|
mode: optional(union([literal("all"), literal("smart")])),
|
|
@@ -1692,19 +1674,24 @@ const OptimizationOptionsSchema = strictObject({
|
|
|
1692
1674
|
})])), description("Enable crossmodule constant inlining")),
|
|
1693
1675
|
pifeForModuleWrappers: pipe(optional(boolean()), description("Use PIFE pattern for module wrappers"))
|
|
1694
1676
|
});
|
|
1677
|
+
isTypeTrue();
|
|
1695
1678
|
const LogOrStringHandlerSchema = pipe(vFunction(), args(tuple([LogLevelWithErrorSchema, RollupLogWithStringSchema])));
|
|
1679
|
+
isTypeTrue();
|
|
1696
1680
|
const OnLogSchema = pipe(vFunction(), args(tuple([
|
|
1697
1681
|
LogLevelSchema,
|
|
1698
1682
|
RollupLogSchema,
|
|
1699
1683
|
LogOrStringHandlerSchema
|
|
1700
1684
|
])));
|
|
1685
|
+
isTypeTrue();
|
|
1701
1686
|
const OnwarnSchema = pipe(vFunction(), args(tuple([RollupLogSchema, pipe(vFunction(), args(tuple([union([RollupLogWithStringSchema, pipe(vFunction(), returns(RollupLogWithStringSchema))])])))])));
|
|
1687
|
+
isTypeTrue();
|
|
1702
1688
|
const DevModeSchema = union([boolean(), strictObject({
|
|
1703
1689
|
port: optional(number()),
|
|
1704
1690
|
host: optional(string()),
|
|
1705
1691
|
implement: optional(string()),
|
|
1706
1692
|
lazy: optional(boolean())
|
|
1707
1693
|
})]);
|
|
1694
|
+
isTypeTrue();
|
|
1708
1695
|
const InputOptionsSchema = strictObject({
|
|
1709
1696
|
input: optional(InputOptionSchema),
|
|
1710
1697
|
plugins: optional(custom(() => true)),
|
|
@@ -1718,35 +1705,34 @@ const InputOptionsSchema = strictObject({
|
|
|
1718
1705
|
literal("node")
|
|
1719
1706
|
])), description(`Platform for which the code should be generated (node, ${styleText$1("underline", "browser")}, neutral)`)),
|
|
1720
1707
|
shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
|
|
1721
|
-
treeshake: optional(TreeshakingOptionsSchema),
|
|
1708
|
+
treeshake: optional(union([boolean(), TreeshakingOptionsSchema])),
|
|
1722
1709
|
optimization: optional(OptimizationOptionsSchema),
|
|
1723
1710
|
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${styleText$1("dim", "silent")}, ${styleText$1(["underline", "gray"], "info")}, debug, ${styleText$1("yellow", "warn")})`)),
|
|
1724
1711
|
onLog: optional(OnLogSchema),
|
|
1725
1712
|
onwarn: optional(OnwarnSchema),
|
|
1726
1713
|
moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
|
|
1727
1714
|
experimental: optional(strictObject({
|
|
1728
|
-
enableComposingJsPlugins: optional(boolean()),
|
|
1729
1715
|
viteMode: optional(boolean()),
|
|
1730
1716
|
resolveNewUrlToAsset: optional(boolean()),
|
|
1731
|
-
strictExecutionOrder: optional(boolean()),
|
|
1732
|
-
onDemandWrapping: optional(boolean()),
|
|
1733
|
-
incrementalBuild: optional(boolean()),
|
|
1734
1717
|
devMode: optional(DevModeSchema),
|
|
1718
|
+
chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")])),
|
|
1735
1719
|
attachDebugInfo: optional(union([
|
|
1736
1720
|
literal("none"),
|
|
1737
1721
|
literal("simple"),
|
|
1738
1722
|
literal("full")
|
|
1739
1723
|
])),
|
|
1740
|
-
chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")])),
|
|
1741
1724
|
chunkImportMap: optional(union([boolean(), object({
|
|
1742
1725
|
baseUrl: optional(string()),
|
|
1743
1726
|
fileName: optional(string())
|
|
1744
1727
|
})])),
|
|
1728
|
+
onDemandWrapping: optional(boolean()),
|
|
1729
|
+
incrementalBuild: optional(boolean()),
|
|
1745
1730
|
nativeMagicString: optional(boolean()),
|
|
1746
|
-
chunkOptimization: optional(boolean())
|
|
1731
|
+
chunkOptimization: optional(boolean()),
|
|
1732
|
+
lazyBarrel: optional(boolean())
|
|
1747
1733
|
})),
|
|
1748
1734
|
transform: optional(TransformOptionsSchema),
|
|
1749
|
-
watch: optional(union([
|
|
1735
|
+
watch: optional(union([WatcherOptionsSchema, literal(false)])),
|
|
1750
1736
|
checks: optional(ChecksOptionsSchema),
|
|
1751
1737
|
devtools: pipe(optional(object({ sessionId: pipe(optional(string()), description("Used to name the build.")) })), description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly.")),
|
|
1752
1738
|
preserveEntrySignatures: pipe(optional(union([
|
|
@@ -1755,8 +1741,10 @@ const InputOptionsSchema = strictObject({
|
|
|
1755
1741
|
literal("exports-only"),
|
|
1756
1742
|
literal(false)
|
|
1757
1743
|
]))),
|
|
1744
|
+
context: pipe(optional(string()), description("The value of `this` at the top level of each module.")),
|
|
1758
1745
|
tsconfig: pipe(optional(union([boolean(), string()])), description("Path to the tsconfig.json file."))
|
|
1759
1746
|
});
|
|
1747
|
+
isTypeTrue();
|
|
1760
1748
|
const InputCliOverrideSchema = strictObject({
|
|
1761
1749
|
input: pipe(optional(array(string())), description("Entry file")),
|
|
1762
1750
|
external: pipe(optional(array(string())), description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
|
|
@@ -1785,22 +1773,32 @@ const ModuleFormatSchema = union([
|
|
|
1785
1773
|
literal("iife"),
|
|
1786
1774
|
literal("umd")
|
|
1787
1775
|
]);
|
|
1776
|
+
isTypeTrue();
|
|
1788
1777
|
const AddonFunctionSchema = pipe(vFunction(), args(tuple([custom(() => true)])), returnsAsync(unionAsync([string(), pipeAsync(promise(), awaitAsync(), string())])));
|
|
1778
|
+
isTypeTrue();
|
|
1789
1779
|
const ChunkFileNamesFunctionSchema = pipe(vFunction(), args(tuple([custom(() => true)])), returns(string()));
|
|
1780
|
+
isTypeTrue();
|
|
1790
1781
|
const ChunkFileNamesSchema = union([string(), ChunkFileNamesFunctionSchema]);
|
|
1791
1782
|
const AssetFileNamesFunctionSchema = pipe(vFunction(), args(tuple([custom(() => true)])), returns(string()));
|
|
1783
|
+
isTypeTrue();
|
|
1792
1784
|
const AssetFileNamesSchema = union([string(), AssetFileNamesFunctionSchema]);
|
|
1793
1785
|
const SanitizeFileNameFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(string()));
|
|
1786
|
+
isTypeTrue();
|
|
1794
1787
|
const SanitizeFileNameSchema = union([boolean(), SanitizeFileNameFunctionSchema]);
|
|
1795
1788
|
const GlobalsFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(string()));
|
|
1789
|
+
isTypeTrue();
|
|
1796
1790
|
const PathsFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(string()));
|
|
1791
|
+
isTypeTrue();
|
|
1797
1792
|
const ManualChunksFunctionSchema = pipe(vFunction(), args(tuple([string(), object({})])), returns(nullish(string())));
|
|
1793
|
+
isTypeTrue();
|
|
1798
1794
|
const AdvancedChunksNameFunctionSchema = pipe(vFunction(), args(tuple([string(), object({})])), returns(nullish(string())));
|
|
1795
|
+
isTypeTrue();
|
|
1799
1796
|
const AdvancedChunksTestFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(union([
|
|
1800
1797
|
boolean(),
|
|
1801
1798
|
void_(),
|
|
1802
1799
|
undefined_()
|
|
1803
1800
|
])));
|
|
1801
|
+
isTypeTrue();
|
|
1804
1802
|
const AdvancedChunksSchema = strictObject({
|
|
1805
1803
|
includeDependenciesRecursively: optional(boolean()),
|
|
1806
1804
|
minSize: optional(number()),
|
|
@@ -1819,12 +1817,15 @@ const AdvancedChunksSchema = strictObject({
|
|
|
1819
1817
|
maxModuleSize: optional(number())
|
|
1820
1818
|
})))
|
|
1821
1819
|
});
|
|
1820
|
+
isTypeTrue();
|
|
1822
1821
|
const GeneratedCodePresetSchema = union([literal("es5"), literal("es2015")]);
|
|
1822
|
+
isTypeTrue();
|
|
1823
1823
|
const GeneratedCodeOptionsSchema = strictObject({
|
|
1824
1824
|
symbols: pipe(optional(boolean()), description("Whether to use Symbol.toStringTag for namespace objects")),
|
|
1825
|
-
preset: GeneratedCodePresetSchema,
|
|
1825
|
+
preset: optional(GeneratedCodePresetSchema),
|
|
1826
1826
|
profilerNames: pipe(optional(boolean()), description("Whether to add readable names to internal variables for profiling purposes"))
|
|
1827
1827
|
});
|
|
1828
|
+
isTypeTrue();
|
|
1828
1829
|
const OutputOptionsSchema = strictObject({
|
|
1829
1830
|
dir: pipe(optional(string()), description("Output directory, defaults to `dist` if `file` is not set")),
|
|
1830
1831
|
file: pipe(optional(string()), description("Single output file")),
|
|
@@ -1892,8 +1893,10 @@ const OutputOptionsSchema = strictObject({
|
|
|
1892
1893
|
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports")),
|
|
1893
1894
|
topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`.")),
|
|
1894
1895
|
cleanDir: pipe(optional(boolean()), description("Clean output directory before emitting output")),
|
|
1895
|
-
keepNames: pipe(optional(boolean()), description("Keep function and class names after bundling"))
|
|
1896
|
+
keepNames: pipe(optional(boolean()), description("Keep function and class names after bundling")),
|
|
1897
|
+
strictExecutionOrder: pipe(optional(boolean()), description("Lets modules be executed in the order they are declared."))
|
|
1896
1898
|
});
|
|
1899
|
+
isTypeTrue();
|
|
1897
1900
|
const getAddonDescription = (placement, wrapper) => {
|
|
1898
1901
|
return `Code to insert the ${styleText$1("bold", placement)} of the bundled file (${styleText$1("bold", wrapper)} the wrapper function)`;
|
|
1899
1902
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@oxc-project+types@0.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@oxc-project+types@0.111.0/node_modules/@oxc-project/types/types.d.ts
|
|
2
2
|
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
|
3
3
|
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/typescript.rs`.
|
|
4
4
|
interface Program extends Span {
|
|
@@ -1235,7 +1235,7 @@ interface TSImportEqualsDeclaration extends Span {
|
|
|
1235
1235
|
importKind: ImportOrExportKind;
|
|
1236
1236
|
parent?: Node;
|
|
1237
1237
|
}
|
|
1238
|
-
type TSModuleReference = TSExternalModuleReference |
|
|
1238
|
+
type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName;
|
|
1239
1239
|
interface TSExternalModuleReference extends Span {
|
|
1240
1240
|
type: "TSExternalModuleReference";
|
|
1241
1241
|
expression: StringLiteral;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as logMultiplyNotifyOption } from "./logs-B2CASPcx.mjs";
|
|
2
|
-
import { a as aggregateBindingErrorsIntoJsError, b as LOG_LEVEL_WARN } from "./bindingify-input-options-
|
|
2
|
+
import { a as aggregateBindingErrorsIntoJsError, b as LOG_LEVEL_WARN } from "./bindingify-input-options-CObJx_Uj.mjs";
|
|
3
3
|
import { h as arraify } from "./composable-filters-CIxSuZSM.mjs";
|
|
4
|
-
import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-
|
|
4
|
+
import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-Do6WlRGM.mjs";
|
|
5
5
|
import { BindingWatcher, shutdownAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
6
6
|
|
|
7
7
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
@@ -368,11 +368,11 @@ function getValidNotifyOption(bundlerOptions) {
|
|
|
368
368
|
* @experimental
|
|
369
369
|
* @category Programmatic APIs
|
|
370
370
|
*/
|
|
371
|
-
|
|
371
|
+
function watch(input) {
|
|
372
372
|
const emitter = new WatcherEmitter();
|
|
373
373
|
createWatcher(emitter, input);
|
|
374
374
|
return emitter;
|
|
375
|
-
}
|
|
375
|
+
}
|
|
376
376
|
|
|
377
377
|
//#endregion
|
|
378
378
|
export { onExit as n, watch as t };
|