rolldown 0.14.0-snapshot-d42ea8a-20241202003632 → 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.
Files changed (53) hide show
  1. package/dist/cjs/cli.cjs +189 -175
  2. package/dist/cjs/experimental-index.cjs +12 -3
  3. package/dist/cjs/index.cjs +2 -1
  4. package/dist/cjs/parallel-plugin-worker.cjs +2 -2
  5. package/dist/esm/cli.mjs +282 -268
  6. package/dist/esm/experimental-index.mjs +10 -1
  7. package/dist/esm/index.mjs +2 -2
  8. package/dist/esm/parallel-plugin-worker.mjs +1 -1
  9. package/dist/shared/{chunk-BK2Ye-xa.cjs → chunk-BFvIen8E.cjs} +0 -11
  10. package/dist/shared/{consola_36c0034f-_8_dG1Nr.cjs → consola_36c0034f-B7L-radJ.cjs} +2 -2
  11. package/dist/shared/{consola_36c0034f-DWsVjwtA.mjs → consola_36c0034f-D9ce-831.mjs} +10 -10
  12. package/dist/shared/{prompt-RFvZMmjc.cjs → prompt-BiXtYIJ2.cjs} +3 -3
  13. package/dist/shared/{prompt-DGW8ZJmn.mjs → prompt-DlQ-08lk.mjs} +2 -2
  14. package/dist/shared/{src-CfQyqNSn.cjs → src-Bs7g4_us.cjs} +227 -121
  15. package/dist/shared/{src-DhHfkqAC.mjs → src-C-NQjnqV.mjs} +226 -136
  16. package/dist/tsconfig.dts.tsbuildinfo +1 -0
  17. package/dist/types/api/build.d.ts +16 -0
  18. package/dist/types/api/experimental.d.ts +7 -0
  19. package/dist/types/api/rolldown/index.d.ts +3 -0
  20. package/dist/types/{rolldown-build.d.ts → api/rolldown/rolldown-build.d.ts} +3 -3
  21. package/dist/types/api/watch/index.d.ts +3 -0
  22. package/dist/types/{watcher.d.ts → api/watch/watch-emitter.d.ts} +15 -17
  23. package/dist/types/api/watch/watcher.d.ts +13 -0
  24. package/dist/types/binding.d.ts +108 -15
  25. package/dist/types/builtin-plugin/constructors.d.ts +1 -5
  26. package/dist/types/cli/arguments/index.d.ts +5 -3
  27. package/dist/types/cli/arguments/schema.d.ts +10 -397
  28. package/dist/types/cli/colors.d.ts +11 -1
  29. package/dist/types/cli/utils.d.ts +2 -1
  30. package/dist/types/constants/plugin.d.ts +8 -1
  31. package/dist/types/experimental-index.d.ts +1 -1
  32. package/dist/types/index.d.ts +8 -6
  33. package/dist/types/log/logging.d.ts +6 -6
  34. package/dist/types/log/logs.d.ts +1 -0
  35. package/dist/types/options/input-options-schema.d.ts +3 -595
  36. package/dist/types/options/input-options.d.ts +16 -1
  37. package/dist/types/options/normalized-input-options.d.ts +1 -1
  38. package/dist/types/options/normalized-output-options.d.ts +20 -17
  39. package/dist/types/options/output-options-schema.d.ts +2 -146
  40. package/dist/types/options/output-options.d.ts +1 -0
  41. package/dist/types/plugin/plugin-context-data.d.ts +2 -1
  42. package/dist/types/rollup.d.ts +4 -0
  43. package/dist/types/treeshake/module-side-effects.d.ts +14 -115
  44. package/dist/types/types/rolldown-output.d.ts +6 -0
  45. package/dist/types/utils/bindingify-input-options.d.ts +1 -1
  46. package/dist/types/utils/create-bundler-option.d.ts +11 -0
  47. package/dist/types/utils/error.d.ts +2 -1
  48. package/dist/types/utils/misc.d.ts +1 -0
  49. package/dist/types/utils/transform-sourcemap.d.ts +1 -1
  50. package/dist/types/utils/zod-ext.d.ts +6 -5
  51. package/package.json +15 -15
  52. package/dist/types/log/locate-character/index.d.ts +0 -13
  53. package/dist/types/rolldown.d.ts +0 -12
@@ -1,3 +1,4 @@
1
+ import { type UnsupportedFnRet } from '../utils/misc';
1
2
  import type { BindingNormalizedOptions } from '../binding';
2
3
  import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup';
3
4
  import type { ChunkFileNamesFunction, GlobalsFunction, OutputOptions } from './output-options';
@@ -29,35 +30,37 @@ export interface NormalizedOutputOptions {
29
30
  sourcemapPathTransform: SourcemapPathTransformOption | undefined;
30
31
  minify: boolean;
31
32
  comments: 'none' | 'preserve-legal';
33
+ polyfillRequire: boolean;
32
34
  }
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 | (() => never);
38
- get chunkFileNames(): string | (() => never);
39
+ get entryFileNames(): string | UnsupportedFnRet;
40
+ get chunkFileNames(): string | UnsupportedFnRet;
39
41
  get assetFileNames(): string;
