rollup 3.0.0 → 3.1.0

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.0.0
6
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
5
+ Rollup.js v3.1.0
6
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
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.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -15,7 +15,7 @@ import { createHash as createHash$1 } from 'node:crypto';
15
15
  import { promises } from 'node:fs';
16
16
  import { EventEmitter } from 'node:events';
17
17
 
18
- var version$1 = "3.0.0";
18
+ var version$1 = "3.1.0";
19
19
 
20
20
  var charToInteger = {};
21
21
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -11930,8 +11930,15 @@ class VariableDeclaration extends NodeBase {
11930
11930
  for (const declarator of this.declarations) {
11931
11931
  if (includeChildrenRecursively || declarator.shouldBeIncluded(context))
11932
11932
  declarator.include(context, includeChildrenRecursively);
11933
+ const { id, init } = declarator;
11933
11934
  if (asSingleStatement) {
11934
- declarator.id.include(context, includeChildrenRecursively);
11935
+ id.include(context, includeChildrenRecursively);
11936
+ }
11937
+ if (init &&
11938
+ id.included &&
11939
+ !init.included &&
11940
+ (id instanceof ObjectPattern || id instanceof ArrayPattern)) {
11941
+ init.include(context, includeChildrenRecursively);
11935
11942
  }
11936
11943
  }
11937
11944
  }
@@ -23816,6 +23823,7 @@ const getOptionWithPreset = (value, presets, optionName, additionalValues) => {
23816
23823
  return objectifyOptionWithPresets(presets, optionName, additionalValues)(value);
23817
23824
  };
23818
23825
  const getHashFromObjectOption = (optionName) => optionName.split('.').join('').toLowerCase();
23826
+ const normalizePluginOption = (plugins) => [plugins].flat(Infinity).filter(Boolean);
23819
23827
 
