rollup 3.20.4 → 3.20.5

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.20.4
6
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
5
+ Rollup.js v3.20.5
6
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
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.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,7 +16,7 @@ import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/pr
16
16
  import { EventEmitter } from 'node:events';
17
17
  import * as tty from 'tty';
18
18
 
19
- var version$1 = "3.20.4";
19
+ var version$1 = "3.20.5";
20
20
 
21
21
  const comma = ','.charCodeAt(0);
22
22
  const semicolon = ';'.charCodeAt(0);
@@ -6860,11 +6860,17 @@ function toBase64(value) {
6860
6860
  return outString;
6861
6861
  }
6862
6862
 
6863
+ const validIdentifier = /^(?!\d)[\w$]+$/;
6864
+ function isValidIdentifier(name) {
6865
+ return validIdentifier.test(name);
6866
+ }
6867
+
6863
6868
  function getSafeName(baseName, usedNames, forbiddenNames) {
6864
- let safeName = baseName;
6869
+ const safeBase = isValidIdentifier(baseName) ? baseName : '_safe';
6870
+ let safeName = safeBase;
6865
6871
  let count = 1;
6866
6872
  while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName) || forbiddenNames?.has(safeName)) {
6867
- safeName = `${baseName}$${toBase64(count++)}`;
6873
+ safeName = `${safeBase}$${toBase64(count++)}`;
6868
6874
  }
6869
6875
  usedNames.add(safeName);
6870
6876
  return safeName;
@@ -14401,6 +14407,7 @@ function getImportBlock$1(dependencies, { _, cnst, n }, compact) {
14401
14407
  return '';
14402
14408
  }
14403
14409
 
14410
+ const safeExportName = (name) => isValidIdentifier(name) ? name : JSON.stringify(name);
14404
14411
  function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }, { externalLiveBindings, freeze, namespaceToStringTag }) {
14405
14412
  const { n } = snippets;
14406
14413
  const importBlock = getImportBlock(dependencies, snippets);
@@ -14450,7 +14457,7 @@ function getImportBlock(dependencies, { _ }) {
14450
14457
  importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames
14451
14458
  .map(specifier => specifier.imported === specifier.local
14452
14459
  ? specifier.imported
14453
- : `${specifier.imported} as ${specifier.local}`)
14460
+ : `${safeExportName(specifier.imported)} as ${specifier.local}`)
14454
14461
  .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`);
14455
14462
  }
14456
14463
  }
@@ -14478,14 +14485,16 @@ function getImportBlock(dependencies, { _ }) {
14478
14485
  importBlock.push(`import${_}*${_}as ${name} from${_}${pathWithAssertion}`);
14479
14486
  }
14480
14487
  for (const specifier of namespaceReexports) {
14481
- importBlock.push(`export${_}{${_}${name === specifier.reexported ? name : `${name} as ${specifier.reexported}`} };`);
14488
+ importBlock.push(`export${_}{${_}${name === specifier.reexported
14489
+ ? name
14490
+ : `${name} as ${safeExportName(specifier.reexported)}`} };`);
14482
14491
  }
14483
14492
  }
14484
14493
  if (namedReexports.length > 0) {
14485
14494
  importBlock.push(`export${_}{${_}${namedReexports
14486
14495
  .map(specifier => specifier.imported === specifier.reexported
14487
- ? specifier.imported
14488
- : `${specifier.imported} as ${specifier.reexported}`)
14496
+ ? safeExportName(specifier.imported)
14497
+ : `${safeExportName(specifier.imported)} as ${safeExportName(specifier.reexported)}`)
14489
14498
  .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`);
14490
14499
  }
14491
14500
  }
@@ -14501,7 +14510,7 @@ function getExportBlock(exports, { _, cnst }) {
14501
14510
  }
14502
14511
  exportDeclaration.push(specifier.exported === specifier.local
14503
14512
  ? specifier.local
14504
- : `${specifier.local} as ${specifier.exported}`);
14513
+ : `${specifier.local} as ${safeExportName(specifier.exported)}`);
14505
14514
  }
14506
14515
  if (exportDeclaration.length > 0) {
14507
14516
  exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`);
@@ -16959,8 +16968,8 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
16959
16968
  : `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}`
16960
16969
  ];
16961
16970
  const isValidPropertyName = reservedNamesAsProps
16962
- ? (name) => validPropertyName.test(name)
16963
- : (name) => !RESERVED_NAMES$1.has(name) && validPropertyName.test(name);
16971
+ ? isValidIdentifier
16972
+ : (name) => !RESERVED_NAMES$1.has(name) && isValidIdentifier(name);
16964
16973
  return {
16965
16974
  _,
16966
16975
  cnst,
@@ -16994,7 +17003,6 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
16994
17003
  };
16995
17004
  }
16996
17005
  const wrapIfNeeded = (code, needsParens) => needsParens ? `(${code})` : code;
16997
- const validPropertyName = /^(?!\d)[\w$]+$/;
16998
17006
 
