rollup 3.0.0-3 → 3.0.0-6

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.
@@ -1,22 +1,26 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-2
4
- Sat, 30 Jul 2022 12:51:34 GMT - commit 41906cedefbc03640d6e8ca23ce6975f3bb5c6a1
3
+ Rollup.js v3.0.0-5
4
+ Tue, 06 Sep 2022 05:29:28 GMT - commit 1d085668121abe6be83c28c212a02c181c16d2b8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
8
8
  Released under the MIT License.
9
9
  */
10
- import require$$0$2, { resolve } from 'path';
11
- import process$1 from 'process';
10
+ import { resolve } from 'node:path';
11
+ import process$1 from 'node:process';
12
12
  import { ensureArray, warnUnknownOptions, defaultOnWarn, objectifyOptionWithPresets, treeshakePresets, objectifyOption, generatedCodePresets, picomatch as picomatch$2, getAugmentedNamespace, fseventsImporter, createFilter, rollupInternal } from './rollup.js';
13
- import require$$2$1, { platform } from 'os';
13
+ import { platform } from 'node:os';
14
14
  import require$$0$1 from 'fs';
15
15
  import require$$2 from 'util';
16
16
  import require$$1 from 'stream';
17
+ import require$$0$2 from 'path';
18
+ import require$$2$1 from 'os';
17
19
  import require$$0$3 from 'events';
18
- import 'perf_hooks';
19
- import 'crypto';
20
+ import 'node:perf_hooks';
21
+ import 'node:crypto';
22
+ import 'node:fs';
23
+ import 'node:events';
20
24
 
