rolldown 0.14.0-snapshot-ab438c3-20241121003459 → 0.14.0-snapshot-db4090b-20241123003628

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 (31) hide show
  1. package/dist/cjs/cli.cjs +9 -5
  2. package/dist/cjs/experimental-index.cjs +1 -1
  3. package/dist/cjs/index.cjs +1 -1
  4. package/dist/cjs/parallel-plugin-worker.cjs +1 -1
  5. package/dist/esm/cli.mjs +9 -5
  6. package/dist/esm/experimental-index.mjs +1 -1
  7. package/dist/esm/index.mjs +1 -1
  8. package/dist/esm/parallel-plugin-worker.mjs +1 -1
  9. package/dist/shared/rolldown-binding.wasi.cjs +6 -8
  10. package/dist/shared/{src_index-Yt-qn7mE.cjs → src_index-WgTHG2Z9.cjs} +613 -649
  11. package/dist/shared/{src_index-k_6h6jvv.mjs → src_index-wJBYWP9G.mjs} +613 -649
  12. package/dist/types/binding.d.ts +10 -14
  13. package/dist/types/cli/arguments/schema.d.ts +60 -56
  14. package/dist/types/log/logger.d.ts +3 -3
  15. package/dist/types/options/bindingify-input-options.d.ts +3 -2
  16. package/dist/types/options/input-options.d.ts +128 -120
  17. package/dist/types/options/normalized-input-options.d.ts +1 -10
  18. package/dist/types/options/normalized-output-options.d.ts +1 -15
  19. package/dist/types/options/output-options.d.ts +12 -11
  20. package/dist/types/plugin/plugin-driver.d.ts +2 -3
  21. package/dist/types/treeshake/index.d.ts +0 -4
  22. package/dist/types/treeshake/module-side-effects.d.ts +23 -21
  23. package/dist/types/types/input-options.d.ts +8 -0
  24. package/dist/types/types/output-options.d.ts +12 -1
  25. package/dist/types/utils/error.d.ts +1 -0
  26. package/dist/types/utils/normalize-plugin-option.d.ts +2 -2
  27. package/dist/types/watcher.d.ts +2 -3
  28. package/package.json +15 -15
  29. package/dist/types/utils/normalize-input-options.d.ts +0 -3
  30. package/dist/types/utils/normalize-output-options.d.ts +0 -3
  31. package/dist/types/utils/normalize-tree-shake.d.ts +0 -3
