@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
|
@@ -451,7 +451,7 @@ const win32 = /* @__PURE__ */ mix(";");
|
|
|
451
451
|
|
|
452
452
|
//#endregion
|
|
453
453
|
//#region package.json
|
|
454
|
-
var version = "1.0.0-rc.
|
|
454
|
+
var version = "1.0.0-rc.2";
|
|
455
455
|
|
|
456
456
|
//#endregion
|
|
457
457
|
//#region src/version.ts
|
|
@@ -1083,6 +1083,19 @@ function getDefault(schema, dataset, config$1) {
|
|
|
1083
1083
|
return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
|
|
1084
1084
|
}
|
|
1085
1085
|
/**
|
|
1086
|
+
* Checks if the input matches the schema. By using a type predicate, this
|
|
1087
|
+
* function can be used as a type guard.
|
|
1088
|
+
*
|
|
1089
|
+
* @param schema The schema to be used.
|
|
1090
|
+
* @param input The input to be tested.
|
|
1091
|
+
*
|
|
1092
|
+
* @returns Whether the input matches the schema.
|
|
1093
|
+
*/
|
|
1094
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1095
|
+
function is(schema, input) {
|
|
1096
|
+
return !schema["~run"]({ value: input }, { abortEarly: true }).issues;
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1086
1099
|
* Creates an any schema.
|
|
1087
1100
|
*
|
|
1088
1101
|
* Hint: This schema function exists only for completeness and is not
|
|
@@ -1255,74 +1268,6 @@ function literal(literal_, message$1) {
|
|
|
1255
1268
|
};
|
|
1256
1269
|
}
|
|
1257
1270
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1258
|
-
function looseObject(entries$1, message$1) {
|
|
1259
|
-
return {
|
|
1260
|
-
kind: "schema",
|
|
1261
|
-
type: "loose_object",
|
|
1262
|
-
reference: looseObject,
|
|
1263
|
-
expects: "Object",
|
|
1264
|
-
async: false,
|
|
1265
|
-
entries: entries$1,
|
|
1266
|
-
message: message$1,
|
|
1267
|
-
get "~standard"() {
|
|
1268
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
1269
|
-
},
|
|
1270
|
-
"~run"(dataset, config$1) {
|
|
1271
|
-
const input = dataset.value;
|
|
1272
|
-
if (input && typeof input === "object") {
|
|
1273
|
-
dataset.typed = true;
|
|
1274
|
-
dataset.value = {};
|
|
1275
|
-
for (const key in this.entries) {
|
|
1276
|
-
const valueSchema = this.entries[key];
|
|
1277
|
-
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
1278
|
-
const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
1279
|
-
const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
|
|
1280
|
-
if (valueDataset.issues) {
|
|
1281
|
-
const pathItem = {
|
|
1282
|
-
type: "object",
|
|
1283
|
-
origin: "value",
|
|
1284
|
-
input,
|
|
1285
|
-
key,
|
|
1286
|
-
value: value$1
|
|
1287
|
-
};
|
|
1288
|
-
for (const issue of valueDataset.issues) {
|
|
1289
|
-
if (issue.path) issue.path.unshift(pathItem);
|
|
1290
|
-
else issue.path = [pathItem];
|
|
1291
|
-
dataset.issues?.push(issue);
|
|
1292
|
-
}
|
|
1293
|
-
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1294
|
-
if (config$1.abortEarly) {
|
|
1295
|
-
dataset.typed = false;
|
|
1296
|
-
break;
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
if (!valueDataset.typed) dataset.typed = false;
|
|
1300
|
-
dataset.value[key] = valueDataset.value;
|
|
1301
|
-
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
1302
|
-
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
1303
|
-
_addIssue(this, "key", dataset, config$1, {
|
|
1304
|
-
input: void 0,
|
|
1305
|
-
expected: `"${key}"`,
|
|
1306
|
-
path: [{
|
|
1307
|
-
type: "object",
|
|
1308
|
-
origin: "key",
|
|
1309
|
-
input,
|
|
1310
|
-
key,
|
|
1311
|
-
value: input[key]
|
|
1312
|
-
}]
|
|
1313
|
-
});
|
|
1314
|
-
if (config$1.abortEarly) break;
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
if (!dataset.issues || !config$1.abortEarly) {
|
|
1318
|
-
for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
|
|
1319
|
-
}
|
|
1320
|
-
} else _addIssue(this, "type", dataset, config$1);
|
|
1321
|
-
return dataset;
|
|
1322
|
-
}
|
|
1323
|
-
};
|
|
1324
|
-
}
|
|
1325
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
1326
1271
|
function never(message$1) {
|
|
1327
1272
|
return {
|
|
1328
1273
|
kind: "schema",
|
|
@@ -1943,7 +1888,9 @@ function styleText(...args) {
|
|
|
1943
1888
|
|
|
1944
1889
|
//#endregion
|
|
1945
1890
|
//#region src/utils/validator.ts
|
|
1891
|
+
function isTypeTrue() {}
|
|
1946
1892
|
const StringOrRegExpSchema = union([string(), instance(RegExp)]);
|
|
1893
|
+
isTypeTrue();
|
|
1947
1894
|
function vFunction() {
|
|
1948
1895
|
return function_();
|
|
1949
1896
|
}
|
|
@@ -1952,25 +1899,32 @@ const LogLevelSchema = union([
|
|
|
1952
1899
|
literal("info"),
|
|
1953
1900
|
literal("warn")
|
|
1954
1901
|
]);
|
|
1902
|
+
isTypeTrue();
|
|
1955
1903
|
const LogLevelOptionSchema = union([LogLevelSchema, literal("silent")]);
|
|
1904
|
+
isTypeTrue();
|
|
1956
1905
|
const LogLevelWithErrorSchema = union([LogLevelSchema, literal("error")]);
|
|
1906
|
+
isTypeTrue();
|
|
1957
1907
|
const RollupLogSchema = any();
|
|
1958
1908
|
const RollupLogWithStringSchema = union([RollupLogSchema, string()]);
|
|
1909
|
+
isTypeTrue();
|
|
1959
1910
|
const InputOptionSchema = union([
|
|
1960
1911
|
string(),
|
|
1961
1912
|
array(string()),
|
|
1962
1913
|
record(string(), string())
|
|
1963
1914
|
]);
|
|
1915
|
+
isTypeTrue();
|
|
1964
1916
|
const ExternalOptionFunctionSchema = pipe(vFunction(), args(tuple([
|
|
1965
1917
|
string(),
|
|
1966
1918
|
optional(string()),
|
|
1967
1919
|
boolean()
|
|
1968
1920
|
])), returns(nullish(boolean())));
|
|
1921
|
+
isTypeTrue();
|
|
1969
1922
|
const ExternalOptionSchema = union([
|
|
1970
1923
|
StringOrRegExpSchema,
|
|
1971
1924
|
array(StringOrRegExpSchema),
|
|
1972
1925
|
ExternalOptionFunctionSchema
|
|
1973
1926
|
]);
|
|
1927
|
+
isTypeTrue();
|
|
1974
1928
|
const ModuleTypesSchema = record(string(), union([
|
|
1975
1929
|
literal("asset"),
|
|
1976
1930
|
literal("base64"),
|
|
@@ -1985,21 +1939,26 @@ const ModuleTypesSchema = record(string(), union([
|
|
|
1985
1939
|
literal("ts"),
|
|
1986
1940
|
literal("tsx")
|
|
1987
1941
|
]));
|
|
1942
|
+
isTypeTrue();
|
|
1988
1943
|
const JsxOptionsSchema = strictObject({
|
|
1989
1944
|
runtime: pipe(optional(union([literal("classic"), literal("automatic")])), description("Which runtime to use")),
|
|
1990
1945
|
development: pipe(optional(boolean()), description("Development specific information")),
|
|
1991
1946
|
throwIfNamespace: pipe(optional(boolean()), description("Toggles whether to throw an error when a tag name uses an XML namespace")),
|
|
1947
|
+
pure: pipe(optional(boolean()), description("Mark JSX elements and top-level React method calls as pure for tree shaking.")),
|
|
1992
1948
|
importSource: pipe(optional(string()), description("Import the factory of element and fragment if mode is classic")),
|
|
1993
1949
|
pragma: pipe(optional(string()), description("Jsx element transformation")),
|
|
1994
1950
|
pragmaFrag: pipe(optional(string()), description("Jsx fragment transformation")),
|
|
1995
|
-
refresh: pipe(optional(boolean()), description("Enable react fast refresh"))
|
|
1951
|
+
refresh: pipe(optional(union([boolean(), any()])), description("Enable react fast refresh"))
|
|
1996
1952
|
});
|
|
1953
|
+
isTypeTrue();
|
|
1997
1954
|
const HelperModeSchema = union([literal("Runtime"), literal("External")]);
|
|
1998
1955
|
const DecoratorOptionSchema = object({
|
|
1999
1956
|
legacy: optional(boolean()),
|
|
2000
1957
|
emitDecoratorMetadata: optional(boolean())
|
|
2001
1958
|
});
|
|
1959
|
+
isTypeTrue();
|
|
2002
1960
|
const HelpersSchema = object({ mode: optional(HelperModeSchema) });
|
|
1961
|
+
isTypeTrue();
|
|
2003
1962
|
const RewriteImportExtensionsSchema = union([
|
|
2004
1963
|
literal("rewrite"),
|
|
2005
1964
|
literal("remove"),
|
|
@@ -2011,12 +1970,14 @@ const TypescriptSchema = object({
|
|
|
2011
1970
|
onlyRemoveTypeImports: optional(boolean()),
|
|
2012
1971
|
allowNamespaces: optional(boolean()),
|
|
2013
1972
|
allowDeclareFields: optional(boolean()),
|
|
1973
|
+
removeClassFieldsWithoutInitializer: optional(boolean()),
|
|
2014
1974
|
declaration: optional(object({
|
|
2015
1975
|
stripInternal: optional(boolean()),
|
|
2016
1976
|
sourcemap: optional(boolean())
|
|
2017
1977
|
})),
|
|
2018
1978
|
rewriteImportExtensions: optional(RewriteImportExtensionsSchema)
|
|
2019
1979
|
});
|
|
1980
|
+
isTypeTrue();
|
|
2020
1981
|
const AssumptionsSchema = object({
|
|
2021
1982
|
ignoreFunctionLength: optional(boolean()),
|
|
2022
1983
|
noDocumentAll: optional(boolean()),
|
|
@@ -2024,11 +1985,17 @@ const AssumptionsSchema = object({
|
|
|
2024
1985
|
pureGetters: optional(boolean()),
|
|
2025
1986
|
setPublicClassFields: optional(boolean())
|
|
2026
1987
|
});
|
|
1988
|
+
isTypeTrue();
|
|
1989
|
+
const TransformPluginsSchema = object({
|
|
1990
|
+
styledComponents: optional(any()),
|
|
1991
|
+
taggedTemplateEscape: optional(boolean())
|
|
1992
|
+
});
|
|
1993
|
+
isTypeTrue();
|
|
2027
1994
|
const TransformOptionsSchema = object({
|
|
2028
1995
|
assumptions: optional(AssumptionsSchema),
|
|
2029
1996
|
typescript: optional(TypescriptSchema),
|
|
2030
1997
|
helpers: optional(HelpersSchema),
|
|
2031
|
-
|
|
1998
|
+
decorator: optional(DecoratorOptionSchema),
|
|
2032
1999
|
jsx: optional(union([
|
|
2033
2000
|
literal(false),
|
|
2034
2001
|
literal("preserve"),
|
|
@@ -2039,9 +2006,11 @@ const TransformOptionsSchema = object({
|
|
|
2039
2006
|
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment")),
|
|
2040
2007
|
define: pipe(optional(record(string(), string())), description("Define global variables (syntax: key=value,key2=value2)")),
|
|
2041
2008
|
inject: pipe(optional(record(string(), union([string(), tuple([string(), string()])]))), description("Inject import statements on demand")),
|
|
2042
|
-
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names"))
|
|
2009
|
+
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names")),
|
|
2010
|
+
plugins: pipe(optional(TransformPluginsSchema), description("Third-party plugins to use"))
|
|
2043
2011
|
});
|
|
2044
|
-
|
|
2012
|
+
isTypeTrue();
|
|
2013
|
+
const WatcherOptionsSchema = strictObject({
|
|
2045
2014
|
chokidar: optional(never(`The "watch.chokidar" option is deprecated, please use "watch.notify" instead of it`)),
|
|
2046
2015
|
exclude: optional(union([StringOrRegExpSchema, array(StringOrRegExpSchema)])),
|
|
2047
2016
|
include: optional(union([StringOrRegExpSchema, array(StringOrRegExpSchema)])),
|
|
@@ -2052,8 +2021,9 @@ const WatchOptionsSchema = strictObject({
|
|
|
2052
2021
|
skipWrite: pipe(optional(boolean()), description("Skip the bundle.write() step")),
|
|
2053
2022
|
buildDelay: pipe(optional(number()), description("Throttle watch rebuilds")),
|
|
2054
2023
|
clearScreen: pipe(optional(boolean()), description("Whether to clear the screen when a rebuild is triggered")),
|
|
2055
|
-
onInvalidate: pipe(optional(
|
|
2024
|
+
onInvalidate: pipe(optional(vFunction()), description("An optional function that will be called immediately every time a module changes that is part of the build."))
|
|
2056
2025
|
});
|
|
2026
|
+
isTypeTrue();
|
|
2057
2027
|
const ChecksOptionsSchema = strictObject({
|
|
2058
2028
|
circularDependency: pipe(optional(boolean()), description("Whether to emit warnings when detecting circular dependency")),
|
|
2059
2029
|
eval: pipe(optional(boolean()), description("Whether to emit warnings when detecting uses of direct `eval`s")),
|
|
@@ -2071,46 +2041,55 @@ const ChecksOptionsSchema = strictObject({
|
|
|
2071
2041
|
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warnings when a config value is overridden by another config value with a higher priority")),
|
|
2072
2042
|
preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warnings when a plugin that is covered by a built-in feature is used")),
|
|
2073
2043
|
couldNotCleanDirectory: pipe(optional(boolean()), description("Whether to emit warnings when Rolldown could not clean the output directory")),
|
|
2074
|
-
pluginTimings: pipe(optional(boolean()), description("Whether to emit warnings when plugins take significant time during the build process"))
|
|
2044
|
+
pluginTimings: pipe(optional(boolean()), description("Whether to emit warnings when plugins take significant time during the build process")),
|
|
2045
|
+
duplicateShebang: pipe(optional(boolean()), description("Whether to emit warnings when both the code and postBanner contain shebang"))
|
|
2075
2046
|
});
|
|
2047
|
+
isTypeTrue();
|
|
2076
2048
|
const CompressOptionsKeepNamesSchema = strictObject({
|
|
2077
2049
|
function: boolean(),
|
|
2078
2050
|
class: boolean()
|
|
2079
2051
|
});
|
|
2052
|
+
isTypeTrue();
|
|
2053
|
+
const CompressTreeshakeOptionsSchema = strictObject({
|
|
2054
|
+
annotations: optional(boolean()),
|
|
2055
|
+
manualPureFunctions: optional(array(string())),
|
|
2056
|
+
propertyReadSideEffects: optional(union([boolean(), literal("always")])),
|
|
2057
|
+
unknownGlobalSideEffects: optional(boolean()),
|
|
2058
|
+
invalidImportSideEffects: optional(boolean())
|
|
2059
|
+
});
|
|
2060
|
+
isTypeTrue();
|
|
2080
2061
|
const CompressOptionsSchema = strictObject({
|
|
2081
|
-
target: optional(union([
|
|
2082
|
-
literal("esnext"),
|
|
2083
|
-
literal("es2015"),
|
|
2084
|
-
literal("es2016"),
|
|
2085
|
-
literal("es2017"),
|
|
2086
|
-
literal("es2018"),
|
|
2087
|
-
literal("es2019"),
|
|
2088
|
-
literal("es2020"),
|
|
2089
|
-
literal("es2021"),
|
|
2090
|
-
literal("es2022"),
|
|
2091
|
-
literal("es2023"),
|
|
2092
|
-
literal("es2024")
|
|
2093
|
-
])),
|
|
2062
|
+
target: optional(union([string(), array(string())])),
|
|
2094
2063
|
dropConsole: optional(boolean()),
|
|
2095
2064
|
dropDebugger: optional(boolean()),
|
|
2096
2065
|
keepNames: optional(CompressOptionsKeepNamesSchema),
|
|
2097
|
-
unused: optional(union([boolean(), literal("keep_assign")]))
|
|
2066
|
+
unused: optional(union([boolean(), literal("keep_assign")])),
|
|
2067
|
+
joinVars: optional(boolean()),
|
|
2068
|
+
sequences: optional(boolean()),
|
|
2069
|
+
dropLabels: optional(array(string())),
|
|
2070
|
+
maxIterations: optional(number()),
|
|
2071
|
+
treeshake: optional(CompressTreeshakeOptionsSchema)
|
|
2098
2072
|
});
|
|
2073
|
+
isTypeTrue();
|
|
2099
2074
|
const MangleOptionsKeepNamesSchema = strictObject({
|
|
2100
2075
|
function: boolean(),
|
|
2101
2076
|
class: boolean()
|
|
2102
2077
|
});
|
|
2078
|
+
isTypeTrue();
|
|
2103
2079
|
const MangleOptionsSchema = strictObject({
|
|
2104
2080
|
toplevel: optional(boolean()),
|
|
2105
2081
|
keepNames: optional(union([boolean(), MangleOptionsKeepNamesSchema])),
|
|
2106
2082
|
debug: optional(boolean())
|
|
2107
2083
|
});
|
|
2084
|
+
isTypeTrue();
|
|
2108
2085
|
const CodegenOptionsSchema = strictObject({ removeWhitespace: optional(boolean()) });
|
|
2086
|
+
isTypeTrue();
|
|
2109
2087
|
const MinifyOptionsSchema = strictObject({
|
|
2110
2088
|
compress: optional(union([boolean(), CompressOptionsSchema])),
|
|
2111
2089
|
mangle: optional(union([boolean(), MangleOptionsSchema])),
|
|
2112
2090
|
codegen: optional(union([boolean(), CodegenOptionsSchema]))
|
|
2113
2091
|
});
|
|
2092
|
+
isTypeTrue();
|
|
2114
2093
|
const ResolveOptionsSchema = strictObject({
|
|
2115
2094
|
alias: optional(record(string(), union([
|
|
2116
2095
|
literal(false),
|
|
@@ -2126,17 +2105,20 @@ const ResolveOptionsSchema = strictObject({
|
|
|
2126
2105
|
mainFiles: optional(array(string())),
|
|
2127
2106
|
modules: optional(array(string())),
|
|
2128
2107
|
symlinks: optional(boolean()),
|
|
2129
|
-
|
|
2108
|
+
tsconfigFilename: optional(string())
|
|
2130
2109
|
});
|
|
2131
|
-
|
|
2110
|
+
isTypeTrue();
|
|
2111
|
+
const TreeshakingOptionsSchema = strictObject({
|
|
2112
|
+
moduleSideEffects: optional(any()),
|
|
2132
2113
|
annotations: optional(boolean()),
|
|
2133
|
-
manualPureFunctions: optional(array(string())),
|
|
2114
|
+
manualPureFunctions: optional(custom((input) => is(array(string()), input), "string array")),
|
|
2134
2115
|
unknownGlobalSideEffects: optional(boolean()),
|
|
2135
2116
|
invalidImportSideEffects: optional(boolean()),
|
|
2136
2117
|
commonjs: optional(boolean()),
|
|
2137
2118
|
propertyReadSideEffects: optional(union([literal(false), literal("always")])),
|
|
2138
2119
|
propertyWriteSideEffects: optional(union([literal(false), literal("always")]))
|
|
2139
|
-
})
|
|
2120
|
+
});
|
|
2121
|
+
isTypeTrue();
|
|
2140
2122
|
const OptimizationOptionsSchema = strictObject({
|
|
2141
2123
|
inlineConst: pipe(optional(union([boolean(), strictObject({
|
|
2142
2124
|
mode: optional(union([literal("all"), literal("smart")])),
|
|
@@ -2144,19 +2126,24 @@ const OptimizationOptionsSchema = strictObject({
|
|
|
2144
2126
|
})])), description("Enable crossmodule constant inlining")),
|
|
2145
2127
|
pifeForModuleWrappers: pipe(optional(boolean()), description("Use PIFE pattern for module wrappers"))
|
|
2146
2128
|
});
|
|
2129
|
+
isTypeTrue();
|
|
2147
2130
|
const LogOrStringHandlerSchema = pipe(vFunction(), args(tuple([LogLevelWithErrorSchema, RollupLogWithStringSchema])));
|
|
2131
|
+
isTypeTrue();
|
|
2148
2132
|
const OnLogSchema = pipe(vFunction(), args(tuple([
|
|
2149
2133
|
LogLevelSchema,
|
|
2150
2134
|
RollupLogSchema,
|
|
2151
2135
|
LogOrStringHandlerSchema
|
|
2152
2136
|
])));
|
|
2137
|
+
isTypeTrue();
|
|
2153
2138
|
const OnwarnSchema = pipe(vFunction(), args(tuple([RollupLogSchema, pipe(vFunction(), args(tuple([union([RollupLogWithStringSchema, pipe(vFunction(), returns(RollupLogWithStringSchema))])])))])));
|
|
2139
|
+
isTypeTrue();
|
|
2154
2140
|
const DevModeSchema = union([boolean(), strictObject({
|
|
2155
2141
|
port: optional(number()),
|
|
2156
2142
|
host: optional(string()),
|
|
2157
2143
|
implement: optional(string()),
|
|
2158
2144
|
lazy: optional(boolean())
|
|
2159
2145
|
})]);
|
|
2146
|
+
isTypeTrue();
|
|
2160
2147
|
const InputOptionsSchema = strictObject({
|
|
2161
2148
|
input: optional(InputOptionSchema),
|
|
2162
2149
|
plugins: optional(custom(() => true)),
|
|
@@ -2170,35 +2157,34 @@ const InputOptionsSchema = strictObject({
|
|
|
2170
2157
|
literal("node")
|
|
2171
2158
|
])), description(`Platform for which the code should be generated (node, ${styleText("underline", "browser")}, neutral)`)),
|
|
2172
2159
|
shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
|
|
2173
|
-
treeshake: optional(TreeshakingOptionsSchema),
|
|
2160
|
+
treeshake: optional(union([boolean(), TreeshakingOptionsSchema])),
|
|
2174
2161
|
optimization: optional(OptimizationOptionsSchema),
|
|
2175
2162
|
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${styleText("dim", "silent")}, ${styleText(["underline", "gray"], "info")}, debug, ${styleText("yellow", "warn")})`)),
|
|
2176
2163
|
onLog: optional(OnLogSchema),
|
|
2177
2164
|
onwarn: optional(OnwarnSchema),
|
|
2178
2165
|
moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
|
|
2179
2166
|
experimental: optional(strictObject({
|
|
2180
|
-
enableComposingJsPlugins: optional(boolean()),
|
|
2181
2167
|
viteMode: optional(boolean()),
|
|
2182
2168
|
resolveNewUrlToAsset: optional(boolean()),
|
|
2183
|
-
strictExecutionOrder: optional(boolean()),
|
|
2184
|
-
onDemandWrapping: optional(boolean()),
|
|
2185
|
-
incrementalBuild: optional(boolean()),
|
|
2186
2169
|
devMode: optional(DevModeSchema),
|
|
2170
|
+
chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")])),
|
|
2187
2171
|
attachDebugInfo: optional(union([
|
|
2188
2172
|
literal("none"),
|
|
2189
2173
|
literal("simple"),
|
|
2190
2174
|
literal("full")
|
|
2191
2175
|
])),
|
|
2192
|
-
chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")])),
|
|
2193
2176
|
chunkImportMap: optional(union([boolean(), object({
|
|
2194
2177
|
baseUrl: optional(string()),
|
|
2195
2178
|
fileName: optional(string())
|
|
2196
2179
|
})])),
|
|
2180
|
+
onDemandWrapping: optional(boolean()),
|
|
2181
|
+
incrementalBuild: optional(boolean()),
|
|
2197
2182
|
nativeMagicString: optional(boolean()),
|
|
2198
|
-
chunkOptimization: optional(boolean())
|
|
2183
|
+
chunkOptimization: optional(boolean()),
|
|
2184
|
+
lazyBarrel: optional(boolean())
|
|
2199
2185
|
})),
|
|
2200
2186
|
transform: optional(TransformOptionsSchema),
|
|
2201
|
-
watch: optional(union([
|
|
2187
|
+
watch: optional(union([WatcherOptionsSchema, literal(false)])),
|
|
2202
2188
|
checks: optional(ChecksOptionsSchema),
|
|
2203
2189
|
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.")),
|
|
2204
2190
|
preserveEntrySignatures: pipe(optional(union([
|
|
@@ -2207,8 +2193,10 @@ const InputOptionsSchema = strictObject({
|
|
|
2207
2193
|
literal("exports-only"),
|
|
2208
2194
|
literal(false)
|
|
2209
2195
|
]))),
|
|
2196
|
+
context: pipe(optional(string()), description("The value of `this` at the top level of each module.")),
|
|
2210
2197
|
tsconfig: pipe(optional(union([boolean(), string()])), description("Path to the tsconfig.json file."))
|
|
2211
2198
|
});
|
|
2199
|
+
isTypeTrue();
|
|
2212
2200
|
const InputCliOverrideSchema = strictObject({
|
|
2213
2201
|
input: pipe(optional(array(string())), description("Entry file")),
|
|
2214
2202
|
external: pipe(optional(array(string())), description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
|
|
@@ -2237,22 +2225,32 @@ const ModuleFormatSchema = union([
|
|
|
2237
2225
|
literal("iife"),
|
|
2238
2226
|
literal("umd")
|
|
2239
2227
|
]);
|
|
2228
|
+
isTypeTrue();
|
|
2240
2229
|
const AddonFunctionSchema = pipe(vFunction(), args(tuple([custom(() => true)])), returnsAsync(unionAsync([string(), pipeAsync(promise(), awaitAsync(), string())])));
|
|
2230
|
+
isTypeTrue();
|
|
2241
2231
|
const ChunkFileNamesFunctionSchema = pipe(vFunction(), args(tuple([custom(() => true)])), returns(string()));
|
|
2232
|
+
isTypeTrue();
|
|
2242
2233
|
const ChunkFileNamesSchema = union([string(), ChunkFileNamesFunctionSchema]);
|
|
2243
2234
|
const AssetFileNamesFunctionSchema = pipe(vFunction(), args(tuple([custom(() => true)])), returns(string()));
|
|
2235
|
+
isTypeTrue();
|
|
2244
2236
|
const AssetFileNamesSchema = union([string(), AssetFileNamesFunctionSchema]);
|
|
2245
2237
|
const SanitizeFileNameFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(string()));
|
|
2238
|
+
isTypeTrue();
|
|
2246
2239
|
const SanitizeFileNameSchema = union([boolean(), SanitizeFileNameFunctionSchema]);
|
|
2247
2240
|
const GlobalsFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(string()));
|
|
2241
|
+
isTypeTrue();
|
|
2248
2242
|
const PathsFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(string()));
|
|
2243
|
+
isTypeTrue();
|
|
2249
2244
|
const ManualChunksFunctionSchema = pipe(vFunction(), args(tuple([string(), object({})])), returns(nullish(string())));
|
|
2245
|
+
isTypeTrue();
|
|
2250
2246
|
const AdvancedChunksNameFunctionSchema = pipe(vFunction(), args(tuple([string(), object({})])), returns(nullish(string())));
|
|
2247
|
+
isTypeTrue();
|
|
2251
2248
|
const AdvancedChunksTestFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(union([
|
|
2252
2249
|
boolean(),
|
|
2253
2250
|
void_(),
|
|
2254
2251
|
undefined_()
|
|
2255
2252
|
])));
|
|
2253
|
+
isTypeTrue();
|
|
2256
2254
|
const AdvancedChunksSchema = strictObject({
|
|
2257
2255
|
includeDependenciesRecursively: optional(boolean()),
|
|
2258
2256
|
minSize: optional(number()),
|
|
@@ -2271,12 +2269,15 @@ const AdvancedChunksSchema = strictObject({
|
|
|
2271
2269
|
maxModuleSize: optional(number())
|
|
2272
2270
|
})))
|
|
2273
2271
|
});
|
|
2272
|
+
isTypeTrue();
|
|
2274
2273
|
const GeneratedCodePresetSchema = union([literal("es5"), literal("es2015")]);
|
|
2274
|
+
isTypeTrue();
|
|
2275
2275
|
const GeneratedCodeOptionsSchema = strictObject({
|
|
2276
2276
|
symbols: pipe(optional(boolean()), description("Whether to use Symbol.toStringTag for namespace objects")),
|
|
2277
|
-
preset: GeneratedCodePresetSchema,
|
|
2277
|
+
preset: optional(GeneratedCodePresetSchema),
|
|
2278
2278
|
profilerNames: pipe(optional(boolean()), description("Whether to add readable names to internal variables for profiling purposes"))
|
|
2279
2279
|
});
|
|
2280
|
+
isTypeTrue();
|
|
2280
2281
|
const OutputOptionsSchema = strictObject({
|
|
2281
2282
|
dir: pipe(optional(string()), description("Output directory, defaults to `dist` if `file` is not set")),
|
|
2282
2283
|
file: pipe(optional(string()), description("Single output file")),
|
|
@@ -2344,8 +2345,10 @@ const OutputOptionsSchema = strictObject({
|
|
|
2344
2345
|
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports")),
|
|
2345
2346
|
topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`.")),
|
|
2346
2347
|
cleanDir: pipe(optional(boolean()), description("Clean output directory before emitting output")),
|
|
2347
|
-
keepNames: pipe(optional(boolean()), description("Keep function and class names after bundling"))
|
|
2348
|
+
keepNames: pipe(optional(boolean()), description("Keep function and class names after bundling")),
|
|
2349
|
+
strictExecutionOrder: pipe(optional(boolean()), description("Lets modules be executed in the order they are declared."))
|
|
2348
2350
|
});
|
|
2351
|
+
isTypeTrue();
|
|
2349
2352
|
const getAddonDescription = (placement, wrapper) => {
|
|
2350
2353
|
return `Code to insert the ${styleText("bold", placement)} of the bundled file (${styleText("bold", wrapper)} the wrapper function)`;
|
|
2351
2354
|
};
|
|
@@ -2548,7 +2551,7 @@ function bindingAssetSource(source) {
|
|
|
2548
2551
|
}
|
|
2549
2552
|
|
|
2550
2553
|
//#endregion
|
|
2551
|
-
//#region \0@oxc-project+runtime@0.
|
|
2554
|
+
//#region \0@oxc-project+runtime@0.111.0/helpers/decorate.js
|
|
2552
2555
|
function __decorate(decorators, target, key, desc) {
|
|
2553
2556
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2554
2557
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2937,7 +2940,7 @@ var RolldownOutputImpl = class extends PlainObjectLike {
|
|
|
2937
2940
|
__decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
|
|
2938
2941
|
|
|
2939
2942
|
//#endregion
|
|
2940
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
2943
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.111.0/node_modules/oxc-parser/src-js/wrap.js
|
|
2941
2944
|
function wrap$1(result) {
|
|
2942
2945
|
let program, module, comments, errors;
|
|
2943
2946
|
return {
|
|
@@ -3507,10 +3510,14 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3507
3510
|
emitFile = (file) => {
|
|
3508
3511
|
if (file.type === "prebuilt-chunk") return this.context.emitPrebuiltChunk({
|
|
3509
3512
|
fileName: file.fileName,
|
|
3513
|
+
name: file.name,
|
|
3510
3514
|
code: file.code,
|
|
3511
3515
|
exports: file.exports,
|
|
3512
3516
|
map: bindingifySourcemap$1(file.map),
|
|
3513
|
-
sourcemapFileName: file.sourcemapFileName
|
|
3517
|
+
sourcemapFileName: file.sourcemapFileName,
|
|
3518
|
+
facadeModuleId: file.facadeModuleId,
|
|
3519
|
+
isEntry: file.isEntry,
|
|
3520
|
+
isDynamicEntry: file.isDynamicEntry
|
|
3514
3521
|
});
|
|
3515
3522
|
if (file.type === "chunk") return this.context.emitChunk({
|
|
3516
3523
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(file.preserveSignature),
|
|
@@ -4626,7 +4633,8 @@ function bindingifyExperimental(experimental) {
|
|
|
4626
4633
|
onDemandWrapping: experimental?.onDemandWrapping,
|
|
4627
4634
|
incrementalBuild: experimental?.incrementalBuild,
|
|
4628
4635
|
nativeMagicString: experimental?.nativeMagicString,
|
|
4629
|
-
chunkOptimization: experimental?.chunkOptimization
|
|
4636
|
+
chunkOptimization: experimental?.chunkOptimization,
|
|
4637
|
+
lazyBarrel: experimental?.lazyBarrel
|
|
4630
4638
|
};
|
|
4631
4639
|
}
|
|
4632
4640
|
function bindingifyResolve(resolve) {
|
package/dist/shared/{bindingify-input-options-Bp2kpiI8.mjs → bindingify-input-options-CObJx_Uj.mjs}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { a as logInvalidLogPosition, c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-B2CASPcx.mjs";
|
|
2
2
|
import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-DIwprzLy.mjs";
|
|
3
3
|
import { _ as noop, a as id, b as unsupported, f as or, h as arraify, n as code, r as exclude, s as include, t as and, u as moduleType, y as unreachable } from "./composable-filters-CIxSuZSM.mjs";
|
|
4
|
-
import { t as parseAst } from "./parse-ast-index-
|
|
4
|
+
import { t as parseAst } from "./parse-ast-index-BQpfNG1v.mjs";
|
|
5
5
|
import { BindingAttachDebugInfo, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects } from "../rolldown-binding.wasi.cjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import fsp from "node:fs/promises";
|
|
8
8
|
|
|
9
9
|
//#region package.json
|
|
10
|
-
var version = "1.0.0-rc.
|
|
10
|
+
var version = "1.0.0-rc.2";
|
|
11
11
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
@@ -219,7 +219,7 @@ function bindingAssetSource(source) {
|
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
//#endregion
|
|
222
|
-
//#region \0@oxc-project+runtime@0.
|
|
222
|
+
//#region \0@oxc-project+runtime@0.111.0/helpers/decorate.js
|
|
223
223
|
function __decorate(decorators, target, key, desc) {
|
|
224
224
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
225
225
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -977,10 +977,14 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
977
977
|
emitFile = (file) => {
|
|
978
978
|
if (file.type === "prebuilt-chunk") return this.context.emitPrebuiltChunk({
|
|
979
979
|
fileName: file.fileName,
|
|
980
|
+
name: file.name,
|
|
980
981
|
code: file.code,
|
|
981
982
|
exports: file.exports,
|
|
982
983
|
map: bindingifySourcemap(file.map),
|
|
983
|
-
sourcemapFileName: file.sourcemapFileName
|
|
984
|
+
sourcemapFileName: file.sourcemapFileName,
|
|
985
|
+
facadeModuleId: file.facadeModuleId,
|
|
986
|
+
isEntry: file.isEntry,
|
|
987
|
+
isDynamicEntry: file.isDynamicEntry
|
|
984
988
|
});
|
|
985
989
|
if (file.type === "chunk") return this.context.emitChunk({
|
|
986
990
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(file.preserveSignature),
|
|
@@ -2096,7 +2100,8 @@ function bindingifyExperimental(experimental) {
|
|
|
2096
2100
|
onDemandWrapping: experimental?.onDemandWrapping,
|
|
2097
2101
|
incrementalBuild: experimental?.incrementalBuild,
|
|
2098
2102
|
nativeMagicString: experimental?.nativeMagicString,
|
|
2099
|
-
chunkOptimization: experimental?.chunkOptimization
|
|
2103
|
+
chunkOptimization: experimental?.chunkOptimization,
|
|
2104
|
+
lazyBarrel: experimental?.lazyBarrel
|
|
2100
2105
|
};
|
|
2101
2106
|
}
|
|
2102
2107
|
function bindingifyResolve(resolve) {
|