rolldown 0.15.0-snapshot-5e456b6-20241203003703 → 0.15.0-snapshot-b2570e7-20241204003545
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 +1 -1
- 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 +1 -1
- 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/{src-COU7qQBJ.cjs → src-1jxF0vle.cjs} +87 -69
- package/dist/shared/{src-DEPa5yhI.mjs → src-Cm19F5A9.mjs} +87 -69
- package/dist/types/api/build.d.ts +2 -0
- package/dist/types/api/watch/index.d.ts +2 -2
- package/dist/types/api/watch/watch-emitter.d.ts +31 -0
- package/dist/types/api/watch/watcher.d.ts +6 -26
- package/dist/types/binding.d.ts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/types/utils/error.d.ts +1 -1
- package/package.json +14 -14
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-1jxF0vle.cjs');
|
|
4
4
|
const require_consola_36c0034f = require('../shared/consola_36c0034f-_8_dG1Nr.cjs');
|
|
5
5
|
const zod = require_chunk.__toESM(require("zod"));
|
|
6
6
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-1jxF0vle.cjs');
|
|
4
4
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
5
5
|
|
|
6
6
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-1jxF0vle.cjs');
|
|
4
4
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
5
5
|
|
|
6
6
|
//#region src/parallel-plugin-worker.ts
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src-
|
|
1
|
+
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src-Cm19F5A9.mjs";
|
|
2
2
|
import { createConsola } from "../shared/consola_36c0034f-DWsVjwtA.mjs";
|
|
3
3
|
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";
|
|
4
4
|
import nodePath, { default as path } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-
|
|
1
|
+
import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-Cm19F5A9.mjs";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-
|
|
1
|
+
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-Cm19F5A9.mjs";
|
|
2
2
|
import { parentPort, workerData } from "node:worker_threads";
|
|
3
3
|
|
|
4
4
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -2625,93 +2625,111 @@ const rolldown = async (input) => {
|
|
|
2625
2625
|
return new RolldownBuild(input);
|
|
2626
2626
|
};
|
|
2627
2627
|
|
|
2628
|
+
//#endregion
|
|
2629
|
+
//#region src/api/watch/watch-emitter.ts
|
|
2630
|
+
var WatcherEmitter = class {
|
|
2631
|
+
listeners = new Map();
|
|
2632
|
+
timer;
|
|
2633
|
+
constructor() {
|
|
2634
|
+
this.timer = setInterval(
|
|
2635
|
+
() => {},
|
|
2636
|
+
1e9
|
|
2637
|
+
/* Low power usage */
|
|
2638
|
+
);
|
|
2639
|
+
}
|
|
2640
|
+
on(event, listener) {
|
|
2641
|
+
const listeners = this.listeners.get(event);
|
|
2642
|
+
if (listeners) listeners.push(listener);
|
|
2643
|
+
else this.listeners.set(event, [listener]);
|
|
2644
|
+
return this;
|
|
2645
|
+
}
|
|
2646
|
+
async onEvent(event) {
|
|
2647
|
+
const listeners = this.listeners.get(event.eventKind());
|
|
2648
|
+
if (listeners) switch (event.eventKind()) {
|
|
2649
|
+
case "close":
|
|
2650
|
+
case "restart":
|
|
2651
|
+
for (const listener of listeners) await listener();
|
|
2652
|
+
break;
|
|
2653
|
+
case "event":
|
|
2654
|
+
for (const listener of listeners) {
|
|
2655
|
+
const code = event.bundleEventKind();
|
|
2656
|
+
switch (code) {
|
|
2657
|
+
case "BUNDLE_END":
|
|
2658
|
+
const { duration, output } = event.bundleEndData();
|
|
2659
|
+
await listener({
|
|
2660
|
+
code: "BUNDLE_END",
|
|
2661
|
+
duration,
|
|
2662
|
+
output: [output]
|
|
2663
|
+
});
|
|
2664
|
+
break;
|
|
2665
|
+
case "ERROR":
|
|
2666
|
+
const errors = event.errors();
|
|
2667
|
+
await listener({
|
|
2668
|
+
code: "ERROR",
|
|
2669
|
+
error: normalizeErrors(errors)
|
|
2670
|
+
});
|
|
2671
|
+
break;
|
|
2672
|
+
default:
|
|
2673
|
+
await listener({ code });
|
|
2674
|
+
break;
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
break;
|
|
2678
|
+
case "change":
|
|
2679
|
+
for (const listener of listeners) {
|
|
2680
|
+
const { path: path$2, kind } = event.watchChangeData();
|
|
2681
|
+
await listener(path$2, { event: kind });
|
|
2682
|
+
}
|
|
2683
|
+
break;
|
|
2684
|
+
default: throw new Error(`Unknown event: ${event}`);
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
async close() {
|
|
2688
|
+
clearInterval(this.timer);
|
|
2689
|
+
}
|
|
2690
|
+
};
|
|
2691
|
+
|
|
2628
2692
|
//#endregion
|
|
2629
2693
|
//#region src/api/watch/watcher.ts
|
|
2630
2694
|
var Watcher = class {
|
|
2631
2695
|
closed;
|
|
2632
|
-
controller;
|
|
2633
2696
|
inner;
|
|
2697
|
+
emitter;
|
|
2634
2698
|
stopWorkers;
|
|
2635
|
-
|
|
2636
|
-
constructor(inner, stopWorkers) {
|
|
2699
|
+
constructor(emitter, inner, stopWorkers) {
|
|
2637
2700
|
this.closed = false;
|
|
2638
|
-
this.controller = new AbortController();
|
|
2639
2701
|
this.inner = inner;
|
|
2702
|
+
this.emitter = emitter;
|
|
2703
|
+
const originClose = emitter.close.bind(emitter);
|
|
2704
|
+
emitter.close = async () => {
|
|
2705
|
+
await this.close();
|
|
2706
|
+
originClose();
|
|
2707
|
+
};
|
|
2640
2708
|
this.stopWorkers = stopWorkers;
|
|
2641
2709
|
}
|
|
2642
2710
|
async close() {
|
|
2711
|
+
if (this.closed) return;
|
|
2643
2712
|
this.closed = true;
|
|
2644
2713
|
await this.stopWorkers?.();
|
|
2645
2714
|
await this.inner.close();
|
|
2646
|
-
this.controller.abort();
|
|
2647
2715
|
}
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
if (listeners) listeners.push(listener);
|
|
2651
|
-
else this.listeners.set(event, [listener]);
|
|
2652
|
-
return this;
|
|
2653
|
-
}
|
|
2654
|
-
watch() {
|
|
2655
|
-
const timer = setInterval(
|
|
2656
|
-
() => {},
|
|
2657
|
-
1e9
|
|
2658
|
-
/* Low power usage */
|
|
2659
|
-
);
|
|
2660
|
-
this.controller.signal.addEventListener("abort", () => {
|
|
2661
|
-
clearInterval(timer);
|
|
2662
|
-
});
|
|
2663
|
-
process.nextTick(() => this.inner.start(async (event) => {
|
|
2664
|
-
const listeners = this.listeners.get(event.eventKind());
|
|
2665
|
-
if (listeners) switch (event.eventKind()) {
|
|
2666
|
-
case "close":
|
|
2667
|
-
case "restart":
|
|
2668
|
-
for (const listener of listeners) await listener();
|
|
2669
|
-
break;
|
|
2670
|
-
case "event":
|
|
2671
|
-
for (const listener of listeners) {
|
|
2672
|
-
const code = event.bundleEventKind();
|
|
2673
|
-
switch (code) {
|
|
2674
|
-
case "BUNDLE_END":
|
|
2675
|
-
const { duration, output } = event.bundleEndData();
|
|
2676
|
-
await listener({
|
|
2677
|
-
code: "BUNDLE_END",
|
|
2678
|
-
duration,
|
|
2679
|
-
output: [output]
|
|
2680
|
-
});
|
|
2681
|
-
break;
|
|
2682
|
-
case "ERROR":
|
|
2683
|
-
const errors = event.errors();
|
|
2684
|
-
await listener({
|
|
2685
|
-
code: "ERROR",
|
|
2686
|
-
error: normalizeErrors(errors)
|
|
2687
|
-
});
|
|
2688
|
-
break;
|
|
2689
|
-
default:
|
|
2690
|
-
await listener({ code });
|
|
2691
|
-
break;
|
|
2692
|
-
}
|
|
2693
|
-
}
|
|
2694
|
-
break;
|
|
2695
|
-
case "change":
|
|
2696
|
-
for (const listener of listeners) {
|
|
2697
|
-
const { path: path$2, kind } = event.watchChangeData();
|
|
2698
|
-
await listener(path$2, { event: kind });
|
|
2699
|
-
}
|
|
2700
|
-
break;
|
|
2701
|
-
default: throw new Error(`Unknown event: ${event}`);
|
|
2702
|
-
}
|
|
2703
|
-
}));
|
|
2716
|
+
start() {
|
|
2717
|
+
process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
|
|
2704
2718
|
}
|
|
2705
2719
|
};
|
|
2720
|
+
async function createWatcher(emitter, input) {
|
|
2721
|
+
const { bundler, stopWorkers } = await createBundler(input, input.output || {});
|
|
2722
|
+
const bindingWatcher = await bundler.watch();
|
|
2723
|
+
const watcher = new Watcher(emitter, bindingWatcher, stopWorkers);
|
|
2724
|
+
watcher.start();
|
|
2725
|
+
}
|
|
2706
2726
|
|
|
2707
2727
|
//#endregion
|
|
2708
2728
|
//#region src/api/watch/index.ts
|
|
2709
|
-
const watch =
|
|
2710
|
-
const
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
watcher.watch();
|
|
2714
|
-
return watcher;
|
|
2729
|
+
const watch = (input) => {
|
|
2730
|
+
const emitter = new WatcherEmitter();
|
|
2731
|
+
createWatcher(emitter, input);
|
|
2732
|
+
return emitter;
|
|
2715
2733
|
};
|
|
2716
2734
|
|
|
2717
2735
|
//#endregion
|
|
@@ -2724,9 +2742,9 @@ var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compat
|
|
|
2724
2742
|
async function build(options) {
|
|
2725
2743
|
if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
|
|
2726
2744
|
else {
|
|
2727
|
-
const { output,...inputOptions } = options;
|
|
2745
|
+
const { output, write = true,...inputOptions } = options;
|
|
2728
2746
|
const build$1 = await rolldown(inputOptions);
|
|
2729
|
-
if (
|
|
2747
|
+
if (write) return build$1.write(output);
|
|
2730
2748
|
else return build$1.generate(output);
|
|
2731
2749
|
}
|
|
2732
2750
|
}
|
|
@@ -2657,93 +2657,111 @@ const rolldown = async (input) => {
|
|
|
2657
2657
|
return new RolldownBuild(input);
|
|
2658
2658
|
};
|
|
2659
2659
|
|
|
2660
|
+
//#endregion
|
|
2661
|
+
//#region src/api/watch/watch-emitter.ts
|
|
2662
|
+
var WatcherEmitter = class {
|
|
2663
|
+
listeners = new Map();
|
|
2664
|
+
timer;
|
|
2665
|
+
constructor() {
|
|
2666
|
+
this.timer = setInterval(
|
|
2667
|
+
() => {},
|
|
2668
|
+
1e9
|
|
2669
|
+
/* Low power usage */
|
|
2670
|
+
);
|
|
2671
|
+
}
|
|
2672
|
+
on(event, listener) {
|
|
2673
|
+
const listeners = this.listeners.get(event);
|
|
2674
|
+
if (listeners) listeners.push(listener);
|
|
2675
|
+
else this.listeners.set(event, [listener]);
|
|
2676
|
+
return this;
|
|
2677
|
+
}
|
|
2678
|
+
async onEvent(event) {
|
|
2679
|
+
const listeners = this.listeners.get(event.eventKind());
|
|
2680
|
+
if (listeners) switch (event.eventKind()) {
|
|
2681
|
+
case "close":
|
|
2682
|
+
case "restart":
|
|
2683
|
+
for (const listener of listeners) await listener();
|
|
2684
|
+
break;
|
|
2685
|
+
case "event":
|
|
2686
|
+
for (const listener of listeners) {
|
|
2687
|
+
const code = event.bundleEventKind();
|
|
2688
|
+
switch (code) {
|
|
2689
|
+
case "BUNDLE_END":
|
|
2690
|
+
const { duration, output } = event.bundleEndData();
|
|
2691
|
+
await listener({
|
|
2692
|
+
code: "BUNDLE_END",
|
|
2693
|
+
duration,
|
|
2694
|
+
output: [output]
|
|
2695
|
+
});
|
|
2696
|
+
break;
|
|
2697
|
+
case "ERROR":
|
|
2698
|
+
const errors = event.errors();
|
|
2699
|
+
await listener({
|
|
2700
|
+
code: "ERROR",
|
|
2701
|
+
error: normalizeErrors(errors)
|
|
2702
|
+
});
|
|
2703
|
+
break;
|
|
2704
|
+
default:
|
|
2705
|
+
await listener({ code });
|
|
2706
|
+
break;
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
break;
|
|
2710
|
+
case "change":
|
|
2711
|
+
for (const listener of listeners) {
|
|
2712
|
+
const { path: path$2, kind } = event.watchChangeData();
|
|
2713
|
+
await listener(path$2, { event: kind });
|
|
2714
|
+
}
|
|
2715
|
+
break;
|
|
2716
|
+
default: throw new Error(`Unknown event: ${event}`);
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
async close() {
|
|
2720
|
+
clearInterval(this.timer);
|
|
2721
|
+
}
|
|
2722
|
+
};
|
|
2723
|
+
|
|
2660
2724
|
//#endregion
|
|
2661
2725
|
//#region src/api/watch/watcher.ts
|
|
2662
2726
|
var Watcher = class {
|
|
2663
2727
|
closed;
|
|
2664
|
-
controller;
|
|
2665
2728
|
inner;
|
|
2729
|
+
emitter;
|
|
2666
2730
|
stopWorkers;
|
|
2667
|
-
|
|
2668
|
-
constructor(inner, stopWorkers) {
|
|
2731
|
+
constructor(emitter, inner, stopWorkers) {
|
|
2669
2732
|
this.closed = false;
|
|
2670
|
-
this.controller = new AbortController();
|
|
2671
2733
|
this.inner = inner;
|
|
2734
|
+
this.emitter = emitter;
|
|
2735
|
+
const originClose = emitter.close.bind(emitter);
|
|
2736
|
+
emitter.close = async () => {
|
|
2737
|
+
await this.close();
|
|
2738
|
+
originClose();
|
|
2739
|
+
};
|
|
2672
2740
|
this.stopWorkers = stopWorkers;
|
|
2673
2741
|
}
|
|
2674
2742
|
async close() {
|
|
2743
|
+
if (this.closed) return;
|
|
2675
2744
|
this.closed = true;
|
|
2676
2745
|
await this.stopWorkers?.();
|
|
2677
2746
|
await this.inner.close();
|
|
2678
|
-
this.controller.abort();
|
|
2679
2747
|
}
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
if (listeners) listeners.push(listener);
|
|
2683
|
-
else this.listeners.set(event, [listener]);
|
|
2684
|
-
return this;
|
|
2685
|
-
}
|
|
2686
|
-
watch() {
|
|
2687
|
-
const timer = setInterval(
|
|
2688
|
-
() => {},
|
|
2689
|
-
1e9
|
|
2690
|
-
/* Low power usage */
|
|
2691
|
-
);
|
|
2692
|
-
this.controller.signal.addEventListener("abort", () => {
|
|
2693
|
-
clearInterval(timer);
|
|
2694
|
-
});
|
|
2695
|
-
process.nextTick(() => this.inner.start(async (event) => {
|
|
2696
|
-
const listeners = this.listeners.get(event.eventKind());
|
|
2697
|
-
if (listeners) switch (event.eventKind()) {
|
|
2698
|
-
case "close":
|
|
2699
|
-
case "restart":
|
|
2700
|
-
for (const listener of listeners) await listener();
|
|
2701
|
-
break;
|
|
2702
|
-
case "event":
|
|
2703
|
-
for (const listener of listeners) {
|
|
2704
|
-
const code = event.bundleEventKind();
|
|
2705
|
-
switch (code) {
|
|
2706
|
-
case "BUNDLE_END":
|
|
2707
|
-
const { duration, output } = event.bundleEndData();
|
|
2708
|
-
await listener({
|
|
2709
|
-
code: "BUNDLE_END",
|
|
2710
|
-
duration,
|
|
2711
|
-
output: [output]
|
|
2712
|
-
});
|
|
2713
|
-
break;
|
|
2714
|
-
case "ERROR":
|
|
2715
|
-
const errors = event.errors();
|
|
2716
|
-
await listener({
|
|
2717
|
-
code: "ERROR",
|
|
2718
|
-
error: normalizeErrors(errors)
|
|
2719
|
-
});
|
|
2720
|
-
break;
|
|
2721
|
-
default:
|
|
2722
|
-
await listener({ code });
|
|
2723
|
-
break;
|
|
2724
|
-
}
|
|
2725
|
-
}
|
|
2726
|
-
break;
|
|
2727
|
-
case "change":
|
|
2728
|
-
for (const listener of listeners) {
|
|
2729
|
-
const { path: path$2, kind } = event.watchChangeData();
|
|
2730
|
-
await listener(path$2, { event: kind });
|
|
2731
|
-
}
|
|
2732
|
-
break;
|
|
2733
|
-
default: throw new Error(`Unknown event: ${event}`);
|
|
2734
|
-
}
|
|
2735
|
-
}));
|
|
2748
|
+
start() {
|
|
2749
|
+
process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
|
|
2736
2750
|
}
|
|
2737
2751
|
};
|
|
2752
|
+
async function createWatcher(emitter, input) {
|
|
2753
|
+
const { bundler, stopWorkers } = await createBundler(input, input.output || {});
|
|
2754
|
+
const bindingWatcher = await bundler.watch();
|
|
2755
|
+
const watcher = new Watcher(emitter, bindingWatcher, stopWorkers);
|
|
2756
|
+
watcher.start();
|
|
2757
|
+
}
|
|
2738
2758
|
|
|
2739
2759
|
//#endregion
|
|
2740
2760
|
//#region src/api/watch/index.ts
|
|
2741
|
-
const watch =
|
|
2742
|
-
const
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
watcher.watch();
|
|
2746
|
-
return watcher;
|
|
2761
|
+
const watch = (input) => {
|
|
2762
|
+
const emitter = new WatcherEmitter();
|
|
2763
|
+
createWatcher(emitter, input);
|
|
2764
|
+
return emitter;
|
|
2747
2765
|
};
|
|
2748
2766
|
|
|
2749
2767
|
//#endregion
|
|
@@ -2756,9 +2774,9 @@ var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compat
|
|
|
2756
2774
|
async function build(options) {
|
|
2757
2775
|
if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
|
|
2758
2776
|
else {
|
|
2759
|
-
const { output,...inputOptions } = options;
|
|
2777
|
+
const { output, write = true,...inputOptions } = options;
|
|
2760
2778
|
const build$1 = await rolldown(inputOptions);
|
|
2761
|
-
if (
|
|
2779
|
+
if (write) return build$1.write(output);
|
|
2762
2780
|
else return build$1.generate(output);
|
|
2763
2781
|
}
|
|
2764
2782
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { WatchOptions } from '../../options/watch-options';
|
|
2
|
-
import {
|
|
3
|
-
export declare const watch: (input: WatchOptions) =>
|
|
2
|
+
import { RolldownWatcher } from './watch-emitter';
|
|
3
|
+
export declare const watch: (input: WatchOptions) => RolldownWatcher;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BindingWatcherEvent } from '../../binding';
|
|
2
|
+
import { MaybePromise } from '../../types/utils';
|
|
3
|
+
export type WatcherEvent = 'close' | 'event' | 'restart' | 'change';
|
|
4
|
+
export type ChangeEvent = 'create' | 'update' | 'delete';
|
|
5
|
+
export type RollupWatcherEvent = {
|
|
6
|
+
code: 'START';
|
|
7
|
+
} | {
|
|
8
|
+
code: 'BUNDLE_START';
|
|
9
|
+
} | {
|
|
10
|
+
code: 'BUNDLE_END';
|
|
11
|
+
duration: number;
|
|
12
|
+
output: readonly string[];
|
|
13
|
+
} | {
|
|
14
|
+
code: 'END';
|
|
15
|
+
} | {
|
|
16
|
+
code: 'ERROR';
|
|
17
|
+
error: Error;
|
|
18
|
+
};
|
|
19
|
+
export declare class WatcherEmitter {
|
|
20
|
+
listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>;
|
|
21
|
+
timer: any;
|
|
22
|
+
constructor();
|
|
23
|
+
on(event: 'change', listener: (id: string, change: {
|
|
24
|
+
event: ChangeEvent;
|
|
25
|
+
}) => MaybePromise<void>): this;
|
|
26
|
+
on(event: 'event', listener: (data: RollupWatcherEvent) => MaybePromise<void>): this;
|
|
27
|
+
on(event: 'restart' | 'close', listener: () => MaybePromise<void>): this;
|
|
28
|
+
onEvent(event: BindingWatcherEvent): Promise<void>;
|
|
29
|
+
close(): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
export type RolldownWatcher = WatcherEmitter;
|
|
@@ -1,33 +1,13 @@
|
|
|
1
1
|
import { BindingWatcher } from '../../binding';
|
|
2
|
-
import {
|
|
2
|
+
import { WatchOptions } from '../../options/watch-options';
|
|
3
|
+
import { WatcherEmitter } from './watch-emitter';
|
|
3
4
|
export declare class Watcher {
|
|
4
5
|
closed: boolean;
|
|
5
|
-
controller: AbortController;
|
|
6
6
|
inner: BindingWatcher;
|
|
7
|
+
emitter: WatcherEmitter;
|
|
7
8
|
stopWorkers?: () => Promise<void>;
|
|
8
|
-
|
|
9
|
-
constructor(inner: BindingWatcher, stopWorkers?: () => Promise<void>);
|
|
9
|
+
constructor(emitter: WatcherEmitter, inner: BindingWatcher, stopWorkers?: () => Promise<void>);
|
|
10
10
|
close(): Promise<void>;
|
|
11
|
-
|
|
12
|
-
event: ChangeEvent;
|
|
13
|
-
}) => MaybePromise<void>): this;
|
|
14
|
-
on(event: 'event', listener: (data: RollupWatcherEvent) => MaybePromise<void>): this;
|
|
15
|
-
on(event: 'restart' | 'close', listener: () => MaybePromise<void>): this;
|
|
16
|
-
watch(): void;
|
|
11
|
+
start(): void;
|
|
17
12
|
}
|
|
18
|
-
export
|
|
19
|
-
export type ChangeEvent = 'create' | 'update' | 'delete';
|
|
20
|
-
export type RollupWatcherEvent = {
|
|
21
|
-
code: 'START';
|
|
22
|
-
} | {
|
|
23
|
-
code: 'BUNDLE_START';
|
|
24
|
-
} | {
|
|
25
|
-
code: 'BUNDLE_END';
|
|
26
|
-
duration: number;
|
|
27
|
-
output: readonly string[];
|
|
28
|
-
} | {
|
|
29
|
-
code: 'END';
|
|
30
|
-
} | {
|
|
31
|
-
code: 'ERROR';
|
|
32
|
-
error: Error;
|
|
33
|
-
};
|
|
13
|
+
export declare function createWatcher(emitter: WatcherEmitter, input: WatchOptions): Promise<void>;
|
package/dist/types/binding.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare class BindingCallableBuiltinPlugin {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export declare class BindingHookError {
|
|
19
|
-
get errors(): Array<
|
|
19
|
+
get errors(): Array<Error | object>
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export declare class BindingLog {
|
|
@@ -92,7 +92,7 @@ export declare class BindingOutputChunk {
|
|
|
92
92
|
export declare class BindingOutputs {
|
|
93
93
|
get chunks(): Array<BindingOutputChunk>
|
|
94
94
|
get assets(): Array<BindingOutputAsset>
|
|
95
|
-
get errors(): Array<
|
|
95
|
+
get errors(): Array<Error | object>
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export declare class BindingPluginContext {
|
|
@@ -129,7 +129,7 @@ export declare class BindingWatcherEvent {
|
|
|
129
129
|
watchChangeData(): BindingWatcherChangeData
|
|
130
130
|
bundleEndData(): BindingBundleEndEventData
|
|
131
131
|
bundleEventKind(): string
|
|
132
|
-
errors(): Array<
|
|
132
|
+
errors(): Array<Error | object>
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
export declare class Bundler {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,10 +20,10 @@ import { MinimalPluginContext } from './plugin/minimal-plugin-context';
|
|
|
20
20
|
import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap';
|
|
21
21
|
import { OutputBundle } from './types/output-bundle';
|
|
22
22
|
import { WatchOptions } from './options/watch-options';
|
|
23
|
-
import {
|
|
23
|
+
import { RolldownWatcher } from './api/watch/watch-emitter';
|
|
24
24
|
import { build, type BuildOptions } from './api/build';
|
|
25
25
|
export { defineConfig, rolldown, watch, build };
|
|
26
26
|
export declare const VERSION: string;
|
|
27
|
-
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions,
|
|
28
|
-
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, };
|
|
27
|
+
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, RolldownWatcher, BuildOptions, };
|
|
28
|
+
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, RolldownWatcher as RollupWatcher, };
|
|
29
29
|
export type { RollupError, RollupLog, LoggingFunction } from './rollup';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function normalizeErrors(rawErrors:
|
|
1
|
+
export declare function normalizeErrors(rawErrors: (object | Error)[]): Error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "0.15.0-snapshot-
|
|
3
|
+
"version": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -113,21 +113,21 @@
|
|
|
113
113
|
"why-is-node-running": "^3.0.0",
|
|
114
114
|
"zod-to-json-schema": "^3.23.2",
|
|
115
115
|
"@rolldown/testing": "0.0.1",
|
|
116
|
-
"rolldown": "0.15.0-snapshot-
|
|
116
|
+
"rolldown": "0.15.0-snapshot-b2570e7-20241204003545"
|
|
117
117
|
},
|
|
118
118
|
"optionalDependencies": {
|
|
119
|
-
"@rolldown/binding-darwin-
|
|
120
|
-
"@rolldown/binding-
|
|
121
|
-
"@rolldown/binding-
|
|
122
|
-
"@rolldown/binding-linux-arm-gnueabihf": "0.15.0-snapshot-
|
|
123
|
-
"@rolldown/binding-linux-arm64-gnu": "0.15.0-snapshot-
|
|
124
|
-
"@rolldown/binding-linux-arm64-musl": "0.15.0-snapshot-
|
|
125
|
-
"@rolldown/binding-linux-x64-
|
|
126
|
-
"@rolldown/binding-
|
|
127
|
-
"@rolldown/binding-
|
|
128
|
-
"@rolldown/binding-win32-
|
|
129
|
-
"@rolldown/binding-win32-x64-msvc": "0.15.0-snapshot-
|
|
130
|
-
"@rolldown/binding-win32-
|
|
119
|
+
"@rolldown/binding-darwin-x64": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
120
|
+
"@rolldown/binding-freebsd-x64": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
121
|
+
"@rolldown/binding-darwin-arm64": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
122
|
+
"@rolldown/binding-linux-arm-gnueabihf": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
123
|
+
"@rolldown/binding-linux-arm64-gnu": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
124
|
+
"@rolldown/binding-linux-arm64-musl": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
125
|
+
"@rolldown/binding-linux-x64-musl": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
126
|
+
"@rolldown/binding-wasm32-wasi": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
127
|
+
"@rolldown/binding-linux-x64-gnu": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
128
|
+
"@rolldown/binding-win32-ia32-msvc": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
129
|
+
"@rolldown/binding-win32-x64-msvc": "0.15.0-snapshot-b2570e7-20241204003545",
|
|
130
|
+
"@rolldown/binding-win32-arm64-msvc": "0.15.0-snapshot-b2570e7-20241204003545"
|
|
131
131
|
},
|
|
132
132
|
"scripts": {
|
|
133
133
|
"# Scrips for binding #": "_",
|