21
25
  const commandAliases = {
22
26
  c: 'config',
@@ -44,7 +48,7 @@ function mergeOptions(config, rawCommandOptions = { external: [], globals: undef
44
48
  if (outputOptionsArray.length === 0)
45
49
  outputOptionsArray.push({});
46
50
  const outputOptions = outputOptionsArray.map(singleOutputOptions => mergeOutputOptions(singleOutputOptions, command, warn));
47
- warnUnknownOptions(command, Object.keys(inputOptions).concat(Object.keys(outputOptions[0]).filter(option => option !== 'sourcemapPathTransform'), Object.keys(commandAliases), 'config', 'environment', 'plugin', 'silent', 'failAfterWarnings', 'stdin', 'waitForBundleInput', 'configPlugin'), 'CLI flags', warn, /^_$|output$|config/);
51
+ warnUnknownOptions(command, Object.keys(inputOptions).concat(Object.keys(outputOptions[0]).filter(option => option !== 'sourcemapPathTransform'), Object.keys(commandAliases), 'bundleConfigAsCjs', 'config', 'environment', 'plugin', 'silent', 'failAfterWarnings', 'stdin', 'waitForBundleInput', 'configPlugin'), 'CLI flags', warn, /^_$|output$|config/);
48
52
  inputOptions.output = outputOptions;
49
53
  return inputOptions;
50
54
  }
@@ -4799,6 +4803,7 @@ class Watcher {
4799
4803
  constructor(configs, emitter) {
4800
4804
  this.buildDelay = 0;
4801
4805
  this.buildTimeout = null;
4806
+ this.closed = false;
4802
4807
  this.invalidatedIds = new Map();
4803
4808
  this.rerun = false;
4804
4809
  this.running = true;
@@ -4811,12 +4816,15 @@ class Watcher {
4811
4816
  process$1.nextTick(() => this.run());
4812
4817
  }
4813
4818
  async close() {
4819
+ if (this.closed)
4820
+ return;
4821
+ this.closed = true;
4814
4822
  if (this.buildTimeout)
4815
4823
  clearTimeout(this.buildTimeout);
4816
4824
  for (const task of this.tasks) {
4817
4825
  task.close();
4818
4826
  }
4819
- await this.emitter.emitAndAwait('close');
4827
+ await this.emitter.emit('close');
4820
4828
  this.emitter.removeAllListeners();
4821
4829
  }
4822
4830
  invalidate(file) {
@@ -4843,20 +4851,20 @@ class Watcher {
4843
4851
  this.buildTimeout = setTimeout(async () => {
4844
4852
  this.buildTimeout = null;
4845
4853
  try {
4846
- await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emitAndAwait('change', id, { event })));
4854
+ await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event })));
4847
4855
  this.invalidatedIds.clear();
4848
- this.emitter.emit('restart');
4849
- this.emitter.removeAwaited();
4856
+ await this.emitter.emit('restart');
4857
+ this.emitter.removeListenersForCurrentRun();
4850
4858
  this.run();
4851
4859
  }
4852
4860
  catch (error) {
4853
4861
  this.invalidatedIds.clear();
4854
- this.emitter.emit('event', {
4862
+ await this.emitter.emit('event', {
4855
4863
  code: 'ERROR',
4856
4864
  error,
4857
4865
  result: null
4858
4866
  });
4859
- this.emitter.emit('event', {
4867
+ await this.emitter.emit('event', {
4860
4868
  code: 'END'
4861
4869
  });
4862
4870
  }
@@ -4864,14 +4872,14 @@ class Watcher {
4864
4872
  }
4865
4873
  async run() {
4866
4874
  this.running = true;
4867
- this.emitter.emit('event', {
4875
+ await this.emitter.emit('event', {
4868
4876
  code: 'START'
4869
4877
  });
4870
4878
  for (const task of this.tasks) {
4871
4879
  await task.run();
4872
4880
  }
4873
4881
  this.running = false;
4874
- this.emitter.emit('event', {
4882
+ await this.emitter.emit('event', {
4875
4883
  code: 'END'
4876
4884
  });
4877
4885
  if (this.rerun) {
@@ -4929,7 +4937,7 @@ class Task {
4929
4937
  cache: this.cache
4930
4938
  };
4931
4939
  const start = Date.now();
4932
- this.watcher.emitter.emit('event', {
4940
+ await this.watcher.emitter.emit('event', {
4933
4941
  code: 'BUNDLE_START',
4934
4942
  input: this.options.input,
4935
4943
  output: this.outputFiles
@@ -4942,7 +4950,7 @@ class Task {
4942
4950
  }
4943
4951
  this.updateWatchedFiles(result);
4944
4952
  this.skipWrite || (await Promise.all(this.outputs.map(output => result.write(output))));
4945
- this.watcher.emitter.emit('event', {
4953
+ await this.watcher.emitter.emit('event', {
4946
4954
  code: 'BUNDLE_END',
4947
4955
  duration: Date.now() - start,
4948
4956
  input: this.options.input,
@@ -4961,7 +4969,7 @@ class Task {
4961
4969
  this.cache.modules = this.cache.modules.filter(module => module.id !== error.id);
4962
4970
  }
4963
4971
  }
4964
- this.watcher.emitter.emit('event', {
4972
+ await this.watcher.emitter.emit('event', {
4965
4973
  code: 'ERROR',
4966
4974
  error,
4967
4975
  result
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-2
4
- Sat, 30 Jul 2022 12:51:34 GMT - commit 41906cedefbc03640d6e8ca23ce6975f3bb5c6a1
3
+ Rollup.js v3.0.0-5
4
+ Tue, 06 Sep 2022 05:29:28 GMT - commit 1d085668121abe6be83c28c212a02c181c16d2b8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -9,20 +9,20 @@
9
9
  */
10
10
  'use strict';
11
11
 
12
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
12
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13
13
 
14
- require('path');
15
- require('url');
14
+ require('node:fs');
15
+ require('node:path');
16
+ require('node:process');
17
+ require('node:url');
16
18
  const loadConfigFile_js = require('./shared/loadConfigFile.js');
17
19
  require('./shared/rollup.js');
18
20
  require('./shared/mergeOptions.js');
19
- require('fs');
20
- require('util');
21
- require('process');
22
21
  require('tty');
23
- require('perf_hooks');
24
- require('crypto');
25
- require('events');
22
+ require('path');
23
+ require('node:perf_hooks');
24
+ require('node:crypto');
25
+ require('node:events');
26
26
 
27
27
 
28
28
 
package/dist/rollup.d.ts CHANGED
@@ -28,6 +28,7 @@ export interface RollupLog {
28
28
  pluginCode?: string;
29
29
  pos?: number;
30
30
  reexporter?: string;
31
+ stack?: string;
31
32
  url?: string;
32
33
  }
33
34
 
@@ -220,7 +221,7 @@ export type ResolveIdHook = (
220
221
  source: string,
221
222
  importer: string | undefined,
222
223
  options: { custom?: CustomPluginOptions; isEntry: boolean }
223
- ) => Promise<ResolveIdResult> | ResolveIdResult;
224
+ ) => ResolveIdResult;
224
225
 
225
226
  export type ShouldTransformCachedModuleHook = (
226
227
  this: PluginContext,
@@ -233,7 +234,7 @@ export type ShouldTransformCachedModuleHook = (
233
234
  resolvedSources: ResolvedIdMap;
234
235
  syntheticNamedExports: boolean | string;
235
236
  }
236
- ) => Promise<boolean> | boolean;
237
+ ) => boolean;
237
238
 
238
239
  export type IsExternal = (
239
240
  source: string,
@@ -245,9 +246,9 @@ export type IsPureModule = (id: string) => boolean | null | void;
245
246
 
246
247
  export type HasModuleSideEffects = (id: string, external: boolean) => boolean;
247
248
 
248
- type LoadResult = SourceDescription | string | null | void;
249
+ export type LoadResult = SourceDescription | string | null | void;
249
250
 
250
- export type LoadHook = (this: PluginContext, id: string) => Promise<LoadResult> | LoadResult;
251
+ export type LoadHook = (this: PluginContext, id: string) => LoadResult;
251
252
 
252
253
  export interface TransformPluginContext extends PluginContext {
253
254
  getCombinedSourcemap: () => SourceMap;
@@ -259,9 +260,9 @@ export type TransformHook = (
259
260
  this: TransformPluginContext,
260
261
  code: string,
261
262
  id: string
262
- ) => Promise<TransformResult> | TransformResult;
263
+ ) => TransformResult;
263
264
 
264
- export type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => Promise<void> | void;
265
+ export type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
265
266
 
266
267
  export type RenderChunkHook = (
267
268
  this: PluginContext,
@@ -269,18 +270,13 @@ export type RenderChunkHook = (
269
270
  chunk: RenderedChunk,
270
271
  options: NormalizedOutputOptions,
271
272
  meta: { chunks: Record<string, RenderedChunk> }
272
- ) =>
273
- | Promise<{ code: string; map?: SourceMapInput } | null>
274
- | { code: string; map?: SourceMapInput }
275
- | string
276
- | null
277
- | undefined;
273
+ ) => { code: string; map?: SourceMapInput } | string | null | undefined;
278
274
 
279
275
  export type ResolveDynamicImportHook = (
280
276
  this: PluginContext,
281
277
  specifier: string | AcornNode,
282
278
  importer: string
283
- ) => Promise<ResolveIdResult> | ResolveIdResult;
279
+ ) => ResolveIdResult;
284
280
 
285
281
  export type ResolveImportMetaHook = (
286
282
  this: PluginContext,
@@ -311,7 +307,7 @@ export type WatchChangeHook = (
311
307
  this: PluginContext,
312
308
  id: string,
313
309
  change: { event: ChangeEvent }
314
- ) => Promise<void> | void;
310
+ ) => void;
315
311
 
316
312
  /**
317
313
  * use this type for plugin annotation
@@ -338,32 +334,21 @@ export interface OutputBundleWithPlaceholders {
338
334
  [fileName: string]: OutputAsset | OutputChunk | FilePlaceholder;
339
335
  }
340
336
 
341
- export interface PluginHooks extends OutputPluginHooks {
342
- buildEnd: (this: PluginContext, err?: Error) => Promise<void> | void;
343
- buildStart: (this: PluginContext, options: NormalizedInputOptions) => Promise<void> | void;
344
- closeBundle: (this: PluginContext) => Promise<void> | void;
345
- closeWatcher: (this: PluginContext) => Promise<void> | void;
346
- load: LoadHook;
347
- moduleParsed: ModuleParsedHook;
348
- options: (
349
- this: MinimalPluginContext,
350
- options: InputOptions
351
- ) => Promise<InputOptions | null | void> | InputOptions | null | void;
352
- resolveDynamicImport: ResolveDynamicImportHook;
353
- resolveId: ResolveIdHook;
354
- shouldTransformCachedModule: ShouldTransformCachedModuleHook;
355
- transform: TransformHook;
356
- watchChange: WatchChangeHook;
357
- }
358
-
359
- interface OutputPluginHooks {
337
+ export interface FunctionPluginHooks {
360
338
  augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void;
339
+ buildEnd: (this: PluginContext, err?: Error) => void;
340
+ buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
341
+ closeBundle: (this: PluginContext) => void;
342
+ closeWatcher: (this: PluginContext) => void;
361
343
  generateBundle: (
362
344
  this: PluginContext,
363
345
  options: NormalizedOutputOptions,
364
346
  bundle: OutputBundle,
365
347
  isWrite: boolean
366
- ) => void | Promise<void>;
348
+ ) => void;
349
+ load: LoadHook;
350
+ moduleParsed: ModuleParsedHook;
351
+ options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | null | void;
367
352
  outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | null | void;
368
353
  renderChunk: RenderChunkHook;
369
354
  renderDynamicImport: (
@@ -375,43 +360,48 @@ interface OutputPluginHooks {
375
360
  targetModuleId: string | null;
376
361
  }
377
362
  ) => { left: string; right: string } | null | void;
378
- renderError: (this: PluginContext, err?: Error) => Promise<void> | void;
363
+ renderError: (this: PluginContext, err?: Error) => void;
379
364
  renderStart: (
380
365
  this: PluginContext,
381
366
  outputOptions: NormalizedOutputOptions,
382
367
  inputOptions: NormalizedInputOptions
383
- ) => Promise<void> | void;
368
+ ) => void;
369
+ resolveDynamicImport: ResolveDynamicImportHook;
384
370
  resolveFileUrl: ResolveFileUrlHook;
371
+ resolveId: ResolveIdHook;
385
372
  resolveImportMeta: ResolveImportMetaHook;
373
+ shouldTransformCachedModule: ShouldTransformCachedModuleHook;
374
+ transform: TransformHook;
375
+ watchChange: WatchChangeHook;
386
376
  writeBundle: (
387
377
  this: PluginContext,
388
378
  options: NormalizedOutputOptions,
389
379
  bundle: OutputBundle
390
- ) => void | Promise<void>;
380
+ ) => void;
391
381
  }
392
382
 
393
- export type AsyncPluginHooks =
394
- | 'options'
395
- | 'buildEnd'
396
- | 'buildStart'
383
+ export type OutputPluginHooks =
384
+ | 'augmentChunkHash'
397
385
  | 'generateBundle'
398
- | 'load'
399
- | 'moduleParsed'
386
+ | 'outputOptions'
400
387
  | 'renderChunk'
388
+ | 'renderDynamicImport'
401
389
  | 'renderError'
402
390
  | 'renderStart'
403
- | 'resolveDynamicImport'
404
- | 'resolveId'
405
- | 'shouldTransformCachedModule'
406
- | 'transform'
407
- | 'writeBundle'
408
- | 'closeBundle'
409
- | 'closeWatcher'
410
- | 'watchChange';
391
+ | 'resolveFileUrl'
392
+ | 'resolveImportMeta'
393
+ | 'writeBundle';
411
394
 
412
- export type PluginValueHooks = 'banner' | 'footer' | 'intro' | 'outro';
395
+ export type InputPluginHooks = Exclude<keyof FunctionPluginHooks, OutputPluginHooks>;
413
396
 
414
- export type SyncPluginHooks = Exclude<keyof PluginHooks, AsyncPluginHooks>;
397
+ export type SyncPluginHooks =
398
+ | 'augmentChunkHash'
399
+ | 'outputOptions'
400
+ | 'renderDynamicImport'
401
+ | 'resolveFileUrl'
402
+ | 'resolveImportMeta';
403
+
404
+ export type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
415
405
 
416
406
  export type FirstPluginHooks =
417
407
  | 'load'
@@ -430,37 +420,38 @@ export type SequentialPluginHooks =
430
420
  | 'renderChunk'
431
421
  | 'transform';
432
422
 
433
- export type ParallelPluginHooks =
434
- | 'banner'
435
- | 'buildEnd'
436
- | 'buildStart'
437
- | 'footer'
438
- | 'intro'
439
- | 'moduleParsed'
440
- | 'outro'
441
- | 'renderError'
442
- | 'renderStart'
443
- | 'writeBundle'
444
- | 'closeBundle'
445
- | 'closeWatcher'
446
- | 'watchChange';
423
+ export type ParallelPluginHooks = Exclude<
424
+ keyof FunctionPluginHooks | AddonHooks,
425
+ FirstPluginHooks | SequentialPluginHooks
426
+ >;
447
427
 
448
- interface OutputPluginValueHooks {
449
- banner: AddonHook;
450
- cacheKey: string;
451
- footer: AddonHook;
452
- intro: AddonHook;
453
- outro: AddonHook;
454
- }
428
+ export type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro';
455
429
 
456
- export interface Plugin extends Partial<PluginHooks>, Partial<OutputPluginValueHooks> {
457
- // for inter-plugin communication
458
- api?: any;
430
+ type MakeAsync<Fn> = Fn extends (this: infer This, ...args: infer Args) => infer Return
431
+ ? (this: This, ...args: Args) => Return | Promise<Return>
432
+ : never;
433
+
434
+ // eslint-disable-next-line @typescript-eslint/ban-types
435
+ type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
436
+
437
+ export type PluginHooks = {
438
+ [K in keyof FunctionPluginHooks]: ObjectHook<
439
+ K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K],
440
+ // eslint-disable-next-line @typescript-eslint/ban-types
441
+ K extends ParallelPluginHooks ? { sequential?: boolean } : {}
442
+ >;
443
+ };
444
+
445
+ export interface OutputPlugin
446
+ extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
447
+ Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
448
+ cacheKey?: string;
459
449
  name: string;
460
450
  }
461
451
 
462
- export interface OutputPlugin extends Partial<OutputPluginHooks>, Partial<OutputPluginValueHooks> {
463
- name: string;
452
+ export interface Plugin extends OutputPlugin, Partial<PluginHooks> {
453
+ // for inter-plugin communication
454
+ api?: any;
464
455
  }
465
456
 
466
457
  type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
@@ -581,7 +572,7 @@ interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {
581
572
 
582
573
  export type OptionsPaths = Record<string, string> | ((id: string) => string);
583
574
 
584
- export type InteropType = boolean | 'auto' | 'esModule' | 'default' | 'defaultOnly';
575
+ export type InteropType = 'compat' | 'auto' | 'esModule' | 'default' | 'defaultOnly';
585
576
 
586
577
  export type GetInterop = (id: string | null) => InteropType;
587
578
 
@@ -601,6 +592,7 @@ export type AmdOptions = (
601
592
  }
602
593
  ) & {
603
594
  define?: string;
595
+ forceJsExtensionForImports?: boolean;
604
596
  };
605
597
 
606
598
  export type NormalizedAmdOptions = (
@@ -614,6 +606,7 @@ export type NormalizedAmdOptions = (
614
606
  }
615
607
  ) & {
616
608
  define: string;
609
+ forceJsExtensionForImports: boolean;
617
610
  };
618
611
 
619
612
  type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
@@ -629,7 +622,7 @@ export interface OutputOptions {
629
622
  /** @deprecated Use the "renderDynamicImport" plugin hook instead. */
630
623
  dynamicImportFunction?: string;
631
624
  entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
632
- esModule?: boolean;
625
+ esModule?: boolean | 'if-default-prop';
633
626
  exports?: 'default' | 'named' | 'none' | 'auto';
634
627
  extend?: boolean;
635
628
  externalLiveBindings?: boolean;
@@ -679,7 +672,7 @@ export interface NormalizedOutputOptions {
679
672
  /** @deprecated Use the "renderDynamicImport" plugin hook instead. */
680
673
  dynamicImportFunction: string | undefined;
681
674
  entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
682
- esModule: boolean;
675
+ esModule: boolean | 'if-default-prop';
683
676
  exports: 'default' | 'named' | 'none' | 'auto';
684
677
  extend: boolean;
685
678
  externalLiveBindings: boolean;
@@ -849,40 +842,37 @@ export interface RollupWatchOptions extends InputOptions {
849
842
  watch?: WatcherOptions | false;
850
843
  }
851
844
 
852
- interface TypedEventEmitter<T extends { [event: string]: (...args: any) => any }> {
853
- addListener<K extends keyof T>(event: K, listener: T[K]): this;
854
- emit<K extends keyof T>(event: K, ...args: Parameters<T[K]>): boolean;
855
- eventNames(): Array<keyof T>;
856
- getMaxListeners(): number;
857
- listenerCount(type: keyof T): number;
858
- listeners<K extends keyof T>(event: K): Array<T[K]>;
859
- off<K extends keyof T>(event: K, listener: T[K]): this;
860
- on<K extends keyof T>(event: K, listener: T[K]): this;
861
- once<K extends keyof T>(event: K, listener: T[K]): this;
862
- prependListener<K extends keyof T>(event: K, listener: T[K]): this;
863
- prependOnceListener<K extends keyof T>(event: K, listener: T[K]): this;
864
- rawListeners<K extends keyof T>(event: K): Array<T[K]>;
865
- removeAllListeners<K extends keyof T>(event?: K): this;
866
- removeListener<K extends keyof T>(event: K, listener: T[K]): this;
867
- setMaxListeners(n: number): this;
868
- }
869
-
870
- export interface RollupAwaitingEmitter<T extends { [event: string]: (...args: any) => any }>
871
- extends TypedEventEmitter<T> {
845
+ export type AwaitedEventListener<
846
+ T extends { [event: string]: (...args: any) => any },
847
+ K extends keyof T
848
+ > = (...args: Parameters<T[K]>) => void | Promise<void>;
849
+
850
+ export interface AwaitingEventEmitter<T extends { [event: string]: (...args: any) => any }> {
872
851
  close(): Promise<void>;
873
- emitAndAwait<K extends keyof T>(event: K, ...args: Parameters<T[K]>): Promise<ReturnType<T[K]>[]>;
852
+ emit<K extends keyof T>(event: K, ...args: Parameters<T[K]>): Promise<unknown>;
853
+ /**
854
+ * Removes an event listener.
855
+ */
856
+ off<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this;
857
+ /**
858
+ * Registers an event listener that will be awaited before Rollup continues.
859
+ * All listeners will be awaited in parallel while rejections are tracked via
860
+ * Promise.all.
861
+ */
862
+ on<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this;
874
863
  /**
875
- * Registers an event listener that will be awaited before Rollup continues
876
- * for events emitted via emitAndAwait. All listeners will be awaited in
877
- * parallel while rejections are tracked via Promise.all.
878
- * Listeners are removed automatically when removeAwaited is called, which
879
- * happens automatically after each run.
864
+ * Registers an event listener that will be awaited before Rollup continues.
865
+ * All listeners will be awaited in parallel while rejections are tracked via
866
+ * Promise.all.
867
+ * Listeners are removed automatically when removeListenersForCurrentRun is
868
+ * called, which happens automatically after each run.
880
869
  */
881
- onCurrentAwaited<K extends keyof T>(
870
+ onCurrentRun<K extends keyof T>(
882
871
  event: K,
883
872
  listener: (...args: Parameters<T[K]>) => Promise<ReturnType<T[K]>>
884
873
  ): this;
885
- removeAwaited(): this;
874
+ removeAllListeners(): this;
875
+ removeListenersForCurrentRun(): this;
886
876
  }
887
877
 
888
878
  export type RollupWatcherEvent =
@@ -898,7 +888,7 @@ export type RollupWatcherEvent =
898
888
  | { code: 'END' }
899
889
  | { code: 'ERROR'; error: RollupError; result: RollupBuild | null };
900
890
 
901
- export type RollupWatcher = RollupAwaitingEmitter<{
891
+ export type RollupWatcher = AwaitingEventEmitter<{
902
892
  change: (id: string, change: { event: ChangeEvent }) => void;
903
893
  close: () => void;
904
894
  event: (event: RollupWatcherEvent) => void;
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-2
4
- Sat, 30 Jul 2022 12:51:34 GMT - commit 41906cedefbc03640d6e8ca23ce6975f3bb5c6a1
3
+ Rollup.js v3.0.0-5
4
+ Tue, 06 Sep 2022 05:29:28 GMT - commit 1d085668121abe6be83c28c212a02c181c16d2b8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -9,15 +9,16 @@
9
9
  */
10
10
  'use strict';
11
11
 
12
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
12
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13
13
 
14
14
  const rollup = require('./shared/rollup.js');
15
+ require('node:path');
15
16
  require('path');
16
- require('process');
17
- require('perf_hooks');
18
- require('crypto');
19
- require('fs');
20
- require('events');
17
+ require('node:process');
18
+ require('node:perf_hooks');
19
+ require('node:crypto');
20
+ require('node:fs');
21
+ require('node:events');
21
22
 
22
23
 
23
24
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-2
4
- Sat, 30 Jul 2022 12:51:34 GMT - commit 41906cedefbc03640d6e8ca23ce6975f3bb5c6a1
3
+ Rollup.js v3.0.0-5
4
+ Tue, 06 Sep 2022 05:29:28 GMT - commit 1d085668121abe6be83c28c212a02c181c16d2b8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7