rollup 4.9.1 → 4.9.3

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/README.md CHANGED
@@ -6,6 +6,9 @@
6
6
  <a href="https://www.npmjs.com/package/rollup">
7
7
  <img src="https://img.shields.io/npm/v/rollup.svg" alt="npm version" >
8
8
  </a>
9
+ <a href="https://nodejs.org/en/about/previous-releases">
10
+ <img src="https://img.shields.io/node/v/rollup.svg" alt="node compatibility">
11
+ </a>
9
12
  <a href="https://packagephobia.now.sh/result?p=rollup">
10
13
  <img src="https://packagephobia.now.sh/badge?p=rollup" alt="install size" >
11
14
  </a>
@@ -13,7 +16,7 @@
13
16
  <img src="https://codecov.io/gh/rollup/rollup/graph/badge.svg" alt="code coverage" >
14
17
  </a>
15
18
  <a href="#backers" alt="sponsors on Open Collective">
16
- <img src="https://opencollective.com/rollup/backers/badge.svg" alt="backers" >
19
+ <img src="https://opencollective.com/rollup/backers/badge.svg" alt="backers" >
17
20
  </a>
18
21
  <a href="#sponsors" alt="Sponsors on Open Collective">
19
22
  <img src="https://opencollective.com/rollup/sponsors/badge.svg" alt="sponsors" >
@@ -21,7 +24,6 @@
21
24
  <a href="https://github.com/rollup/rollup/blob/master/LICENSE.md">
22
25
  <img src="https://img.shields.io/npm/l/rollup.svg" alt="license">
23
26
  </a>
24
-
25
27
  <a href='https://is.gd/rollup_chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge'>
26
28
  <img src='https://img.shields.io/discord/466787075518365708?color=778cd1&label=chat' alt='Join the chat at https://is.gd/rollup_chat'>
27
29
  </a>
package/dist/bin/rollup CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
3
  @license
4
- Rollup.js v4.9.1
5
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
4
+ Rollup.js v4.9.3
5
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
6
6
 
7
7
  https://github.com/rollup/rollup
8
8
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,7 +16,7 @@ import { xxhashBase64Url } from '../../native.js';
16
16
  import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
17
17
  import * as tty from 'tty';
18
18
 
19
- var version = "4.9.1";
19
+ var version = "4.9.3";
20
20
 
21
21
  const comma = ','.charCodeAt(0);
22
22
  const semicolon = ';'.charCodeAt(0);
@@ -2041,11 +2041,10 @@ const RESERVED_NAMES = new Set([
2041
2041
  'with',
2042
2042
  'yield'
2043
2043
  ]);
2044
- const RESERVED_NAMES$1 = RESERVED_NAMES;
2045
2044
 
2046
2045
  const illegalCharacters = /[^\w$]/g;
2047
2046
  const startsWithDigit = (value) => /\d/.test(value[0]);
