rollup 3.2.1 → 3.2.2

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/bin/rollup CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  /*
4
4
  @license
5
- Rollup.js v3.2.1
6
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
5
+ Rollup.js v3.2.2
6
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
7
7
 
8
8
  https://github.com/rollup/rollup
9
9
 
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.1
4
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
3
+ Rollup.js v3.2.2
4
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.1
4
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
3
+ Rollup.js v3.2.2
4
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,7 +16,7 @@ import { promises } from 'node:fs';
16
16
  import { EventEmitter } from 'node:events';
17
17
  import * as tty from 'tty';
18
18
 
19
- var version$1 = "3.2.1";
19
+ var version$1 = "3.2.2";
20
20
 
21
21
  var charToInteger = {};
22
22
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -11198,8 +11198,13 @@ class Program extends NodeBase {
11198
11198
  }
11199
11199
  }
11200
11200
  render(code, options) {
11201
+ let start = this.start;
11202
+ if (code.original.startsWith('#!')) {
11203
+ start = Math.min(code.original.indexOf('\n') + 1, this.end);
11204
+ code.remove(0, start);
11205
+ }
11201
11206
  if (this.body.length > 0) {
11202
- renderStatementList(this.body, code, this.start, this.end, options);
11207
+ renderStatementList(this.body, code, start, this.end, options);
11203
11208
  }
11204
11209
  else {
11205
11210
  super.render(code, options);
@@ -15024,9 +15029,7 @@ class Chunk {
15024
15029
  const map = module.getExportNamesByVariable();
15025
15030
  for (const exportedVariable of map.keys()) {
15026
15031
  const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
15027
- const importedVariable = isSynthetic
15028
- ? exportedVariable.getBaseVariable()
15029
- : exportedVariable;
15032
+ const importedVariable = isSynthetic ? exportedVariable.getBaseVariable() : exportedVariable;
15030
15033
  if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {
15031
15034
  this.checkCircularDependencyImport(importedVariable, module);
15032
15035
  const exportingModule = importedVariable.module;
@@ -24767,9 +24770,7 @@ const getExternal = (config, overrides) => {
24767
24770
  ? (source, importer, isResolved) => configExternal(source, importer, isResolved) || overrides.external.includes(source)
24768
24771
  : [...ensureArray(configExternal), ...overrides.external];
24769
24772
  };
24770
- const getOnWarn = (config, defaultOnWarnHandler) => config.onwarn
24771
- ? warning => config.onwarn(warning, defaultOnWarnHandler)
24772
- : defaultOnWarnHandler;
24773
+ const getOnWarn = (config, defaultOnWarnHandler) => config.onwarn ? warning => config.onwarn(warning, defaultOnWarnHandler) : defaultOnWarnHandler;
24773
24774
  const getObjectOption = (config, overrides, name, objectifyValue = objectifyOption) => {
24774
24775
  const commandOption = normalizeObjectOptionValue(overrides[name], objectifyValue);
24775
24776
  const configOption = normalizeObjectOptionValue(config[name], objectifyValue);
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.1
4
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
3
+ Rollup.js v3.2.2
4
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.1
4
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
3
+ Rollup.js v3.2.2
4
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.d.ts CHANGED
@@ -1,9 +1,14 @@
1
1
  export const VERSION: string;
2
2
 
3
- type FalsyValue = false | null | undefined;
3
+ // utils
4
+ type NullValue = null | undefined | void;
4
5
  type MaybeArray<T> = T | T[];
5
6
  type MaybePromise<T> = T | Promise<T>;
6
7
 
8
+ type PartialNull<T> = {
9
+ [P in keyof T]: T[P] | null;
10
+ };
11
+
7
12
  export interface RollupError extends RollupLog {
8
13
  name?: string;
9
14
  stack?: string;
@@ -82,10 +87,6 @@ export interface SourceMap {
82
87
 
83
88
  export type SourceMapInput = ExistingRawSourceMap | string | null | { mappings: '' };
84
89
 
85
- type PartialNull<T> = {
86
- [P in keyof T]: T[P] | null;
87
- };
88
-
89
90
  interface ModuleOptions {
90
91
  assertions: Record<string, string>;
91
92
  meta: CustomPluginOptions;
@@ -224,7 +225,7 @@ interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
224
225
  id: string;
225
226
  }
226
227
 
227
- export type ResolveIdResult = string | false | null | void | PartialResolvedId;
228
+ export type ResolveIdResult = string | NullValue | false | PartialResolvedId;
228
229
 
229
230
  export type ResolveIdHook = (
230
231
  this: PluginContext,
@@ -252,11 +253,11 @@ export type IsExternal = (
252
253
  isResolved: boolean
253
254
  ) => boolean;
254
255
 
255
- export type IsPureModule = (id: string) => boolean | null | void;
256
+ export type IsPureModule = (id: string) => boolean | NullValue;
256
257
 
257
258
  export type HasModuleSideEffects = (id: string, external: boolean) => boolean;
258
259
 
259
- export type LoadResult = SourceDescription | string | null | void;
260
+ export type LoadResult = SourceDescription | string | NullValue;
260
261
 
261
262
  export type LoadHook = (this: PluginContext, id: string) => LoadResult;
262
263
 
@@ -264,7 +265,7 @@ export interface TransformPluginContext extends PluginContext {
264
265
  getCombinedSourcemap: () => SourceMap;
265
266
  }
266
267
 
267
- export type TransformResult = string | null | void | Partial<SourceDescription>;
268
+ export type TransformResult = string | NullValue | Partial<SourceDescription>;
268
269
 
269
270
  export type TransformHook = (
270
271
  this: TransformPluginContext,
@@ -280,7 +281,7 @@ export type RenderChunkHook = (
280
281
  chunk: RenderedChunk,
281
282
  options: NormalizedOutputOptions,
282
283
  meta: { chunks: Record<string, RenderedChunk> }
283
- ) => { code: string; map?: SourceMapInput } | string | null | undefined;
284
+ ) => { code: string; map?: SourceMapInput } | string | NullValue;
284
285
 
285
286
  export type ResolveDynamicImportHook = (
286
287
  this: PluginContext,
@@ -293,7 +294,7 @@ export type ResolveImportMetaHook = (
293
294
  this: PluginContext,
294
295
  property: string | null,
295
296
  options: { chunkId: string; format: InternalModuleFormat; moduleId: string }
296
- ) => string | null | void;
297
+ ) => string | NullValue;
297
298
 
298
299
  export type ResolveFileUrlHook = (
299
300
  this: PluginContext,
@@ -305,7 +306,7 @@ export type ResolveFileUrlHook = (
305
306
  referenceId: string;
306
307
  relativePath: string;
307
308
  }
308
- ) => string | null | void;
309
+ ) => string | NullValue;
309
310
 
310
311
  export type AddonHookFunction = (
311
312
  this: PluginContext,
@@ -351,8 +352,8 @@ export interface FunctionPluginHooks {
351
352
  ) => void;
352
353
  load: LoadHook;
353
354
  moduleParsed: ModuleParsedHook;
354
- options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | null | void;
355
- outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | null | void;
355
+ options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue;
356
+ outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | NullValue;
356
357
  renderChunk: RenderChunkHook;
357
358
  renderDynamicImport: (
358
359
  this: PluginContext,
@@ -362,7 +363,7 @@ export interface FunctionPluginHooks {
362
363
  moduleId: string;
363
364
  targetModuleId: string | null;
364
365
  }
365
- ) => { left: string; right: string } | null | void;
366
+ ) => { left: string; right: string } | NullValue;
366
367
  renderError: (this: PluginContext, error?: Error) => void;
367
368
  renderStart: (
368
369
  this: PluginContext,
@@ -481,13 +482,13 @@ interface ManualChunkMeta {
481
482
  getModuleIds: () => IterableIterator<string>;
482
483
  getModuleInfo: GetModuleInfo;
483
484
  }
484
- export type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | null | void;
485
+ export type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue;
485
486
 
486
487
  export type ExternalOption =
487
488
  | (string | RegExp)[]
488
489
  | string
489
490
  | RegExp
490
- | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | void);
491
+ | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue);
491
492
  export type PureModulesOption = boolean | string[] | IsPureModule;
492
493
  export type GlobalsOption = { [name: string]: string } | ((name: string) => string);
493
494
  export type InputOption = string | string[] | { [entryAlias: string]: string };
@@ -499,7 +500,7 @@ export type SourcemapPathTransformOption = (
499
500
  sourcemapPath: string
500
501
  ) => string;
501
502
 
502
- export type InputPluginOption = MaybePromise<Plugin | FalsyValue | InputPluginOption[]>;
503
+ export type InputPluginOption = MaybePromise<Plugin | NullValue | false | InputPluginOption[]>;
503
504
 
504
505
  export interface InputOptions {
505
506
  acorn?: Record<string, unknown>;
@@ -517,7 +518,7 @@ export interface InputOptions {
517
518
  maxParallelFileOps?: number;
518
519
  /** @deprecated Use the "maxParallelFileOps" option instead. */
