rolldown 0.15.0-snapshot-3cea4f5-20241211003613 → 0.15.1-commit.09cccaf

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.
Files changed (40) hide show
  1. package/dist/cjs/cli.cjs +78 -26
  2. package/dist/cjs/experimental-index.cjs +1 -1
  3. package/dist/cjs/index.cjs +1 -1
  4. package/dist/cjs/parallel-plugin-worker.cjs +1 -1
  5. package/dist/esm/cli.mjs +80 -28
  6. package/dist/esm/experimental-index.mjs +1 -1
  7. package/dist/esm/index.mjs +1 -1
  8. package/dist/esm/parallel-plugin-worker.mjs +1 -1
  9. package/dist/shared/{src-DYANT4eY.cjs → src-BKghi7SX.cjs} +127 -108
  10. package/dist/shared/{src-0e08MJIp.mjs → src-BKlslLnW.mjs} +127 -108
  11. package/dist/tsconfig.dts.tsbuildinfo +1 -1
  12. package/dist/types/binding.d.ts +8 -2
  13. package/dist/types/cli/load-config.d.ts +3 -0
  14. package/dist/types/cli/{utils.d.ts → logger.d.ts} +0 -2
  15. package/dist/types/index.d.ts +3 -4
  16. package/dist/types/log/logHandler.d.ts +1 -1
  17. package/dist/types/log/logger.d.ts +1 -1
  18. package/dist/types/log/logs.d.ts +2 -1
  19. package/dist/types/options/input-options.d.ts +10 -2
  20. package/dist/types/options/normalized-input-options.d.ts +1 -1
  21. package/dist/types/options/normalized-output-options.d.ts +3 -2
  22. package/dist/types/options/output-options.d.ts +3 -3
  23. package/dist/types/plugin/bindingify-plugin.d.ts +1 -1
  24. package/dist/types/plugin/index.d.ts +6 -6
  25. package/dist/types/plugin/minimal-plugin-context.d.ts +4 -4
  26. package/dist/types/plugin/plugin-context.d.ts +15 -11
  27. package/dist/types/plugin/transform-plugin-context.d.ts +8 -5
  28. package/dist/types/types/misc.d.ts +40 -0
  29. package/dist/types/types/module-info.d.ts +1 -0
  30. package/dist/types/types/output-bundle.d.ts +2 -2
  31. package/dist/types/types/rolldown-output.d.ts +8 -11
  32. package/dist/types/utils/bindingify-input-options.d.ts +1 -1
  33. package/dist/types/utils/create-bundler-option.d.ts +1 -1
  34. package/dist/types/utils/misc.d.ts +1 -2
  35. package/dist/types/utils/normalize-plugin-option.d.ts +1 -1
  36. package/dist/types/utils/transform-rendered-chunk.d.ts +4 -4
  37. package/dist/types/utils/transform-rendered-module.d.ts +2 -2
  38. package/package.json +17 -17
  39. package/dist/types/rollup-types.d.ts +0 -1
  40. package/dist/types/rollup.d.ts +0 -1118
@@ -31,6 +31,7 @@ export declare class BindingModuleInfo {
31
31
  dynamicImporters: Array<string>
32
32
  importedIds: Array<string>
33
33
  dynamicallyImportedIds: Array<string>
34
+ exports: Array<string>
34
35
  isEntry: boolean
35
36
  get code(): string | null
36
37
  }