2048
- const needsEscape = (value) => startsWithDigit(value) || RESERVED_NAMES$1.has(value) || value === 'arguments';
2047
+ const needsEscape = (value) => startsWithDigit(value) || RESERVED_NAMES.has(value) || value === 'arguments';
2049
2048
  function isLegal(value) {
2050
2049
  if (needsEscape(value)) {
2051
2050
  return false;
@@ -2064,7 +2063,7 @@ const VALID_IDENTIFIER_REGEXP = /^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]
2064
2063
  const NUMBER_REGEXP = /^\d+$/;
2065
2064
  function stringifyObjectKeyIfNeeded(key) {
2066
2065
  if (VALID_IDENTIFIER_REGEXP.test(key) || NUMBER_REGEXP.test(key)) {
2067
- return key;
2066
+ return key === '__proto__' ? '["__proto__"]' : key;
2068
2067
  }
2069
2068
  return JSON.stringify(key);
2070
2069
  }
@@ -5780,7 +5779,7 @@ function toBase64(value) {
5780
5779
  function getSafeName(baseName, usedNames, forbiddenNames) {
5781
5780
  let safeName = baseName;
5782
5781
  let count = 1;
5783
- while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName) || forbiddenNames?.has(safeName)) {
5782
+ while (usedNames.has(safeName) || RESERVED_NAMES.has(safeName) || forbiddenNames?.has(safeName)) {
5784
5783
  safeName = `${baseName}$${toBase64(count++)}`;
5785
5784
  }
5786
5785
  usedNames.add(safeName);
@@ -7311,7 +7310,9 @@ class Identifier extends NodeBase {
7311
7310
  // in the same function or at top level of module
7312
7311
  return (this.isTDZAccess = true);
7313
7312
  }
7314
- if (!this.variable.initReached) {
7313
+ // We ignore the case where the module is not yet executed because
7314
+ // moduleSideEffects are false.
7315
+ if (!this.variable.initReached && this.scope.context.module.isExecuted) {
7315
7316
  // Either a const/let TDZ violation or
7316
7317
  // var use before declaration was encountered.
7317
7318
  return (this.isTDZAccess = true);
@@ -9597,7 +9598,7 @@ class ExportDefaultDeclaration extends NodeBase {
9597
9598
  const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/
9598
9599
  const systemExportNames = format === 'system' && exportNamesByVariable.get(this.variable);
9599
9600
  if (systemExportNames) {
9600
- code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports('${systemExportNames[0]}', `);
9601
+ code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports(${JSON.stringify(systemExportNames[0])}, `);
9601
9602
  code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';'));
9602
9603
  }
9603
9604
  else {
@@ -10050,14 +10051,14 @@ const HELPER_GENERATORS = {
10050
10051
  `}${n}${n}`);
10051
10052
  },
10052
10053
  [INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE](_t, snippets, _liveBindings, freeze, symbols) {
10053
- const { getDirectReturnFunction, getObject, n } = snippets;
10054
+ const { getDirectReturnFunction, getObject, n, _ } = snippets;
10054
10055
  const [left, right] = getDirectReturnFunction(['e'], {
10055
10056
  functionReturn: true,
10056
10057
  lineBreakIndent: null,
10057
10058
  name: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE
10058
10059
  });
10059
10060
  return `${left}${getFrozen(freeze, getWithToStringTag(symbols, getObject([
10060
- ['__proto__', 'null'],
10061
+ [null, `__proto__:${_}null`],
10061
10062
  ['default', 'e']
10062
10063
  ], { lineBreakIndent: null }), snippets))}${right}${n}${n}`;
10063
10064
  },
@@ -13510,7 +13511,7 @@ class Module {
13510
13511
  }
13511
13512
  async tryParseAsync() {
13512
13513
  try {
13513
- return (await parseAstAsync(this.info.code));
13514
+ return await parseAstAsync(this.info.code);
13514
13515
  }
13515
13516
  catch (error_) {
13516
13517
  return this.error(logModuleParseError(error_, this.id), error_.pos);
@@ -13573,6 +13574,12 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
13573
13574
  `${t}enumerable:${_}true,${n}` +
13574
13575
  `${t}get:${_}${left}${importName}${right}${n}});`;
13575
13576
  }
13577
+ else if (specifier.reexported === '__proto__') {
13578
+ exportBlock +=
13579
+ `Object.defineProperty(exports,${_}"__proto__",${_}{${n}` +
13580
+ `${t}enumerable:${_}true,${n}` +
13581
+ `${t}value:${_}${importName}${n}});`;
13582
+ }
13576
13583
  else {
13577
13584
  exportBlock += `exports${getPropertyAccess(specifier.reexported)}${_}=${_}${importName};`;
13578
13585
  }
@@ -13586,7 +13593,12 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
13586
13593
  if (lhs !== rhs) {
13587
13594
  if (exportBlock)
13588
13595
  exportBlock += n;
13589
- exportBlock += `${lhs}${_}=${_}${rhs};`;
13596
+ exportBlock +=
13597
+ exported === '__proto__'
13598
+ ? `Object.defineProperty(exports,${_}"__proto__",${_}{${n}` +
13599
+ `${t}enumerable:${_}true,${n}` +
13600
+ `${t}value:${_}${rhs}${n}});`
13601
+ : `${lhs}${_}=${_}${rhs};`;
13590
13602
  }
13591
13603
  }
13592
13604
  for (const { name, reexports } of dependencies) {
@@ -13678,7 +13690,9 @@ const getDefineProperty = (name, needsLiveBinding, t, { _, getDirectReturnFuncti
13678
13690
  `${t}${t}enumerable:${_}true,${n}` +
13679
13691
  `${t}${t}get:${_}${left}${name}[k]${right}${n}${t}})`);
13680
13692
  }
13681
- return `exports[k]${_}=${_}${name}[k]`;
13693
+ return (`k${_}===${_}'__proto__'${_}?${_}Object.defineProperty(exports,${_}k,${_}{${n}` +
13694
+ `${t}${t}enumerable:${_}true,${n}` +
13695
+ `${t}${t}value:${_}${name}[k]${n}${t}})${_}:${_}exports[k]${_}=${_}${name}[k]`);
13682
13696
  };
13683
13697
 
13684
13698
  function getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, indent, snippets) {
@@ -14187,20 +14201,22 @@ function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, get
14187
14201
  }
14188
14202
  }
14189
14203
  if (reexportedNames.length > 1 || hasStarReexport) {
14190
- const exportMapping = getObject(reexportedNames, { lineBreakIndent: null });
14191
14204
  if (hasStarReexport) {
14192
14205
  if (!starExcludes) {
14193
14206
  starExcludes = getStarExcludes({ dependencies, exports });
14194
14207
  }
14208
+ reexportedNames.unshift([null, `__proto__:${_}null`]);
14209
+ const exportMapping = getObject(reexportedNames, { lineBreakIndent: null });
14195
14210
  setter.push(`${cnst} setter${_}=${_}${exportMapping};`, `for${_}(${cnst} name in module)${_}{`, `${t}if${_}(!_starExcludes[name])${_}setter[name]${_}=${_}module[name];`, '}', 'exports(setter);');
14196
14211
  }
14197
14212
  else {
14213
+ const exportMapping = getObject(reexportedNames, { lineBreakIndent: null });
14198
14214
  setter.push(`exports(${exportMapping});`);
14199
14215
  }
14200
14216
  }
14201
14217
  else {
14202
14218
  const [key, value] = reexportedNames[0];
14203
- setter.push(`exports('${key}',${_}${value});`);
14219
+ setter.push(`exports(${JSON.stringify(key)},${_}${value});`);
14204
14220
  }
14205
14221
  }
