rolldown 1.0.0-beta.6 → 1.0.0-beta.6-commit.231bdea

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('./chunk-qZFfknuJ.cjs');
3
- const require_parse_ast_index = require('./parse-ast-index-D7XtMFo4.cjs');
3
+ const require_parse_ast_index = require('./parse-ast-index-BytJf1vj.cjs');
4
4
  const node_path = require_chunk.__toESM(require("node:path"));
5
5
  const valibot = require_chunk.__toESM(require("valibot"));
6
6
  const __valibot_to_json_schema = require_chunk.__toESM(require("@valibot/to-json-schema"));
@@ -2664,12 +2664,18 @@ async function createBundlerOptions(inputOptions, outputOptions, isClose) {
2664
2664
 
2665
2665
  //#endregion
2666
2666
  //#region src/utils/create-bundler.ts
2667
+ let asyncRuntimeShutdown = false;
2667
2668
  async function createBundler(inputOptions, outputOptions, isClose) {
2668
2669
  const option = await createBundlerOptions(inputOptions, outputOptions, isClose);
2670
+ if (asyncRuntimeShutdown) (0, require_parse_ast_index.import_binding.startAsyncRuntime)();
2669
2671
  try {
2670
2672
  return {
2671
2673
  bundler: new require_parse_ast_index.import_binding.Bundler(option.bundlerOptions),
2672
- stopWorkers: option.stopWorkers
2674
+ stopWorkers: option.stopWorkers,
2675
+ shutdown: () => {
2676
+ (0, require_parse_ast_index.import_binding.shutdownAsyncRuntime)();
2677
+ asyncRuntimeShutdown = true;
2678
+ }
2673
2679
  };
2674
2680
  } catch (e) {
2675
2681
  await option.stopWorkers?.();
@@ -2687,10 +2693,10 @@ var RolldownBuild = class {
2687
2693
  this.#inputOptions = inputOptions;
2688
2694
  }
2689
2695
  get closed() {
2690
- return this.#bundler ? this.#bundler.bundler.closed : false;
2696
+ return this.#bundler?.bundler.closed ?? false;
2691
2697
  }
2692
2698
  async #getBundlerWithStopWorker(outputOptions, isClose) {
2693
- if (this.#bundler) this.#bundler.stopWorkers?.();
2699
+ if (this.#bundler) await this.#bundler.stopWorkers?.();
2694
2700
  return this.#bundler = await createBundler(this.#inputOptions, outputOptions, isClose);
2695
2701
  }
2696
2702
  async generate(outputOptions = {}) {
@@ -2706,9 +2712,10 @@ var RolldownBuild = class {
2706
2712
  return transformToRollupOutput(output);
2707
2713
  }
2708
2714
  async close() {
2709
- const { bundler, stopWorkers } = await this.#getBundlerWithStopWorker({}, true);
2715
+ const { bundler, stopWorkers, shutdown } = await this.#getBundlerWithStopWorker({}, true);
2710
2716
  await stopWorkers?.();
2711
2717
  await bundler.close();
2718
+ shutdown();
2712
2719
  }
2713
2720
  async [Symbol.asyncDispose]() {
2714
2721
  await this.close();
@@ -2813,6 +2820,7 @@ var Watcher = class {
2813
2820
  this.closed = true;
2814
2821
  for (const stop of this.stopWorkers) await stop?.();
2815
2822
  await this.inner.close();
2823
+ (0, require_parse_ast_index.import_binding.shutdownAsyncRuntime)();
2816
2824
  }
2817
2825
  start() {
2818
2826
  process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
@@ -2850,7 +2858,7 @@ const watch = (input) => {
2850
2858
 
2851
2859
  //#endregion
2852
2860
  //#region package.json
2853
- var version = "1.0.0-beta.6";
2861
+ var version = "1.0.0-beta.6-commit.231bdea";
2854
2862
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2855
2863
 
2856
2864
  //#endregion
@@ -1,4 +1,4 @@
1
- import { augmentCodeLocation, colors, error, import_binding, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-CyX8MVZE.mjs";
1
+ import { augmentCodeLocation, colors, error, import_binding, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-D8k04LFo.mjs";
2
2
  import path from "node:path";
3
3
  import * as v from "valibot";
4
4
  import { toJsonSchema } from "@valibot/to-json-schema";
@@ -2662,12 +2662,18 @@ async function createBundlerOptions(inputOptions, outputOptions, isClose) {
2662
2662
 
2663
2663
  //#endregion
2664
2664
  //#region src/utils/create-bundler.ts
2665
+ let asyncRuntimeShutdown = false;
2665
2666
  async function createBundler(inputOptions, outputOptions, isClose) {
2666
2667
  const option = await createBundlerOptions(inputOptions, outputOptions, isClose);
2668
+ if (asyncRuntimeShutdown) (0, import_binding.startAsyncRuntime)();
2667
2669
  try {
2668
2670
  return {
2669
2671
  bundler: new import_binding.Bundler(option.bundlerOptions),
2670
- stopWorkers: option.stopWorkers
2672
+ stopWorkers: option.stopWorkers,
2673
+ shutdown: () => {
2674
+ (0, import_binding.shutdownAsyncRuntime)();
2675
+ asyncRuntimeShutdown = true;
2676
+ }
2671
2677
  };
2672
2678
  } catch (e) {
2673
2679
  await option.stopWorkers?.();
@@ -2685,10 +2691,10 @@ var RolldownBuild = class {
2685
2691
  this.#inputOptions = inputOptions;
2686
2692
  }
2687
2693
  get closed() {
2688
- return this.#bundler ? this.#bundler.bundler.closed : false;
2694
+ return this.#bundler?.bundler.closed ?? false;
2689
2695
  }
2690
2696
  async #getBundlerWithStopWorker(outputOptions, isClose) {
2691
- if (this.#bundler) this.#bundler.stopWorkers?.();
2697
+ if (this.#bundler) await this.#bundler.stopWorkers?.();
2692
2698
  return this.#bundler = await createBundler(this.#inputOptions, outputOptions, isClose);
2693
2699
  }
2694
2700
  async generate(outputOptions = {}) {
@@ -2704,9 +2710,10 @@ var RolldownBuild = class {
2704
2710
  return transformToRollupOutput(output);
2705
2711
  }
2706
2712
  async close() {
2707
- const { bundler, stopWorkers } = await this.#getBundlerWithStopWorker({}, true);
2713
+ const { bundler, stopWorkers, shutdown } = await this.#getBundlerWithStopWorker({}, true);
2708
2714
  await stopWorkers?.();
2709
2715
  await bundler.close();
2716
+ shutdown();
2710
2717
  }
2711
2718
  async [Symbol.asyncDispose]() {
2712
2719
  await this.close();
@@ -2811,6 +2818,7 @@ var Watcher = class {
2811
2818
  this.closed = true;
2812
2819
  for (const stop of this.stopWorkers) await stop?.();
2813
2820
  await this.inner.close();
2821
+ (0, import_binding.shutdownAsyncRuntime)();
2814
2822
  }
2815
2823
  start() {
2816
2824
  process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
@@ -2848,7 +2856,7 @@ const watch = (input) => {
2848
2856
 
2849
2857
  //#endregion
2850
2858
  //#region package.json
2851
- var version = "1.0.0-beta.6";
2859
+ var version = "1.0.0-beta.6-commit.231bdea";
2852
2860
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2853
2861
 
2854
2862
  //#endregion
@@ -1209,6 +1209,14 @@ export type Severity = 'Error'|
1209
1209
  'Warning'|
1210
1210
  'Advice';
1211
1211
 
1212
+ /**
1213
+ * Shutdown the tokio runtime manually.
1214
+ *
1215
+ * This is required for the wasm target with `tokio_unstable` cfg.
1216
+ * In the wasm runtime, the `park` threads will hang there until the tokio::Runtime is shutdown.
1217
+ */
1218
+ export declare function shutdownAsyncRuntime(): void
1219
+
1212
1220
  export interface SourceMap {
1213
1221
  file?: string
1214
1222
  mappings: string
@@ -1225,6 +1233,14 @@ export interface Span {
1225
1233
  end: number
1226
1234
  }
1227
1235
 
1236
+ /**
1237
+ * Start the async runtime manually.
1238
+ *
1239
+ * This is required when the async runtime is shutdown manually.
1240
+ * Usually it's used in test.
1241
+ */
1242
+ export declare function startAsyncRuntime(): void
1243
+
1228
1244
  export interface StaticExport {
1229
1245
  start: number
1230
1246
  end: number
@@ -5,4 +5,5 @@ export declare function createBundler(inputOptions: InputOptions, outputOptions:
5
5
  export interface BundlerWithStopWorker {
6
6
  bundler: Bundler;
7
7
  stopWorkers?: () => Promise<void>;
8
+ shutdown: () => void;
8
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.6-commit.231bdea",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "repository": {
@@ -104,7 +104,7 @@
104
104
  "@types/fs-extra": "^11.0.4",
105
105
  "@types/lodash-es": "^4.17.12",
106
106
  "colorette": "^2.0.20",
107
- "consola": "^3.2.3",
107
+ "consola": "^3.4.2",
108
108
  "emnapi": "^1.2.0",
109
109
  "execa": "^9.2.0",
110
110
  "fs-extra": "^11.2.0",
@@ -122,21 +122,21 @@
122
122
  "unbuild": "^3.0.0",
123
123
  "why-is-node-running": "^3.0.0",
124
124
  "@rolldown/testing": "0.0.1",
125
- "rolldown": "1.0.0-beta.6"
125
+ "rolldown": "1.0.0-beta.6-commit.231bdea"
126
126
  },
127
127
  "optionalDependencies": {
128
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.6",
129
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.6",
130
- "@rolldown/binding-darwin-x64": "1.0.0-beta.6",
131
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.6",
132
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.6",
133
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.6",
134
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.6",
135
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.6",
136
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.6",
137
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.6",
138
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.6",
139
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.6"
128
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.6-commit.231bdea",
129
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.6-commit.231bdea",
130
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.6-commit.231bdea",
131
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.6-commit.231bdea",
132
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.6-commit.231bdea",
133
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.6-commit.231bdea",
134
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.6-commit.231bdea",
135
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.6-commit.231bdea",
136
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.6-commit.231bdea",
137
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.6-commit.231bdea",
138
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.6-commit.231bdea",
139
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.6-commit.231bdea"
140
140
  },
141
141
  "scripts": {
142
142
  "# Scrips for binding #": "_",