519
520
  maxParallelFileReads?: number;
520
- moduleContext?: ((id: string) => string | null | void) | { [id: string]: string };
521
+ moduleContext?: ((id: string) => string | NullValue) | { [id: string]: string };
521
522
  onwarn?: WarningHandlerWithDefault;
522
523
  perf?: boolean;
523
524
  plugins?: InputPluginOption;
@@ -623,7 +624,7 @@ export type NormalizedAmdOptions = (
623
624
 
624
625
  type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
625
626
 
626
- type OutputPluginOption = MaybePromise<OutputPlugin | FalsyValue | OutputPluginOption[]>;
627
+ type OutputPluginOption = MaybePromise<OutputPlugin | NullValue | false | OutputPluginOption[]>;
627
628
 
628
629
  export interface OutputOptions {
629
630
  amd?: AmdOptions;
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.1
4
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
3
+ Rollup.js v3.2.2
4
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.1
4
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
3
+ Rollup.js v3.2.2
4
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.1
4
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
3
+ Rollup.js v3.2.2
4
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.1
4
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
3
+ Rollup.js v3.2.2
4
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -31,7 +31,7 @@ function _interopNamespaceDefault(e) {
31
31
 
32
32
  const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
33
33
 
34
- var version$1 = "3.2.1";
34
+ var version$1 = "3.2.2";
35
35
 
36
36
  function ensureArray$1(items) {
37
37
  if (Array.isArray(items)) {
@@ -978,9 +978,7 @@ const getExternal = (config, overrides) => {
978
978
  ? (source, importer, isResolved) => configExternal(source, importer, isResolved) || overrides.external.includes(source)
979
979
  : [...ensureArray$1(configExternal), ...overrides.external];
980
980
  };
981
- const getOnWarn = (config, defaultOnWarnHandler) => config.onwarn
982
- ? warning => config.onwarn(warning, defaultOnWarnHandler)
983
- : defaultOnWarnHandler;
981
+ const getOnWarn = (config, defaultOnWarnHandler) => config.onwarn ? warning => config.onwarn(warning, defaultOnWarnHandler) : defaultOnWarnHandler;
984
982
  const getObjectOption = (config, overrides, name, objectifyValue = objectifyOption) => {
985
983
  const commandOption = normalizeObjectOptionValue(overrides[name], objectifyValue);
986
984
  const configOption = normalizeObjectOptionValue(config[name], objectifyValue);
@@ -11711,8 +11709,13 @@ class Program extends NodeBase {
11711
11709
  }
11712
11710
  }
11713
11711
  render(code, options) {
11712
+ let start = this.start;
11713
+ if (code.original.startsWith('#!')) {
11714
+ start = Math.min(code.original.indexOf('\n') + 1, this.end);
11715
+ code.remove(0, start);
11716
+ }
11714
11717
  if (this.body.length > 0) {
11715
- renderStatementList(this.body, code, this.start, this.end, options);
11718
+ renderStatementList(this.body, code, start, this.end, options);
11716
11719
  }
11717
11720
  else {
11718
11721
  super.render(code, options);
@@ -15537,9 +15540,7 @@ class Chunk {
15537
15540
  const map = module.getExportNamesByVariable();
15538
15541
  for (const exportedVariable of map.keys()) {
15539
15542
  const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
15540
- const importedVariable = isSynthetic
15541
- ? exportedVariable.getBaseVariable()
15542
- : exportedVariable;
15543
+ const importedVariable = isSynthetic ? exportedVariable.getBaseVariable() : exportedVariable;
15543
15544
  if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {
15544
15545
  this.checkCircularDependencyImport(importedVariable, module);
15545
15546
  const exportingModule = importedVariable.module;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.1
4
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
3
+ Rollup.js v3.2.2
4
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.1
4
- Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
3
+ Rollup.js v3.2.2
4
+ Sun, 16 Oct 2022 19:13:40 GMT - commit 9cb38d2e72b88341e0e70938eaeb97f47c2b8c67
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",