@@ -86,8 +86,7 @@ export declare class BindingTransformPluginContext {
86
86
 
87
87
  export declare class BindingWatcher {
88
88
  close(): Promise<void>
89
- on(event: BindingWatcherEvent, listener: (data: BindingWatcherEventData) => void): void
90
- start(): Promise<void>
89
+ start(listener: (data: BindingWatcherEvent) => void): Promise<void>
91
90
  }
92
91
 
93
92
  export declare class BindingWatcherChangeData {
@@ -95,11 +94,12 @@ export declare class BindingWatcherChangeData {
95
94
  kind: string
96
95
  }
97
96
 
98
- export declare class BindingWatcherEventData {
97
+ export declare class BindingWatcherEvent {
98
+ eventKind(): string
99
99
  watchChangeData(): BindingWatcherChangeData
100
100
  bundleEndData(): BindingBundleEndEventData
101
101
  bundleEventKind(): string
102
- error(): string
102
+ errors(): Array<unknown>
103
103
  }
104
104
 
105
105
  export declare class Bundler {
@@ -193,6 +193,7 @@ export interface BindingEmittedAsset {
193
193
  export interface BindingExperimentalOptions {
194
194
  strictExecutionOrder?: boolean
195
195
  disableLiveBindings?: boolean
196
+ viteMode?: boolean
196
197
  }
197
198
 
198
199
  export interface BindingGeneralHookFilter {
@@ -283,7 +284,7 @@ export interface BindingInputOptions {
283
284
  resolve?: BindingResolveOptions
284
285
  shimMissingExports?: boolean
285
286
  platform?: 'node' | 'browser' | 'neutral'
286
- logLevel?: BindingLogLevel
287
+ logLevel: BindingLogLevel
287
288
  onLog: (logLevel: 'debug' | 'warn' | 'info', log: BindingLog) => void
288
289
  cwd: string
289
290
  treeshake?: BindingTreeshake
@@ -366,7 +367,7 @@ export interface BindingOutputOptions {
366
367
  externalLiveBindings?: boolean
367
368
  footer?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>>
368
369
  format?: 'es' | 'cjs' | 'iife' | 'umd'
369
- globals?: Record<string, string>
370
+ globals?: Record<string, string> | ((name: string) => string)
370
371
  hashCharacters?: 'base64' | 'base36' | 'hex'
371
372
  inlineDynamicImports?: boolean
372
373
  intro?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>>
@@ -498,6 +499,7 @@ export interface BindingTransformPluginConfig {
498
499
 
499
500
  export interface BindingTreeshake {
500
501
  moduleSideEffects: boolean | BindingModuleSideEffectsRule[]
502
+ annotations?: boolean
501
503
  }
502
504
 
503
505
  export interface BindingViteResolvePluginConfig {
@@ -516,6 +518,7 @@ export interface BindingViteResolvePluginResolveOptions {
516
518
  isProduction: boolean
517
519
  asSrc: boolean
518
520
  preferRelative: boolean
521
+ isRequire?: boolean
519
522
  root: string
520
523
  scan: boolean
521
524
  mainFields: Array<string>
@@ -527,13 +530,6 @@ export interface BindingViteResolvePluginResolveOptions {
527
530
  preserveSymlinks: boolean
528
531
  }
529
532
 
530
- export declare enum BindingWatcherEvent {
531
- Close = 0,
532
- Event = 1,
533
- ReStart = 2,
534
- Change = 3
535
- }
536
-
537
533
  export interface BindingWatchOption {
538
534
  skipWrite?: boolean
539
535
  notify?: BindingNotifyOption
@@ -693,7 +689,7 @@ export interface JsxOptions {
693
689
  /**
694
690
  * Enable React Fast Refresh .
695
691
  *
696
- * Conforms to the implementation in {@link https://github.com/facebook/react/tree/main/packages/react-refresh}
692
+ * Conforms to the implementation in {@link https://github.com/facebook/react/tree/v18.3.1/packages/react-refresh}
697
693
  *
698
694
  * @default false
699
695
  */
@@ -56,21 +56,22 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
56
56
  sideEffects: z.ZodBoolean;
57
57
  }, "strip", z.ZodTypeAny, {
58
58
  sideEffects: boolean;
59
- test?: RegExp | undefined;
60
59
  external?: boolean | undefined;
60
+ test?: RegExp | undefined;
61
61
  }, {
62
62
  sideEffects: boolean;
63
- test?: RegExp | undefined;
64
63
  external?: boolean | undefined;
64
+ test?: RegExp | undefined;
65
65
  }>, {
66
66
  sideEffects: boolean;
67
- test?: RegExp | undefined;
68
67
  external?: boolean | undefined;
68
+ test?: RegExp | undefined;
69
69
  }, {
70
70
  sideEffects: boolean;
71
- test?: RegExp | undefined;
72
71
  external?: boolean | undefined;
72
+ test?: RegExp | undefined;
73
73
  }>, "many">]>, z.ZodLiteral<"no-external">]>>;
74
+ annotations: z.ZodOptional<z.ZodBoolean>;
74
75
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
75
76
  moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
76
77
  test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
@@ -78,21 +79,22 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
78
79
  sideEffects: z.ZodBoolean;
79
80
  }, "strip", z.ZodTypeAny, {
80
81
  sideEffects: boolean;
81
- test?: RegExp | undefined;
82
82
  external?: boolean | undefined;
83
+ test?: RegExp | undefined;
83
84
  }, {
84
85
  sideEffects: boolean;
85
- test?: RegExp | undefined;
86
86
  external?: boolean | undefined;
87
+ test?: RegExp | undefined;
87
88
  }>, {
88
89
  sideEffects: boolean;
89
- test?: RegExp | undefined;
90
90
  external?: boolean | undefined;
91
+ test?: RegExp | undefined;
91
92
  }, {
92
93
  sideEffects: boolean;
93
- test?: RegExp | undefined;
94
94
  external?: boolean | undefined;
95
+ test?: RegExp | undefined;
95
96
  }>, "many">]>, z.ZodLiteral<"no-external">]>>;
97
+ annotations: z.ZodOptional<z.ZodBoolean>;
96
98
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
97
99
  moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
98
100
  test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
@@ -100,21 +102,22 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
100
102
  sideEffects: z.ZodBoolean;
101
103
  }, "strip", z.ZodTypeAny, {
102
104
  sideEffects: boolean;
103
- test?: RegExp | undefined;
104
105
  external?: boolean | undefined;
106
+ test?: RegExp | undefined;
105
107
  }, {
106
108
  sideEffects: boolean;
107
- test?: RegExp | undefined;
108
109
  external?: boolean | undefined;
110
+ test?: RegExp | undefined;
109
111
  }>, {
110
112
  sideEffects: boolean;
111
- test?: RegExp | undefined;
112
113
  external?: boolean | undefined;
114
+ test?: RegExp | undefined;
113
115
  }, {
114
116
  sideEffects: boolean;
115
- test?: RegExp | undefined;
116
117
  external?: boolean | undefined;
118
+ test?: RegExp | undefined;
117
119
  }>, "many">]>, z.ZodLiteral<"no-external">]>>;
120
+ annotations: z.ZodOptional<z.ZodBoolean>;
118
121
  }, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
119
122
  logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
120
123
  onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>;
@@ -200,7 +203,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
200
203
  external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
201
204
  inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
202
205
  treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
203
- }>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental" | "profilerNames" | "watch">>, Omit<z.objectUtil.extendShape<{
206
+ }>, "onLog" | "onwarn" | "input" | "resolve" | "watch" | "plugins" | "experimental" | "profilerNames">>, Omit<z.objectUtil.extendShape<{
204
207
  dir: z.ZodOptional<z.ZodString>;
205
208
  file: z.ZodOptional<z.ZodString>;
206
209
  exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>;
@@ -222,7 +225,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
222
225
  cssChunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
223
226
  minify: z.ZodOptional<z.ZodBoolean>;
224
227
  name: z.ZodOptional<z.ZodString>;
225
- globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
228
+ globals: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodString>]>>;
226
229
  externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
227
230
  inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
228
231
  advancedChunks: z.ZodOptional<z.ZodObject<{
@@ -275,6 +278,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
275
278
  intro: z.ZodOptional<z.ZodString>;
276
279
  outro: z.ZodOptional<z.ZodString>;
277
280
  esModule: z.ZodOptional<z.ZodBoolean>;
281
+ globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
278
282
  advancedChunks: z.ZodOptional<z.ZodObject<{
279
283
  minSize: z.ZodOptional<z.ZodNumber>;
280
284
  minShareCount: z.ZodOptional<z.ZodNumber>;
@@ -286,34 +290,15 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
286
290
  minShareCount?: number | undefined;
287
291
  }>>;
288
292
  }>, "sourcemapIgnoreList" | "sourcemapPathTransform">>, "strict", z.ZodTypeAny, {
289
- external?: string[] | undefined;
290
- treeshake?: boolean | undefined;
291
- cwd?: string | undefined;
292
- platform?: "node" | "browser" | "neutral" | undefined;
293
- shimMissingExports?: boolean | undefined;
294
- logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
295
- moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
296
- define?: Record<string, string> | undefined;
297
- inject?: Record<string, string> | undefined;
298
- jsx?: {
299
- development?: boolean | undefined;
300
- refresh?: boolean | undefined;
301
- mode?: "classic" | "automatic" | undefined;
302
- factory?: string | undefined;
303
- fragment?: string | undefined;
304
- importSource?: string | undefined;
305
- jsxImportSource?: string | undefined;
306
- } | undefined;
307
- watch?: boolean | undefined;
308
- dropLabels?: string[] | undefined;
309
- footer?: string | undefined;
310
- banner?: string | undefined;
311
- intro?: string | undefined;
312
- outro?: string | undefined;
313
293
  file?: string | undefined;
314
294
  name?: string | undefined;
315
295
  exports?: "auto" | "named" | "default" | "none" | undefined;
296
+ banner?: string | undefined;
297
+ footer?: string | undefined;
298
+ intro?: string | undefined;
299
+ outro?: string | undefined;
316
300
  esModule?: boolean | undefined;
301
+ globals?: Record<string, string> | undefined;
317
302
  advancedChunks?: {
318
303
  minSize?: number | undefined;
319
304
  minShareCount?: number | undefined;
@@ -329,23 +314,10 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
329
314
  cssEntryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
330
315
  cssChunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
331
316
  minify?: boolean | undefined;
332
- globals?: Record<string, string> | undefined;
333
317
  externalLiveBindings?: boolean | undefined;
334
318
  inlineDynamicImports?: boolean | undefined;
335
319
  comments?: "none" | "preserve-legal" | undefined;
336
- version?: boolean | undefined;
337
- config?: string | boolean | undefined;
338
- help?: boolean | undefined;
339
- }, {
340
320
  external?: string[] | undefined;
341
- treeshake?: boolean | undefined;
342
- cwd?: string | undefined;
343
- platform?: "node" | "browser" | "neutral" | undefined;
344
- shimMissingExports?: boolean | undefined;
345
- logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
346
- moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
347
- define?: Record<string, string> | undefined;
348
- inject?: Record<string, string> | undefined;
349
321
  jsx?: {
350
322
  development?: boolean | undefined;
351
323
  refresh?: boolean | undefined;
@@ -355,16 +327,29 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
355
327
  importSource?: string | undefined;
356
328
  jsxImportSource?: string | undefined;
357
329
  } | undefined;
330
+ logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
331
+ treeshake?: boolean | undefined;
332
+ inject?: Record<string, string> | undefined;
358
333
  watch?: boolean | undefined;
334
+ version?: boolean | undefined;
335
+ cwd?: string | undefined;
336
+ platform?: "node" | "browser" | "neutral" | undefined;
337
+ shimMissingExports?: boolean | undefined;
338
+ moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
339
+ define?: Record<string, string> | undefined;
359
340
  dropLabels?: string[] | undefined;
360
- footer?: string | undefined;
361
- banner?: string | undefined;
362
- intro?: string | undefined;
363
- outro?: string | undefined;
341
+ config?: string | boolean | undefined;
342
+ help?: boolean | undefined;
343
+ }, {
364
344
  file?: string | undefined;
365
345
  name?: string | undefined;
366
346
  exports?: "auto" | "named" | "default" | "none" | undefined;
347
+ banner?: string | undefined;
348
+ footer?: string | undefined;
349
+ intro?: string | undefined;
350
+ outro?: string | undefined;
367
351
  esModule?: boolean | undefined;
352
+ globals?: Record<string, string> | undefined;
368
353
  advancedChunks?: {
369
354
  minSize?: number | undefined;
370
355
  minShareCount?: number | undefined;
@@ -380,11 +365,30 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
380
365
  cssEntryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
381
366
  cssChunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
382
367
  minify?: boolean | undefined;
383
- globals?: Record<string, string> | undefined;
384
368
  externalLiveBindings?: boolean | undefined;
385
369
  inlineDynamicImports?: boolean | undefined;
386
370
  comments?: "none" | "preserve-legal" | undefined;
371
+ external?: string[] | undefined;
372
+ jsx?: {
373
+ development?: boolean | undefined;
374
+ refresh?: boolean | undefined;
375
+ mode?: "classic" | "automatic" | undefined;
376
+ factory?: string | undefined;
377
+ fragment?: string | undefined;
378
+ importSource?: string | undefined;
379
+ jsxImportSource?: string | undefined;
380
+ } | undefined;
381
+ logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
382
+ treeshake?: boolean | undefined;
383
+ inject?: Record<string, string> | undefined;
384
+ watch?: boolean | undefined;
387
385
  version?: boolean | undefined;
386
+ cwd?: string | undefined;
387
+ platform?: "node" | "browser" | "neutral" | undefined;
388
+ shimMissingExports?: boolean | undefined;
389
+ moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
390
+ define?: Record<string, string> | undefined;
391
+ dropLabels?: string[] | undefined;
388
392
  config?: string | boolean | undefined;
389
393
  help?: boolean | undefined;
390
394
  }>;
@@ -9,12 +9,12 @@ export interface PluginContextMeta {
9
9
  watchMode: boolean;
10
10
  }
11
11
  export declare class MinimalPluginContext {
12
- debug: LoggingFunction;
13
12
  info: LoggingFunction;
14
- meta: PluginContextMeta;
15
13
  warn: LoggingFunction;
14
+ debug: LoggingFunction;
15
+ meta: PluginContextMeta;
16
16
  readonly error: (error: RollupError | string) => never;
17
17
  constructor(options: NormalizedInputOptions, plugin: Plugin);
18
18
  }
19
19
  export declare function getLogger(plugins: Plugin[], onLog: LogHandler, logLevel: LogLevelOption): LogHandler;
20
- export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => NormalizedInputOptions["onLog"];
20
+ export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => LogHandler;
@@ -1,4 +1,5 @@
1
- import { BindingInputOptions } from '../binding';
1
+ import type { RolldownPlugin } from '..';
2
2
  import type { NormalizedInputOptions } from './normalized-input-options';
3
3
  import type { NormalizedOutputOptions } from './normalized-output-options';
4
- export declare function bindingifyInputOptions(options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions): BindingInputOptions;
4
+ import type { BindingInputOptions } from '../binding';
5
+ export declare function bindingifyInputOptions(rawPlugins: RolldownPlugin[], inputOptions: NormalizedInputOptions, outputOptions: NormalizedOutputOptions): BindingInputOptions;