@@ -337,7 +338,7 @@ export interface BindingInputOptions {
337
338
  inject?: Array<BindingInjectImportNamed | BindingInjectImportNamespace>
338
339
  experimental?: BindingExperimentalOptions
339
340
  profilerNames?: boolean
340
- jsx?: JsxOptions
341
+ jsx?: BindingJsx
341
342
  watch?: BindingWatchOption
342
343
  keepNames?: boolean
343
344
  checks?: BindingChecksOptions
@@ -365,6 +366,11 @@ export interface BindingJsWatchChangeEvent {
365
366
  event: string
366
367
  }
367
368
 
369
+ export type BindingJsx =
370
+ | { type: 'Disable' }
371
+ | { type: 'Preserve' }
372
+ | { type: 'Enable', field0: JsxOptions }
373
+
368
374
  export declare enum BindingLogLevel {
369
375
  Silent = 0,
370
376
  Warn = 1,
@@ -891,7 +897,7 @@ export interface TransformOptions {
891
897
  /** Configure how TypeScript is transformed. */
892
898
  typescript?: TypeScriptOptions
893
899
  /** Configure how TSX and JSX are transformed. */
894
- jsx?: JsxOptions
900
+ jsx?: 'preserve' | JsxOptions
895
901
  /**
896
902
  * Sets the target environment for the generated JavaScript.
897
903
  *
@@ -0,0 +1,3 @@
1
+ import { ConfigExport } from '../types/config-export';
2
+ export declare function loadTsConfig(configFile: string): Promise<ConfigExport>;
3
+ export declare function loadConfig(configPath: string): Promise<ConfigExport>;
@@ -1,7 +1,5 @@
1
1
  import { type ConsolaInstance } from 'consola';
2
- import type { ConfigExport } from '../types/config-export';
3
2
  /**
4
3
  * Console logger
5
4
  */
6
5
  export declare const logger: Record<string, any> | ConsolaInstance;
7
- export declare function ensureConfig(configPath: string): Promise<ConfigExport>;
@@ -1,4 +1,4 @@
1
- import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, RolldownRenderedChunk, SourceMap } from './types/rolldown-output';
1
+ import { RolldownOutput, OutputAsset, OutputChunk, RenderedChunk, SourceMap } from './types/rolldown-output';
2
2
  import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './options/input-options';
3
3
  import type { ModuleFormat, OutputOptions } from './options/output-options';
4
4
  import type { RolldownOptions } from './types/rolldown-options';
@@ -24,6 +24,5 @@ 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, 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
- export type { RollupError, RollupLog, LoggingFunction } from './rollup';
27
+ export type { OutputAsset, OutputChunk, 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, RenderedChunk, };
28
+ export type { RollupError, RollupLog, LoggingFunction } from './types/misc';
@@ -1,4 +1,4 @@
1
- import type { LoggingFunctionWithPosition, LogHandler, RollupLog } from '../rollup';
1
+ import type { LoggingFunctionWithPosition, LogHandler, RollupLog } from '../types/misc';
2
2
  import { type LogLevel, type LogLevelOption } from './logging';
3
3
  export declare const normalizeLog: (log: RollupLog | string | (() => RollupLog | string)) => RollupLog;
4
4
  export declare function getLogHandler(level: LogLevel, code: string, logger: LogHandler, pluginName: string, logLevel: LogLevelOption): LoggingFunctionWithPosition;
@@ -1,4 +1,4 @@
1
- import type { LogHandler } from '../rollup';
1
+ import type { LogHandler } from '../types/misc';
2
2
  import type { Plugin } from '../plugin';
3
3
  import { type LogLevelOption } from './logging';
4
4
  import type { InputOptions } from '../options/input-options';
@@ -1,4 +1,5 @@
1
- import type { RollupLog } from '../rollup';
1
+ import type { RollupLog } from '../types/misc';
2
+ export declare function logMinifyWarning(): RollupLog;
2
3
  export declare function logInvalidLogPosition(pluginName: string): RollupLog;
3
4
  export declare function logInputHookInOutputPlugin(pluginName: string, hookName: string): RollupLog;
4
5
  export declare function logCycleLoading(pluginName: string, moduleId: string): RollupLog;
@@ -6,7 +6,7 @@ export type InputOption = string | string[] | Record<string, string>;
6
6
  export type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
7
7
  export type ModuleTypes = Record<string, 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | 'css'>;
8
8
  export interface JsxOptions {
9
- mode?: 'classic' | 'automatic';
9
+ mode?: 'classic' | 'automatic' | 'preserve';
10
10
  factory?: string;
11
11
  fragment?: string;
12
12
  importSource?: string;
@@ -102,7 +102,15 @@ export interface InputOptions {
102
102
  */
103
103
  inject?: Record<string, string | [string, string]>;
104
104
  profilerNames?: boolean;
105
- jsx?: JsxOptions;
105
+ /**
106
+ * JSX options.
107
+ * The `false` is disabled jsx parser, it will give you a syntax error if you use jsx syntax
108
+ * The `mode: preserve` is disabled jsx transformer, it perverse original jsx syntax in the output.
109
+ * The `mode: classic` is enabled jsx `classic` transformer.
110
+ * The `mode: automatic` is enabled jsx `automatic` transformer.
111
+ * @default mode = 'automatic'
112
+ */
113
+ jsx?: false | JsxOptions;
106
114
  watch?: WatchOptions | false;
107
115
  dropLabels?: string[];
108
116
  keepNames?: boolean;
@@ -1,4 +1,4 @@
1
- import type { LogHandler } from '../rollup';
1
+ import type { LogHandler } from '../types/misc';
2
2
  import { BindingNormalizedOptions } from '../binding';
3
3
  import { InputOptions } from '..';
4
4
  export interface NormalizedInputOptions {
@@ -1,6 +1,5 @@
1
- import { type UnsupportedFnRet } from '../utils/misc';
2
1
  import type { BindingNormalizedOptions } from '../binding';
3
- import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup';
2
+ import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../types/misc';
4
3
  import type { ChunkFileNamesFunction, GlobalsFunction, OutputOptions } from './output-options';
5
4
  export type InternalModuleFormat = 'es' | 'cjs' | 'iife' | 'umd' | 'app';
6
5
  export interface NormalizedOutputOptions {
@@ -32,6 +31,7 @@ export interface NormalizedOutputOptions {
32
31
  comments: 'none' | 'preserve-legal';
33
32
  polyfillRequire: boolean;
34
33
  }
34
+ type UnsupportedFnRet = () => never;
35
35
  export declare class NormalizedOutputOptionsImpl implements NormalizedOutputOptions {
36
36
  inner: BindingNormalizedOptions;
37
37
  constructor(inner: BindingNormalizedOptions);
@@ -64,3 +64,4 @@ export declare class NormalizedOutputOptionsImpl implements NormalizedOutputOpti
64
64
  get comments(): 'none' | 'preserve-legal';
65
65
  get polyfillRequire(): boolean;
66
66
  }
67
+ export {};
@@ -1,10 +1,10 @@
1
1
  import type { StringOrRegExp } from '../types/utils';
2
2
  import type { PreRenderedChunk } from '../binding';
3
- import { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup';
3
+ import { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../types/misc';
4
4
  import { RolldownOutputPluginOption } from '../plugin';
5
- import { RolldownRenderedChunk } from '../types/rolldown-output';
5
+ import { RenderedChunk } from '../types/rolldown-output';
6
6
  export type ModuleFormat = 'es' | 'cjs' | 'esm' | 'module' | 'commonjs' | 'iife' | 'umd' | 'experimental-app';
7
- export type AddonFunction = (chunk: RolldownRenderedChunk) => string | Promise<string>;
7
+ export type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
8
8
  export type ChunkFileNamesFunction = (chunkInfo: PreRenderedChunk) => string;
9
9
  export type GlobalsFunction = (name: string) => string;
10
10
  export interface OutputOptions {
@@ -2,7 +2,7 @@ import type { BindingPluginOptions } from '../binding';
2
2
  import type { Plugin } from './index';
3
3
  import type { OutputOptions } from '../options/output-options';
4
4
  import { PluginContextData } from './plugin-context-data';
5
- import type { LogHandler, LogLevelOption } from '../rollup';
5
+ import type { LogHandler, LogLevelOption } from '../types/misc';
6
6
  import type { InputOptions } from '../options/input-options';
7
7
  export interface BindingifyPluginArgs {
8
8
  plugin: Plugin;
@@ -8,7 +8,7 @@ import type { PluginContext } from './plugin-context';
8
8
  import type { TransformPluginContext } from './transform-plugin-context';
9
9
  import type { NormalizedOutputOptions } from '../options/normalized-output-options';
10
10
  import type { LogLevel } from '../log/logging';
11
- import type { RollupLog } from '../rollup';
11
+ import type { RollupLog } from '../types/misc';
12
12
  import type { MinimalPluginContext } from './minimal-plugin-context';
13
13
  import type { InputOptions, OutputOptions } from '..';
14
14
  import type { BuiltinPlugin } from '../builtin-plugin/constructors';
@@ -17,7 +17,7 @@ import type { DefinedHookNames } from '../constants/plugin';
17
17
  import type { DEFINED_HOOK_NAMES } from '../constants/plugin';
18
18
  import type { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context';
19
19
  import type { HookFilter } from './hook-filter';
20
- import { RolldownRenderedChunk } from '../types/rolldown-output';
20
+ import { RenderedChunk } from '../types/rolldown-output';
21
21
  export type ModuleSideEffects = boolean | 'no-treeshake' | null;
22
22
  export type ModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
23
23
  export type ImportKind = BindingHookResolveIdExtraArgs['kind'];
@@ -70,11 +70,11 @@ export interface FunctionPluginHooks {
70
70
  [DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
71
71
  [DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
72
72
  [DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
73
- [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RolldownRenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | {
73
+ [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | {
74
74
  code: string;
75
75
  map?: SourceMapInput;
76
76
  };
77
- [DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RolldownRenderedChunk) => string | void;
77
+ [DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RenderedChunk) => string | void;
78
78
  [DEFINED_HOOK_NAMES.renderError]: (this: PluginContext, error: Error) => void;
79
79
  [DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
80
80
  [DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void;
@@ -107,14 +107,14 @@ export type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends
107
107
  export type PluginHooks = {
108
108
  [K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], HookFilterExtension<K>>;
109
109
  };
110
- export type AddonHookFunction = (this: PluginContext, chunk: RolldownRenderedChunk) => string | Promise<string>;
110
+ export type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>;
111
111
  export type AddonHook = string | AddonHookFunction;
112
112
  export interface OutputPlugin extends Partial<{
113
113
  [K in OutputPluginHooks]: PluginHooks[K];
114
114
  }>, Partial<{
115
115
  [K in AddonHooks]: ObjectHook<AddonHook>;
116
116
  }> {
117
- name?: string;
117
+ name: string;
118
118
  }
119
119
  export interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
120
120
  api?: A;
@@ -1,15 +1,15 @@
1
- import type { LoggingFunction, LogHandler, LogLevelOption, RollupError } from '../rollup';
2
- import type { Plugin } from '../plugin';
1
+ import type { LoggingFunction, LogHandler, LogLevelOption, RollupError } from '../types/misc';
3
2
  export interface PluginContextMeta {
4
3
  rollupVersion: string;
5
4
  rolldownVersion: string;
6
5
  watchMode: boolean;
7
6
  }
8
7
  export declare class MinimalPluginContext {
8
+ readonly pluginName: string;
9
9
  info: LoggingFunction;
10
10
  warn: LoggingFunction;
11
11
  debug: LoggingFunction;
12
12
  meta: PluginContextMeta;
13
- readonly error: (error: RollupError | string) => never;
14
- constructor(onLog: LogHandler, logLevel: LogLevelOption, plugin: Plugin);
13
+ constructor(onLog: LogHandler, logLevel: LogLevelOption, pluginName: string);
14
+ error(e: RollupError | string): never;
15
15
  }
@@ -6,7 +6,7 @@ import { ModuleInfo } from '../types/module-info';
6
6
  import { PluginContextData } from './plugin-context-data';
7
7
  import { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context';
8
8
  import { PartialNull } from '../types/utils';
9
- import type { LogHandler, LogLevelOption } from '../rollup';
9
+ import type { LogHandler, LogLevelOption } from '../types/misc';
10
10
  export interface EmittedAsset {
11
11
  type: 'asset';
12
12
  name?: string;
@@ -23,19 +23,23 @@ export interface PrivatePluginContextResolveOptions extends PluginContextResolve
23
23
  [SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]?: symbol;
24
24
  }
25
25
  export declare class PluginContext extends MinimalPluginContext {
26
- readonly load: (options: {
26
+ private context;
27
+ private data;
28
+ private onLog;
29
+ private currentLoadingModule?;
30
+ constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption, currentLoadingModule?: string | undefined);
31
+ load(options: {
27
32
  id: string;
28
33
  resolveDependencies?: boolean;
29
- } & Partial<PartialNull<ModuleOptions>>) => Promise<ModuleInfo>;
30
- readonly resolve: (source: string, importer?: string, options?: PluginContextResolveOptions) => Promise<ResolvedId | null>;
31
- readonly emitFile: (file: EmittedAsset) => string;
32
- readonly getFileName: (referenceId: string) => string;
33
- readonly getModuleInfo: (id: string) => ModuleInfo | null;
34
- readonly getModuleIds: () => IterableIterator<string>;
35
- readonly addWatchFile: (id: string) => void;
34
+ } & Partial<PartialNull<ModuleOptions>>): Promise<ModuleInfo>;
35
+ resolve(source: string, importer?: string, options?: PluginContextResolveOptions): Promise<ResolvedId | null>;
36
+ emitFile(file: EmittedAsset): string;
37
+ getFileName(referenceId: string): string;
38
+ getModuleInfo(id: string): ModuleInfo | null;
39
+ getModuleIds(): IterableIterator<string>;
40
+ addWatchFile(id: string): void;
36
41
  /**
37
42
  * @deprecated This rollup API won't be supported by rolldown. Using this API will cause runtime error.
38
43
  */
39
- readonly parse: (input: string, options?: any) => any;
40
- constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption, currentLoadingModule?: string);
44
+ parse(_input: string, _options?: any): any;
41
45
  }
@@ -1,14 +1,17 @@
1
1
  import type { BindingPluginContext, BindingTransformPluginContext } from '../binding';
2
- import type { LogHandler, LogLevelOption, RollupError } from '../rollup';
2
+ import type { LogHandler, LogLevelOption, RollupError } from '../types/misc';
3
3
  import { PluginContext } from './plugin-context';
4
4
  import { PluginContextData } from './plugin-context-data';
5
5
  import type { Plugin } from './index';
6
6
  import { SourceMap } from '../types/rolldown-output';
7
7
  export declare class TransformPluginContext extends PluginContext {
8
- error: (error: RollupError | string, pos?: number | {
8
+ private inner;
9
+ private moduleId;
10
+ private moduleSource;
11
+ constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string, onLog: LogHandler, LogLevelOption: LogLevelOption);
12
+ error(e: RollupError | string, pos?: number | {
9
13
  column: number;
10
14
  line: number;
11
- }) => never;
12
- getCombinedSourcemap: () => SourceMap;
13
- constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string, onLog: LogHandler, LogLevelOption: LogLevelOption);
15
+ }): never;
16
+ getCombinedSourcemap(): SourceMap;
14
17
  }
@@ -0,0 +1,40 @@
1
+ export interface RollupLog {
2
+ binding?: string;
3
+ cause?: unknown;
4
+ code?: string;
5
+ exporter?: string;
6
+ frame?: string;
7
+ hook?: string;
8
+ id?: string;
9
+ ids?: string[];
10
+ loc?: {
11
+ column: number;
12
+ file?: string;
13
+ line: number;
14
+ };
15
+ message: string;
16
+ meta?: any;
17
+ names?: string[];
18
+ plugin?: string;
19
+ pluginCode?: unknown;
20
+ pos?: number;
21
+ reexporter?: string;
22
+ stack?: string;
23
+ url?: string;
24
+ }
25
+ export interface RollupError extends RollupLog {
26
+ name?: string;
27
+ stack?: string;
28
+ watchFiles?: string[];
29
+ }
30
+ export type LogLevel = 'warn' | 'info' | 'debug';
31
+ export type LogLevelOption = LogLevel | 'silent';
32
+ export type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void;
33
+ export type LoggingFunctionWithPosition = (log: RollupLog | string | (() => RollupLog | string), pos?: number | {
34
+ column: number;
35
+ line: number;
36
+ }) => void;
37
+ export type LogHandler = (level: LogLevel, log: RollupLog) => void;
38
+ export type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string;
39
+ export type SourcemapIgnoreListOption = (relativeSourcePath: string, sourcemapPath: string) => boolean;
40
+ export type WarningHandlerWithDefault = (warning: RollupLog, defaultHandler: LoggingFunction) => void;
@@ -10,5 +10,6 @@ export interface ModuleInfo extends ModuleOptions {
10
10
  dynamicImporters: string[];
11
11
  importedIds: string[];
12
12
  dynamicallyImportedIds: string[];
13
+ exports: string[];
13
14
  isEntry: boolean;
14
15
  }
@@ -1,4 +1,4 @@
1
- import type { RolldownOutputAsset, RolldownOutputChunk } from './rolldown-output';
1
+ import type { OutputAsset, OutputChunk } from './rolldown-output';
2
2
  export interface OutputBundle {
3
- [fileName: string]: RolldownOutputAsset | RolldownOutputChunk;
3
+ [fileName: string]: OutputAsset | OutputChunk;
4
4
  }
@@ -1,6 +1,6 @@
1
1
  import { AssetSource } from '../utils/asset-source';
2
- import type { RenderedChunk } from '../binding';
3
- export interface RolldownOutputAsset {
2
+ import type { RenderedChunk as BindingRenderedChunk } from '../binding';
3
+ export interface OutputAsset {
4
4
  type: 'asset';
5
5
  fileName: string;
6
6
  /** @deprecated Use "originalFileNames" instead. */
@@ -21,16 +21,16 @@ export interface SourceMap {
21
21
  toString(): string;
22
22
  toUrl(): string;
23
23
  }
24
- export interface RolldownRenderedModule {
24
+ export interface RenderedModule {
25
25
  readonly code: string | null;
26
26
  renderedLength: number;
27
27
  }
28
- export interface RolldownRenderedChunk extends Omit<RenderedChunk, 'modules'> {
28
+ export interface RenderedChunk extends Omit<BindingRenderedChunk, 'modules'> {
29
29
  modules: {
30
- [id: string]: RolldownRenderedModule;
30
+ [id: string]: RenderedModule;
31
31
  };
32
32
  }
33
- export interface RolldownOutputChunk {
33
+ export interface OutputChunk {
34
34
  type: 'chunk';
35
35
  code: string;
36
36
  name: string;
@@ -38,7 +38,7 @@ export interface RolldownOutputChunk {
38
38
  exports: string[];
39
39
  fileName: string;
40
40
  modules: {
41
- [id: string]: RolldownRenderedModule;
41
+ [id: string]: RenderedModule;
42
42
  };
43
43
  imports: string[];
44
44
  dynamicImports: string[];
@@ -50,8 +50,5 @@ export interface RolldownOutputChunk {
50
50
  preliminaryFileName: string;
51
51
  }
52
52
  export interface RolldownOutput {
53
- output: [
54
- RolldownOutputChunk,
55
- ...(RolldownOutputChunk | RolldownOutputAsset)[]
56
- ];
53
+ output: [OutputChunk, ...(OutputChunk | OutputAsset)[]];
57
54
  }
@@ -2,6 +2,6 @@ import type { RolldownPlugin } from '../plugin';
2
2
  import type { InputOptions } from '../options/input-options';
3
3
  import type { OutputOptions } from '../options/output-options';
4
4
  import type { BindingInputOptions } from '../binding';
5
- import { LogHandler } from '../rollup';
5
+ import { LogHandler } from '../types/misc';
6
6
  import { LogLevelOption } from '../log/logging';
7
7
  export declare function bindingifyInputOptions(rawPlugins: RolldownPlugin[], inputOptions: InputOptions, outputOptions: OutputOptions, onLog: LogHandler, logLevel: LogLevelOption): BindingInputOptions;
@@ -1,7 +1,7 @@
1
1
  import { BindingBundlerOptions } from '../binding';
2
+ import { LogHandler } from '../types/misc';
2
3
  import type { InputOptions } from '../options/input-options';
3
4
  import type { OutputOptions } from '../options/output-options';
4
- import { LogHandler } from '../rollup';
5
5
  export declare function createBundlerOptions(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<BundlerOptionWithStopWorker>;
6
6
  export interface BundlerOptionWithStopWorker {
7
7
  bundlerOptions: BindingBundlerOptions;
@@ -2,6 +2,5 @@ export declare function arraify<T>(value: T | T[]): T[];
2
2
  export declare function isNullish(value: any): value is null | undefined | void;
3
3
  export declare function unimplemented(info?: string): never;
4
4
  export declare function unreachable(info?: string): never;
5
- export declare function unsupported(info: string): () => never;
6
- export type UnsupportedFnRet = ReturnType<typeof unsupported>;
5
+ export declare function unsupported(info: string): never;
7
6
  export declare function noop(..._args: any[]): void;
@@ -1,7 +1,7 @@
1
1
  import type { RolldownPlugin, RolldownOutputPlugin } from '../plugin';
2
2
  import type { InputOptions } from '../options/input-options';
3
3
  import type { OutputOptions } from '../options/output-options';
4
- import { LogHandler } from '../rollup';
4
+ import { LogHandler } from '../types/misc';
5
5
  export declare const normalizePluginOption: {
6
6
  (plugins: InputOptions['plugins']): Promise<RolldownPlugin[]>;
7
7
  (plugins: OutputOptions['plugins']): Promise<RolldownOutputPlugin[]>;
@@ -1,4 +1,4 @@
1
- import { RenderedChunk } from '../binding';
2
- import { RolldownRenderedChunk } from '../types/rolldown-output';
3
- export declare function transformRenderedChunk(chunk: RenderedChunk): RolldownRenderedChunk;
4
- export declare function transformChunkModules(modules: RenderedChunk['modules']): RolldownRenderedChunk['modules'];
1
+ import { RenderedChunk as BindingRenderedChunk } from '../binding';
2
+ import { RenderedChunk } from '../types/rolldown-output';
3
+ export declare function transformRenderedChunk(chunk: BindingRenderedChunk): RenderedChunk;
4
+ export declare function transformChunkModules(modules: BindingRenderedChunk['modules']): RenderedChunk['modules'];
@@ -1,3 +1,3 @@
1
1
  import { BindingRenderedModule } from '../binding';
2
- import { RolldownRenderedModule } from '../types/rolldown-output';
3
- export declare function transformToRenderedModule(bindingRenderedModule: BindingRenderedModule): RolldownRenderedModule;
2
+ import { RenderedModule } from '../types/rolldown-output';
3
+ export declare function transformToRenderedModule(bindingRenderedModule: BindingRenderedModule): RenderedModule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "0.15.0-snapshot-3cea4f5-20241211003613",
3
+ "version": "0.15.1-commit.09cccaf",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "repository": {
@@ -91,7 +91,7 @@
91
91
  },
92
92
  "devDependencies": {
93
93
  "@jridgewell/sourcemap-codec": "^1.5.0",
94
- "@napi-rs/cli": "^3.0.0-alpha.60",
94
+ "@napi-rs/cli": "^3.0.0-alpha.65",
95
95
  "@napi-rs/wasm-runtime": "^0.2.4",
96
96
  "@types/fs-extra": "^11.0.4",
97
97
  "@types/lodash-es": "^4.17.12",
@@ -109,25 +109,25 @@
109
109
  "source-map": "^0.7.4",
110
110
  "tsx": "^4.19.2",
111
111
  "type-fest": "^4.20.0",
112
- "unbuild": "^2.0.0",
112
+ "unbuild": "^3.0.0",
113
113
  "why-is-node-running": "^3.0.0",
114
114
  "zod-to-json-schema": "^3.23.2",
115
- "@rolldown/testing": "0.0.1",
116
- "rolldown": "0.15.0-snapshot-3cea4f5-20241211003613"
115
+ "rolldown": "0.15.1-commit.09cccaf",
116
+ "@rolldown/testing": "0.0.1"
117
117
  },
118
118
  "optionalDependencies": {
119
- "@rolldown/binding-darwin-arm64": "0.15.0-snapshot-3cea4f5-20241211003613",
120
- "@rolldown/binding-darwin-x64": "0.15.0-snapshot-3cea4f5-20241211003613",
121
- "@rolldown/binding-linux-arm-gnueabihf": "0.15.0-snapshot-3cea4f5-20241211003613",
122
- "@rolldown/binding-freebsd-x64": "0.15.0-snapshot-3cea4f5-20241211003613",
123
- "@rolldown/binding-linux-arm64-gnu": "0.15.0-snapshot-3cea4f5-20241211003613",
124
- "@rolldown/binding-linux-arm64-musl": "0.15.0-snapshot-3cea4f5-20241211003613",
125
- "@rolldown/binding-linux-x64-gnu": "0.15.0-snapshot-3cea4f5-20241211003613",
126
- "@rolldown/binding-wasm32-wasi": "0.15.0-snapshot-3cea4f5-20241211003613",
127
- "@rolldown/binding-linux-x64-musl": "0.15.0-snapshot-3cea4f5-20241211003613",
128
- "@rolldown/binding-win32-arm64-msvc": "0.15.0-snapshot-3cea4f5-20241211003613",
129
- "@rolldown/binding-win32-x64-msvc": "0.15.0-snapshot-3cea4f5-20241211003613",
130
- "@rolldown/binding-win32-ia32-msvc": "0.15.0-snapshot-3cea4f5-20241211003613"
119
+ "@rolldown/binding-darwin-arm64": "0.15.1-commit.09cccaf",
120
+ "@rolldown/binding-darwin-x64": "0.15.1-commit.09cccaf",
121
+ "@rolldown/binding-freebsd-x64": "0.15.1-commit.09cccaf",
122
+ "@rolldown/binding-linux-arm64-gnu": "0.15.1-commit.09cccaf",
123
+ "@rolldown/binding-linux-arm64-musl": "0.15.1-commit.09cccaf",
124
+ "@rolldown/binding-linux-arm-gnueabihf": "0.15.1-commit.09cccaf",
125
+ "@rolldown/binding-linux-x64-musl": "0.15.1-commit.09cccaf",
126
+ "@rolldown/binding-linux-x64-gnu": "0.15.1-commit.09cccaf",
127
+ "@rolldown/binding-win32-arm64-msvc": "0.15.1-commit.09cccaf",
128
+ "@rolldown/binding-wasm32-wasi": "0.15.1-commit.09cccaf",
129
+ "@rolldown/binding-win32-ia32-msvc": "0.15.1-commit.09cccaf",
130
+ "@rolldown/binding-win32-x64-msvc": "0.15.1-commit.09cccaf"
131
131
  },
132
132
  "scripts": {
133
133
  "# Scrips for binding #": "_",
@@ -1 +0,0 @@
1
- export type { OutputOptions, InputOptions, Plugin, OutputPlugin, OutputChunk, NormalizedInputOptions, OutputAsset, OutputBundle, SourceMapInput, RenderedChunk, } from './rollup';