rolldown 0.13.2-snapshot-e5c8b2f-20241017003312 → 0.13.2-snapshot-c19f7b8-20241019003221
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/cjs/cli.cjs +2 -2
- package/dist/cjs/experimental-index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/parallel-plugin-worker.cjs +1 -1
- package/dist/esm/cli.mjs +2 -2
- package/dist/esm/experimental-index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +1 -1
- package/dist/shared/rolldown-binding.wasi.cjs +3 -1
- package/dist/shared/{src_index-TBh5p3Dw.mjs → src_index-qHSdyVE7.mjs} +61 -33
- package/dist/shared/{src_index-AYQ0hgIb.cjs → src_index-w33O5rvI.cjs} +61 -33
- package/dist/types/binding.d.ts +8 -0
- package/dist/types/cli/arguments/schema.d.ts +3 -3
- package/dist/types/options/input-options.d.ts +6 -6
- package/dist/types/watcher.d.ts +19 -0
- package/package.json +14 -14
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { __export, __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
|
|
4
|
-
const { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, arraify, description, rolldown, version, watch } = require("../shared/src_index-
|
|
4
|
+
const { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, arraify, description, rolldown, version, watch } = require("../shared/src_index-w33O5rvI.cjs");
|
|
5
5
|
const { createConsola } = require("../shared/consola.36c0034f-HcmWcfPe.cjs");
|
|
6
6
|
const { default: nodePath } = __toESM(require("node:path"));
|
|
7
7
|
const { ZodFirstPartyTypeKind, ZodFirstPartyTypeKind: ZodFirstPartyTypeKind$1, ZodFirstPartyTypeKind: ZodFirstPartyTypeKind$2, z, z: z$1, z: z$2, z: z$3 } = __toESM(require("zod"));
|
|
@@ -1317,7 +1317,7 @@ const voidNullable = () => {
|
|
|
1317
1317
|
//#region src/options/input-options.ts
|
|
1318
1318
|
const inputOptionSchema = ((z$2.string()).or((z$2.string()).array())).or(z$2.record(z$2.string()));
|
|
1319
1319
|
const externalSchema = ((stringOrRegExp()).or((stringOrRegExp()).array())).or(((z$2.function()).args(z$2.string(), (z$2.string()).optional(), z$2.boolean())).returns(voidNullableWith(z$2.boolean())));
|
|
1320
|
-
const moduleTypesSchema = z$2.record((((((((((z$2.literal("js")).or(z$2.literal("jsx"))).or(z$2.literal("ts"))).or(z$2.literal("tsx"))).or(z$2.literal("json"))).or(z$2.literal("text"))).or(z$2.literal("base64"))).or(z$2.literal("dataurl"))).or(z$2.literal("binary"))).or(z$2.literal("empty")));
|
|
1320
|
+
const moduleTypesSchema = z$2.record(((((((((((z$2.literal("js")).or(z$2.literal("jsx"))).or(z$2.literal("ts"))).or(z$2.literal("tsx"))).or(z$2.literal("json"))).or(z$2.literal("text"))).or(z$2.literal("base64"))).or(z$2.literal("dataurl"))).or(z$2.literal("binary"))).or(z$2.literal("empty"))).or(z$2.literal("css")));
|
|
1321
1321
|
const jsxOptionsSchema = z$2.strictObject({
|
|
1322
1322
|
mode: (((z$2.literal("classic")).or(z$2.literal("automatic"))).describe("Jsx transformation mode")).optional(),
|
|
1323
1323
|
factory: ((z$2.string()).describe("Jsx element transformation")).optional(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
|
|
4
|
-
const { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } = require("../shared/src_index-
|
|
4
|
+
const { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } = require("../shared/src_index-w33O5rvI.cjs");
|
|
5
5
|
const { pathToFileURL } = __toESM(require("node:url"));
|
|
6
6
|
|
|
7
7
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const { VERSION, defineConfig, rolldown, watch } = require("../shared/src_index-
|
|
3
|
+
const { VERSION, defineConfig, rolldown, watch } = require("../shared/src_index-w33O5rvI.cjs");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
6
|
exports.VERSION = VERSION;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
|
|
4
|
-
const { PluginContextData, bindingifyPlugin, require_binding } = require("../shared/src_index-
|
|
4
|
+
const { PluginContextData, bindingifyPlugin, require_binding } = require("../shared/src_index-w33O5rvI.cjs");
|
|
5
5
|
const { parentPort, workerData } = __toESM(require("node:worker_threads"));
|
|
6
6
|
|
|
7
7
|
//#region src/parallel-plugin-worker.ts
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src_index-
|
|
3
|
+
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src_index-qHSdyVE7.mjs";
|
|
4
4
|
import { createConsola } from "../shared/consola.36c0034f-Xyw7SC_7.mjs";
|
|
5
5
|
import { default as nodePath } from "node:path";
|
|
6
6
|
import { ZodFirstPartyTypeKind, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$1, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$2, z, z as z$1, z as z$2, z as z$3 } from "zod";
|
|
@@ -1316,7 +1316,7 @@ const voidNullable = () => {
|
|
|
1316
1316
|
//#region src/options/input-options.ts
|
|
1317
1317
|
const inputOptionSchema = ((z$2.string()).or((z$2.string()).array())).or(z$2.record(z$2.string()));
|
|
1318
1318
|
const externalSchema = ((stringOrRegExp()).or((stringOrRegExp()).array())).or(((z$2.function()).args(z$2.string(), (z$2.string()).optional(), z$2.boolean())).returns(voidNullableWith(z$2.boolean())));
|
|
1319
|
-
const moduleTypesSchema = z$2.record((((((((((z$2.literal("js")).or(z$2.literal("jsx"))).or(z$2.literal("ts"))).or(z$2.literal("tsx"))).or(z$2.literal("json"))).or(z$2.literal("text"))).or(z$2.literal("base64"))).or(z$2.literal("dataurl"))).or(z$2.literal("binary"))).or(z$2.literal("empty")));
|
|
1319
|
+
const moduleTypesSchema = z$2.record(((((((((((z$2.literal("js")).or(z$2.literal("jsx"))).or(z$2.literal("ts"))).or(z$2.literal("tsx"))).or(z$2.literal("json"))).or(z$2.literal("text"))).or(z$2.literal("base64"))).or(z$2.literal("dataurl"))).or(z$2.literal("binary"))).or(z$2.literal("empty"))).or(z$2.literal("css")));
|
|
1320
1320
|
const jsxOptionsSchema = z$2.strictObject({
|
|
1321
1321
|
mode: (((z$2.literal("classic")).or(z$2.literal("automatic"))).describe("Jsx transformation mode")).optional(),
|
|
1322
1322
|
factory: ((z$2.string()).describe("Jsx element transformation")).optional(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { __toESM, aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src_index-
|
|
3
|
+
import { __toESM, aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src_index-qHSdyVE7.mjs";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
|
|
6
6
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { VERSION, defineConfig, rolldown, watch } from "../shared/src_index-
|
|
3
|
+
import { VERSION, defineConfig, rolldown, watch } from "../shared/src_index-qHSdyVE7.mjs";
|
|
4
4
|
|
|
5
5
|
export { VERSION, defineConfig, rolldown, watch };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src_index-
|
|
3
|
+
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src_index-qHSdyVE7.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
|
|
6
6
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -163,7 +163,8 @@ function __napi_rs_initialize_modules(__napiInstance) {
|
|
|
163
163
|
__napiInstance.exports['__napi_register__BindingSourcemap_struct_100']?.()
|
|
164
164
|
__napiInstance.exports['__napi_register__BindingJsonSourcemap_struct_101']?.()
|
|
165
165
|
__napiInstance.exports['__napi_register__BindingWatcher_struct_102']?.()
|
|
166
|
-
__napiInstance.exports['
|
|
166
|
+
__napiInstance.exports['__napi_register__BindingWatcher_impl_105']?.()
|
|
167
|
+
__napiInstance.exports['__napi_register__BindingWatcherEvent_106']?.()
|
|
167
168
|
}
|
|
168
169
|
module.exports.BindingLog = __napiModule.exports.BindingLog
|
|
169
170
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
@@ -179,6 +180,7 @@ module.exports.BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPlu
|
|
|
179
180
|
module.exports.BindingHookSideEffects = __napiModule.exports.BindingHookSideEffects
|
|
180
181
|
module.exports.BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
181
182
|
module.exports.BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
183
|
+
module.exports.BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
182
184
|
module.exports.isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
183
185
|
module.exports.registerPlugins = __napiModule.exports.registerPlugins
|
|
184
186
|
module.exports.transform = __napiModule.exports.transform
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
|
-
import { default as path, default as path$1
|
|
4
|
+
import { default as path, default as path$1 } from "node:path";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { isRegExp, isRegExp as isRegExp$1, isRegExp as isRegExp$2 } from "node:util/types";
|
|
7
7
|
import { Worker } from "node:worker_threads";
|
|
@@ -531,6 +531,7 @@ var require_binding = __commonJSMin((exports, module) => {
|
|
|
531
531
|
module.exports.BindingHookSideEffects = nativeBinding.BindingHookSideEffects;
|
|
532
532
|
module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
|
|
533
533
|
module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
|
|
534
|
+
module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
|
|
534
535
|
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
|
|
535
536
|
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
|
536
537
|
module.exports.transform = nativeBinding.transform;
|
|
@@ -999,12 +1000,12 @@ class TransformPluginContext extends PluginContext {
|
|
|
999
1000
|
|
|
1000
1001
|
//#endregion
|
|
1001
1002
|
//#region src/utils/transform-side-effects.ts
|
|
1002
|
-
var import_binding$
|
|
1003
|
+
var import_binding$6 = __toESM(require_binding());
|
|
1003
1004
|
function bindingifySideEffects(sideEffects) {
|
|
1004
1005
|
switch (sideEffects) {
|
|
1005
|
-
case true: return import_binding$
|
|
1006
|
-
case false: return import_binding$
|
|
1007
|
-
case "no-treeshake": return import_binding$
|
|
1006
|
+
case true: return import_binding$6.BindingHookSideEffects.True;
|
|
1007
|
+
case false: return import_binding$6.BindingHookSideEffects.False;
|
|
1008
|
+
case "no-treeshake": return import_binding$6.BindingHookSideEffects.NoTreeshake;
|
|
1008
1009
|
case null:
|
|
1009
1010
|
case undefined: return undefined;
|
|
1010
1011
|
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
@@ -1013,14 +1014,14 @@ function bindingifySideEffects(sideEffects) {
|
|
|
1013
1014
|
|
|
1014
1015
|
//#endregion
|
|
1015
1016
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
1016
|
-
var import_binding$
|
|
1017
|
+
var import_binding$5 = __toESM(require_binding());
|
|
1017
1018
|
function bindingifyPluginHookMeta(options) {
|
|
1018
1019
|
return {order: bindingPluginOrder(options.order)};
|
|
1019
1020
|
}
|
|
1020
1021
|
function bindingPluginOrder(order) {
|
|
1021
1022
|
switch (order) {
|
|
1022
|
-
case "post": return import_binding$
|
|
1023
|
-
case "pre": return import_binding$
|
|
1023
|
+
case "post": return import_binding$5.BindingPluginOrder.Post;
|
|
1024
|
+
case "pre": return import_binding$5.BindingPluginOrder.Pre;
|
|
1024
1025
|
case null:
|
|
1025
1026
|
case undefined: return undefined;
|
|
1026
1027
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
@@ -1660,7 +1661,7 @@ function normalizeAliasPluginConfig(config) {
|
|
|
1660
1661
|
|
|
1661
1662
|
//#endregion
|
|
1662
1663
|
//#region src/plugin/builtin-plugin.ts
|
|
1663
|
-
var import_binding$
|
|
1664
|
+
var import_binding$4 = __toESM(require_binding());
|
|
1664
1665
|
class BuiltinPlugin {
|
|
1665
1666
|
constructor(name, options) {
|
|
1666
1667
|
this.name = name;
|
|
@@ -1671,64 +1672,64 @@ class BuiltinPlugin {
|
|
|
1671
1672
|
}
|
|
1672
1673
|
class ModulePreloadPolyfillPlugin extends BuiltinPlugin {
|
|
1673
1674
|
constructor(config) {
|
|
1674
|
-
super(import_binding$
|
|
1675
|
+
super(import_binding$4.BindingBuiltinPluginName.ModulePreloadPolyfillPlugin, config);
|
|
1675
1676
|
}
|
|
1676
1677
|
}
|
|
1677
1678
|
class DynamicImportVarsPlugin extends BuiltinPlugin {
|
|
1678
1679
|
constructor() {
|
|
1679
|
-
super(import_binding$
|
|
1680
|
+
super(import_binding$4.BindingBuiltinPluginName.DynamicImportVarsPlugin);
|
|
1680
1681
|
}
|
|
1681
1682
|
}
|
|
1682
1683
|
class ImportGlobPlugin extends BuiltinPlugin {
|
|
1683
1684
|
constructor(config) {
|
|
1684
|
-
super(import_binding$
|
|
1685
|
+
super(import_binding$4.BindingBuiltinPluginName.ImportGlobPlugin, config);
|
|
1685
1686
|
}
|
|
1686
1687
|
}
|
|
1687
1688
|
class ManifestPlugin extends BuiltinPlugin {
|
|
1688
1689
|
constructor(config) {
|
|
1689
|
-
super(import_binding$
|
|
1690
|
+
super(import_binding$4.BindingBuiltinPluginName.ManifestPlugin, config);
|
|
1690
1691
|
}
|
|
1691
1692
|
}
|
|
1692
1693
|
class WasmHelperPlugin extends BuiltinPlugin {
|
|
1693
1694
|
constructor() {
|
|
1694
|
-
super(import_binding$
|
|
1695
|
+
super(import_binding$4.BindingBuiltinPluginName.WasmHelperPlugin);
|
|
1695
1696
|
}
|
|
1696
1697
|
}
|
|
1697
1698
|
class WasmFallbackPlugin extends BuiltinPlugin {
|
|
1698
1699
|
constructor() {
|
|
1699
|
-
super(import_binding$
|
|
1700
|
+
super(import_binding$4.BindingBuiltinPluginName.WasmFallbackPlugin);
|
|
1700
1701
|
}
|
|
1701
1702
|
}
|
|
1702
1703
|
class LoadFallbackPlugin extends BuiltinPlugin {
|
|
1703
1704
|
constructor() {
|
|
1704
|
-
super(import_binding$
|
|
1705
|
+
super(import_binding$4.BindingBuiltinPluginName.LoadFallbackPlugin);
|
|
1705
1706
|
}
|
|
1706
1707
|
}
|
|
1707
1708
|
class AliasPlugin extends BuiltinPlugin {
|
|
1708
1709
|
constructor(config) {
|
|
1709
1710
|
let normalizedAliasPluginConfig = normalizeAliasPluginConfig(config);
|
|
1710
|
-
super(import_binding$
|
|
1711
|
+
super(import_binding$4.BindingBuiltinPluginName.AliasPlugin, normalizedAliasPluginConfig);
|
|
1711
1712
|
}
|
|
1712
1713
|
}
|
|
1713
1714
|
class TransformPlugin extends BuiltinPlugin {
|
|
1714
1715
|
constructor(config) {
|
|
1715
1716
|
let normalizedConfig = normalizeEcmaTransformPluginConfig(config);
|
|
1716
|
-
super(import_binding$
|
|
1717
|
+
super(import_binding$4.BindingBuiltinPluginName.TransformPlugin, normalizedConfig);
|
|
1717
1718
|
}
|
|
1718
1719
|
}
|
|
1719
1720
|
class JsonPlugin extends BuiltinPlugin {
|
|
1720
1721
|
constructor(config) {
|
|
1721
|
-
super(import_binding$
|
|
1722
|
+
super(import_binding$4.BindingBuiltinPluginName.JsonPlugin, config);
|
|
1722
1723
|
}
|
|
1723
1724
|
}
|
|
1724
1725
|
class BuildImportAnalysisPlugin extends BuiltinPlugin {
|
|
1725
1726
|
constructor(config) {
|
|
1726
|
-
super(import_binding$
|
|
1727
|
+
super(import_binding$4.BindingBuiltinPluginName.BuildImportAnalysisPlugin, config);
|
|
1727
1728
|
}
|
|
1728
1729
|
}
|
|
1729
1730
|
class ReplacePlugin extends BuiltinPlugin {
|
|
1730
1731
|
constructor(config) {
|
|
1731
|
-
super(import_binding$
|
|
1732
|
+
super(import_binding$4.BindingBuiltinPluginName.ReplacePlugin, config);
|
|
1732
1733
|
}
|
|
1733
1734
|
}
|
|
1734
1735
|
function modulePreloadPolyfillPlugin(config) {
|
|
@@ -1836,7 +1837,7 @@ class PluginContextData {
|
|
|
1836
1837
|
|
|
1837
1838
|
//#endregion
|
|
1838
1839
|
//#region src/options/bindingify-input-options.ts
|
|
1839
|
-
var import_binding$
|
|
1840
|
+
var import_binding$3 = __toESM(require_binding());
|
|
1840
1841
|
function bindingifyInputOptions(options, outputOptions) {
|
|
1841
1842
|
const pluginContextData = new PluginContextData();
|
|
1842
1843
|
return {
|
|
@@ -1929,10 +1930,10 @@ function bindingifyInputOptions(options, outputOptions) {
|
|
|
1929
1930
|
}
|
|
1930
1931
|
function bindingifyLogLevel(logLevel) {
|
|
1931
1932
|
switch (logLevel) {
|
|
1932
|
-
case "silent": return import_binding$
|
|
1933
|
-
case "warn": return import_binding$
|
|
1934
|
-
case "info": return import_binding$
|
|
1935
|
-
case "debug": return import_binding$
|
|
1933
|
+
case "silent": return import_binding$3.BindingLogLevel.Silent;
|
|
1934
|
+
case "warn": return import_binding$3.BindingLogLevel.Warn;
|
|
1935
|
+
case "info": return import_binding$3.BindingLogLevel.Info;
|
|
1936
|
+
case "debug": return import_binding$3.BindingLogLevel.Debug;
|
|
1936
1937
|
default: throw new Error(`Unexpected log level: ${logLevel}`);
|
|
1937
1938
|
}
|
|
1938
1939
|
}
|
|
@@ -1966,7 +1967,7 @@ function bindingifyJsx(input) {
|
|
|
1966
1967
|
|
|
1967
1968
|
//#endregion
|
|
1968
1969
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
1969
|
-
var import_binding$
|
|
1970
|
+
var import_binding$2 = __toESM(require_binding());
|
|
1970
1971
|
async function initializeParallelPlugins(plugins) {
|
|
1971
1972
|
const pluginInfos = [];
|
|
1972
1973
|
for (const [index, plugin] of plugins.entries()) {
|
|
@@ -1983,7 +1984,7 @@ async function initializeParallelPlugins(plugins) {
|
|
|
1983
1984
|
return undefined;
|
|
1984
1985
|
}
|
|
1985
1986
|
const count = Math.min(availableParallelism(), 8);
|
|
1986
|
-
const parallelJsPluginRegistry = new import_binding$
|
|
1987
|
+
const parallelJsPluginRegistry = new import_binding$2.ParallelJsPluginRegistry(count);
|
|
1987
1988
|
const registryId = parallelJsPluginRegistry.id;
|
|
1988
1989
|
const workers = await initializeWorkers(registryId, count, pluginInfos);
|
|
1989
1990
|
const stopWorkers = async () => {
|
|
@@ -2008,12 +2009,12 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
|
|
|
2008
2009
|
try {
|
|
2009
2010
|
worker = new Worker(new URL(urlString), {workerData});
|
|
2010
2011
|
worker.unref();
|
|
2011
|
-
await new Promise((resolve
|
|
2012
|
+
await new Promise((resolve, reject) => {
|
|
2012
2013
|
worker.once("message", async (message) => {
|
|
2013
2014
|
if (message.type === "error") {
|
|
2014
2015
|
reject(message.error);
|
|
2015
2016
|
} else {
|
|
2016
|
-
resolve
|
|
2017
|
+
resolve();
|
|
2017
2018
|
}
|
|
2018
2019
|
});
|
|
2019
2020
|
});
|
|
@@ -2673,7 +2674,7 @@ function bindingifyEsModule(esModule) {
|
|
|
2673
2674
|
|
|
2674
2675
|
//#endregion
|
|
2675
2676
|
//#region src/utils/create-bundler.ts
|
|
2676
|
-
var import_binding = __toESM(require_binding());
|
|
2677
|
+
var import_binding$1 = __toESM(require_binding());
|
|
2677
2678
|
async function createBundler(inputOptions, outputOptions) {
|
|
2678
2679
|
const pluginDriver = new PluginDriver();
|
|
2679
2680
|
inputOptions = await pluginDriver.callOptionsHook(inputOptions);
|
|
@@ -2684,7 +2685,7 @@ async function createBundler(inputOptions, outputOptions) {
|
|
|
2684
2685
|
const normalizedOutputOptions = normalizeOutputOptions(outputOptions);
|
|
2685
2686
|
const bindingInputOptions = bindingifyInputOptions(normalizedInputOptions, normalizedOutputOptions);
|
|
2686
2687
|
return {
|
|
2687
|
-
bundler: new import_binding.Bundler(bindingInputOptions, bindingifyOutputOptions(normalizedOutputOptions), parallelPluginInitResult?.registry),
|
|
2688
|
+
bundler: new import_binding$1.Bundler(bindingInputOptions, bindingifyOutputOptions(normalizedOutputOptions), parallelPluginInitResult?.registry),
|
|
2688
2689
|
stopWorkers: parallelPluginInitResult?.stopWorkers
|
|
2689
2690
|
};
|
|
2690
2691
|
} catch (e) {
|
|
@@ -2695,6 +2696,7 @@ async function createBundler(inputOptions, outputOptions) {
|
|
|
2695
2696
|
|
|
2696
2697
|
//#endregion
|
|
2697
2698
|
//#region src/watcher.ts
|
|
2699
|
+
var import_binding = __toESM(require_binding());
|
|
2698
2700
|
class Watcher {
|
|
2699
2701
|
closed;
|
|
2700
2702
|
controller;
|
|
@@ -2709,8 +2711,34 @@ class Watcher {
|
|
|
2709
2711
|
await this.inner.close();
|
|
2710
2712
|
this.controller.abort();
|
|
2711
2713
|
}
|
|
2714
|
+
on(event, listener) {
|
|
2715
|
+
switch (event) {
|
|
2716
|
+
case "close":
|
|
2717
|
+
this.inner.on(import_binding.BindingWatcherEvent.Close, async () => {
|
|
2718
|
+
await listener();
|
|
2719
|
+
});
|
|
2720
|
+
break;
|
|
2721
|
+
case "event":
|
|
2722
|
+
this.inner.on(import_binding.BindingWatcherEvent.Event, async (data) => {
|
|
2723
|
+
await listener(data);
|
|
2724
|
+
});
|
|
2725
|
+
break;
|
|
2726
|
+
case "restart":
|
|
2727
|
+
this.inner.on(import_binding.BindingWatcherEvent.ReStart, async () => {
|
|
2728
|
+
await listener();
|
|
2729
|
+
});
|
|
2730
|
+
break;
|
|
2731
|
+
case "change":
|
|
2732
|
+
this.inner.on(import_binding.BindingWatcherEvent.Change, async (data) => {
|
|
2733
|
+
await listener(data.id, {event: data.kind});
|
|
2734
|
+
});
|
|
2735
|
+
break;
|
|
2736
|
+
default: throw new Error(`Unknown event: ${event}`);
|
|
2737
|
+
}
|
|
2738
|
+
return this;
|
|
2739
|
+
}
|
|
2712
2740
|
watch() {
|
|
2713
|
-
const watcherWorkerPath = resolve("rolldown
|
|
2741
|
+
const watcherWorkerPath = require.resolve("rolldown/watcher-worker");
|
|
2714
2742
|
const child = spawn(process.argv[0], [watcherWorkerPath], {signal: this.controller.signal});
|
|
2715
2743
|
child.on("error", () => {});
|
|
2716
2744
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { __commonJSMin, __toESM } = require("./chunk-JoMxl5V2.cjs");
|
|
2
2
|
const { spawn } = __toESM(require("node:child_process"));
|
|
3
|
-
const { default: path, default: path$1
|
|
3
|
+
const { default: path, default: path$1 } = __toESM(require("node:path"));
|
|
4
4
|
const { z } = __toESM(require("zod"));
|
|
5
5
|
const { isRegExp, isRegExp: isRegExp$1, isRegExp: isRegExp$2 } = __toESM(require("node:util/types"));
|
|
6
6
|
const { Worker } = __toESM(require("node:worker_threads"));
|
|
@@ -500,6 +500,7 @@ var require_binding = __commonJSMin((exports, module) => {
|
|
|
500
500
|
module.exports.BindingHookSideEffects = nativeBinding.BindingHookSideEffects;
|
|
501
501
|
module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
|
|
502
502
|
module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
|
|
503
|
+
module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
|
|
503
504
|
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
|
|
504
505
|
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
|
505
506
|
module.exports.transform = nativeBinding.transform;
|
|
@@ -968,12 +969,12 @@ class TransformPluginContext extends PluginContext {
|
|
|
968
969
|
|
|
969
970
|
//#endregion
|
|
970
971
|
//#region src/utils/transform-side-effects.ts
|
|
971
|
-
var import_binding$
|
|
972
|
+
var import_binding$6 = __toESM(require_binding());
|
|
972
973
|
function bindingifySideEffects(sideEffects) {
|
|
973
974
|
switch (sideEffects) {
|
|
974
|
-
case true: return import_binding$
|
|
975
|
-
case false: return import_binding$
|
|
976
|
-
case "no-treeshake": return import_binding$
|
|
975
|
+
case true: return import_binding$6.BindingHookSideEffects.True;
|
|
976
|
+
case false: return import_binding$6.BindingHookSideEffects.False;
|
|
977
|
+
case "no-treeshake": return import_binding$6.BindingHookSideEffects.NoTreeshake;
|
|
977
978
|
case null:
|
|
978
979
|
case undefined: return undefined;
|
|
979
980
|
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
@@ -982,14 +983,14 @@ function bindingifySideEffects(sideEffects) {
|
|
|
982
983
|
|
|
983
984
|
//#endregion
|
|
984
985
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
985
|
-
var import_binding$
|
|
986
|
+
var import_binding$5 = __toESM(require_binding());
|
|
986
987
|
function bindingifyPluginHookMeta(options) {
|
|
987
988
|
return {order: bindingPluginOrder(options.order)};
|
|
988
989
|
}
|
|
989
990
|
function bindingPluginOrder(order) {
|
|
990
991
|
switch (order) {
|
|
991
|
-
case "post": return import_binding$
|
|
992
|
-
case "pre": return import_binding$
|
|
992
|
+
case "post": return import_binding$5.BindingPluginOrder.Post;
|
|
993
|
+
case "pre": return import_binding$5.BindingPluginOrder.Pre;
|
|
993
994
|
case null:
|
|
994
995
|
case undefined: return undefined;
|
|
995
996
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
@@ -1629,7 +1630,7 @@ function normalizeAliasPluginConfig(config) {
|
|
|
1629
1630
|
|
|
1630
1631
|
//#endregion
|
|
1631
1632
|
//#region src/plugin/builtin-plugin.ts
|
|
1632
|
-
var import_binding$
|
|
1633
|
+
var import_binding$4 = __toESM(require_binding());
|
|
1633
1634
|
class BuiltinPlugin {
|
|
1634
1635
|
constructor(name, options) {
|
|
1635
1636
|
this.name = name;
|
|
@@ -1640,64 +1641,64 @@ class BuiltinPlugin {
|
|
|
1640
1641
|
}
|
|
1641
1642
|
class ModulePreloadPolyfillPlugin extends BuiltinPlugin {
|
|
1642
1643
|
constructor(config) {
|
|
1643
|
-
super(import_binding$
|
|
1644
|
+
super(import_binding$4.BindingBuiltinPluginName.ModulePreloadPolyfillPlugin, config);
|
|
1644
1645
|
}
|
|
1645
1646
|
}
|
|
1646
1647
|
class DynamicImportVarsPlugin extends BuiltinPlugin {
|
|
1647
1648
|
constructor() {
|
|
1648
|
-
super(import_binding$
|
|
1649
|
+
super(import_binding$4.BindingBuiltinPluginName.DynamicImportVarsPlugin);
|
|
1649
1650
|
}
|
|
1650
1651
|
}
|
|
1651
1652
|
class ImportGlobPlugin extends BuiltinPlugin {
|
|
1652
1653
|
constructor(config) {
|
|
1653
|
-
super(import_binding$
|
|
1654
|
+
super(import_binding$4.BindingBuiltinPluginName.ImportGlobPlugin, config);
|
|
1654
1655
|
}
|
|
1655
1656
|
}
|
|
1656
1657
|
class ManifestPlugin extends BuiltinPlugin {
|
|
1657
1658
|
constructor(config) {
|
|
1658
|
-
super(import_binding$
|
|
1659
|
+
super(import_binding$4.BindingBuiltinPluginName.ManifestPlugin, config);
|
|
1659
1660
|
}
|
|
1660
1661
|
}
|
|
1661
1662
|
class WasmHelperPlugin extends BuiltinPlugin {
|
|
1662
1663
|
constructor() {
|
|
1663
|
-
super(import_binding$
|
|
1664
|
+
super(import_binding$4.BindingBuiltinPluginName.WasmHelperPlugin);
|
|
1664
1665
|
}
|
|
1665
1666
|
}
|
|
1666
1667
|
class WasmFallbackPlugin extends BuiltinPlugin {
|
|
1667
1668
|
constructor() {
|
|
1668
|
-
super(import_binding$
|
|
1669
|
+
super(import_binding$4.BindingBuiltinPluginName.WasmFallbackPlugin);
|
|
1669
1670
|
}
|
|
1670
1671
|
}
|
|
1671
1672
|
class LoadFallbackPlugin extends BuiltinPlugin {
|
|
1672
1673
|
constructor() {
|
|
1673
|
-
super(import_binding$
|
|
1674
|
+
super(import_binding$4.BindingBuiltinPluginName.LoadFallbackPlugin);
|
|
1674
1675
|
}
|
|
1675
1676
|
}
|
|
1676
1677
|
class AliasPlugin extends BuiltinPlugin {
|
|
1677
1678
|
constructor(config) {
|
|
1678
1679
|
let normalizedAliasPluginConfig = normalizeAliasPluginConfig(config);
|
|
1679
|
-
super(import_binding$
|
|
1680
|
+
super(import_binding$4.BindingBuiltinPluginName.AliasPlugin, normalizedAliasPluginConfig);
|
|
1680
1681
|
}
|
|
1681
1682
|
}
|
|
1682
1683
|
class TransformPlugin extends BuiltinPlugin {
|
|
1683
1684
|
constructor(config) {
|
|
1684
1685
|
let normalizedConfig = normalizeEcmaTransformPluginConfig(config);
|
|
1685
|
-
super(import_binding$
|
|
1686
|
+
super(import_binding$4.BindingBuiltinPluginName.TransformPlugin, normalizedConfig);
|
|
1686
1687
|
}
|
|
1687
1688
|
}
|
|
1688
1689
|
class JsonPlugin extends BuiltinPlugin {
|
|
1689
1690
|
constructor(config) {
|
|
1690
|
-
super(import_binding$
|
|
1691
|
+
super(import_binding$4.BindingBuiltinPluginName.JsonPlugin, config);
|
|
1691
1692
|
}
|
|
1692
1693
|
}
|
|
1693
1694
|
class BuildImportAnalysisPlugin extends BuiltinPlugin {
|
|
1694
1695
|
constructor(config) {
|
|
1695
|
-
super(import_binding$
|
|
1696
|
+
super(import_binding$4.BindingBuiltinPluginName.BuildImportAnalysisPlugin, config);
|
|
1696
1697
|
}
|
|
1697
1698
|
}
|
|
1698
1699
|
class ReplacePlugin extends BuiltinPlugin {
|
|
1699
1700
|
constructor(config) {
|
|
1700
|
-
super(import_binding$
|
|
1701
|
+
super(import_binding$4.BindingBuiltinPluginName.ReplacePlugin, config);
|
|
1701
1702
|
}
|
|
1702
1703
|
}
|
|
1703
1704
|
function modulePreloadPolyfillPlugin(config) {
|
|
@@ -1805,7 +1806,7 @@ class PluginContextData {
|
|
|
1805
1806
|
|
|
1806
1807
|
//#endregion
|
|
1807
1808
|
//#region src/options/bindingify-input-options.ts
|
|
1808
|
-
var import_binding$
|
|
1809
|
+
var import_binding$3 = __toESM(require_binding());
|
|
1809
1810
|
function bindingifyInputOptions(options, outputOptions) {
|
|
1810
1811
|
const pluginContextData = new PluginContextData();
|
|
1811
1812
|
return {
|
|
@@ -1898,10 +1899,10 @@ function bindingifyInputOptions(options, outputOptions) {
|
|
|
1898
1899
|
}
|
|
1899
1900
|
function bindingifyLogLevel(logLevel) {
|
|
1900
1901
|
switch (logLevel) {
|
|
1901
|
-
case "silent": return import_binding$
|
|
1902
|
-
case "warn": return import_binding$
|
|
1903
|
-
case "info": return import_binding$
|
|
1904
|
-
case "debug": return import_binding$
|
|
1902
|
+
case "silent": return import_binding$3.BindingLogLevel.Silent;
|
|
1903
|
+
case "warn": return import_binding$3.BindingLogLevel.Warn;
|
|
1904
|
+
case "info": return import_binding$3.BindingLogLevel.Info;
|
|
1905
|
+
case "debug": return import_binding$3.BindingLogLevel.Debug;
|
|
1905
1906
|
default: throw new Error(`Unexpected log level: ${logLevel}`);
|
|
1906
1907
|
}
|
|
1907
1908
|
}
|
|
@@ -1935,7 +1936,7 @@ function bindingifyJsx(input) {
|
|
|
1935
1936
|
|
|
1936
1937
|
//#endregion
|
|
1937
1938
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
1938
|
-
var import_binding$
|
|
1939
|
+
var import_binding$2 = __toESM(require_binding());
|
|
1939
1940
|
async function initializeParallelPlugins(plugins) {
|
|
1940
1941
|
const pluginInfos = [];
|
|
1941
1942
|
for (const [index, plugin] of plugins.entries()) {
|
|
@@ -1952,7 +1953,7 @@ async function initializeParallelPlugins(plugins) {
|
|
|
1952
1953
|
return undefined;
|
|
1953
1954
|
}
|
|
1954
1955
|
const count = Math.min(availableParallelism(), 8);
|
|
1955
|
-
const parallelJsPluginRegistry = new import_binding$
|
|
1956
|
+
const parallelJsPluginRegistry = new import_binding$2.ParallelJsPluginRegistry(count);
|
|
1956
1957
|
const registryId = parallelJsPluginRegistry.id;
|
|
1957
1958
|
const workers = await initializeWorkers(registryId, count, pluginInfos);
|
|
1958
1959
|
const stopWorkers = async () => {
|
|
@@ -1977,12 +1978,12 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
|
|
|
1977
1978
|
try {
|
|
1978
1979
|
worker = new Worker(new URL(urlString), {workerData});
|
|
1979
1980
|
worker.unref();
|
|
1980
|
-
await new Promise((resolve
|
|
1981
|
+
await new Promise((resolve, reject) => {
|
|
1981
1982
|
worker.once("message", async (message) => {
|
|
1982
1983
|
if (message.type === "error") {
|
|
1983
1984
|
reject(message.error);
|
|
1984
1985
|
} else {
|
|
1985
|
-
resolve
|
|
1986
|
+
resolve();
|
|
1986
1987
|
}
|
|
1987
1988
|
});
|
|
1988
1989
|
});
|
|
@@ -2642,7 +2643,7 @@ function bindingifyEsModule(esModule) {
|
|
|
2642
2643
|
|
|
2643
2644
|
//#endregion
|
|
2644
2645
|
//#region src/utils/create-bundler.ts
|
|
2645
|
-
var import_binding = __toESM(require_binding());
|
|
2646
|
+
var import_binding$1 = __toESM(require_binding());
|
|
2646
2647
|
async function createBundler(inputOptions, outputOptions) {
|
|
2647
2648
|
const pluginDriver = new PluginDriver();
|
|
2648
2649
|
inputOptions = await pluginDriver.callOptionsHook(inputOptions);
|
|
@@ -2653,7 +2654,7 @@ async function createBundler(inputOptions, outputOptions) {
|
|
|
2653
2654
|
const normalizedOutputOptions = normalizeOutputOptions(outputOptions);
|
|
2654
2655
|
const bindingInputOptions = bindingifyInputOptions(normalizedInputOptions, normalizedOutputOptions);
|
|
2655
2656
|
return {
|
|
2656
|
-
bundler: new import_binding.Bundler(bindingInputOptions, bindingifyOutputOptions(normalizedOutputOptions), parallelPluginInitResult?.registry),
|
|
2657
|
+
bundler: new import_binding$1.Bundler(bindingInputOptions, bindingifyOutputOptions(normalizedOutputOptions), parallelPluginInitResult?.registry),
|
|
2657
2658
|
stopWorkers: parallelPluginInitResult?.stopWorkers
|
|
2658
2659
|
};
|
|
2659
2660
|
} catch (e) {
|
|
@@ -2664,6 +2665,7 @@ async function createBundler(inputOptions, outputOptions) {
|
|
|
2664
2665
|
|
|
2665
2666
|
//#endregion
|
|
2666
2667
|
//#region src/watcher.ts
|
|
2668
|
+
var import_binding = __toESM(require_binding());
|
|
2667
2669
|
class Watcher {
|
|
2668
2670
|
closed;
|
|
2669
2671
|
controller;
|
|
@@ -2678,8 +2680,34 @@ class Watcher {
|
|
|
2678
2680
|
await this.inner.close();
|
|
2679
2681
|
this.controller.abort();
|
|
2680
2682
|
}
|
|
2683
|
+
on(event, listener) {
|
|
2684
|
+
switch (event) {
|
|
2685
|
+
case "close":
|
|
2686
|
+
this.inner.on(import_binding.BindingWatcherEvent.Close, async () => {
|
|
2687
|
+
await listener();
|
|
2688
|
+
});
|
|
2689
|
+
break;
|
|
2690
|
+
case "event":
|
|
2691
|
+
this.inner.on(import_binding.BindingWatcherEvent.Event, async (data) => {
|
|
2692
|
+
await listener(data);
|
|
2693
|
+
});
|
|
2694
|
+
break;
|
|
2695
|
+
case "restart":
|
|
2696
|
+
this.inner.on(import_binding.BindingWatcherEvent.ReStart, async () => {
|
|
2697
|
+
await listener();
|
|
2698
|
+
});
|
|
2699
|
+
break;
|
|
2700
|
+
case "change":
|
|
2701
|
+
this.inner.on(import_binding.BindingWatcherEvent.Change, async (data) => {
|
|
2702
|
+
await listener(data.id, {event: data.kind});
|
|
2703
|
+
});
|
|
2704
|
+
break;
|
|
2705
|
+
default: throw new Error(`Unknown event: ${event}`);
|
|
2706
|
+
}
|
|
2707
|
+
return this;
|
|
2708
|
+
}
|
|
2681
2709
|
watch() {
|
|
2682
|
-
const watcherWorkerPath = resolve("rolldown
|
|
2710
|
+
const watcherWorkerPath = require.resolve("rolldown/watcher-worker");
|
|
2683
2711
|
const child = spawn(process.argv[0], [watcherWorkerPath], {signal: this.controller.signal});
|
|
2684
2712
|
child.on("error", () => {});
|
|
2685
2713
|
}
|
package/dist/types/binding.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export declare class BindingTransformPluginContext {
|
|
|
59
59
|
|
|
60
60
|
export declare class BindingWatcher {
|
|
61
61
|
close(): Promise<void>
|
|
62
|
+
on(event: BindingWatcherEvent, listener: (data?: Record<string, string>) => void): void
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
export declare class Bundler {
|
|
@@ -435,6 +436,13 @@ export interface BindingTreeshake {
|
|
|
435
436
|
moduleSideEffects: string
|
|
436
437
|
}
|
|
437
438
|
|
|
439
|
+
export declare enum BindingWatcherEvent {
|
|
440
|
+
Close = 0,
|
|
441
|
+
Event = 1,
|
|
442
|
+
ReStart = 2,
|
|
443
|
+
Change = 3
|
|
444
|
+
}
|
|
445
|
+
|
|
438
446
|
export interface Es2015Options {
|
|
439
447
|
/** Transform arrow functions into function expressions. */
|
|
440
448
|
arrowFunction?: ArrowFunctionsOptions
|
|
@@ -53,7 +53,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
53
53
|
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
|
54
54
|
onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>;
|
|
55
55
|
onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>;
|
|
56
|
-
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>>>;
|
|
56
|
+
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>;
|
|
57
57
|
experimental: z.ZodOptional<z.ZodObject<{
|
|
58
58
|
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>;
|
|
59
59
|
strictExecutionOrder: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -195,7 +195,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
195
195
|
refresh?: boolean | undefined;
|
|
196
196
|
development?: boolean | undefined;
|
|
197
197
|
} | undefined;
|
|
198
|
-
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
198
|
+
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
|
|
199
199
|
define?: Record<string, string> | undefined;
|
|
200
200
|
inject?: Record<string, string> | undefined;
|
|
201
201
|
footer?: string | undefined;
|
|
@@ -240,7 +240,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
240
240
|
refresh?: boolean | undefined;
|
|
241
241
|
development?: boolean | undefined;
|
|
242
242
|
} | undefined;
|
|
243
|
-
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
243
|
+
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
|
|
244
244
|
define?: Record<string, string> | undefined;
|
|
245
245
|
inject?: Record<string, string> | undefined;
|
|
246
246
|
footer?: string | undefined;
|
|
@@ -76,7 +76,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
76
76
|
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
|
77
77
|
onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>;
|
|
78
78
|
onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>;
|
|
79
|
-
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>>>;
|
|
79
|
+
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>;
|
|
80
80
|
experimental: z.ZodOptional<z.ZodObject<{
|
|
81
81
|
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>;
|
|
82
82
|
strictExecutionOrder: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -151,7 +151,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
151
151
|
refresh?: boolean | undefined;
|
|
152
152
|
development?: boolean | undefined;
|
|
153
153
|
} | undefined;
|
|
154
|
-
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
154
|
+
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
|
|
155
155
|
experimental?: {
|
|
156
156
|
enableComposingJsPlugins?: boolean | undefined;
|
|
157
157
|
strictExecutionOrder?: boolean | undefined;
|
|
@@ -193,7 +193,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
193
193
|
refresh?: boolean | undefined;
|
|
194
194
|
development?: boolean | undefined;
|
|
195
195
|
} | undefined;
|
|
196
|
-
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
196
|
+
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
|
|
197
197
|
experimental?: {
|
|
198
198
|
enableComposingJsPlugins?: boolean | undefined;
|
|
199
199
|
strictExecutionOrder?: boolean | undefined;
|
|
@@ -251,7 +251,7 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
251
251
|
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
|
252
252
|
onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>;
|
|
253
253
|
onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>;
|
|
254
|
-
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>>>;
|
|
254
|
+
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>;
|
|
255
255
|
experimental: z.ZodOptional<z.ZodObject<{
|
|
256
256
|
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>;
|
|
257
257
|
strictExecutionOrder: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -313,7 +313,7 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
313
313
|
refresh?: boolean | undefined;
|
|
314
314
|
development?: boolean | undefined;
|
|
315
315
|
} | undefined;
|
|
316
|
-
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
316
|
+
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
|
|
317
317
|
define?: Record<string, string> | undefined;
|
|
318
318
|
inject?: Record<string, string> | undefined;
|
|
319
319
|
}, {
|
|
@@ -332,7 +332,7 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
332
332
|
refresh?: boolean | undefined;
|
|
333
333
|
development?: boolean | undefined;
|
|
334
334
|
} | undefined;
|
|
335
|
-
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
335
|
+
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
|
|
336
336
|
define?: Record<string, string> | undefined;
|
|
337
337
|
inject?: Record<string, string> | undefined;
|
|
338
338
|
}>;
|
package/dist/types/watcher.d.ts
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import { BindingWatcher } from './binding';
|
|
2
|
+
import { MaybePromise } from './types/utils';
|
|
2
3
|
export declare class Watcher {
|
|
3
4
|
closed: boolean;
|
|
4
5
|
controller: AbortController;
|
|
5
6
|
inner: BindingWatcher;
|
|
6
7
|
constructor(inner: BindingWatcher);
|
|
7
8
|
close(): Promise<void>;
|
|
9
|
+
on(event: 'change', listener: (id: string, change: {
|
|
10
|
+
event: ChangeEvent;
|
|
11
|
+
}) => MaybePromise<void>): this;
|
|
12
|
+
on(event: 'event', listener: (data: RollupWatcherEvent) => MaybePromise<void>): this;
|
|
13
|
+
on(event: 'restart' | 'close', listener: () => MaybePromise<void>): this;
|
|
8
14
|
watch(): void;
|
|
9
15
|
}
|
|
16
|
+
export type WatcherEvent = 'close' | 'event' | 'restart' | 'change';
|
|
17
|
+
export type ChangeEvent = 'create' | 'update' | 'delete';
|
|
18
|
+
export type RollupWatcherEvent = {
|
|
19
|
+
code: 'START';
|
|
20
|
+
} | {
|
|
21
|
+
code: 'BUNDLE_START';
|
|
22
|
+
} | {
|
|
23
|
+
code: 'BUNDLE_END';
|
|
24
|
+
} | {
|
|
25
|
+
code: 'END';
|
|
26
|
+
} | {
|
|
27
|
+
code: 'ERROR'; /** error: RollupError; result: RollupBuild | null **/
|
|
28
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "0.13.2-snapshot-
|
|
3
|
+
"version": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -104,21 +104,21 @@
|
|
|
104
104
|
"why-is-node-running": "^3.0.0",
|
|
105
105
|
"zod-to-json-schema": "^3.23.2",
|
|
106
106
|
"@rolldown/testing": "0.0.1",
|
|
107
|
-
"rolldown": "0.13.2-snapshot-
|
|
107
|
+
"rolldown": "0.13.2-snapshot-c19f7b8-20241019003221"
|
|
108
108
|
},
|
|
109
109
|
"optionalDependencies": {
|
|
110
|
-
"@rolldown/binding-darwin-
|
|
111
|
-
"@rolldown/binding-
|
|
112
|
-
"@rolldown/binding-
|
|
113
|
-
"@rolldown/binding-
|
|
114
|
-
"@rolldown/binding-linux-arm64-gnu": "0.13.2-snapshot-
|
|
115
|
-
"@rolldown/binding-linux-
|
|
116
|
-
"@rolldown/binding-linux-
|
|
117
|
-
"@rolldown/binding-
|
|
118
|
-
"@rolldown/binding-
|
|
119
|
-
"@rolldown/binding-win32-
|
|
120
|
-
"@rolldown/binding-win32-
|
|
121
|
-
"@rolldown/binding-win32-
|
|
110
|
+
"@rolldown/binding-darwin-x64": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
111
|
+
"@rolldown/binding-linux-arm-gnueabihf": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
112
|
+
"@rolldown/binding-darwin-arm64": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
113
|
+
"@rolldown/binding-freebsd-x64": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
114
|
+
"@rolldown/binding-linux-arm64-gnu": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
115
|
+
"@rolldown/binding-linux-x64-gnu": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
116
|
+
"@rolldown/binding-linux-arm64-musl": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
117
|
+
"@rolldown/binding-wasm32-wasi": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
118
|
+
"@rolldown/binding-linux-x64-musl": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
119
|
+
"@rolldown/binding-win32-x64-msvc": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
120
|
+
"@rolldown/binding-win32-arm64-msvc": "0.13.2-snapshot-c19f7b8-20241019003221",
|
|
121
|
+
"@rolldown/binding-win32-ia32-msvc": "0.13.2-snapshot-c19f7b8-20241019003221"
|
|
122
122
|
},
|
|
123
123
|
"scripts": {
|
|
124
124
|
"# Scrips for binding #": "_",
|