14206
14222
  setters.push(setter.join(`${n}${t}${t}${t}`));
@@ -14220,9 +14236,19 @@ const getStarExcludes = ({ dependencies, exports }) => {
14220
14236
  }
14221
14237
  return starExcludes;
14222
14238
  };
14223
- const getStarExcludesBlock = (starExcludes, t, { _, cnst, getObject, n }) => starExcludes
14224
- ? `${n}${t}${cnst} _starExcludes${_}=${_}${getObject([...starExcludes].map(property => [property, '1']), { lineBreakIndent: { base: t, t } })};`
14225
- : '';
14239
+ const getStarExcludesBlock = (starExcludes, t, { _, cnst, getObject, n }) => {
14240
+ if (starExcludes) {
14241
+ const fields = [...starExcludes].map(property => [
14242
+ property,
14243
+ '1'
14244
+ ]);
14245
+ fields.unshift([null, `__proto__:${_}null`]);
14246
+ return `${n}${t}${cnst} _starExcludes${_}=${_}${getObject(fields, {
14247
+ lineBreakIndent: { base: t, t }
14248
+ })};`;
14249
+ }
14250
+ return '';
14251
+ };
14226
14252
  const getImportBindingsBlock = (importBindings, t, { _, n }) => (importBindings.length > 0 ? `${n}${t}var ${importBindings.join(`,${_}`)};` : '');
14227
14253
  const getHoistedExportsBlock = (exports, t, snippets) => getExportsBlock(exports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets);
14228
14254
  function getExportsBlock(exports, t, { _, n }) {
@@ -14230,10 +14256,12 @@ function getExportsBlock(exports, t, { _, n }) {
14230
14256
  return '';
14231
14257
  }
14232
14258
  if (exports.length === 1) {
14233
- return `exports('${exports[0].name}',${_}${exports[0].value});${n}${n}`;
14259
+ return `exports(${JSON.stringify(exports[0].name)},${_}${exports[0].value});${n}${n}`;
14234
14260
  }
14235
14261
  return (`exports({${n}` +
14236
- exports.map(({ name, value }) => `${t}${name}:${_}${value}`).join(`,${n}`) +
14262
+ exports
14263
+ .map(({ name, value }) => `${t}${stringifyObjectKeyIfNeeded(name)}:${_}${value}`)
14264
+ .join(`,${n}`) +
14237
14265
  `${n}});${n}${n}`);
14238
14266
  }
14239
14267
  const getSyntheticExportsBlock = (exports, t, snippets) => getExportsBlock(exports
@@ -14507,7 +14535,7 @@ function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariab
14507
14535
  nameIndex += 9 * 64 ** (exportName.length - 1);
14508
14536
  exportName = toBase64(nameIndex);
14509
14537
  }
14510
- } while (RESERVED_NAMES$1.has(exportName) || exportsByName.has(exportName));
14538
+ } while (RESERVED_NAMES.has(exportName) || exportsByName.has(exportName));
14511
14539
  }
14512
14540
  exportsByName.set(exportName, variable);
14513
14541
  exportNamesByVariable.set(variable, [exportName]);
@@ -16547,7 +16575,7 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
16547
16575
  ];
16548
16576
  const isValidPropertyName = reservedNamesAsProps
16549
16577
  ? (name) => VALID_IDENTIFIER_REGEXP.test(name)
16550
- : (name) => !RESERVED_NAMES$1.has(name) && VALID_IDENTIFIER_REGEXP.test(name);
16578
+ : (name) => !RESERVED_NAMES.has(name) && VALID_IDENTIFIER_REGEXP.test(name);
16551
16579
  return {
16552
16580
  _,
16553
16581
  cnst,
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/parseAst.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { Program } from 'estree';
2
+
1
3
  export const VERSION: string;
2
4
 
3
5
  // utils
@@ -98,13 +100,13 @@ interface ModuleOptions {
98
100
  }
99
101
 
100
102
  export interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
101
- ast?: AstNode;
103
+ ast?: ProgramNode;
102
104
  code: string;
103
105
  map?: SourceMapInput;
104
106
  }
