rolldown 0.15.0 → 0.15.1-commit.cc6f557
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 +249 -183
- package/dist/cjs/experimental-index.cjs +2 -2
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/parallel-plugin-worker.cjs +2 -2
- package/dist/esm/cli.mjs +343 -277
- package/dist/esm/experimental-index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +1 -1
- package/dist/shared/{chunk-BK2Ye-xa.cjs → chunk-BFvIen8E.cjs} +0 -11
- package/dist/shared/{consola_36c0034f-_8_dG1Nr.cjs → consola_36c0034f-B7L-radJ.cjs} +2 -2
- package/dist/shared/{consola_36c0034f-DWsVjwtA.mjs → consola_36c0034f-D9ce-831.mjs} +10 -10
- package/dist/shared/{prompt-RFvZMmjc.cjs → prompt-BiXtYIJ2.cjs} +3 -3
- package/dist/shared/{prompt-DGW8ZJmn.mjs → prompt-DlQ-08lk.mjs} +2 -2
- package/dist/shared/{src-DEPa5yhI.mjs → src-C4XpZnTu.mjs} +332 -233
- package/dist/shared/{src-COU7qQBJ.cjs → src-DKykz7Lg.cjs} +321 -216
- package/dist/tsconfig.dts.tsbuildinfo +1 -0
- package/dist/types/api/build.d.ts +2 -0
- package/dist/types/api/watch/index.d.ts +2 -2
- package/dist/types/api/watch/watch-emitter.d.ts +31 -0
- package/dist/types/api/watch/watcher.d.ts +7 -27
- package/dist/types/binding.d.ts +114 -19
- package/dist/types/builtin-plugin/constructors.d.ts +1 -5
- package/dist/types/cli/arguments/index.d.ts +5 -3
- package/dist/types/cli/arguments/schema.d.ts +10 -397
- package/dist/types/cli/colors.d.ts +11 -1
- package/dist/types/cli/load-config.d.ts +3 -0
- package/dist/types/cli/logger.d.ts +5 -0
- package/dist/types/constants/plugin.d.ts +8 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/log/logging.d.ts +6 -6
- package/dist/types/log/logs.d.ts +2 -0
- package/dist/types/options/input-options-schema.d.ts +3 -595
- package/dist/types/options/input-options.d.ts +26 -3
- package/dist/types/options/normalized-input-options.d.ts +1 -1
- package/dist/types/options/normalized-output-options.d.ts +21 -17
- package/dist/types/options/output-options-schema.d.ts +2 -146
- package/dist/types/options/output-options.d.ts +1 -0
- package/dist/types/plugin/minimal-plugin-context.d.ts +3 -3
- package/dist/types/plugin/plugin-context-data.d.ts +2 -1
- package/dist/types/plugin/plugin-context.d.ts +14 -10
- package/dist/types/plugin/transform-plugin-context.d.ts +7 -4
- package/dist/types/rollup.d.ts +4 -0
- package/dist/types/treeshake/module-side-effects.d.ts +14 -115
- package/dist/types/types/module-info.d.ts +1 -0
- package/dist/types/types/rolldown-output.d.ts +6 -0
- package/dist/types/utils/bindingify-input-options.d.ts +1 -1
- package/dist/types/utils/create-bundler-option.d.ts +11 -0
- package/dist/types/utils/error.d.ts +2 -1
- package/dist/types/utils/misc.d.ts +1 -1
- package/dist/types/utils/transform-sourcemap.d.ts +1 -1
- package/dist/types/utils/zod-ext.d.ts +6 -5
- package/package.json +16 -16
- package/dist/types/cli/utils.d.ts +0 -6
- package/dist/types/log/locate-character/index.d.ts +0 -13
|
@@ -29,35 +29,39 @@ export interface NormalizedOutputOptions {
|
|
|
29
29
|
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
|
30
30
|
minify: boolean;
|
|
31
31
|
comments: 'none' | 'preserve-legal';
|
|
32
|
+
polyfillRequire: boolean;
|
|
32
33
|
}
|
|
34
|
+
type UnsupportedFnRet = () => never;
|
|
33
35
|
export declare class NormalizedOutputOptionsImpl implements NormalizedOutputOptions {
|
|
34
36
|
inner: BindingNormalizedOptions;
|
|
35
37
|
constructor(inner: BindingNormalizedOptions);
|
|
36
38
|
get dir(): string | undefined;
|
|
37
|
-
get entryFileNames(): string |
|
|
38
|
-
get chunkFileNames(): string |
|
|
39
|
+
get entryFileNames(): string | UnsupportedFnRet;
|
|
40
|
+
get chunkFileNames(): string | UnsupportedFnRet;
|
|
39
41
|
get assetFileNames(): string;
|
|
40
|
-
get format():
|
|
41
|
-
get exports():
|
|
42
|
-
get sourcemap(): boolean |
|
|
43
|
-
get cssEntryFileNames(): string |
|
|
44
|
-
get cssChunkFileNames(): string |
|
|
42
|
+
get format(): 'es' | 'cjs' | 'app' | 'iife' | 'umd';
|
|
43
|
+
get exports(): 'default' | 'named' | 'none' | 'auto';
|
|
44
|
+
get sourcemap(): boolean | 'inline' | 'hidden';
|
|
45
|
+
get cssEntryFileNames(): string | UnsupportedFnRet;
|
|
46
|
+
get cssChunkFileNames(): string | UnsupportedFnRet;
|
|
45
47
|
get shimMissingExports(): boolean;
|
|
46
48
|
get name(): string | undefined;
|
|
47
49
|
get file(): string | undefined;
|
|
48
50
|
get inlineDynamicImports(): boolean;
|
|
49
51
|
get externalLiveBindings(): boolean;
|
|
50
|
-
get banner(): string |
|
|
51
|
-
get footer(): string |
|
|
52
|
-
get intro(): string |
|
|
53
|
-
get outro(): string |
|
|
54
|
-
get esModule(): boolean |
|
|
52
|
+
get banner(): string | UnsupportedFnRet | undefined;
|
|
53
|
+
get footer(): string | UnsupportedFnRet | undefined;
|
|
54
|
+
get intro(): string | UnsupportedFnRet | undefined;
|
|
55
|
+
get outro(): string | UnsupportedFnRet | undefined;
|
|
56
|
+
get esModule(): boolean | 'if-default-prop';
|
|
55
57
|
get extend(): boolean;
|
|
56
|
-
get globals(): Record<string, string> |
|
|
57
|
-
get hashCharacters():
|
|
58
|
+
get globals(): Record<string, string> | UnsupportedFnRet;
|
|
59
|
+
get hashCharacters(): 'base64' | 'base36' | 'hex';
|
|
58
60
|
get sourcemapDebugIds(): boolean;
|
|
59
|
-
get sourcemapIgnoreList():
|
|
60
|
-
get sourcemapPathTransform():
|
|
61
|
+
get sourcemapIgnoreList(): UnsupportedFnRet | undefined;
|
|
62
|
+
get sourcemapPathTransform(): UnsupportedFnRet | undefined;
|
|
61
63
|
get minify(): boolean;
|
|
62
|
-
get comments():
|
|
64
|
+
get comments(): 'none' | 'preserve-legal';
|
|
65
|
+
get polyfillRequire(): boolean;
|
|
63
66
|
}
|
|
67
|
+
export {};
|
|
@@ -1,147 +1,3 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
import { RolldownRenderedChunk } from '../types/rolldown-output';
|
|
5
|
-
export declare const outputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
|
|
6
|
-
dir: z.ZodOptional<z.ZodString>;
|
|
7
|
-
file: z.ZodOptional<z.ZodString>;
|
|
8
|
-
exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>;
|
|
9
|
-
hashCharacters: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"base64">, z.ZodLiteral<"base36">]>, z.ZodLiteral<"hex">]>>;
|
|
10
|
-
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>, z.ZodLiteral<"umd">]>>;
|
|
11
|
-
sourcemap: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"inline">]>, z.ZodLiteral<"hidden">]>>;
|
|
12
|
-
sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<SourcemapIgnoreListOption, z.ZodTypeDef, SourcemapIgnoreListOption>]>>;
|
|
13
|
-
sourcemapPathTransform: z.ZodOptional<z.ZodType<SourcemapPathTransformOption, z.ZodTypeDef, SourcemapPathTransformOption>>;
|
|
14
|
-
banner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
|
|
15
|
-
footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
|
|
16
|
-
intro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
|
|
17
|
-
outro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
|
|
18
|
-
extend: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
-
esModule: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"if-default-prop">, z.ZodBoolean]>>;
|
|
20
|
-
assetFileNames: z.ZodOptional<z.ZodString>;
|
|
21
|
-
entryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
|
|
22
|
-
chunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
|
|
23
|
-
cssEntryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
|
|
24
|
-
cssChunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
|
|
25
|
-
minify: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
-
name: z.ZodOptional<z.ZodString>;
|
|
27
|
-
globals: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodString>]>>;
|
|
28
|
-
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
29
|
-
inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
30
|
-
advancedChunks: z.ZodOptional<z.ZodObject<{
|
|
31
|
-
minSize: z.ZodOptional<z.ZodNumber>;
|
|
32
|
-
minShareCount: z.ZodOptional<z.ZodNumber>;
|
|
33
|
-
groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
34
|
-
name: z.ZodString;
|
|
35
|
-
test: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>>;
|
|
36
|
-
priority: z.ZodOptional<z.ZodNumber>;
|
|
37
|
-
minSize: z.ZodOptional<z.ZodNumber>;
|
|
38
|
-
minShareCount: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
}, "strict", z.ZodTypeAny, {
|
|
40
|
-
name: string;
|
|
41
|
-
test?: string | RegExp | undefined;
|
|
42
|
-
minSize?: number | undefined;
|
|
43
|
-
minShareCount?: number | undefined;
|
|
44
|
-
priority?: number | undefined;
|
|
45
|
-
}, {
|
|
46
|
-
name: string;
|
|
47
|
-
test?: string | RegExp | undefined;
|
|
48
|
-
minSize?: number | undefined;
|
|
49
|
-
minShareCount?: number | undefined;
|
|
50
|
-
priority?: number | undefined;
|
|
51
|
-
}>, "many">>;
|
|
52
|
-
}, "strict", z.ZodTypeAny, {
|
|
53
|
-
minSize?: number | undefined;
|
|
54
|
-
minShareCount?: number | undefined;
|
|
55
|
-
groups?: {
|
|
56
|
-
name: string;
|
|
57
|
-
test?: string | RegExp | undefined;
|
|
58
|
-
minSize?: number | undefined;
|
|
59
|
-
minShareCount?: number | undefined;
|
|
60
|
-
priority?: number | undefined;
|
|
61
|
-
}[] | undefined;
|
|
62
|
-
}, {
|
|
63
|
-
minSize?: number | undefined;
|
|
64
|
-
minShareCount?: number | undefined;
|
|
65
|
-
groups?: {
|
|
66
|
-
name: string;
|
|
67
|
-
test?: string | RegExp | undefined;
|
|
68
|
-
minSize?: number | undefined;
|
|
69
|
-
minShareCount?: number | undefined;
|
|
70
|
-
priority?: number | undefined;
|
|
71
|
-
}[] | undefined;
|
|
72
|
-
}>>;
|
|
73
|
-
comments: z.ZodOptional<z.ZodEnum<["none", "preserve-legal"]>>;
|
|
74
|
-
}, {
|
|
75
|
-
banner: z.ZodOptional<z.ZodString>;
|
|
76
|
-
footer: z.ZodOptional<z.ZodString>;
|
|
77
|
-
intro: z.ZodOptional<z.ZodString>;
|
|
78
|
-
outro: z.ZodOptional<z.ZodString>;
|
|
79
|
-
esModule: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
-
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
81
|
-
advancedChunks: z.ZodOptional<z.ZodObject<{
|
|
82
|
-
minSize: z.ZodOptional<z.ZodNumber>;
|
|
83
|
-
minShareCount: z.ZodOptional<z.ZodNumber>;
|
|
84
|
-
}, "strict", z.ZodTypeAny, {
|
|
85
|
-
minSize?: number | undefined;
|
|
86
|
-
minShareCount?: number | undefined;
|
|
87
|
-
}, {
|
|
88
|
-
minSize?: number | undefined;
|
|
89
|
-
minShareCount?: number | undefined;
|
|
90
|
-
}>>;
|
|
91
|
-
}>, "sourcemapIgnoreList" | "sourcemapPathTransform">, "strict", z.ZodTypeAny, {
|
|
92
|
-
name?: string | undefined;
|
|
93
|
-
exports?: "auto" | "named" | "default" | "none" | undefined;
|
|
94
|
-
banner?: string | undefined;
|
|
95
|
-
footer?: string | undefined;
|
|
96
|
-
intro?: string | undefined;
|
|
97
|
-
outro?: string | undefined;
|
|
98
|
-
esModule?: boolean | undefined;
|
|
99
|
-
globals?: Record<string, string> | undefined;
|
|
100
|
-
advancedChunks?: {
|
|
101
|
-
minSize?: number | undefined;
|
|
102
|
-
minShareCount?: number | undefined;
|
|
103
|
-
} | undefined;
|
|
104
|
-
dir?: string | undefined;
|
|
105
|
-
file?: string | undefined;
|
|
106
|
-
hashCharacters?: "base64" | "base36" | "hex" | undefined;
|
|
107
|
-
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined;
|
|
108
|
-
sourcemap?: boolean | "inline" | "hidden" | undefined;
|
|
109
|
-
extend?: boolean | undefined;
|
|
110
|
-
assetFileNames?: string | undefined;
|
|
111
|
-
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
|
|
112
|
-
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
|
|
113
|
-
cssEntryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
|
|
114
|
-
cssChunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
|
|
115
|
-
minify?: boolean | undefined;
|
|
116
|
-
externalLiveBindings?: boolean | undefined;
|
|
117
|
-
inlineDynamicImports?: boolean | undefined;
|
|
118
|
-
comments?: "none" | "preserve-legal" | undefined;
|
|
119
|
-
}, {
|
|
120
|
-
name?: string | undefined;
|
|
121
|
-
exports?: "auto" | "named" | "default" | "none" | undefined;
|
|
122
|
-
banner?: string | undefined;
|
|
123
|
-
footer?: string | undefined;
|
|
124
|
-
intro?: string | undefined;
|
|
125
|
-
outro?: string | undefined;
|
|
126
|
-
esModule?: boolean | undefined;
|
|
127
|
-
globals?: Record<string, string> | undefined;
|
|
128
|
-
advancedChunks?: {
|
|
129
|
-
minSize?: number | undefined;
|
|
130
|
-
minShareCount?: number | undefined;
|
|
131
|
-
} | undefined;
|
|
132
|
-
dir?: string | undefined;
|
|
133
|
-
file?: string | undefined;
|
|
134
|
-
hashCharacters?: "base64" | "base36" | "hex" | undefined;
|
|
135
|
-
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined;
|
|
136
|
-
sourcemap?: boolean | "inline" | "hidden" | undefined;
|
|
137
|
-
extend?: boolean | undefined;
|
|
138
|
-
assetFileNames?: string | undefined;
|
|
139
|
-
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
|
|
140
|
-
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
|
|
141
|
-
cssEntryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
|
|
142
|
-
cssChunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
|
|
143
|
-
minify?: boolean | undefined;
|
|
144
|
-
externalLiveBindings?: boolean | undefined;
|
|
145
|
-
inlineDynamicImports?: boolean | undefined;
|
|
146
|
-
comments?: "none" | "preserve-legal" | undefined;
|
|
147
|
-
}>;
|
|
2
|
+
import type { OutputCliOptions } from '../options/output-options';
|
|
3
|
+
export declare const outputCliOptionsSchema: z.ZodType<OutputCliOptions>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { LoggingFunction, LogHandler, LogLevelOption, RollupError } from '../rollup';
|
|
2
|
-
import type { Plugin } from '../plugin';
|
|
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
|
-
|
|
14
|
-
|
|
13
|
+
constructor(onLog: LogHandler, logLevel: LogLevelOption, pluginName: string);
|
|
14
|
+
error(e: RollupError | string): never;
|
|
15
15
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { BindingPluginContext } from '../binding';
|
|
2
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
6
|
moduleOptionMap: Map<string, ModuleOptions>;
|
|
6
7
|
resolveOptionsMap: Map<number, PluginContextResolveOptions>;
|
|
7
8
|
loadModulePromiseMap: Map<string, Promise<void>>;
|
|
8
9
|
updateModuleOption(id: string, option: ModuleOptions): void;
|
|
9
10
|
getModuleOption(id: string): ModuleOptions;
|
|
10
|
-
getModuleInfo(id: string, context: BindingPluginContext):
|
|
11
|
+
getModuleInfo(id: string, context: BindingPluginContext): ModuleInfo | null;
|
|
11
12
|
getModuleIds(context: BindingPluginContext): ArrayIterator<string>;
|
|
12
13
|
saveResolveOptions(options: PluginContextResolveOptions): number;
|
|
13
14
|
getSavedResolveOptions(receipt: number): PluginContextResolveOptions | undefined;
|
|
@@ -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
|
-
|
|
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>>)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
40
|
-
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption, currentLoadingModule?: string);
|
|
44
|
+
parse(_input: string, _options?: any): any;
|
|
41
45
|
}
|
|
@@ -5,10 +5,13 @@ 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
|
-
|
|
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
|
-
})
|
|
12
|
-
getCombinedSourcemap
|
|
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
|
}
|
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,115 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}>, {
|
|
16
|
-
sideEffects: boolean;
|
|
17
|
-
external?: boolean | undefined;
|
|
18
|
-
test?: RegExp | undefined;
|
|
19
|
-
}, {
|
|
20
|
-
sideEffects: boolean;
|
|
21
|
-
external?: boolean | undefined;
|
|
22
|
-
test?: RegExp | undefined;
|
|
23
|
-
}>;
|
|
24
|
-
export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
25
|
-
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
26
|
-
external: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
-
sideEffects: z.ZodBoolean;
|
|
28
|
-
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
sideEffects: boolean;
|
|
30
|
-
external?: boolean | undefined;
|
|
31
|
-
test?: RegExp | undefined;
|
|
32
|
-
}, {
|
|
33
|
-
sideEffects: boolean;
|
|
34
|
-
external?: boolean | undefined;
|
|
35
|
-
test?: RegExp | undefined;
|
|
36
|
-
}>, {
|
|
37
|
-
sideEffects: boolean;
|
|
38
|
-
external?: boolean | undefined;
|
|
39
|
-
test?: RegExp | undefined;
|
|
40
|
-
}, {
|
|
41
|
-
sideEffects: boolean;
|
|
42
|
-
external?: boolean | undefined;
|
|
43
|
-
test?: RegExp | undefined;
|
|
44
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>;
|
|
45
|
-
export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{
|
|
46
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
47
|
-
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
48
|
-
external: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
-
sideEffects: z.ZodBoolean;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
sideEffects: boolean;
|
|
52
|
-
external?: boolean | undefined;
|
|
53
|
-
test?: RegExp | undefined;
|
|
54
|
-
}, {
|
|
55
|
-
sideEffects: boolean;
|
|
56
|
-
external?: boolean | undefined;
|
|
57
|
-
test?: RegExp | undefined;
|
|
58
|
-
}>, {
|
|
59
|
-
sideEffects: boolean;
|
|
60
|
-
external?: boolean | undefined;
|
|
61
|
-
test?: RegExp | undefined;
|
|
62
|
-
}, {
|
|
63
|
-
sideEffects: boolean;
|
|
64
|
-
external?: boolean | undefined;
|
|
65
|
-
test?: RegExp | undefined;
|
|
66
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
67
|
-
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
69
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
70
|
-
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
71
|
-
external: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
-
sideEffects: z.ZodBoolean;
|
|
73
|
-
}, "strip", z.ZodTypeAny, {
|
|
74
|
-
sideEffects: boolean;
|
|
75
|
-
external?: boolean | undefined;
|
|
76
|
-
test?: RegExp | undefined;
|
|
77
|
-
}, {
|
|
78
|
-
sideEffects: boolean;
|
|
79
|
-
external?: boolean | undefined;
|
|
80
|
-
test?: RegExp | undefined;
|
|
81
|
-
}>, {
|
|
82
|
-
sideEffects: boolean;
|
|
83
|
-
external?: boolean | undefined;
|
|
84
|
-
test?: RegExp | undefined;
|
|
85
|
-
}, {
|
|
86
|
-
sideEffects: boolean;
|
|
87
|
-
external?: boolean | undefined;
|
|
88
|
-
test?: RegExp | undefined;
|
|
89
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
90
|
-
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
92
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
93
|
-
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
94
|
-
external: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
-
sideEffects: z.ZodBoolean;
|
|
96
|
-
}, "strip", z.ZodTypeAny, {
|
|
97
|
-
sideEffects: boolean;
|
|
98
|
-
external?: boolean | undefined;
|
|
99
|
-
test?: RegExp | undefined;
|
|
100
|
-
}, {
|
|
101
|
-
sideEffects: boolean;
|
|
102
|
-
external?: boolean | undefined;
|
|
103
|
-
test?: RegExp | undefined;
|
|
104
|
-
}>, {
|
|
105
|
-
sideEffects: boolean;
|
|
106
|
-
external?: boolean | undefined;
|
|
107
|
-
test?: RegExp | undefined;
|
|
108
|
-
}, {
|
|
109
|
-
sideEffects: boolean;
|
|
110
|
-
external?: boolean | undefined;
|
|
111
|
-
test?: RegExp | undefined;
|
|
112
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
113
|
-
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
-
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>;
|
|
115
|
-
export type TreeshakingOptions = z.infer<typeof TreeshakingOptionsSchema>;
|
|
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>;
|
|
@@ -3,9 +3,13 @@ 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,8 @@ export interface SourceMap {
|
|
|
14
18
|
sources: string[];
|
|
15
19
|
sourcesContent: string[];
|
|
16
20
|
version: number;
|
|
21
|
+
toString(): string;
|
|
22
|
+
toUrl(): string;
|
|
17
23
|
}
|
|
18
24
|
export interface RolldownRenderedModule {
|
|
19
25
|
readonly code: string | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RolldownPlugin } from '
|
|
1
|
+
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';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BindingBundlerOptions } from '../binding';
|
|
2
|
+
import { LogHandler } from '../rollup';
|
|
3
|
+
import type { InputOptions } from '../options/input-options';
|
|
4
|
+
import type { OutputOptions } from '../options/output-options';
|
|
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 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { BindingError } from '../binding';
|
|
2
|
+
export declare function normalizeErrors(rawErrors: (BindingError | Error)[]): Error;
|
|
@@ -2,5 +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):
|
|
5
|
+
export declare function unsupported(info: string): never;
|
|
6
6
|
export declare function noop(..._args: any[]): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExistingRawSourceMap, SourceMapInput } from '../types/sourcemap';
|
|
1
|
+
import { type ExistingRawSourceMap, SourceMapInput } from '../types/sourcemap';
|
|
2
2
|
export declare function isEmptySourcemapFiled(array: undefined | (string | null)[]): boolean;
|
|
3
3
|
export declare function normalizeTransformHookSourcemap(id: string, originalCode: string, rawMap?: SourceMapInput): ExistingRawSourceMap | undefined;
|
|
@@ -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.15.
|
|
3
|
+
"version": "0.15.1-commit.cc6f557",
|
|
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.
|
|
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": "^
|
|
112
|
+
"unbuild": "^3.0.0",
|
|
113
113
|
"why-is-node-running": "^3.0.0",
|
|
114
114
|
"zod-to-json-schema": "^3.23.2",
|
|
115
115
|
"@rolldown/testing": "0.0.1",
|
|
116
|
-
"rolldown": "0.15.
|
|
116
|
+
"rolldown": "0.15.1-commit.cc6f557"
|
|
117
117
|
},
|
|
118
118
|
"optionalDependencies": {
|
|
119
|
-
"@rolldown/binding-darwin-arm64": "0.15.
|
|
120
|
-
"@rolldown/binding-
|
|
121
|
-
"@rolldown/binding-
|
|
122
|
-
"@rolldown/binding-
|
|
123
|
-
"@rolldown/binding-linux-arm64-
|
|
124
|
-
"@rolldown/binding-linux-
|
|
125
|
-
"@rolldown/binding-linux-x64-
|
|
126
|
-
"@rolldown/binding-linux-
|
|
127
|
-
"@rolldown/binding-wasm32-wasi": "0.15.
|
|
128
|
-
"@rolldown/binding-win32-
|
|
129
|
-
"@rolldown/binding-win32-
|
|
130
|
-
"@rolldown/binding-win32-x64-msvc": "0.15.
|
|
119
|
+
"@rolldown/binding-darwin-arm64": "0.15.1-commit.cc6f557",
|
|
120
|
+
"@rolldown/binding-darwin-x64": "0.15.1-commit.cc6f557",
|
|
121
|
+
"@rolldown/binding-freebsd-x64": "0.15.1-commit.cc6f557",
|
|
122
|
+
"@rolldown/binding-linux-arm-gnueabihf": "0.15.1-commit.cc6f557",
|
|
123
|
+
"@rolldown/binding-linux-arm64-musl": "0.15.1-commit.cc6f557",
|
|
124
|
+
"@rolldown/binding-linux-x64-gnu": "0.15.1-commit.cc6f557",
|
|
125
|
+
"@rolldown/binding-linux-x64-musl": "0.15.1-commit.cc6f557",
|
|
126
|
+
"@rolldown/binding-linux-arm64-gnu": "0.15.1-commit.cc6f557",
|
|
127
|
+
"@rolldown/binding-wasm32-wasi": "0.15.1-commit.cc6f557",
|
|
128
|
+
"@rolldown/binding-win32-ia32-msvc": "0.15.1-commit.cc6f557",
|
|
129
|
+
"@rolldown/binding-win32-arm64-msvc": "0.15.1-commit.cc6f557",
|
|
130
|
+
"@rolldown/binding-win32-x64-msvc": "0.15.1-commit.cc6f557"
|
|
131
131
|
},
|
|
132
132
|
"scripts": {
|
|
133
133
|
"# Scrips for binding #": "_",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {string} source
|
|
3
|
-
* @param {import('./types').Options} [options]
|
|
4
|
-
*/
|
|
5
|
-
export function getLocator(source: string, options?: import("./types").Options | undefined): (search: string | number, index?: number | undefined) => Location | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* @param {string} source
|
|
8
|
-
* @param {string | number} search
|
|
9
|
-
* @param {import('./types').Options} [options]
|
|
10
|
-
* @returns {Location | undefined}
|
|
11
|
-
*/
|
|
12
|
-
export function locate(source: string, search: string | number, options?: import("./types").Options | undefined): Location | undefined;
|
|
13
|
-
export type Location = import("./types").Location;
|