rolldown 0.14.0-snapshot-d42ea8a-20241202003632 → 0.15.0

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 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-CfQyqNSn.cjs');
3
+ const require_src = require('../shared/src-COU7qQBJ.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-CfQyqNSn.cjs');
3
+ const require_src = require('../shared/src-COU7qQBJ.cjs');
4
4
  const node_url = require_chunk.__toESM(require("node:url"));
5
5
 
6
6
  //#region src/plugin/parallel-plugin.ts
@@ -13,6 +13,15 @@ function defineParallelPlugin(pluginPath) {
13
13
  };
14
14
  }
15
15
 
16
+ //#endregion
17
+ //#region src/api/experimental.ts
18
+ const experimental_scan = async (input) => {
19
+ const { bundler, stopWorkers } = await require_src.createBundler(input, {});
20
+ const output = await bundler.scan();
21
+ require_src.handleOutputErrors(output);
22
+ await stopWorkers?.();
23
+ };
24
+
16
25
  //#endregion
17
26
  //#region src/builtin-plugin/transform-plugin.ts
18
27
  function normalizeEcmaTransformPluginConfig(config) {
@@ -59,7 +68,7 @@ exports.loadFallbackPlugin = require_src.loadFallbackPlugin
59
68
  exports.manifestPlugin = require_src.manifestPlugin
60
69
  exports.modulePreloadPolyfillPlugin = require_src.modulePreloadPolyfillPlugin
61
70
  exports.replacePlugin = replacePlugin
62
- exports.scan = require_src.experimental_scan
71
+ exports.scan = experimental_scan
63
72
  Object.defineProperty(exports, 'transform', {
64
73
  enumerable: true,
65
74
  get: function () {
@@ -1,6 +1,7 @@
1
- const require_src = require('../shared/src-CfQyqNSn.cjs');
1
+ const require_src = require('../shared/src-COU7qQBJ.cjs');
2
2
 
3
3
  exports.VERSION = require_src.VERSION
4
+ exports.build = require_src.build
4
5
  exports.defineConfig = require_src.defineConfig
5
6
  exports.rolldown = require_src.rolldown
6
7
  exports.watch = require_src.watch
@@ -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-CfQyqNSn.cjs');
3
+ const require_src = require('../shared/src-COU7qQBJ.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-DhHfkqAC.mjs";
1
+ import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src-DEPa5yhI.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, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-DhHfkqAC.mjs";
1
+ import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-DEPa5yhI.mjs";
2
2
  import { pathToFileURL } from "node:url";
3
3
 
4
4
  //#region src/plugin/parallel-plugin.ts
@@ -11,6 +11,15 @@ function defineParallelPlugin(pluginPath) {
11
11
  };
12
12
  }
13
13
 
14
+ //#endregion
15
+ //#region src/api/experimental.ts
16
+ const experimental_scan = async (input) => {
17
+ const { bundler, stopWorkers } = await createBundler(input, {});
18
+ const output = await bundler.scan();
19
+ handleOutputErrors(output);
20
+ await stopWorkers?.();
21
+ };
22
+
14
23
  //#endregion
15
24
  //#region src/builtin-plugin/transform-plugin.ts
16
25
  function normalizeEcmaTransformPluginConfig(config) {
@@ -1,3 +1,3 @@
1
- import { VERSION, defineConfig, rolldown, watch } from "../shared/src-DhHfkqAC.mjs";
1
+ import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-DEPa5yhI.mjs";
2
2
 
3
- export { VERSION, defineConfig, rolldown, watch };
3
+ export { VERSION, build, defineConfig, rolldown, watch };
@@ -1,4 +1,4 @@
1
- import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-DhHfkqAC.mjs";
1
+ import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-DEPa5yhI.mjs";
2
2
  import { parentPort, workerData } from "node:worker_threads";
3
3
 
4
4
  //#region src/parallel-plugin-worker.ts
@@ -207,7 +207,7 @@ else chunks.push({
207
207
  name: item.name,
208
208
  isEntry: item.isEntry,
209
209
  exports: item.exports,
210
- modules: Object.fromEntries(Object.entries(item.modules).map(([key$1, _]) => [key$1, {}])),
210
+ modules: {},
211
211
  imports: item.imports,
212
212
  dynamicImports: item.dynamicImports,
213
213
  facadeModuleId: item.facadeModuleId || undefined,
@@ -517,6 +517,7 @@ else loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architectur
517
517
  }
518
518
  module.exports.BindingBundleEndEventData = nativeBinding.BindingBundleEndEventData;
519
519
  module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
520
+ module.exports.BindingHookError = nativeBinding.BindingHookError;
520
521
  module.exports.BindingLog = nativeBinding.BindingLog;
521
522
  module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
522
523
  module.exports.BindingNormalizedOptions = nativeBinding.BindingNormalizedOptions;
@@ -1354,7 +1355,7 @@ function bindingifyBuildEnd(args) {
1354
1355
  const { handler, meta } = normalizeHook(hook);
1355
1356
  return {
1356
1357
  plugin: async (ctx, err) => {
1357
- await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), err ? new Error(err) : undefined);
1358
+ await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), err ? normalizeErrors(err.errors) : undefined);
1358
1359
  },
1359
1360
  meta: bindingifyPluginHookMeta(meta)
1360
1361
  };
@@ -2583,7 +2584,7 @@ async function createBundler(inputOptions, outputOptions) {
2583
2584
  }
2584
2585
 
2585
2586
  //#endregion
2586
- //#region src/rolldown-build.ts
2587
+ //#region src/api/rolldown/rolldown-build.ts
2587
2588
  Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
2588
2589
  var RolldownBuild = class {
2589
2590
  #inputOptions;
@@ -2619,7 +2620,13 @@ var RolldownBuild = class {
2619
2620
  };
2620
2621
 
2621
2622
  //#endregion
2622
- //#region src/watcher.ts
2623
+ //#region src/api/rolldown/index.ts
2624
+ const rolldown = async (input) => {
2625
+ return new RolldownBuild(input);
2626
+ };
2627
+
2628
+ //#endregion
2629
+ //#region src/api/watch/watcher.ts
2623
2630
  var Watcher = class {
2624
2631
  closed;
2625
2632
  controller;
@@ -2698,10 +2705,7 @@ else this.listeners.set(event, [listener]);
2698
2705
  };
2699
2706
 
2700
2707
  //#endregion
2701
- //#region src/rolldown.ts
2702
- const rolldown = async (input) => {
2703
- return new RolldownBuild(input);
2704
- };
2708
+ //#region src/api/watch/index.ts
2705
2709
  const watch = async (input) => {
2706
2710
  const { bundler, stopWorkers } = await createBundler(input, input.output || {});
2707
2711
  const bindingWatcher = await bundler.watch();
@@ -2709,18 +2713,24 @@ const watch = async (input) => {
2709
2713
  watcher.watch();
2710
2714
  return watcher;
2711
2715
  };
2712
- const experimental_scan = async (input) => {
2713
- const { bundler, stopWorkers } = await createBundler(input, {});
2714
- const output = await bundler.scan();
2715
- handleOutputErrors(output);
2716
- await stopWorkers?.();
2717
- };
2718
2716
 
2719
2717
  //#endregion
2720
2718
  //#region package.json
2721
- var version = "0.14.0";
2719
+ var version = "0.15.0";
2722
2720
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2723
2721
 
2722
+ //#endregion
2723
+ //#region src/api/build.ts
2724
+ async function build(options) {
2725
+ if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
2726
+ else {
2727
+ const { output,...inputOptions } = options;
2728
+ const build$1 = await rolldown(inputOptions);
2729
+ if (options.write) return build$1.write(output);
2730
+ else return build$1.generate(output);
2731
+ }
2732
+ }
2733
+
2724
2734
  //#endregion
2725
2735
  //#region src/index.ts
2726
2736
  const VERSION = version;
@@ -2781,6 +2791,11 @@ Object.defineProperty(exports, 'BuiltinPlugin', {
2781
2791
  get: function () {
2782
2792
  return bindingifyPlugin;
2783
2793
  }
2794
+ });Object.defineProperty(exports, 'build', {
2795
+ enumerable: true,
2796
+ get: function () {
2797
+ return build;
2798
+ }
2784
2799
  });Object.defineProperty(exports, 'buildImportAnalysisPlugin', {
2785
2800
  enumerable: true,
2786
2801
  get: function () {
@@ -2791,6 +2806,11 @@ Object.defineProperty(exports, 'BuiltinPlugin', {
2791
2806
  get: function () {
2792
2807
  return composeJsPlugins;
2793
2808
  }
2809
+ });Object.defineProperty(exports, 'createBundler', {
2810
+ enumerable: true,
2811
+ get: function () {
2812
+ return createBundler;
2813
+ }
2794
2814
  });Object.defineProperty(exports, 'defineConfig', {
2795
2815
  enumerable: true,
2796
2816
  get: function () {
@@ -2806,10 +2826,10 @@ Object.defineProperty(exports, 'BuiltinPlugin', {
2806
2826
  get: function () {
2807
2827
  return dynamicImportVarsPlugin;
2808
2828
  }
2809
- });Object.defineProperty(exports, 'experimental_scan', {
2829
+ });Object.defineProperty(exports, 'handleOutputErrors', {
2810
2830
  enumerable: true,
2811
2831
  get: function () {
2812
- return experimental_scan;
2832
+ return handleOutputErrors;
2813
2833
  }
2814
2834
  });Object.defineProperty(exports, 'importGlobPlugin', {
2815
2835
  enumerable: true,
@@ -240,7 +240,7 @@ else chunks.push({
240
240
  name: item.name,
241
241
  isEntry: item.isEntry,
242
242
  exports: item.exports,
243
- modules: Object.fromEntries(Object.entries(item.modules).map(([key$1, _]) => [key$1, {}])),
243
+ modules: {},
244
244
  imports: item.imports,
245
245
  dynamicImports: item.dynamicImports,
246
246
  facadeModuleId: item.facadeModuleId || undefined,
@@ -549,6 +549,7 @@ else loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architectur
549
549
  }
550
550
  module.exports.BindingBundleEndEventData = nativeBinding.BindingBundleEndEventData;
551
551
  module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
552
+ module.exports.BindingHookError = nativeBinding.BindingHookError;
552
553
  module.exports.BindingLog = nativeBinding.BindingLog;
553
554
  module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
554
555
  module.exports.BindingNormalizedOptions = nativeBinding.BindingNormalizedOptions;
@@ -1386,7 +1387,7 @@ function bindingifyBuildEnd(args) {
1386
1387
  const { handler, meta } = normalizeHook(hook);
1387
1388
  return {
1388
1389
  plugin: async (ctx, err) => {
1389
- await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), err ? new Error(err) : undefined);
1390
+ await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), err ? normalizeErrors(err.errors) : undefined);
1390
1391
  },
1391
1392
  meta: bindingifyPluginHookMeta(meta)
1392
1393
  };
@@ -2615,7 +2616,7 @@ async function createBundler(inputOptions, outputOptions) {
2615
2616
  }
2616
2617
 
2617
2618
  //#endregion
2618
- //#region src/rolldown-build.ts
2619
+ //#region src/api/rolldown/rolldown-build.ts
2619
2620
  Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
2620
2621
  var RolldownBuild = class {
2621
2622
  #inputOptions;
@@ -2651,7 +2652,13 @@ var RolldownBuild = class {
2651
2652
  };
2652
2653
 
2653
2654
  //#endregion
2654
- //#region src/watcher.ts
2655
+ //#region src/api/rolldown/index.ts
2656
+ const rolldown = async (input) => {
2657
+ return new RolldownBuild(input);
2658
+ };
2659
+
2660
+ //#endregion
2661
+ //#region src/api/watch/watcher.ts
2655
2662
  var Watcher = class {
2656
2663
  closed;
2657
2664
  controller;
@@ -2730,10 +2737,7 @@ else this.listeners.set(event, [listener]);
2730
2737
  };
2731
2738
 
2732
2739
  //#endregion
2733
- //#region src/rolldown.ts
2734
- const rolldown = async (input) => {
2735
- return new RolldownBuild(input);
2736
- };
2740
+ //#region src/api/watch/index.ts
2737
2741
  const watch = async (input) => {
2738
2742
  const { bundler, stopWorkers } = await createBundler(input, input.output || {});
2739
2743
  const bindingWatcher = await bundler.watch();
@@ -2741,21 +2745,27 @@ const watch = async (input) => {
2741
2745
  watcher.watch();
2742
2746
  return watcher;
2743
2747
  };
2744
- const experimental_scan = async (input) => {
2745
- const { bundler, stopWorkers } = await createBundler(input, {});
2746
- const output = await bundler.scan();
2747
- handleOutputErrors(output);
2748
- await stopWorkers?.();
2749
- };
2750
2748
 
2751
2749
  //#endregion
2752
2750
  //#region package.json
2753
- var version = "0.14.0";
2751
+ var version = "0.15.0";
2754
2752
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2755
2753
 
2754
+ //#endregion
2755
+ //#region src/api/build.ts
2756
+ async function build(options) {
2757
+ if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
2758
+ else {
2759
+ const { output,...inputOptions } = options;
2760
+ const build$1 = await rolldown(inputOptions);
2761
+ if (options.write) return build$1.write(output);
2762
+ else return build$1.generate(output);
2763
+ }
2764
+ }
2765
+
2756
2766
  //#endregion
2757
2767
  //#region src/index.ts
2758
2768
  const VERSION = version;
2759
2769
 
2760
2770
  //#endregion
2761
- export { BuiltinPlugin, LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, PluginContextData, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, VERSION, __export, __toESM, arraify, bindingifyPlugin, buildImportAnalysisPlugin, composeJsPlugins, defineConfig, description, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, rolldown, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };
2771
+ export { BuiltinPlugin, LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, PluginContextData, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, VERSION, __export, __toESM, arraify, bindingifyPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, description, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, rolldown, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };
@@ -0,0 +1,14 @@
1
+ import type { RolldownOptions } from '../types/rolldown-options';
2
+ import type { RolldownOutput } from '../types/rolldown-output';
3
+ export interface BuildOptions extends RolldownOptions {
4
+ /**
5
+ * Write the output to the file system
6
+ */
7
+ write?: boolean;
8
+ }
9
+ declare function build(options: BuildOptions): Promise<RolldownOutput>;
10
+ /**
11
+ * Build multiple outputs __sequentially__.
12
+ */
13
+ declare function build(options: BuildOptions[]): Promise<RolldownOutput[]>;
14
+ export { build };
@@ -0,0 +1,7 @@
1
+ import type { InputOptions } from '../options/input-options';
2
+ /**
3
+ * This is an experimental API. It's behavior may change in the future.
4
+ *
5
+ * Calling this API will only execute the scan stage of rolldown.
6
+ */
7
+ export declare const experimental_scan: (input: InputOptions) => Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { InputOptions } from '../../options/input-options';
2
+ import { RolldownBuild } from './rolldown-build';
3
+ export declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
@@ -1,6 +1,6 @@
1
- import type { InputOptions } from './options/input-options';
2
- import type { OutputOptions } from './options/output-options';
3
- import type { RolldownOutput } from './types/rolldown-output';
1
+ import type { InputOptions } from '../../options/input-options';
2
+ import type { OutputOptions } from '../../options/output-options';
3
+ import type { RolldownOutput } from '../../types/rolldown-output';
4
4
  export declare class RolldownBuild {
5
5
  #private;
6
6
  constructor(inputOptions: InputOptions);
@@ -0,0 +1,3 @@
1
+ import type { WatchOptions } from '../../options/watch-options';
2
+ import { Watcher } from './watcher';
3
+ export declare const watch: (input: WatchOptions) => Promise<Watcher>;
@@ -1,5 +1,5 @@
1
- import { BindingWatcher } from './binding';
2
- import { MaybePromise } from './types/utils';
1
+ import { BindingWatcher } from '../../binding';
2
+ import { MaybePromise } from '../../types/utils';
3
3
  export declare class Watcher {
4
4
  closed: boolean;
5
5
  controller: AbortController;
@@ -15,6 +15,10 @@ export declare class BindingCallableBuiltinPlugin {
15
15
  watchChange(path: string, event: BindingJsWatchChangeEvent): Promise<void>
16
16
  }
17
17
 
18
+ export declare class BindingHookError {
19
+ get errors(): Array<unknown>
20
+ }
21
+
18
22
  export declare class BindingLog {
19
23
  code: string
20
24
  message: string
@@ -439,7 +443,7 @@ export interface BindingPluginOptions {
439
443
  transformFilter?: BindingTransformHookFilter
440
444
  moduleParsed?: (ctx: BindingPluginContext, module: BindingModuleInfo) => MaybePromise<VoidNullable>
441
445
  moduleParsedMeta?: BindingPluginHookMeta
442
- buildEnd?: (ctx: BindingPluginContext, error: Nullable<string>) => MaybePromise<VoidNullable>
446
+ buildEnd?: (ctx: BindingPluginContext, error?: BindingHookError) => MaybePromise<VoidNullable>
443
447
  buildEndMeta?: BindingPluginHookMeta
444
448
  renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>>
445
449
  renderChunkMeta?: BindingPluginHookMeta
@@ -1,5 +1,5 @@
1
1
  export { defineParallelPlugin } from './plugin/parallel-plugin';
2
- export { experimental_scan as scan } from './rolldown';
2
+ export { experimental_scan as scan } from './api/experimental';
3
3
  export { transform } from './binding';
4
4
  export type { TransformOptions, TransformResult } from './binding';
5
5
  export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins';
@@ -5,9 +5,10 @@ import type { RolldownOptions } from './types/rolldown-options';
5
5
  import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ModuleType, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin';
6
6
  import { DefineParallelPluginResult } from './plugin/parallel-plugin';
7
7
  import { defineConfig } from './utils/define-config';
8
- import { rolldown, watch } from './rolldown';
8
+ import { rolldown } from './api/rolldown';
9
+ import { watch } from './api/watch';
9
10
  import { ConfigExport } from './types/config-export';
10
- import { RolldownBuild } from './rolldown-build';
11
+ import { RolldownBuild } from './api/rolldown/rolldown-build';
11
12
  import { EmittedAsset, EmittedFile, PluginContext } from './plugin/plugin-context';
12
13
  import { TransformPluginContext } from './plugin/transform-plugin-context';
13
14
  import { InternalModuleFormat, NormalizedOutputOptions } from './options/normalized-output-options';
@@ -19,9 +20,10 @@ import { MinimalPluginContext } from './plugin/minimal-plugin-context';
19
20
  import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap';
20
21
  import { OutputBundle } from './types/output-bundle';
21
22
  import { WatchOptions } from './options/watch-options';
22
- import { Watcher } from './watcher';
23
- export { defineConfig, rolldown, watch };
23
+ import { Watcher } from './api/watch/watcher';
24
+ import { build, type BuildOptions } from './api/build';
25
+ export { defineConfig, rolldown, watch, build };
24
26
  export declare const VERSION: string;
25
- 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, Watcher, };
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, Watcher, BuildOptions, };
26
28
  export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, };
27
29
  export type { RollupError, RollupLog, LoggingFunction } from './rollup';
@@ -262,17 +262,17 @@ export declare const inputOptionsSchema: z.ZodObject<{
262
262
  skipWrite?: boolean | undefined;
263
263
  chokidar?: any;
264
264
  } | undefined;
265
+ cwd?: string | undefined;
266
+ shimMissingExports?: boolean | undefined;
267
+ moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
265
268
  experimental?: {
266
269
  strictExecutionOrder?: boolean | undefined;
267
270
  disableLiveBindings?: boolean | undefined;
268
271
  resolveNewUrlToAsset?: boolean | undefined;
269
272
  enableComposingJsPlugins?: boolean | undefined;
270
273
  } | undefined;
271
- profilerNames?: boolean | undefined;
272
- cwd?: string | undefined;
273
- shimMissingExports?: boolean | undefined;
274
- moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
275
274
  define?: Record<string, string> | undefined;
275
+ profilerNames?: boolean | undefined;
276
276
  dropLabels?: string[] | undefined;
277
277
  }, {
278
278
  plugins?: RolldownPluginOption;
@@ -339,17 +339,17 @@ export declare const inputOptionsSchema: z.ZodObject<{
339
339
  skipWrite?: boolean | undefined;
340
340
  chokidar?: any;
341
341
  } | undefined;
342
+ cwd?: string | undefined;
343
+ shimMissingExports?: boolean | undefined;
344
+ moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
342
345
  experimental?: {
343
346
  strictExecutionOrder?: boolean | undefined;
344
347
  disableLiveBindings?: boolean | undefined;
345
348
  resolveNewUrlToAsset?: boolean | undefined;
346
349
  enableComposingJsPlugins?: boolean | undefined;
347
350
  } | undefined;
348
- profilerNames?: boolean | undefined;
349
- cwd?: string | undefined;
350
- shimMissingExports?: boolean | undefined;
351
- moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
352
351
  define?: Record<string, string> | undefined;
352
+ profilerNames?: boolean | undefined;
353
353
  dropLabels?: string[] | undefined;
354
354
  }>;
355
355
  export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "0.14.0-snapshot-d42ea8a-20241202003632",
3
+ "version": "0.15.0",
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.14.0-snapshot-d42ea8a-20241202003632"
116
+ "rolldown": "0.15.0"
117
117
  },
118
118
  "optionalDependencies": {
119
- "@rolldown/binding-darwin-arm64": "0.14.0-snapshot-d42ea8a-20241202003632",
120
- "@rolldown/binding-darwin-x64": "0.14.0-snapshot-d42ea8a-20241202003632",
121
- "@rolldown/binding-freebsd-x64": "0.14.0-snapshot-d42ea8a-20241202003632",
122
- "@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-d42ea8a-20241202003632",
123
- "@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-d42ea8a-20241202003632",
124
- "@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-d42ea8a-20241202003632",
125
- "@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-d42ea8a-20241202003632",
126
- "@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-d42ea8a-20241202003632",
127
- "@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-d42ea8a-20241202003632",
128
- "@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-d42ea8a-20241202003632",
129
- "@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-d42ea8a-20241202003632",
130
- "@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-d42ea8a-20241202003632"
119
+ "@rolldown/binding-darwin-arm64": "0.15.0",
120
+ "@rolldown/binding-freebsd-x64": "0.15.0",
121
+ "@rolldown/binding-linux-arm-gnueabihf": "0.15.0",
122
+ "@rolldown/binding-darwin-x64": "0.15.0",
123
+ "@rolldown/binding-linux-arm64-gnu": "0.15.0",
124
+ "@rolldown/binding-linux-arm64-musl": "0.15.0",
125
+ "@rolldown/binding-linux-x64-gnu": "0.15.0",
126
+ "@rolldown/binding-linux-x64-musl": "0.15.0",
127
+ "@rolldown/binding-wasm32-wasi": "0.15.0",
128
+ "@rolldown/binding-win32-arm64-msvc": "0.15.0",
129
+ "@rolldown/binding-win32-ia32-msvc": "0.15.0",
130
+ "@rolldown/binding-win32-x64-msvc": "0.15.0"
131
131
  },
132
132
  "scripts": {
133
133
  "# Scrips for binding #": "_",
@@ -1,12 +0,0 @@
1
- import type { InputOptions } from './options/input-options';
2
- import { RolldownBuild } from './rolldown-build';
3
- import { Watcher } from './watcher';
4
- import { WatchOptions } from './options/watch-options';
5
- export declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
6
- export declare const watch: (input: WatchOptions) => Promise<Watcher>;
7
- /**
8
- * @description
9
- * This is an experimental API. It's behavior may change in the future.
10
- * Calling this API will only execute the scan stage of rolldown.
11
- */
12
- export declare const experimental_scan: (input: InputOptions) => Promise<void>;