105
107
 
106
108
  export interface TransformModuleJSON {
107
- ast?: AstNode;
109
+ ast?: ProgramNode;
108
110
  code: string;
109
111
  // note if plugins use new this.cache to opt-out auto transform cache
110
112
  customTransformCache: boolean;
@@ -115,7 +117,7 @@ export interface TransformModuleJSON {
115
117
  }
116
118
 
117
119
  export interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
118
- ast: AstNode;
120
+ ast: ProgramNode;
119
121
  dependencies: string[];
120
122
  id: string;
121
123
  resolvedIds: ResolvedIdMap;
@@ -171,7 +173,7 @@ export type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk;
171
173
  export type EmitFile = (emittedFile: EmittedFile) => string;
172
174
 
173
175
  interface ModuleInfo extends ModuleOptions {
174
- ast: AstNode | null;
176
+ ast: ProgramNode | null;
175
177
  code: string | null;
176
178
  dynamicImporters: readonly string[];
177
179
  dynamicallyImportedIdResolutions: readonly ResolvedId[];
@@ -204,7 +206,7 @@ type LoggingFunctionWithPosition = (
204
206
  export type ParseAst = (
205
207
  input: string,
206
208
  options?: { allowReturnOutsideFunction?: boolean }
207
- ) => AstNode;
209
+ ) => ProgramNode;
208
210
 
209
211
  // declare AbortSignal here for environments without DOM lib or @types/node
210
212
  declare global {
@@ -214,7 +216,7 @@ declare global {
214
216
  export type ParseAstAsync = (
215
217
  input: string,
216
218
  options?: { allowReturnOutsideFunction?: boolean; signal?: AbortSignal }
217
- ) => Promise<AstNode>;
219
+ ) => Promise<ProgramNode>;
218
220
 
219
221
  export interface PluginContext extends MinimalPluginContext {
220
222
  addWatchFile: (id: string) => void;
@@ -280,7 +282,7 @@ export type ResolveIdHook = (
280
282
  export type ShouldTransformCachedModuleHook = (
281
283
  this: PluginContext,
282
284
  options: {
283
- ast: AstNode;
285
+ ast: ProgramNode;
284
286
  code: string;
285
287
  id: string;
286
288
  meta: CustomPluginOptions;
@@ -977,6 +979,8 @@ interface AstNode {
977
979
  type: string;
978
980
  }
979
981
 
982
+ type ProgramNode = Program & AstNode;
983
+
980
984
  export function defineConfig(options: RollupOptions): RollupOptions;
981
985
  export function defineConfig(options: RollupOptions[]): RollupOptions[];
982
986
  export function defineConfig(optionsFunction: RollupOptionsFunction): RollupOptionsFunction;
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
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 = "4.9.1";
34
+ var version = "4.9.3";
35
35
 
36
36
  function ensureArray$1(items) {
37
37
  if (Array.isArray(items)) {
@@ -3487,11 +3487,10 @@ const RESERVED_NAMES = new Set([
3487
3487
  'with',
3488
3488
  'yield'
3489
3489
  ]);
3490
- const RESERVED_NAMES$1 = RESERVED_NAMES;
3491
3490
 
3492
3491
  const illegalCharacters = /[^\w$]/g;
3493
3492
  const startsWithDigit = (value) => /\d/.test(value[0]);
3494
- const needsEscape = (value) => startsWithDigit(value) || RESERVED_NAMES$1.has(value) || value === 'arguments';
3493
+ const needsEscape = (value) => startsWithDigit(value) || RESERVED_NAMES.has(value) || value === 'arguments';
3495
3494
  function isLegal(value) {
3496
3495
  if (needsEscape(value)) {
3497
3496
  return false;
@@ -3510,7 +3509,7 @@ const VALID_IDENTIFIER_REGEXP = /^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]
3510
3509
  const NUMBER_REGEXP = /^\d+$/;
3511
3510
  function stringifyObjectKeyIfNeeded(key) {
3512
3511
  if (VALID_IDENTIFIER_REGEXP.test(key) || NUMBER_REGEXP.test(key)) {
3513
- return key;
3512
+ return key === '__proto__' ? '["__proto__"]' : key;
3514
3513
  }
3515
3514
  return JSON.stringify(key);
3516
3515
  }
@@ -7214,7 +7213,7 @@ class ParameterVariable extends LocalVariable {
7214
7213
  function getSafeName(baseName, usedNames, forbiddenNames) {
7215
7214
  let safeName = baseName;
7216
7215
  let count = 1;
7217
- while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName) || forbiddenNames?.has(safeName)) {
7216
+ while (usedNames.has(safeName) || RESERVED_NAMES.has(safeName) || forbiddenNames?.has(safeName)) {
7218
7217
  safeName = `${baseName}$${toBase64(count++)}`;
7219
7218
  }
7220
7219
  usedNames.add(safeName);
@@ -8743,7 +8742,9 @@ class Identifier extends NodeBase {
8743
8742
  // in the same function or at top level of module
8744
8743
  return (this.isTDZAccess = true);
8745
8744
  }
8746
- if (!this.variable.initReached) {
8745
+ // We ignore the case where the module is not yet executed because
8746
+ // moduleSideEffects are false.
8747
+ if (!this.variable.initReached && this.scope.context.module.isExecuted) {
8747
8748
  // Either a const/let TDZ violation or
8748
8749
  // var use before declaration was encountered.
8749
8750
  return (this.isTDZAccess = true);
@@ -11029,7 +11030,7 @@ class ExportDefaultDeclaration extends NodeBase {
11029
11030
  const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/
11030
11031
  const systemExportNames = format === 'system' && exportNamesByVariable.get(this.variable);
11031
11032
  if (systemExportNames) {
11032
- code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports('${systemExportNames[0]}', `);
11033
+ code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports(${JSON.stringify(systemExportNames[0])}, `);
11033
11034
  code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';'));
11034
11035
  }
11035
11036
  else {
@@ -11482,14 +11483,14 @@ const HELPER_GENERATORS = {
11482
11483
  `}${n}${n}`);
11483
11484
  },
11484
11485
  [INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE](_t, snippets, _liveBindings, freeze, symbols) {
11485
- const { getDirectReturnFunction, getObject, n } = snippets;
11486
+ const { getDirectReturnFunction, getObject, n, _ } = snippets;
11486
11487
  const [left, right] = getDirectReturnFunction(['e'], {
11487
11488
  functionReturn: true,
11488
11489
  lineBreakIndent: null,
11489
11490
  name: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE
11490
11491
  });
11491
11492
  return `${left}${getFrozen(freeze, getWithToStringTag(symbols, getObject([
11492
- ['__proto__', 'null'],
11493
+ [null, `__proto__:${_}null`],
11493
11494
  ['default', 'e']
11494
11495
  ], { lineBreakIndent: null }), snippets))}${right}${n}${n}`;
11495
11496
  },
@@ -14935,7 +14936,7 @@ class Module {
14935
14936
  }
14936
14937
  async tryParseAsync() {
14937
14938
  try {
14938
- return (await parseAst_js.parseAstAsync(this.info.code));
14939
+ return await parseAst_js.parseAstAsync(this.info.code);
14939
14940
  }
14940
14941
  catch (error_) {
14941
14942
  return this.error(parseAst_js.logModuleParseError(error_, this.id), error_.pos);
@@ -14998,6 +14999,12 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
14998
14999
  `${t}enumerable:${_}true,${n}` +
14999
15000
  `${t}get:${_}${left}${importName}${right}${n}});`;
15000
15001
  }
15002
+ else if (specifier.reexported === '__proto__') {
15003
+ exportBlock +=
15004
+ `Object.defineProperty(exports,${_}"__proto__",${_}{${n}` +
15005
+ `${t}enumerable:${_}true,${n}` +
15006
+ `${t}value:${_}${importName}${n}});`;
15007
+ }
15001
15008
  else {
15002
15009
  exportBlock += `exports${getPropertyAccess(specifier.reexported)}${_}=${_}${importName};`;
15003
15010
  }
@@ -15011,7 +15018,12 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
15011
15018
  if (lhs !== rhs) {
15012
15019
  if (exportBlock)
15013
15020
  exportBlock += n;
15014
- exportBlock += `${lhs}${_}=${_}${rhs};`;
15021
+ exportBlock +=
15022
+ exported === '__proto__'
15023
+ ? `Object.defineProperty(exports,${_}"__proto__",${_}{${n}` +
15024
+ `${t}enumerable:${_}true,${n}` +
15025
+ `${t}value:${_}${rhs}${n}});`
15026
+ : `${lhs}${_}=${_}${rhs};`;
15015
15027
  }
15016
15028
  }
15017
15029
  for (const { name, reexports } of dependencies) {
@@ -15103,7 +15115,9 @@ const getDefineProperty = (name, needsLiveBinding, t, { _, getDirectReturnFuncti
15103
15115
  `${t}${t}enumerable:${_}true,${n}` +
15104
15116
  `${t}${t}get:${_}${left}${name}[k]${right}${n}${t}})`);
15105
15117
  }
15106
- return `exports[k]${_}=${_}${name}[k]`;
15118
+ return (`k${_}===${_}'__proto__'${_}?${_}Object.defineProperty(exports,${_}k,${_}{${n}` +
15119
+ `${t}${t}enumerable:${_}true,${n}` +
15120
+ `${t}${t}value:${_}${name}[k]${n}${t}})${_}:${_}exports[k]${_}=${_}${name}[k]`);
15107
15121
  };
15108
15122
 
15109
15123
  function getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, indent, snippets) {
@@ -15612,20 +15626,22 @@ function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, get
15612
15626
  }
15613
15627
  }
15614
15628
  if (reexportedNames.length > 1 || hasStarReexport) {
15615
- const exportMapping = getObject(reexportedNames, { lineBreakIndent: null });
15616
15629
  if (hasStarReexport) {
15617
15630
  if (!starExcludes) {
15618
15631
  starExcludes = getStarExcludes({ dependencies, exports });
15619
15632
  }
15633
+ reexportedNames.unshift([null, `__proto__:${_}null`]);
15634
+ const exportMapping = getObject(reexportedNames, { lineBreakIndent: null });
15620
15635
  setter.push(`${cnst} setter${_}=${_}${exportMapping};`, `for${_}(${cnst} name in module)${_}{`, `${t}if${_}(!_starExcludes[name])${_}setter[name]${_}=${_}module[name];`, '}', 'exports(setter);');
15621
15636
  }
15622
15637
  else {
15638
+ const exportMapping = getObject(reexportedNames, { lineBreakIndent: null });
15623
15639
  setter.push(`exports(${exportMapping});`);
15624
15640
  }
15625
15641
  }
15626
15642
  else {
15627
15643
  const [key, value] = reexportedNames[0];
15628
- setter.push(`exports('${key}',${_}${value});`);
15644
+ setter.push(`exports(${JSON.stringify(key)},${_}${value});`);
15629
15645
  }
15630
15646
  }
15631
15647
  setters.push(setter.join(`${n}${t}${t}${t}`));
@@ -15645,9 +15661,19 @@ const getStarExcludes = ({ dependencies, exports }) => {
15645
15661
  }
15646
15662
  return starExcludes;
15647
15663
  };
15648
- const getStarExcludesBlock = (starExcludes, t, { _, cnst, getObject, n }) => starExcludes
15649
- ? `${n}${t}${cnst} _starExcludes${_}=${_}${getObject([...starExcludes].map(property => [property, '1']), { lineBreakIndent: { base: t, t } })};`
15650
- : '';
15664
+ const getStarExcludesBlock = (starExcludes, t, { _, cnst, getObject, n }) => {
15665
+ if (starExcludes) {
15666
+ const fields = [...starExcludes].map(property => [
15667
+ property,
15668
+ '1'
15669
+ ]);
15670
+ fields.unshift([null, `__proto__:${_}null`]);
15671
+ return `${n}${t}${cnst} _starExcludes${_}=${_}${getObject(fields, {
15672
+ lineBreakIndent: { base: t, t }
15673
+ })};`;
15674
+ }
15675
+ return '';
15676
+ };
15651
15677
  const getImportBindingsBlock = (importBindings, t, { _, n }) => (importBindings.length > 0 ? `${n}${t}var ${importBindings.join(`,${_}`)};` : '');
15652
15678
  const getHoistedExportsBlock = (exports, t, snippets) => getExportsBlock(exports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets);
15653
15679
  function getExportsBlock(exports, t, { _, n }) {
@@ -15655,10 +15681,12 @@ function getExportsBlock(exports, t, { _, n }) {
15655
15681
  return '';
15656
15682
  }
15657
15683
  if (exports.length === 1) {
15658
- return `exports('${exports[0].name}',${_}${exports[0].value});${n}${n}`;
15684
+ return `exports(${JSON.stringify(exports[0].name)},${_}${exports[0].value});${n}${n}`;
15659
15685
  }
15660
15686
  return (`exports({${n}` +
15661
- exports.map(({ name, value }) => `${t}${name}:${_}${value}`).join(`,${n}`) +
15687
+ exports
15688
+ .map(({ name, value }) => `${t}${stringifyObjectKeyIfNeeded(name)}:${_}${value}`)
15689
+ .join(`,${n}`) +
15662
15690
  `${n}});${n}${n}`);
15663
15691
  }
15664
15692
  const getSyntheticExportsBlock = (exports, t, snippets) => getExportsBlock(exports
@@ -15932,7 +15960,7 @@ function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariab
15932
15960
  nameIndex += 9 * 64 ** (exportName.length - 1);
15933
15961
  exportName = toBase64(nameIndex);
15934
15962
  }
15935
- } while (RESERVED_NAMES$1.has(exportName) || exportsByName.has(exportName));
15963
+ } while (RESERVED_NAMES.has(exportName) || exportsByName.has(exportName));
15936
15964
  }
15937
15965
  exportsByName.set(exportName, variable);
15938
15966
  exportNamesByVariable.set(variable, [exportName]);
@@ -17867,7 +17895,7 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
17867
17895
  ];
17868
17896
  const isValidPropertyName = reservedNamesAsProps
17869
17897
  ? (name) => VALID_IDENTIFIER_REGEXP.test(name)
17870
- : (name) => !RESERVED_NAMES$1.has(name) && VALID_IDENTIFIER_REGEXP.test(name);
17898
+ : (name) => !RESERVED_NAMES.has(name) && VALID_IDENTIFIER_REGEXP.test(name);
17871
17899
  return {
17872
17900
  _,
17873
17901
  cnst,
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.9.1
4
- Sun, 17 Dec 2023 06:25:43 GMT - commit d56ac63dc0452820272a0d7536340277f7db68bf
3
+ Rollup.js v4.9.3
4
+ Fri, 05 Jan 2024 06:20:18 GMT - commit 4ab3ad360457cd79f4ea852447d3ddca22da95d6
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": "4.9.1",
3
+ "version": "4.9.3",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -81,7 +81,7 @@
81
81
  "test:package": "node scripts/test-package.js",
82
82
  "test:options": "node scripts/test-options.js",
83
83
  "test:only": "mocha test/test.js",
84
- "test:typescript": "shx rm -rf test/typescript/dist && shx cp -r dist test/typescript/ && tsc --noEmit -p test/typescript && tsc --noEmit",
84
+ "test:typescript": "shx rm -rf test/typescript/dist && shx cp -r dist test/typescript/ && tsc --noEmit -p test/typescript && tsc --noEmit && tsc --noEmit -p scripts",
85
85
  "test:browser": "mocha test/browser/index.js",
86
86
  "watch": "rollup --config rollup.config.ts --configPlugin typescript --watch"
87
87
  },
@@ -101,66 +101,69 @@
101
101
  "homepage": "https://rollupjs.org/",
102
102
  "optionalDependencies": {
103
103
  "fsevents": "~2.3.2",
104
- "@rollup/rollup-darwin-arm64": "4.9.1",
105
- "@rollup/rollup-android-arm64": "4.9.1",
106
- "@rollup/rollup-win32-arm64-msvc": "4.9.1",
107
- "@rollup/rollup-linux-arm64-gnu": "4.9.1",
108
- "@rollup/rollup-linux-arm64-musl": "4.9.1",
109
- "@rollup/rollup-android-arm-eabi": "4.9.1",
110
- "@rollup/rollup-linux-arm-gnueabihf": "4.9.1",
111
- "@rollup/rollup-win32-ia32-msvc": "4.9.1",
112
- "@rollup/rollup-linux-riscv64-gnu": "4.9.1",
113
- "@rollup/rollup-darwin-x64": "4.9.1",
114
- "@rollup/rollup-win32-x64-msvc": "4.9.1",
115
- "@rollup/rollup-linux-x64-gnu": "4.9.1",
116
- "@rollup/rollup-linux-x64-musl": "4.9.1"
104
+ "@rollup/rollup-darwin-arm64": "4.9.3",
105
+ "@rollup/rollup-android-arm64": "4.9.3",
106
+ "@rollup/rollup-win32-arm64-msvc": "4.9.3",
107
+ "@rollup/rollup-linux-arm64-gnu": "4.9.3",
108
+ "@rollup/rollup-linux-arm64-musl": "4.9.3",
109
+ "@rollup/rollup-android-arm-eabi": "4.9.3",
110
+ "@rollup/rollup-linux-arm-gnueabihf": "4.9.3",
111
+ "@rollup/rollup-win32-ia32-msvc": "4.9.3",
112
+ "@rollup/rollup-linux-riscv64-gnu": "4.9.3",
113
+ "@rollup/rollup-darwin-x64": "4.9.3",
114
+ "@rollup/rollup-win32-x64-msvc": "4.9.3",
115
+ "@rollup/rollup-linux-x64-gnu": "4.9.3",
116
+ "@rollup/rollup-linux-x64-musl": "4.9.3"
117
+ },
118
+ "dependencies": {
119
+ "@types/estree": "1.0.5"
117
120
  },
118
121
  "devDependenciesComments": {
119
122
  "@rollup/plugin-typescript": "It appears that 11.1.3 breaks sourcemaps"
120
123
  },
121
124
  "devDependencies": {
122
- "@codemirror/commands": "^6.3.2",
125
+ "@codemirror/commands": "^6.3.3",
123
126
  "@codemirror/lang-javascript": "^6.2.1",
124
- "@codemirror/language": "^6.9.3",
127
+ "@codemirror/language": "^6.10.0",
125
128
  "@codemirror/search": "^6.5.5",
126
- "@codemirror/state": "^6.3.3",
127
- "@codemirror/view": "^6.22.2",
129
+ "@codemirror/state": "^6.4.0",
130
+ "@codemirror/view": "^6.23.0",
128
131
  "@jridgewell/sourcemap-codec": "^1.4.15",
129
132
  "@mermaid-js/mermaid-cli": "^10.6.1",
130
133
  "@napi-rs/cli": "^2.17.0",
131
134
  "@rollup/plugin-alias": "^5.1.0",
132
135
  "@rollup/plugin-buble": "^1.0.3",
133
136
  "@rollup/plugin-commonjs": "^25.0.7",
134
- "@rollup/plugin-json": "^6.0.1",
137
+ "@rollup/plugin-json": "^6.1.0",
135
138
  "@rollup/plugin-node-resolve": "^15.2.3",
136
139
  "@rollup/plugin-replace": "^5.0.5",
137
140
  "@rollup/plugin-terser": "^0.4.4",
138
141
  "@rollup/plugin-typescript": "11.1.5",
139
142
  "@rollup/pluginutils": "^5.1.0",
140
- "@types/estree": "1.0.5",
143
+ "@types/inquirer": "^9.0.7",
141
144
  "@types/mocha": "^10.0.6",
142
145
  "@types/node": "18.0.0",
143
146
  "@types/yargs-parser": "^21.0.3",
144
- "@typescript-eslint/eslint-plugin": "^6.14.0",
145
- "@typescript-eslint/parser": "^6.14.0",
146
- "@vue/eslint-config-prettier": "^8.0.0",
147
+ "@typescript-eslint/eslint-plugin": "^6.17.0",
148
+ "@typescript-eslint/parser": "^6.17.0",
149
+ "@vue/eslint-config-prettier": "^9.0.0",
147
150
  "@vue/eslint-config-typescript": "^12.0.0",
148
- "acorn": "^8.11.2",
151
+ "acorn": "^8.11.3",
149
152
  "acorn-import-assertions": "^1.9.0",
150
153
  "buble": "^0.20.0",
151
154
  "builtin-modules": "^3.3.0",
152
155
  "chokidar": "^3.5.3",
153
156
  "colorette": "^2.0.20",
154
157
  "concurrently": "^8.2.2",
155
- "core-js": "^3.34.0",
158
+ "core-js": "^3.35.0",
156
159
  "date-time": "^4.0.0",
157
160
  "es5-shim": "^4.6.7",
158
161
  "es6-shim": "^0.35.8",
159
- "eslint": "^8.55.0",
162
+ "eslint": "^8.56.0",
160
163
  "eslint-config-prettier": "^9.1.0",
161
- "eslint-plugin-import": "^2.29.0",
162
- "eslint-plugin-prettier": "^5.0.1",
163
- "eslint-plugin-unicorn": "^49.0.0",
164
+ "eslint-plugin-import": "^2.29.1",
165
+ "eslint-plugin-prettier": "^5.1.2",
166
+ "eslint-plugin-unicorn": "^50.0.1",
164
167
  "eslint-plugin-vue": "^9.19.2",
165
168
  "fixturify": "^3.0.0",
166
169
  "flru": "^1.0.2",
@@ -179,28 +182,27 @@
179
182
  "pretty-bytes": "^6.1.1",
180
183
  "pretty-ms": "^8.0.0",
181
184
  "requirejs": "^2.3.6",
182
- "rollup": "^4.8.0",
185
+ "rollup": "^4.9.2",
183
186
  "rollup-plugin-license": "^3.2.0",
184
187
  "rollup-plugin-string": "^3.0.0",
185
- "rollup-plugin-thatworks": "^1.0.4",
186
188
  "semver": "^7.5.4",
187
189
  "shx": "^0.3.4",
188
190
  "signal-exit": "^4.1.0",
189
191
  "source-map": "^0.7.4",
190
192
  "source-map-support": "^0.5.21",
191
- "systemjs": "^6.14.2",
193
+ "systemjs": "^6.14.3",
192
194
  "terser": "^5.26.0",
193
195
  "tslib": "^2.6.2",
194
196
  "typescript": "^5.3.3",
195
- "vite": "^5.0.7",
196
- "vitepress": "^1.0.0-rc.31",
197
- "vue": "^3.3.11",
197
+ "vite": "^5.0.10",
198
+ "vitepress": "^1.0.0-rc.34",
199
+ "vue": "^3.4.3",
198
200
  "wasm-pack": "^0.12.1",
199
201
  "weak-napi": "^2.0.2",
200
202
  "yargs-parser": "^21.1.1"
201
203
  },
202
204
  "overrides": {
203
- "axios": "^1.6.2",
205
+ "axios": "^1.6.3",
204
206
  "semver": "^7.5.4"
205
207
  },
206
208
  "files": [