40
- get format(): "es" | "cjs" | "iife" | "umd" | "app";
41
- get exports(): "auto" | "named" | "default" | "none";
42
- get sourcemap(): boolean | "inline" | "hidden";
43
- get cssEntryFileNames(): string | (() => never);
44
- get cssChunkFileNames(): string | (() => never);
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 | (() => never) | undefined;
51
- get footer(): string | (() => never) | undefined;
52
- get intro(): string | (() => never) | undefined;
53
- get outro(): string | (() => never) | undefined;
54
- get esModule(): boolean | "if-default-prop";
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> | (() => never);
57
- get hashCharacters(): "base64" | "base36" | "hex";
58
+ get globals(): Record<string, string> | UnsupportedFnRet;
59
+ get hashCharacters(): 'base64' | 'base36' | 'hex';
58
60
  get sourcemapDebugIds(): boolean;
59
- get sourcemapIgnoreList(): (() => never) | undefined;
60
- get sourcemapPathTransform(): (() => never) | undefined;
61
+ get sourcemapIgnoreList(): UnsupportedFnRet | undefined;
62
+ get sourcemapPathTransform(): UnsupportedFnRet | undefined;
61
63
  get minify(): boolean;
62
- get comments(): "none" | "preserve-legal";
64
+ get comments(): 'none' | 'preserve-legal';
65
+ get polyfillRequire(): boolean;
63
66
  }
@@ -1,147 +1,3 @@
1
1
  import { z } from 'zod';
2
- import type { PreRenderedChunk } from '../binding';
3
- import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup';
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>;
@@ -60,6 +60,7 @@ export interface OutputOptions {
60
60
  */
61
61
  comments?: 'none' | 'preserve-legal';
62
62
  plugins?: RolldownOutputPluginOption;
63
+ polyfillRequire?: boolean;
63
64
  }
64
65
  interface OverwriteOutputOptionsForCli {
65
66
  banner?: string;
@@ -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): import("..").ModuleInfo | null;
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;
@@ -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 { z } from 'zod';
2
- export type ModuleSideEffectsOption = z.infer<typeof ModuleSideEffectsOptionSchema>;
3
- export declare const ModuleSideEffectsRuleSchema: z.ZodEffects<z.ZodObject<{
4
- test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
5
- external: z.ZodOptional<z.ZodBoolean>;
6
- sideEffects: z.ZodBoolean;
7
- }, "strip", z.ZodTypeAny, {
8
- sideEffects: boolean;
9
- external?: boolean | undefined;
10
- test?: RegExp | undefined;
11
- }, {
12
- sideEffects: boolean;
13
- external?: boolean | undefined;
14
- test?: RegExp | undefined;
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 'rolldown';
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 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 +1,2 @@
1
- export declare function normalizeErrors(rawErrors: unknown[]): Error;
1
+ import { BindingError } from '../binding';
2
+ export declare function normalizeErrors(rawErrors: (BindingError | Error)[]): Error;
@@ -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,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: () => z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>;
3
- export declare const optionalStringArray: () => z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
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>() => z.ZodType<T, z.ZodTypeDef, 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) => z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, 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: () => z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>;
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.14.0-snapshot-d42ea8a-20241202003632",
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": {
@@ -112,22 +112,22 @@
112
112
  "unbuild": "^2.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.14.0-snapshot-d42ea8a-20241202003632"
115
+ "rolldown": "0.15.0-commit.ac58858",
116
+ "@rolldown/testing": "0.0.1"
117
117
  },
118
118
  "optionalDependencies": {
119
- "@rolldown/binding-darwin-arm64": "0.14.0-snapshot-d42ea8a-20241202003632",
120
- "@rolldown/binding-darwin-x64": "0.14.0-snapshot-d42ea8a-20241202003632",
121
- "@rolldown/binding-freebsd-x64": "0.14.0-snapshot-d42ea8a-20241202003632",
122
- "@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-d42ea8a-20241202003632",
123
- "@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-d42ea8a-20241202003632",
124
- "@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-d42ea8a-20241202003632",
125
- "@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-d42ea8a-20241202003632",
126
- "@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-d42ea8a-20241202003632",
127
- "@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-d42ea8a-20241202003632",
128
- "@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-d42ea8a-20241202003632",
129
- "@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-d42ea8a-20241202003632",
130
- "@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-d42ea8a-20241202003632"
119
+ "@rolldown/binding-darwin-arm64": "0.15.0-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"
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;
@@ -1,12 +0,0 @@
1
- import type { InputOptions } from './options/input-options';
2
- import { RolldownBuild } from './rolldown-build';
3
- import { Watcher } from './watcher';
4
- import { WatchOptions } from './options/watch-options';
5
- export declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
6
- export declare const watch: (input: WatchOptions) => Promise<Watcher>;
7
- /**
8
- * @description
9
- * This is an experimental API. It's behavior may change in the future.
10
- * Calling this API will only execute the scan stage of rolldown.
11
- */
12
- export declare const experimental_scan: (input: InputOptions) => Promise<void>;