16999
17007
  class Source {
17000
17008
  constructor(filename, content) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
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.20.4";
34
+ var version$1 = "3.20.5";
35
35
 
36
36
  function ensureArray$1(items) {
37
37
  if (Array.isArray(items)) {
@@ -7358,11 +7358,17 @@ function toBase64(value) {
7358
7358
  return outString;
7359
7359
  }
7360
7360
 
7361
+ const validIdentifier = /^(?!\d)[\w$]+$/;
7362
+ function isValidIdentifier(name) {
7363
+ return validIdentifier.test(name);
7364
+ }
7365
+
7361
7366
  function getSafeName(baseName, usedNames, forbiddenNames) {
7362
- let safeName = baseName;
7367
+ const safeBase = isValidIdentifier(baseName) ? baseName : '_safe';
7368
+ let safeName = safeBase;
7363
7369
  let count = 1;
7364
7370
  while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName) || forbiddenNames?.has(safeName)) {
7365
- safeName = `${baseName}$${toBase64(count++)}`;
7371
+ safeName = `${safeBase}$${toBase64(count++)}`;
7366
7372
  }
7367
7373
  usedNames.add(safeName);
7368
7374
  return safeName;
@@ -14899,6 +14905,7 @@ function getImportBlock$1(dependencies, { _, cnst, n }, compact) {
14899
14905
  return '';
14900
14906
  }
14901
14907
 
14908
+ const safeExportName = (name) => isValidIdentifier(name) ? name : JSON.stringify(name);
14902
14909
  function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }, { externalLiveBindings, freeze, namespaceToStringTag }) {
14903
14910
  const { n } = snippets;
14904
14911
  const importBlock = getImportBlock(dependencies, snippets);
@@ -14948,7 +14955,7 @@ function getImportBlock(dependencies, { _ }) {
14948
14955
  importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames
14949
14956
  .map(specifier => specifier.imported === specifier.local
14950
14957
  ? specifier.imported
14951
- : `${specifier.imported} as ${specifier.local}`)
14958
+ : `${safeExportName(specifier.imported)} as ${specifier.local}`)
14952
14959
  .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`);
14953
14960
  }
14954
14961
  }
@@ -14976,14 +14983,16 @@ function getImportBlock(dependencies, { _ }) {
14976
14983
  importBlock.push(`import${_}*${_}as ${name} from${_}${pathWithAssertion}`);
14977
14984
  }
14978
14985
  for (const specifier of namespaceReexports) {
14979
- importBlock.push(`export${_}{${_}${name === specifier.reexported ? name : `${name} as ${specifier.reexported}`} };`);
14986
+ importBlock.push(`export${_}{${_}${name === specifier.reexported
14987
+ ? name
14988
+ : `${name} as ${safeExportName(specifier.reexported)}`} };`);
14980
14989
  }
14981
14990
  }
14982
14991
  if (namedReexports.length > 0) {
14983
14992
  importBlock.push(`export${_}{${_}${namedReexports
14984
14993
  .map(specifier => specifier.imported === specifier.reexported
14985
- ? specifier.imported
14986
- : `${specifier.imported} as ${specifier.reexported}`)
14994
+ ? safeExportName(specifier.imported)
14995
+ : `${safeExportName(specifier.imported)} as ${safeExportName(specifier.reexported)}`)
14987
14996
  .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`);
14988
14997
  }
14989
14998
  }
@@ -14999,7 +15008,7 @@ function getExportBlock(exports, { _, cnst }) {
14999
15008
  }
15000
15009
  exportDeclaration.push(specifier.exported === specifier.local
15001
15010
  ? specifier.local
15002
- : `${specifier.local} as ${specifier.exported}`);
15011
+ : `${specifier.local} as ${safeExportName(specifier.exported)}`);
15003
15012
  }
15004
15013
  if (exportDeclaration.length > 0) {
15005
15014
  exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`);
@@ -17457,8 +17466,8 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
17457
17466
  : `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}`
17458
17467
  ];
17459
17468
  const isValidPropertyName = reservedNamesAsProps
17460
- ? (name) => validPropertyName.test(name)
17461
- : (name) => !RESERVED_NAMES$1.has(name) && validPropertyName.test(name);
17469
+ ? isValidIdentifier
17470
+ : (name) => !RESERVED_NAMES$1.has(name) && isValidIdentifier(name);
17462
17471
  return {
17463
17472
  _,
17464
17473
  cnst,
@@ -17492,7 +17501,6 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
17492
17501
  };
17493
17502
  }
17494
17503
  const wrapIfNeeded = (code, needsParens) => needsParens ? `(${code})` : code;
17495
- const validPropertyName = /^(?!\d)[\w$]+$/;
17496
17504
 
17497
17505
  class Source {
17498
17506
  constructor(filename, content) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.20.4
4
- Mon, 17 Apr 2023 05:03:36 GMT - commit baa03115f72163a0fc921074822a077444d49402
3
+ Rollup.js v3.20.5
4
+ Tue, 18 Apr 2023 05:00:18 GMT - commit 8411bd07421c8b02b53722fb943cb96700a6e058
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.20.4",
3
+ "version": "3.20.5",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",