rolldown 0.14.0 → 0.15.0-commit.ac58858
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 +902 -960
- package/dist/cjs/experimental-index.cjs +68 -26
- package/dist/cjs/index.cjs +6 -8
- package/dist/cjs/parallel-plugin-worker.cjs +20 -14
- package/dist/cjs/parallel-plugin.cjs +1 -3
- package/dist/esm/cli.mjs +855 -915
- package/dist/esm/experimental-index.mjs +44 -7
- package/dist/esm/index.mjs +2 -4
- package/dist/esm/parallel-plugin-worker.mjs +15 -10
- package/dist/esm/parallel-plugin.mjs +1 -3
- package/dist/shared/{chunk-JoMxl5V2.cjs → chunk-BFvIen8E.cjs} +13 -11
- package/dist/shared/{consola.36c0034f-HcmWcfPe.cjs → consola_36c0034f-B7L-radJ.cjs} +249 -295
- package/dist/shared/{consola.36c0034f-Xyw7SC_7.mjs → consola_36c0034f-D9ce-831.mjs} +221 -286
- package/dist/shared/{prompt-9Ij3R3TG.cjs → prompt-BiXtYIJ2.cjs} +157 -204
- package/dist/shared/{prompt-hoPhcrA-.mjs → prompt-DlQ-08lk.mjs} +125 -174
- package/dist/shared/src-Bs7g4_us.cjs +2985 -0
- package/dist/shared/src-C-NQjnqV.mjs +2851 -0
- package/dist/tsconfig.dts.tsbuildinfo +1 -0
- package/dist/types/api/build.d.ts +16 -0
- package/dist/types/api/experimental.d.ts +7 -0
- package/dist/types/api/rolldown/index.d.ts +3 -0
- package/dist/types/api/rolldown/rolldown-build.d.ts +12 -0
- package/dist/types/api/watch/index.d.ts +3 -0
- package/dist/types/{watcher.d.ts → api/watch/watch-emitter.d.ts} +17 -17
- package/dist/types/api/watch/watcher.d.ts +13 -0
- package/dist/types/binding.d.ts +273 -49
- package/dist/types/builtin-plugin/alias-plugin.d.ts +10 -0
- package/dist/types/builtin-plugin/constructors.d.ts +16 -0
- package/dist/types/builtin-plugin/replace-plugin.d.ts +28 -0
- package/dist/types/{options/normalized-ecma-transform-plugin-config.d.ts → builtin-plugin/transform-plugin.d.ts} +2 -1
- package/dist/types/builtin-plugin/utils.d.ts +8 -0
- package/dist/types/cli/arguments/index.d.ts +5 -3
- package/dist/types/cli/arguments/normalize.d.ts +2 -6
- package/dist/types/cli/arguments/schema.d.ts +10 -309
- package/dist/types/cli/colors.d.ts +11 -1
- package/dist/types/cli/utils.d.ts +2 -1
- package/dist/types/constants/plugin.d.ts +10 -1
- package/dist/types/experimental-index.d.ts +5 -2
- package/dist/types/index.d.ts +13 -10
- package/dist/types/log/logger.d.ts +2 -16
- package/dist/types/log/logging.d.ts +11 -8
- package/dist/types/log/logs.d.ts +3 -0
- package/dist/types/options/input-options-schema.d.ts +4 -0
- package/dist/types/options/input-options.d.ts +89 -430
- package/dist/types/options/normalized-input-options.d.ts +17 -11
- package/dist/types/options/normalized-output-options.d.ts +60 -21
- package/dist/types/options/output-options-schema.d.ts +3 -0
- package/dist/types/options/output-options.d.ts +73 -265
- package/dist/types/options/watch-options.d.ts +5 -0
- package/dist/types/plugin/bindingify-build-hooks.d.ts +9 -11
- package/dist/types/plugin/bindingify-hook-filter.d.ts +5 -5
- package/dist/types/plugin/bindingify-output-hooks.d.ts +13 -16
- package/dist/types/plugin/bindingify-plugin.d.ts +12 -3
- package/dist/types/plugin/bindingify-watch-hooks.d.ts +3 -5
- package/dist/types/plugin/hook-filter.d.ts +1 -1
- package/dist/types/plugin/index.d.ts +21 -18
- package/dist/types/plugin/minimal-plugin-context.d.ts +15 -0
- package/dist/types/plugin/plugin-context-data.d.ts +4 -4
- package/dist/types/plugin/plugin-context.d.ts +9 -4
- package/dist/types/plugin/plugin-driver.d.ts +4 -5
- package/dist/types/plugin/transform-plugin-context.d.ts +4 -3
- package/dist/types/rollup-types.d.ts +1 -1
- package/dist/types/rollup.d.ts +4 -0
- package/dist/types/treeshake/index.d.ts +0 -12
- package/dist/types/treeshake/module-side-effects.d.ts +14 -15
- package/dist/types/types/rolldown-output.d.ts +17 -2
- package/dist/types/types/utils.d.ts +1 -0
- package/dist/types/utils/bindingify-input-options.d.ts +7 -0
- package/dist/types/utils/bindingify-output-options.d.ts +3 -0
- package/dist/types/utils/create-bundler-option.d.ts +11 -0
- package/dist/types/utils/define-config.d.ts +3 -0
- package/dist/types/utils/error.d.ts +2 -0
- package/dist/types/utils/misc.d.ts +1 -0
- package/dist/types/utils/normalize-hook.d.ts +1 -1
- package/dist/types/utils/normalize-plugin-option.d.ts +8 -3
- package/dist/types/{options/utils.d.ts → utils/normalize-string-or-regex.d.ts} +1 -1
- package/dist/types/utils/transform-rendered-chunk.d.ts +4 -0
- package/dist/types/utils/transform-rendered-module.d.ts +3 -0
- package/dist/types/utils/transform-sourcemap.d.ts +2 -0
- package/dist/types/utils/transform-to-rollup-output.d.ts +1 -0
- package/dist/types/utils/zod-ext.d.ts +6 -5
- package/package.json +31 -23
- package/dist/shared/rolldown-binding.wasi.cjs +0 -187
- package/dist/shared/src_index-3pqhEViJ.cjs +0 -2785
- package/dist/shared/src_index-ywYMd4vB.mjs +0 -2786
- package/dist/shared/wasi-worker-browser.mjs +0 -39
- package/dist/shared/wasi-worker.mjs +0 -63
- package/dist/shared/watcher-worker.js +0 -1
- package/dist/types/constants/types.d.ts +0 -1
- package/dist/types/options/bindingify-input-options.d.ts +0 -4
- package/dist/types/options/bindingify-output-options.d.ts +0 -3
- package/dist/types/options/normalized-alias-plugin-config.d.ts +0 -8
- package/dist/types/options/watch-option.d.ts +0 -5
- package/dist/types/plugin/builtin-plugin.d.ts +0 -81
- package/dist/types/rolldown-build.d.ts +0 -10
- package/dist/types/rolldown.d.ts +0 -12
- package/dist/types/types/rendered-module.d.ts +0 -2
- package/dist/types/utils/normalize-input-options.d.ts +0 -3
- package/dist/types/utils/normalize-output-options.d.ts +0 -3
- package/dist/types/utils/normalize-tree-shake.d.ts +0 -3
- /package/dist/types/{utils/type-assert.d.ts → types/assert.d.ts} +0 -0
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs
|
|
1
|
+
import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs } from '../binding';
|
|
2
2
|
import type { NormalizedInputOptions } from '../options/normalized-input-options';
|
|
3
3
|
import type { NullValue, MaybePromise, PartialNull, MakeAsync } from '../types/utils';
|
|
4
4
|
import type { SourceMapInput } from '../types/sourcemap';
|
|
5
5
|
import type { ModuleInfo } from '../types/module-info';
|
|
6
6
|
import type { OutputBundle } from '../types/output-bundle';
|
|
7
|
-
import { PluginContext } from './plugin-context';
|
|
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
11
|
import type { RollupLog } from '../rollup';
|
|
12
|
-
import type { MinimalPluginContext } from '
|
|
13
|
-
import { InputOptions, OutputOptions } from '..';
|
|
14
|
-
import { BuiltinPlugin } from '
|
|
15
|
-
import { ParallelPlugin } from './parallel-plugin';
|
|
12
|
+
import type { MinimalPluginContext } from './minimal-plugin-context';
|
|
13
|
+
import type { InputOptions, OutputOptions } from '..';
|
|
14
|
+
import type { BuiltinPlugin } from '../builtin-plugin/constructors';
|
|
15
|
+
import type { ParallelPlugin } from './parallel-plugin';
|
|
16
16
|
import type { DefinedHookNames } from '../constants/plugin';
|
|
17
|
-
import { DEFINED_HOOK_NAMES } from '../constants/plugin';
|
|
18
|
-
import { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context';
|
|
19
|
-
import { HookFilter } from './hook-filter';
|
|
17
|
+
import type { DEFINED_HOOK_NAMES } from '../constants/plugin';
|
|
18
|
+
import type { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context';
|
|
19
|
+
import type { HookFilter } from './hook-filter';
|
|
20
|
+
import { RolldownRenderedChunk } from '../types/rolldown-output';
|
|
20
21
|
export type ModuleSideEffects = boolean | 'no-treeshake' | null;
|
|
21
22
|
export type ModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
|
22
23
|
export type ImportKind = BindingHookResolveIdExtraArgs['kind'];
|
|
@@ -69,11 +70,11 @@ export interface FunctionPluginHooks {
|
|
|
69
70
|
[DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
|
|
70
71
|
[DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
|
|
71
72
|
[DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
|
|
72
|
-
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk:
|
|
73
|
+
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RolldownRenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | {
|
|
73
74
|
code: string;
|
|
74
75
|
map?: SourceMapInput;
|
|
75
76
|
};
|
|
76
|
-
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk:
|
|
77
|
+
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RolldownRenderedChunk) => string | void;
|
|
77
78
|
[DEFINED_HOOK_NAMES.renderError]: (this: PluginContext, error: Error) => void;
|
|
78
79
|
[DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
|
|
79
80
|
[DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void;
|
|
@@ -85,12 +86,12 @@ export interface FunctionPluginHooks {
|
|
|
85
86
|
}
|
|
86
87
|
export type ChangeEvent = 'create' | 'update' | 'delete';
|
|
87
88
|
export type PluginOrder = 'pre' | 'post' | null;
|
|
88
|
-
export type ObjectHookMeta
|
|
89
|
+
export type ObjectHookMeta = {
|
|
89
90
|
order?: PluginOrder;
|
|
90
|
-
}
|
|
91
|
+
};
|
|
91
92
|
export type ObjectHook<T, O = {}> = T | ({
|
|
92
93
|
handler: T;
|
|
93
|
-
} & ObjectHookMeta
|
|
94
|
+
} & ObjectHookMeta & O);
|
|
94
95
|
export type SyncPluginHooks = DefinedHookNames['augmentChunkHash' | 'onLog' | 'outputOptions'];
|
|
95
96
|
export type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
|
|
96
97
|
export type FirstPluginHooks = DefinedHookNames['load' | 'resolveDynamicImport' | 'resolveId'];
|
|
@@ -98,15 +99,15 @@ export type SequentialPluginHooks = DefinedHookNames['augmentChunkHash' | 'gener
|
|
|
98
99
|
export type AddonHooks = DefinedHookNames['banner' | 'footer' | 'intro' | 'outro'];
|
|
99
100
|
export type OutputPluginHooks = DefinedHookNames['augmentChunkHash' | 'generateBundle' | 'outputOptions' | 'renderChunk' | 'renderError' | 'renderStart' | 'writeBundle'];
|
|
100
101
|
export type ParallelPluginHooks = Exclude<keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>;
|
|
101
|
-
export type
|
|
102
|
+
export type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends 'transform' ? {
|
|
102
103
|
filter?: HookFilter;
|
|
103
104
|
} : K extends 'load' | 'resolveId' ? {
|
|
104
105
|
filter?: Pick<HookFilter, 'id'>;
|
|
105
106
|
} : {};
|
|
106
107
|
export type PluginHooks = {
|
|
107
|
-
[K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K],
|
|
108
|
+
[K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], HookFilterExtension<K>>;
|
|
108
109
|
};
|
|
109
|
-
export type AddonHookFunction = (this: PluginContext, chunk:
|
|
110
|
+
export type AddonHookFunction = (this: PluginContext, chunk: RolldownRenderedChunk) => string | Promise<string>;
|
|
110
111
|
export type AddonHook = string | AddonHookFunction;
|
|
111
112
|
export interface OutputPlugin extends Partial<{
|
|
112
113
|
[K in OutputPluginHooks]: PluginHooks[K];
|
|
@@ -119,5 +120,7 @@ export interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
|
|
|
119
120
|
api?: A;
|
|
120
121
|
}
|
|
121
122
|
export type RolldownPlugin<A = any> = Plugin<A> | BuiltinPlugin | ParallelPlugin;
|
|
122
|
-
export type
|
|
123
|
+
export type RolldownPluginOption<A = any> = MaybePromise<NullValue<RolldownPlugin<A>> | false | RolldownPluginOption[]>;
|
|
124
|
+
export type RolldownOutputPlugin = OutputPlugin | BuiltinPlugin;
|
|
125
|
+
export type RolldownOutputPluginOption = MaybePromise<NullValue<RolldownOutputPlugin> | false | RolldownOutputPluginOption[]>;
|
|
123
126
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LoggingFunction, LogHandler, LogLevelOption, RollupError } from '../rollup';
|
|
2
|
+
import type { Plugin } from '../plugin';
|
|
3
|
+
export interface PluginContextMeta {
|
|
4
|
+
rollupVersion: string;
|
|
5
|
+
rolldownVersion: string;
|
|
6
|
+
watchMode: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class MinimalPluginContext {
|
|
9
|
+
info: LoggingFunction;
|
|
10
|
+
warn: LoggingFunction;
|
|
11
|
+
debug: LoggingFunction;
|
|
12
|
+
meta: PluginContextMeta;
|
|
13
|
+
readonly error: (error: RollupError | string) => never;
|
|
14
|
+
constructor(onLog: LogHandler, logLevel: LogLevelOption, plugin: Plugin);
|
|
15
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BindingPluginContext } from '../binding';
|
|
2
|
-
import {
|
|
2
|
+
import { ModuleOptions } from '..';
|
|
3
3
|
import { PluginContextResolveOptions } from './plugin-context';
|
|
4
|
+
import type { ModuleInfo } from '../types/module-info';
|
|
4
5
|
export declare class PluginContextData {
|
|
5
|
-
modules: Map<string, ModuleInfo>;
|
|
6
|
-
moduleIds: Array<string> | null;
|
|
7
6
|
moduleOptionMap: Map<string, ModuleOptions>;
|
|
8
7
|
resolveOptionsMap: Map<number, PluginContextResolveOptions>;
|
|
8
|
+
loadModulePromiseMap: Map<string, Promise<void>>;
|
|
9
9
|
updateModuleOption(id: string, option: ModuleOptions): void;
|
|
10
|
-
getModuleOption(id: string): ModuleOptions
|
|
10
|
+
getModuleOption(id: string): ModuleOptions;
|
|
11
11
|
getModuleInfo(id: string, context: BindingPluginContext): ModuleInfo | null;
|
|
12
12
|
getModuleIds(context: BindingPluginContext): ArrayIterator<string>;
|
|
13
13
|
saveResolveOptions(options: PluginContextResolveOptions): number;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { BindingPluginContext } from '../binding';
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
4
|
-
import { MinimalPluginContext } from '../log/logger';
|
|
2
|
+
import type { CustomPluginOptions, ModuleOptions, Plugin, ResolvedId } from './index';
|
|
3
|
+
import { MinimalPluginContext } from '../plugin/minimal-plugin-context';
|
|
5
4
|
import { AssetSource } from '../utils/asset-source';
|
|
6
5
|
import { ModuleInfo } from '../types/module-info';
|
|
7
6
|
import { PluginContextData } from './plugin-context-data';
|
|
8
7
|
import { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context';
|
|
8
|
+
import { PartialNull } from '../types/utils';
|
|
9
|
+
import type { LogHandler, LogLevelOption } from '../rollup';
|
|
9
10
|
export interface EmittedAsset {
|
|
10
11
|
type: 'asset';
|
|
11
12
|
name?: string;
|
|
@@ -22,6 +23,10 @@ export interface PrivatePluginContextResolveOptions extends PluginContextResolve
|
|
|
22
23
|
[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]?: symbol;
|
|
23
24
|
}
|
|
24
25
|
export declare class PluginContext extends MinimalPluginContext {
|
|
26
|
+
readonly load: (options: {
|
|
27
|
+
id: string;
|
|
28
|
+
resolveDependencies?: boolean;
|
|
29
|
+
} & Partial<PartialNull<ModuleOptions>>) => Promise<ModuleInfo>;
|
|
25
30
|
readonly resolve: (source: string, importer?: string, options?: PluginContextResolveOptions) => Promise<ResolvedId | null>;
|
|
26
31
|
readonly emitFile: (file: EmittedAsset) => string;
|
|
27
32
|
readonly getFileName: (referenceId: string) => string;
|
|
@@ -32,5 +37,5 @@ export declare class PluginContext extends MinimalPluginContext {
|
|
|
32
37
|
* @deprecated This rollup API won't be supported by rolldown. Using this API will cause runtime error.
|
|
33
38
|
*/
|
|
34
39
|
readonly parse: (input: string, options?: any) => any;
|
|
35
|
-
constructor(
|
|
40
|
+
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption, currentLoadingModule?: string);
|
|
36
41
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Plugin
|
|
2
|
-
import {
|
|
3
|
-
import { InputOptions, OutputOptions } from '..';
|
|
1
|
+
import { Plugin } from './';
|
|
2
|
+
import { InputOptions, OutputOptions, RolldownPlugin } from '..';
|
|
4
3
|
export declare class PluginDriver {
|
|
5
4
|
callOptionsHook(inputOptions: InputOptions): Promise<InputOptions>;
|
|
6
|
-
callOutputOptionsHook(
|
|
5
|
+
callOutputOptionsHook(rawPlugins: RolldownPlugin[], outputOptions: OutputOptions): OutputOptions;
|
|
7
6
|
}
|
|
8
|
-
export declare function getObjectPlugins(plugins:
|
|
7
|
+
export declare function getObjectPlugins(plugins: RolldownPlugin[]): Plugin[];
|
|
9
8
|
export declare function getSortedPlugins(hookName: 'options' | 'outputOptions' | 'onLog', plugins: readonly Plugin[]): Plugin[];
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { BindingPluginContext, BindingTransformPluginContext } from '../binding';
|
|
2
|
-
import type { RollupError } from '../rollup';
|
|
2
|
+
import type { LogHandler, LogLevelOption, RollupError } from '../rollup';
|
|
3
3
|
import { PluginContext } from './plugin-context';
|
|
4
4
|
import { PluginContextData } from './plugin-context-data';
|
|
5
|
-
import { NormalizedInputOptions } from '..';
|
|
6
5
|
import type { Plugin } from './index';
|
|
6
|
+
import { SourceMap } from '../types/rolldown-output';
|
|
7
7
|
export declare class TransformPluginContext extends PluginContext {
|
|
8
8
|
error: (error: RollupError | string, pos?: number | {
|
|
9
9
|
column: number;
|
|
10
10
|
line: number;
|
|
11
11
|
}) => never;
|
|
12
|
-
|
|
12
|
+
getCombinedSourcemap: () => SourceMap;
|
|
13
|
+
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string, onLog: LogHandler, LogLevelOption: LogLevelOption);
|
|
13
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { OutputOptions, InputOptions, Plugin, OutputPlugin, OutputChunk, NormalizedInputOptions, OutputAsset, OutputBundle, SourceMapInput, } from './rollup';
|
|
1
|
+
export type { OutputOptions, InputOptions, Plugin, OutputPlugin, OutputChunk, NormalizedInputOptions, OutputAsset, OutputBundle, SourceMapInput, RenderedChunk, } from './rollup';
|
package/dist/types/rollup.d.ts
CHANGED
|
@@ -906,8 +906,12 @@ export interface SerializedTimings {
|
|
|
906
906
|
}
|
|
907
907
|
|
|
908
908
|
export interface PreRenderedAsset {
|
|
909
|
+
/** @deprecated Use "names" instead. */
|
|
909
910
|
name: string | undefined
|
|
911
|
+
names: string[]
|
|
912
|
+
/** @deprecated Use "originalFileNames" instead. */
|
|
910
913
|
originalFileName: string | null
|
|
914
|
+
originalFileNames: string[]
|
|
911
915
|
source: string | Uint8Array
|
|
912
916
|
type: 'asset'
|
|
913
917
|
}
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
export declare const TreeshakingOptionsSchema: import("zod").ZodObject<import("zod").objectUtil.extendShape<{
|
|
2
|
-
moduleSideEffects: import("zod").ZodUnion<[import("zod").ZodBoolean, import("zod").ZodString]>;
|
|
3
|
-
}, {
|
|
4
|
-
moduleSideEffects: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodBoolean, import("zod").ZodString]>>;
|
|
5
|
-
}>, "strict", import("zod").ZodTypeAny, {
|
|
6
|
-
moduleSideEffects?: string | boolean | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
moduleSideEffects?: string | boolean | undefined;
|
|
9
|
-
}>;
|
|
10
|
-
export interface TreeshakingOptions {
|
|
11
|
-
moduleSideEffects?: boolean | RegExp;
|
|
12
|
-
}
|
|
13
1
|
export * from './module-side-effects';
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
moduleSideEffects
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
1
|
+
import type Z from 'zod';
|
|
2
|
+
export interface ModuleSideEffectsRule {
|
|
3
|
+
test?: RegExp;
|
|
4
|
+
external?: boolean;
|
|
5
|
+
sideEffects: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const ModuleSideEffectsRuleSchema: Z.ZodType<ModuleSideEffectsRule>;
|
|
8
|
+
export type ModuleSideEffectsOption = boolean | ModuleSideEffectsRule[] | ((id: string, isResolved: boolean) => boolean | undefined) | 'no-external';
|
|
9
|
+
export declare const ModuleSideEffectsOptionSchema: Z.ZodType<ModuleSideEffectsOption>;
|
|
10
|
+
export type TreeshakingOptions = {
|
|
11
|
+
moduleSideEffects?: ModuleSideEffectsOption;
|
|
12
|
+
annotations?: boolean;
|
|
13
|
+
} | boolean;
|
|
14
|
+
export declare const TreeshakingOptionsSchema: Z.ZodType<TreeshakingOptions>;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { AssetSource } from '../utils/asset-source';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RenderedChunk } from '../binding';
|
|
3
3
|
export interface RolldownOutputAsset {
|
|
4
4
|
type: 'asset';
|
|
5
5
|
fileName: string;
|
|
6
|
+
/** @deprecated Use "originalFileNames" instead. */
|
|
6
7
|
originalFileName: string | null;
|
|
8
|
+
originalFileNames: string[];
|
|
7
9
|
source: AssetSource;
|
|
10
|
+
/** @deprecated Use "names" instead. */
|
|
8
11
|
name: string | undefined;
|
|
12
|
+
names: string[];
|
|
9
13
|
}
|
|
10
14
|
export interface SourceMap {
|
|
11
15
|
file: string;
|
|
@@ -14,6 +18,17 @@ export interface SourceMap {
|
|
|
14
18
|
sources: string[];
|
|
15
19
|
sourcesContent: string[];
|
|
16
20
|
version: number;
|
|
21
|
+
toString(): string;
|
|
22
|
+
toUrl(): string;
|
|
23
|
+
}
|
|
24
|
+
export interface RolldownRenderedModule {
|
|
25
|
+
readonly code: string | null;
|
|
26
|
+
renderedLength: number;
|
|
27
|
+
}
|
|
28
|
+
export interface RolldownRenderedChunk extends Omit<RenderedChunk, 'modules'> {
|
|
29
|
+
modules: {
|
|
30
|
+
[id: string]: RolldownRenderedModule;
|
|
31
|
+
};
|
|
17
32
|
}
|
|
18
33
|
export interface RolldownOutputChunk {
|
|
19
34
|
type: 'chunk';
|
|
@@ -23,7 +38,7 @@ export interface RolldownOutputChunk {
|
|
|
23
38
|
exports: string[];
|
|
24
39
|
fileName: string;
|
|
25
40
|
modules: {
|
|
26
|
-
[id: string]:
|
|
41
|
+
[id: string]: RolldownRenderedModule;
|
|
27
42
|
};
|
|
28
43
|
imports: string[];
|
|
29
44
|
dynamicImports: string[];
|
|
@@ -10,3 +10,4 @@ export type PartialNull<T> = {
|
|
|
10
10
|
};
|
|
11
11
|
export type MakeAsync<Function_> = Function_ extends (this: infer This, ...parameters: infer Arguments) => infer Return ? (this: This, ...parameters: Arguments) => Return | Promise<Return> : never;
|
|
12
12
|
export type MaybeArray<T> = T | T[];
|
|
13
|
+
export type StringOrRegExp = string | RegExp;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RolldownPlugin } from '../plugin';
|
|
2
|
+
import type { InputOptions } from '../options/input-options';
|
|
3
|
+
import type { OutputOptions } from '../options/output-options';
|
|
4
|
+
import type { BindingInputOptions } from '../binding';
|
|
5
|
+
import { LogHandler } from '../rollup';
|
|
6
|
+
import { LogLevelOption } from '../log/logging';
|
|
7
|
+
export declare function bindingifyInputOptions(rawPlugins: RolldownPlugin[], inputOptions: InputOptions, outputOptions: OutputOptions, onLog: LogHandler, logLevel: LogLevelOption): BindingInputOptions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BindingBundlerOptions } from '../binding';
|
|
2
|
+
import type { InputOptions } from '../options/input-options';
|
|
3
|
+
import type { OutputOptions } from '../options/output-options';
|
|
4
|
+
import { LogHandler } from '../rollup';
|
|
5
|
+
export declare function createBundlerOptions(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<BundlerOptionWithStopWorker>;
|
|
6
|
+
export interface BundlerOptionWithStopWorker {
|
|
7
|
+
bundlerOptions: BindingBundlerOptions;
|
|
8
|
+
inputOptions: InputOptions;
|
|
9
|
+
onLog: LogHandler;
|
|
10
|
+
stopWorkers?: () => Promise<void>;
|
|
11
|
+
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import type { RolldownOptions } from '../types/rolldown-options';
|
|
1
2
|
import type { ConfigExport } from '../types/config-export';
|
|
3
|
+
export declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
4
|
+
export declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
2
5
|
export declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
@@ -3,4 +3,5 @@ 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
5
|
export declare function unsupported(info: string): () => never;
|
|
6
|
+
export type UnsupportedFnRet = ReturnType<typeof unsupported>;
|
|
6
7
|
export declare function noop(..._args: any[]): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyFn } from '../types/utils';
|
|
2
2
|
import type { ObjectHook, ObjectHookMeta } from '../plugin';
|
|
3
|
-
export declare function normalizeHook<Hook extends ObjectHook<AnyFn | string>>(hook: Hook): Hook extends ObjectHook<infer RawHook, infer CustomOptions> ? {
|
|
3
|
+
export declare function normalizeHook<Hook extends ObjectHook<AnyFn | string>>(hook: Hook): Hook extends ObjectHook<infer RawHook, infer CustomOptions> ? Hook extends RawHook ? never : {
|
|
4
4
|
handler: RawHook;
|
|
5
5
|
options: CustomOptions;
|
|
6
6
|
meta: ObjectHookMeta;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RolldownPlugin, RolldownOutputPlugin } from '../plugin';
|
|
2
2
|
import type { InputOptions } from '../options/input-options';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OutputOptions } from '../options/output-options';
|
|
4
|
+
import { LogHandler } from '../rollup';
|
|
4
5
|
export declare const normalizePluginOption: {
|
|
5
6
|
(plugins: InputOptions['plugins']): Promise<RolldownPlugin[]>;
|
|
6
|
-
(plugins: OutputOptions['plugins']): Promise<
|
|
7
|
+
(plugins: OutputOptions['plugins']): Promise<RolldownOutputPlugin[]>;
|
|
7
8
|
(plugins: unknown): Promise<any[]>;
|
|
8
9
|
};
|
|
10
|
+
export declare function checkOutputPluginOption(plugins: RolldownOutputPlugin[], onLog: LogHandler): RolldownOutputPlugin[];
|
|
11
|
+
export declare function normalizePlugins<T extends RolldownPlugin>(plugins: T[], anonymousPrefix: string): T[];
|
|
12
|
+
export declare const ANONYMOUS_PLUGIN_PREFIX = "at position ";
|
|
13
|
+
export declare const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position ";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BindingStringOrRegex } from '../binding
|
|
1
|
+
import type { BindingStringOrRegex } from '../binding';
|
|
2
2
|
export declare function normalizedStringOrRegex(pattern?: Array<string | RegExp> | (string | RegExp)): BindingStringOrRegex[] | undefined;
|
|
@@ -0,0 +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 +1,3 @@
|
|
|
1
|
+
import { type ExistingRawSourceMap, SourceMapInput } from '../types/sourcemap';
|
|
1
2
|
export declare function isEmptySourcemapFiled(array: undefined | (string | null)[]): boolean;
|
|
3
|
+
export declare function normalizeTransformHookSourcemap(id: string, originalCode: string, rawMap?: SourceMapInput): ExistingRawSourceMap | undefined;
|
|
@@ -2,6 +2,7 @@ import type { RolldownOutput } from '../types/rolldown-output';
|
|
|
2
2
|
import type { OutputBundle } from '../types/output-bundle';
|
|
3
3
|
import type { BindingOutputs, JsChangedOutputs } from '../binding';
|
|
4
4
|
export declare function transformToRollupOutput(output: BindingOutputs, changed?: ChangedOutputs): RolldownOutput;
|
|
5
|
+
export declare function handleOutputErrors(output: BindingOutputs): void;
|
|
5
6
|
export declare function transformToOutputBundle(output: BindingOutputs, changed: ChangedOutputs): OutputBundle;
|
|
6
7
|
export interface ChangedOutputs {
|
|
7
8
|
updated: Set<string>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import type Z from 'zod';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
export declare const stringOrRegExp: () =>
|
|
3
|
-
export declare const optionalStringArray: () =>
|
|
3
|
+
export declare const stringOrRegExp: () => Z.ZodUnion<[Z.ZodString, Z.ZodType<RegExp, Z.ZodTypeDef, RegExp>]>;
|
|
4
|
+
export declare const optionalStringArray: () => Z.ZodOptional<Z.ZodArray<Z.ZodString, "many">>;
|
|
4
5
|
/**
|
|
5
6
|
* We use this to ensure the type of a value is `T` but the value is not checked.
|
|
6
7
|
*/
|
|
7
|
-
export declare const phantom: <T>() =>
|
|
8
|
+
export declare const phantom: <T>() => Z.ZodType<T>;
|
|
8
9
|
/**
|
|
9
10
|
* @description Shortcut for `T | null | undefined | void`
|
|
10
11
|
*/
|
|
11
|
-
export declare const voidNullableWith: <T extends z.ZodTypeAny>(t: T) =>
|
|
12
|
+
export declare const voidNullableWith: <T extends z.ZodTypeAny>(t: T) => Z.ZodUnion<[Z.ZodUnion<[Z.ZodUnion<[Z.ZodVoid, Z.ZodNull]>, Z.ZodUndefined]>, T]>;
|
|
12
13
|
/**
|
|
13
14
|
* @description Shortcut for `T | null | undefined | void`
|
|
14
15
|
*/
|
|
15
|
-
export declare const voidNullable: () =>
|
|
16
|
+
export declare const voidNullable: () => Z.ZodUnion<[Z.ZodUnion<[Z.ZodVoid, Z.ZodNull]>, Z.ZodUndefined]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0-commit.ac58858",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"require": "./dist/cjs/parallel-plugin.cjs",
|
|
45
45
|
"import": "./dist/esm/parallel-plugin.mjs"
|
|
46
46
|
},
|
|
47
|
-
"./watcher-worker": "./dist/shared/watcher-worker.js",
|
|
48
47
|
"./package.json": "./package.json"
|
|
49
48
|
},
|
|
50
49
|
"imports": {
|
|
@@ -82,13 +81,22 @@
|
|
|
82
81
|
"dependencies": {
|
|
83
82
|
"zod": "^3.23.8"
|
|
84
83
|
},
|
|
84
|
+
"peerDependencies": {
|
|
85
|
+
"@babel/runtime": ">=7"
|
|
86
|
+
},
|
|
87
|
+
"peerDependenciesMeta": {
|
|
88
|
+
"@babel/runtime": {
|
|
89
|
+
"optional": true
|
|
90
|
+
}
|
|
91
|
+
},
|
|
85
92
|
"devDependencies": {
|
|
93
|
+
"@jridgewell/sourcemap-codec": "^1.5.0",
|
|
86
94
|
"@napi-rs/cli": "^3.0.0-alpha.60",
|
|
87
95
|
"@napi-rs/wasm-runtime": "^0.2.4",
|
|
96
|
+
"@types/fs-extra": "^11.0.4",
|
|
88
97
|
"@types/lodash-es": "^4.17.12",
|
|
89
98
|
"colorette": "^2.0.20",
|
|
90
99
|
"consola": "^3.2.3",
|
|
91
|
-
"cross-env": "^7.0.3",
|
|
92
100
|
"emnapi": "^1.2.0",
|
|
93
101
|
"execa": "^9.2.0",
|
|
94
102
|
"fs-extra": "^11.2.0",
|
|
@@ -98,28 +106,28 @@
|
|
|
98
106
|
"remeda": "^2.10.0",
|
|
99
107
|
"rollup": "^4.18.0",
|
|
100
108
|
"signal-exit": "4.1.0",
|
|
109
|
+
"source-map": "^0.7.4",
|
|
110
|
+
"tsx": "^4.19.2",
|
|
101
111
|
"type-fest": "^4.20.0",
|
|
102
112
|
"unbuild": "^2.0.0",
|
|
103
|
-
"vite": "^5.2.13",
|
|
104
|
-
"vitest": "^2.0.0",
|
|
105
113
|
"why-is-node-running": "^3.0.0",
|
|
106
114
|
"zod-to-json-schema": "^3.23.2",
|
|
107
|
-
"
|
|
108
|
-
"rolldown": "0.
|
|
115
|
+
"rolldown": "0.15.0-commit.ac58858",
|
|
116
|
+
"@rolldown/testing": "0.0.1"
|
|
109
117
|
},
|
|
110
118
|
"optionalDependencies": {
|
|
111
|
-
"@rolldown/binding-darwin-arm64": "0.
|
|
112
|
-
"@rolldown/binding-darwin-x64": "0.
|
|
113
|
-
"@rolldown/binding-
|
|
114
|
-
"@rolldown/binding-linux-arm64-
|
|
115
|
-
"@rolldown/binding-
|
|
116
|
-
"@rolldown/binding-linux-arm64-
|
|
117
|
-
"@rolldown/binding-linux-x64-
|
|
118
|
-
"@rolldown/binding-
|
|
119
|
-
"@rolldown/binding-win32-
|
|
120
|
-
"@rolldown/binding-
|
|
121
|
-
"@rolldown/binding-
|
|
122
|
-
"@rolldown/binding-
|
|
119
|
+
"@rolldown/binding-darwin-arm64": "0.15.0-commit.ac58858",
|
|
120
|
+
"@rolldown/binding-darwin-x64": "0.15.0-commit.ac58858",
|
|
121
|
+
"@rolldown/binding-freebsd-x64": "0.15.0-commit.ac58858",
|
|
122
|
+
"@rolldown/binding-linux-arm64-gnu": "0.15.0-commit.ac58858",
|
|
123
|
+
"@rolldown/binding-linux-arm-gnueabihf": "0.15.0-commit.ac58858",
|
|
124
|
+
"@rolldown/binding-linux-arm64-musl": "0.15.0-commit.ac58858",
|
|
125
|
+
"@rolldown/binding-linux-x64-gnu": "0.15.0-commit.ac58858",
|
|
126
|
+
"@rolldown/binding-win32-arm64-msvc": "0.15.0-commit.ac58858",
|
|
127
|
+
"@rolldown/binding-win32-ia32-msvc": "0.15.0-commit.ac58858",
|
|
128
|
+
"@rolldown/binding-linux-x64-musl": "0.15.0-commit.ac58858",
|
|
129
|
+
"@rolldown/binding-wasm32-wasi": "0.15.0-commit.ac58858",
|
|
130
|
+
"@rolldown/binding-win32-x64-msvc": "0.15.0-commit.ac58858"
|
|
123
131
|
},
|
|
124
132
|
"scripts": {
|
|
125
133
|
"# Scrips for binding #": "_",
|
|
@@ -130,15 +138,15 @@
|
|
|
130
138
|
"build-binding:wasi:release": "pnpm build-binding --profile release-wasi --target wasm32-wasip1-threads",
|
|
131
139
|
"# Scrips for node #": "_",
|
|
132
140
|
"bak_build-node": "unbuild",
|
|
133
|
-
"build-node": "
|
|
141
|
+
"build-node": "tsx ./build.ts",
|
|
134
142
|
"build-types": "tsc -p ./tsconfig.dts.json",
|
|
135
143
|
"build-types-check": "tsc -p ./tsconfig.check.json",
|
|
136
144
|
"build-native:debug": "run-s build-binding build-types build-node build-types-check",
|
|
137
145
|
"build-native:release": "run-s build-binding:release build-types build-node build-types-check",
|
|
138
|
-
"build-wasi:debug": "run-s build-binding:wasi build-node",
|
|
139
|
-
"build-wasi:release": "run-s build-binding:wasi:release build-node",
|
|
146
|
+
"build-wasi:debug": "run-s build-binding build-binding:wasi build-node",
|
|
147
|
+
"build-wasi:release": "run-s build-binding build-binding:wasi:release build-node",
|
|
140
148
|
"# Scrips for checking #": "_",
|
|
141
|
-
"test": "
|
|
149
|
+
"test": "pnpm run --filter rolldown-tests go",
|
|
142
150
|
"test:update": "vitest run -u",
|
|
143
151
|
"type-check": "tsc"
|
|
144
152
|
}
|