23820
23828
  function normalizeInputOptions(config) {
23821
23829
  // These are options that may trigger special warnings or behaviour later
@@ -23841,7 +23849,7 @@ function normalizeInputOptions(config) {
23841
23849
  moduleContext: getModuleContext(config, context),
23842
23850
  onwarn,
23843
23851
  perf: config.perf || false,
23844
- plugins: ensureArray(config.plugins),
23852
+ plugins: normalizePluginOption(config.plugins),
23845
23853
  preserveEntrySignatures: config.preserveEntrySignatures ?? 'exports-only',
23846
23854
  preserveModules: getPreserveModules$1(config, onwarn, strictDeprecations),
23847
23855
  preserveSymlinks: config.preserveSymlinks || false,
@@ -24058,7 +24066,7 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
24058
24066
  noConflict: config.noConflict || false,
24059
24067
  outro: getAddon(config, 'outro'),
24060
24068
  paths: config.paths || {},
24061
- plugins: ensureArray(config.plugins),
24069
+ plugins: normalizePluginOption(config.plugins),
24062
24070
  preferConst,
24063
24071
  preserveModules,
24064
24072
  preserveModulesRoot: getPreserveModulesRoot(config),
@@ -24540,4 +24548,4 @@ function watch(configs) {
24540
24548
  return emitter;
24541
24549
  }
24542
24550
 
24543
- export { createFilter, defaultOnWarn, defineConfig, ensureArray, fseventsImporter, generatedCodePresets, getAugmentedNamespace, objectifyOption, objectifyOptionWithPresets, picomatch$1 as picomatch, rollup, rollupInternal, treeshakePresets, version$1 as version, warnUnknownOptions, watch };
24551
+ export { createFilter, defaultOnWarn, defineConfig, ensureArray, fseventsImporter, generatedCodePresets, getAugmentedNamespace, normalizePluginOption, objectifyOption, objectifyOptionWithPresets, picomatch$1 as picomatch, rollup, rollupInternal, treeshakePresets, version$1 as version, warnUnknownOptions, watch };
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import { resolve } from 'node:path';
11
11
  import process$1 from 'node:process';
12
- import { ensureArray, warnUnknownOptions, defaultOnWarn, objectifyOptionWithPresets, treeshakePresets, objectifyOption, generatedCodePresets, picomatch as picomatch$2, getAugmentedNamespace, fseventsImporter, createFilter, rollupInternal } from './rollup.js';
12
+ import { ensureArray, warnUnknownOptions, defaultOnWarn, normalizePluginOption, objectifyOptionWithPresets, treeshakePresets, objectifyOption, generatedCodePresets, picomatch as picomatch$2, getAugmentedNamespace, fseventsImporter, createFilter, rollupInternal } from './rollup.js';
13
13
  import { platform } from 'node:os';
14
14
  import require$$0$1 from 'fs';
15
15
  import require$$2 from 'util';
@@ -89,7 +89,7 @@ function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
89
89
  moduleContext: getOption('moduleContext'),
90
90
  onwarn: getOnWarn(config, defaultOnWarnHandler),
91
91
  perf: getOption('perf'),
92
- plugins: ensureArray(config.plugins),
92
+ plugins: normalizePluginOption(config.plugins),
93
93
  preserveEntrySignatures: getOption('preserveEntrySignatures'),
94
94
  preserveModules: getOption('preserveModules'),
95
95
  preserveSymlinks: getOption('preserveSymlinks'),
@@ -163,7 +163,7 @@ function mergeOutputOptions(config, overrides, warn) {
163
163
  noConflict: getOption('noConflict'),
164
164
  outro: getOption('outro'),
165
165
  paths: getOption('paths'),
166
- plugins: ensureArray(config.plugins),
166
+ plugins: normalizePluginOption(config.plugins),
167
167
  preferConst: getOption('preferConst'),
168
168
  preserveModules: getOption('preserveModules'),
169
169
  preserveModulesRoot: getOption('preserveModulesRoot'),
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.d.ts CHANGED
@@ -492,6 +492,8 @@ export type SourcemapPathTransformOption = (
492
492
  sourcemapPath: string
493
493
  ) => string;
494
494
 
495
+ export type InputPluginOption = Plugin | null | false | undefined | InputPluginOption[];
496
+
495
497
  export interface InputOptions {
496
498
  acorn?: Record<string, unknown>;
497
499
  acornInjectPlugins?: (() => unknown)[] | (() => unknown);
@@ -511,7 +513,7 @@ export interface InputOptions {
511
513
  moduleContext?: ((id: string) => string | null | void) | { [id: string]: string };
512
514
  onwarn?: WarningHandlerWithDefault;
513
515
  perf?: boolean;
514
- plugins?: (Plugin | null | false | undefined)[];
516
+ plugins?: InputPluginOption;
515
517
  preserveEntrySignatures?: PreserveEntrySignaturesOption;
516
518
  /** @deprecated Use the "preserveModules" output option instead. */
517
519
  preserveModules?: boolean;
@@ -522,6 +524,10 @@ export interface InputOptions {
522
524
  watch?: WatcherOptions | false;
523
525
  }
524
526
 
527
+ export interface InputOptionsWithPlugins extends InputOptions {
528
+ plugins: Plugin[];
529
+ }
530
+
525
531
  export interface NormalizedInputOptions {
526
532
  acorn: Record<string, unknown>;
527
533
  acornInjectPlugins: (() => unknown)[];
@@ -610,6 +616,8 @@ export type NormalizedAmdOptions = (
610
616
 
611
617
  type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
612
618
 
619
+ type OutputPluginOption = OutputPlugin | null | false | undefined | OutputPluginOption[];
620
+
613
621
  export interface OutputOptions {
614
622
  amd?: AmdOptions;
615
623
  assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
@@ -647,7 +655,7 @@ export interface OutputOptions {
647
655
  noConflict?: boolean;
648
656
  outro?: string | AddonFunction;
649
657
  paths?: OptionsPaths;
650
- plugins?: (OutputPlugin | null | false | undefined)[];
658
+ plugins?: OutputPluginOption;
651
659
  /** @deprecated Use "generatedCode.constBindings" instead. */
652
660
  preferConst?: boolean;
653
661
  preserveModules?: boolean;
@@ -800,7 +808,7 @@ export interface RollupOptions extends InputOptions {
800
808
  output?: OutputOptions | OutputOptions[];
801
809
  }
802
810
 
803
- export interface MergedRollupOptions extends InputOptions {
811
+ export interface MergedRollupOptions extends InputOptionsWithPlugins {
804
812
  output: OutputOptions[];
805
813
  }
806
814
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -450,7 +450,7 @@ async function addCommandPluginsToInputOptions(inputOptions, command) {
450
450
  }
451
451
  async function addPluginsFromCommandOption(commandPlugin, inputOptions) {
452
452
  if (commandPlugin) {
453
- const plugins = Array.isArray(commandPlugin) ? commandPlugin : [commandPlugin];
453
+ const plugins = rollup.normalizePluginOption(commandPlugin);
454
454
  for (const plugin of plugins) {
455
455
  if (/[={}]/.test(plugin)) {
456
456
  // -p plugin=value
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -78,7 +78,7 @@ function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
78
78
  moduleContext: getOption('moduleContext'),
79
79
  onwarn: getOnWarn(config, defaultOnWarnHandler),
80
80
  perf: getOption('perf'),
81
- plugins: rollup.ensureArray(config.plugins),
81
+ plugins: rollup.normalizePluginOption(config.plugins),
82
82
  preserveEntrySignatures: getOption('preserveEntrySignatures'),
83
83
  preserveModules: getOption('preserveModules'),
84
84
  preserveSymlinks: getOption('preserveSymlinks'),
@@ -158,7 +158,7 @@ function mergeOutputOptions(config, overrides, warn) {
158
158
  noConflict: getOption('noConflict'),
159
159
  outro: getOption('outro'),
160
160
  paths: getOption('paths'),
161
- plugins: rollup.ensureArray(config.plugins),
161
+ plugins: rollup.normalizePluginOption(config.plugins),
162
162
  preferConst: getOption('preferConst'),
163
163
  preserveModules: getOption('preserveModules'),
164
164
  preserveModulesRoot: getOption('preserveModulesRoot'),
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -17,7 +17,7 @@ const node_crypto = require('node:crypto');
17
17
  const node_fs = require('node:fs');
18
18
  const node_events = require('node:events');
19
19
 
20
- var version$1 = "3.0.0";
20
+ var version$1 = "3.1.0";
21
21
 
22
22
  function ensureArray$1(items) {
23
23
  if (Array.isArray(items)) {
@@ -856,6 +856,7 @@ const getOptionWithPreset = (value, presets, optionName, additionalValues) => {
856
856
  return objectifyOptionWithPresets(presets, optionName, additionalValues)(value);
857
857
  };
858
858
  const getHashFromObjectOption = (optionName) => optionName.split('.').join('').toLowerCase();
859
+ const normalizePluginOption = (plugins) => [plugins].flat(Infinity).filter(Boolean);
859
860
 
860
861
  let fsEvents;
861
862
  let fsEventsImportError;
@@ -12101,8 +12102,15 @@ class VariableDeclaration extends NodeBase {
12101
12102
  for (const declarator of this.declarations) {
12102
12103
  if (includeChildrenRecursively || declarator.shouldBeIncluded(context))
12103
12104
  declarator.include(context, includeChildrenRecursively);
12105
+ const { id, init } = declarator;
12104
12106
  if (asSingleStatement) {
12105
- declarator.id.include(context, includeChildrenRecursively);
12107
+ id.include(context, includeChildrenRecursively);
12108
+ }
12109
+ if (init &&
12110
+ id.included &&
12111
+ !init.included &&
12112
+ (id instanceof ObjectPattern || id instanceof ArrayPattern)) {
12113
+ init.include(context, includeChildrenRecursively);
12106
12114
  }
12107
12115
  }
12108
12116
  }
@@ -23926,7 +23934,7 @@ function normalizeInputOptions(config) {
23926
23934
  moduleContext: getModuleContext(config, context),
23927
23935
  onwarn,
23928
23936
  perf: config.perf || false,
23929
- plugins: ensureArray$1(config.plugins),
23937
+ plugins: normalizePluginOption(config.plugins),
23930
23938
  preserveEntrySignatures: config.preserveEntrySignatures ?? 'exports-only',
23931
23939
  preserveModules: getPreserveModules$1(config, onwarn, strictDeprecations),
23932
23940
  preserveSymlinks: config.preserveSymlinks || false,
@@ -24143,7 +24151,7 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
24143
24151
  noConflict: config.noConflict || false,
24144
24152
  outro: getAddon(config, 'outro'),
24145
24153
  paths: config.paths || {},
24146
- plugins: ensureArray$1(config.plugins),
24154
+ plugins: normalizePluginOption(config.plugins),
24147
24155
  preferConst,
24148
24156
  preserveModules,
24149
24157
  preserveModulesRoot: getPreserveModulesRoot(config),
@@ -24622,6 +24630,7 @@ exports.getAliasName = getAliasName;
24622
24630
  exports.getAugmentedNamespace = getAugmentedNamespace;
24623
24631
  exports.getOrCreate = getOrCreate;
24624
24632
  exports.loadFsEvents = loadFsEvents;
24633
+ exports.normalizePluginOption = normalizePluginOption;
24625
24634
  exports.objectifyOption = objectifyOption;
24626
24635
  exports.objectifyOptionWithPresets = objectifyOptionWithPresets;
24627
24636
  exports.picomatch = picomatch$1;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0
4
- Tue, 11 Oct 2022 13:39:18 GMT - commit 69fef3b3639afc1a0409a4ecf8d41944bef8aa34
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
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.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -12,22 +12,24 @@
12
12
  "build": "rollup --config rollup.config.ts --configPlugin typescript",
13
13
  "build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest",
14
14
  "build:bootstrap": "node dist/bin/rollup --config rollup.config.ts --configPlugin typescript",
15
- "ci:lint": "npm run lint:nofix",
15
+ "ci:lint": "concurrently 'npm:lint:js:nofix' 'npm:lint:markdown:nofix'",
16
16
  "ci:test": "npm run build:cjs && npm run build:bootstrap && npm run test:all",
17
17
  "ci:test:only": "npm run build:cjs && npm run build:bootstrap && npm run test:only",
18
18
  "ci:coverage": "npm run build:cjs && npm run build:bootstrap && nyc --reporter lcovonly mocha",
19
- "lint": "eslint . --fix --cache && prettier --write \"**/*.md\"",
20
- "lint:nofix": "eslint . --cache && prettier --check \"**/*.md\"",
19
+ "lint": "concurrently -c red,green 'npm:lint:js' 'npm:lint:markdown'",
20
+ "lint:js": "eslint . --fix --cache",
21
+ "lint:js:nofix": "eslint . --cache",
21
22
  "lint:markdown": "prettier --write \"**/*.md\"",
23
+ "lint:markdown:nofix": "prettier --check \"**/*.md\"",
22
24
  "perf": "npm run build:cjs && node --expose-gc scripts/perf.js",
23
25
  "perf:init": "node scripts/perf-init.js",
24
- "prepare": "husky install && scripts/check-release.js || npm run build",
25
- "prepublishOnly": "scripts/check-release.js",
26
+ "prepare": "husky install && node scripts/check-release.js || npm run build",
27
+ "prepublishOnly": "node scripts/check-release.js",
26
28
  "release": "node scripts/release.js",
27
29
  "test": "npm run build && npm run test:all",
28
30
  "test:cjs": "npm run build:cjs && npm run test:only",
29
31
  "test:quick": "mocha -b test/test.js",
30
- "test:all": "npm run test:only && npm run test:browser && npm run test:typescript && npm run test:leak && npm run test:package",
32
+ "test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:leak' 'npm:test:package'",
31
33
  "test:coverage": "npm run build:cjs && shx rm -rf coverage/* && nyc --reporter html mocha test/test.js",
32
34
  "test:coverage:browser": "npm run build && shx rm -rf coverage/* && nyc mocha test/browser/index.js",
33
35
  "test:leak": "node --expose-gc test/leak/index.js",
@@ -76,6 +78,7 @@
76
78
  "buble": "^0.20.0",
77
79
  "chokidar": "^3.5.3",
78
80
  "colorette": "^2.0.19",
81
+ "concurrently": "^7.4.0",
79
82
  "core-js": "^3.25.5",
80
83
  "date-time": "^4.0.0",
81
84
  "es5-shim": "^4.6.7",