rollup 3.2.0 → 3.2.1

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.0
6
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
5
+ Rollup.js v3.2.1
6
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
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.0
4
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
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.0
4
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
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.0";
19
+ var version$1 = "3.2.1";
20
20
 
21
21
  var charToInteger = {};
22
22
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -154,7 +154,7 @@ class BitSet {
154
154
  }
155
155
  }
156
156
 
157
- class Chunk$1 {
157
+ let Chunk$1 = class Chunk {
158
158
  constructor(start, end, content) {
159
159
  this.start = start;
160
160
  this.end = end;
@@ -306,7 +306,7 @@ class Chunk$1 {
306
306
  if (this.outro.length) return true;
307
307
  }
308
308
  }
309
- }
309
+ };
310
310
 
311
311
  function getBtoa () {
312
312
  if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
@@ -1281,7 +1281,7 @@ class MagicString {
1281
1281
 
1282
1282
  const hasOwnProp = Object.prototype.hasOwnProperty;
1283
1283
 
1284
- class Bundle$1 {
1284
+ let Bundle$1 = class Bundle {
1285
1285
  constructor(options = {}) {
1286
1286
  this.intro = options.intro || '';
1287
1287
  this.separator = options.separator !== undefined ? options.separator : '\n';
@@ -1559,7 +1559,7 @@ class Bundle$1 {
1559
1559
 
1560
1560
  return this;
1561
1561
  }
1562
- }
1562
+ };
1563
1563
 
1564
1564
  const ANY_SLASH_REGEX = /[/\\]/;
1565
1565
  function relative(from, to) {
@@ -6572,7 +6572,7 @@ function getSafeName(baseName, usedNames) {
6572
6572
  return safeName;
6573
6573
  }
6574
6574
 
6575
- class Scope$1 {
6575
+ let Scope$1 = class Scope {
6576
6576
  constructor() {
6577
6577
  this.children = [];
6578
6578
  this.variables = new Map();
@@ -6595,7 +6595,7 @@ class Scope$1 {
6595
6595
  findVariable(_name) {
6596
6596
  throw new Error('Internal Error: findVariable needs to be implemented by a subclass');
6597
6597
  }
6598
- }
6598
+ };
6599
6599
 
6600
6600
  class ChildScope extends Scope$1 {
6601
6601
  constructor(parent) {
@@ -9617,9 +9617,20 @@ class ClassDeclaration extends ClassNode {
9617
9617
  super.parseNode(esTreeNode);
9618
9618
  }
9619
9619
  render(code, options) {
9620
- const { exportNamesByVariable, format, snippets: { _ } } = options;
9621
- if (format === 'system' && this.id && exportNamesByVariable.has(this.id.variable)) {
9622
- code.appendLeft(this.end, `${_}${getSystemExportStatement([this.id.variable], options)};`);
9620
+ const { exportNamesByVariable, format, snippets: { _, getPropertyAccess } } = options;
9621
+ if (this.id) {
9622
+ const { variable, name } = this.id;
9623
+ if (format === 'system' && exportNamesByVariable.has(variable)) {
9624
+ code.appendLeft(this.end, `${_}${getSystemExportStatement([variable], options)};`);
9625
+ }
9626
+ const renderedVariable = variable.getName(getPropertyAccess);
9627
+ if (renderedVariable !== name) {
9628
+ this.superClass?.render(code, options);
9629
+ this.body.render(code, options);
9630
+ code.prependRight(this.start, `let ${renderedVariable}${_}=${_}`);
9631
+ code.prependLeft(this.end, ';');
9632
+ return;
9633
+ }
9623
9634
  }
9624
9635
  super.render(code, options);
9625
9636
  }
@@ -12118,21 +12129,28 @@ class VariableDeclarator extends NodeBase {
12118
12129
  }
12119
12130
  }
12120
12131
  render(code, options) {
12121
- const { exportNamesByVariable, snippets: { _ } } = options;
12122
- const renderId = this.id.included;
12132
+ const { exportNamesByVariable, snippets: { _, getPropertyAccess } } = options;
12133
+ const { end, id, init, start } = this;
12134
+ const renderId = id.included;
12123
12135
  if (renderId) {
12124
- this.id.render(code, options);
12136
+ id.render(code, options);
12125
12137
  }
12126
12138
  else {
12127
- const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', this.id.end);
12128
- code.remove(this.start, findNonWhiteSpace(code.original, operatorPos + 1));
12129
- }
12130
- if (this.init) {
12131
- this.init.render(code, options, renderId ? BLANK : { renderedSurroundingElement: ExpressionStatement$1 });
12139
+ const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', id.end);
12140
+ code.remove(start, findNonWhiteSpace(code.original, operatorPos + 1));
12141
+ }
12142
+ if (init) {
12143
+ if (id instanceof Identifier && init instanceof ClassExpression && !init.id) {
12144
+ const renderedVariable = id.variable.getName(getPropertyAccess);
12145
+ if (renderedVariable !== id.name) {
12146
+ code.appendLeft(init.start + 5, ` ${id.name}`);
12147
+ }
12148
+ }
12149
+ init.render(code, options, renderId ? BLANK : { renderedSurroundingElement: ExpressionStatement$1 });
12132
12150
  }
12133
- else if (this.id instanceof Identifier &&
12134
- isReassignedExportsMember(this.id.variable, exportNamesByVariable)) {
12135
- code.appendLeft(this.end, `${_}=${_}void 0`);
12151
+ else if (id instanceof Identifier &&
12152
+ isReassignedExportsMember(id.variable, exportNamesByVariable)) {
12153
+ code.appendLeft(end, `${_}=${_}void 0`);
12136
12154
  }
12137
12155
  }
12138
12156
  applyDeoptimizations() { }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.0
4
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -2711,7 +2711,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
2711
2711
  /**
2712
2712
  * @mixin
2713
2713
  */
2714
- class NodeFsHandler$1 {
2714
+ let NodeFsHandler$1 = class NodeFsHandler {
2715
2715
 
2716
2716
  /**
2717
2717
  * @param {import("../index").FSWatcher} fsW
@@ -3067,7 +3067,7 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
3067
3067
  }
3068
3068
  }
3069
3069
 
3070
- }
3070
+ };
3071
3071
 
3072
3072
  var nodefsHandler = NodeFsHandler$1;
3073
3073
 
@@ -3287,7 +3287,7 @@ const sameTypes = (info, stats) => (
3287
3287
  /**
3288
3288
  * @mixin
3289
3289
  */
3290
- class FsEventsHandler$1 {
3290
+ let FsEventsHandler$1 = class FsEventsHandler {
3291
3291
 
3292
3292
  /**
3293
3293
  * @param {import('../index').FSWatcher} fsw
@@ -3593,7 +3593,7 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
3593
3593
  }
3594
3594
  }
3595
3595
 
3596
- }
3596
+ };
3597
3597
 
3598
3598
  fseventsHandler.exports = FsEventsHandler$1;
3599
3599
  fseventsHandler.exports.canUse = canUse;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.0
4
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
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.2.0
4
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
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.0
4
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -2705,7 +2705,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
2705
2705
  /**
2706
2706
  * @mixin
2707
2707
  */
2708
- class NodeFsHandler$1 {
2708
+ let NodeFsHandler$1 = class NodeFsHandler {
2709
2709
 
2710
2710
  /**
2711
2711
  * @param {import("../index").FSWatcher} fsW
@@ -3061,7 +3061,7 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
3061
3061
  }
3062
3062
  }
3063
3063
 
3064
- }
3064
+ };
3065
3065
 
3066
3066
  var nodefsHandler = NodeFsHandler$1;
3067
3067
 
@@ -3281,7 +3281,7 @@ const sameTypes = (info, stats) => (
3281
3281
  /**
3282
3282
  * @mixin
3283
3283
  */
3284
- class FsEventsHandler$1 {
3284
+ let FsEventsHandler$1 = class FsEventsHandler {
3285
3285
 
3286
3286
  /**
3287
3287
  * @param {import('../index').FSWatcher} fsw
@@ -3587,7 +3587,7 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
3587
3587
  }
3588
3588
  }
3589
3589
 
3590
- }
3590
+ };
3591
3591
 
3592
3592
  fseventsHandler.exports = FsEventsHandler$1;
3593
3593
  fseventsHandler.exports.canUse = canUse;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.0
4
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
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.0
4
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
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.0";
34
+ var version$1 = "3.2.1";
35
35
 
36
36
  function ensureArray$1(items) {
37
37
  if (Array.isArray(items)) {
@@ -1359,7 +1359,7 @@ class BitSet {
1359
1359
  }
1360
1360
  }
1361
1361
 
1362
- class Chunk$1 {
1362
+ let Chunk$1 = class Chunk {
1363
1363
  constructor(start, end, content) {
1364
1364
  this.start = start;
1365
1365
  this.end = end;
@@ -1511,7 +1511,7 @@ class Chunk$1 {
1511
1511
  if (this.outro.length) return true;
1512
1512
  }
1513
1513
  }
1514
- }
1514
+ };
1515
1515
 
1516
1516
  function getBtoa () {
1517
1517
  if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
@@ -2486,7 +2486,7 @@ class MagicString {
2486
2486
 
2487
2487
  const hasOwnProp = Object.prototype.hasOwnProperty;
2488
2488
 
2489
- class Bundle$1 {
2489
+ let Bundle$1 = class Bundle {
2490
2490
  constructor(options = {}) {
2491
2491
  this.intro = options.intro || '';
2492
2492
  this.separator = options.separator !== undefined ? options.separator : '\n';
@@ -2764,7 +2764,7 @@ class Bundle$1 {
2764
2764
 
2765
2765
  return this;
2766
2766
  }
2767
- }
2767
+ };
2768
2768
 
2769
2769
  const needsEscapeRegEx = /[\n\r'\\\u2028\u2029]/;
2770
2770
  const quoteNewlineRegEx = /([\n\r'\u2028\u2029])/g;
@@ -7085,7 +7085,7 @@ function getSafeName(baseName, usedNames) {
7085
7085
  return safeName;
7086
7086
  }
7087
7087
 
7088
- class Scope$1 {
7088
+ let Scope$1 = class Scope {
7089
7089
  constructor() {
7090
7090
  this.children = [];
7091
7091
  this.variables = new Map();
@@ -7108,7 +7108,7 @@ class Scope$1 {
7108
7108
  findVariable(_name) {
7109
7109
  throw new Error('Internal Error: findVariable needs to be implemented by a subclass');
7110
7110
  }
7111
- }
7111
+ };
7112
7112
 
7113
7113
  class ChildScope extends Scope$1 {
7114
7114
  constructor(parent) {
@@ -10130,9 +10130,20 @@ class ClassDeclaration extends ClassNode {
10130
10130
  super.parseNode(esTreeNode);
10131
10131
  }
10132
10132
  render(code, options) {
10133
- const { exportNamesByVariable, format, snippets: { _ } } = options;
10134
- if (format === 'system' && this.id && exportNamesByVariable.has(this.id.variable)) {
10135
- code.appendLeft(this.end, `${_}${getSystemExportStatement([this.id.variable], options)};`);
10133
+ const { exportNamesByVariable, format, snippets: { _, getPropertyAccess } } = options;
10134
+ if (this.id) {
10135
+ const { variable, name } = this.id;
10136
+ if (format === 'system' && exportNamesByVariable.has(variable)) {
10137
+ code.appendLeft(this.end, `${_}${getSystemExportStatement([variable], options)};`);
10138
+ }
10139
+ const renderedVariable = variable.getName(getPropertyAccess);
10140
+ if (renderedVariable !== name) {
10141
+ this.superClass?.render(code, options);
10142
+ this.body.render(code, options);
10143
+ code.prependRight(this.start, `let ${renderedVariable}${_}=${_}`);
10144
+ code.prependLeft(this.end, ';');
10145
+ return;
10146
+ }
10136
10147
  }
10137
10148
  super.render(code, options);
10138
10149
  }
@@ -12631,21 +12642,28 @@ class VariableDeclarator extends NodeBase {
12631
12642
  }
12632
12643
  }
12633
12644
  render(code, options) {
12634
- const { exportNamesByVariable, snippets: { _ } } = options;
12635
- const renderId = this.id.included;
12645
+ const { exportNamesByVariable, snippets: { _, getPropertyAccess } } = options;
12646
+ const { end, id, init, start } = this;
12647
+ const renderId = id.included;
12636
12648
  if (renderId) {
12637
- this.id.render(code, options);
12649
+ id.render(code, options);
12638
12650
  }
12639
12651
  else {
12640
- const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', this.id.end);
12641
- code.remove(this.start, findNonWhiteSpace(code.original, operatorPos + 1));
12642
- }
12643
- if (this.init) {
12644
- this.init.render(code, options, renderId ? BLANK : { renderedSurroundingElement: ExpressionStatement$1 });
12652
+ const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', id.end);
12653
+ code.remove(start, findNonWhiteSpace(code.original, operatorPos + 1));
12654
+ }
12655
+ if (init) {
12656
+ if (id instanceof Identifier && init instanceof ClassExpression && !init.id) {
12657
+ const renderedVariable = id.variable.getName(getPropertyAccess);
12658
+ if (renderedVariable !== id.name) {
12659
+ code.appendLeft(init.start + 5, ` ${id.name}`);
12660
+ }
12661
+ }
12662
+ init.render(code, options, renderId ? BLANK : { renderedSurroundingElement: ExpressionStatement$1 });
12645
12663
  }
12646
- else if (this.id instanceof Identifier &&
12647
- isReassignedExportsMember(this.id.variable, exportNamesByVariable)) {
12648
- code.appendLeft(this.end, `${_}=${_}void 0`);
12664
+ else if (id instanceof Identifier &&
12665
+ isReassignedExportsMember(id.variable, exportNamesByVariable)) {
12666
+ code.appendLeft(end, `${_}=${_}void 0`);
12649
12667
  }
12650
12668
  }
12651
12669
  applyDeoptimizations() { }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.2.0
4
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
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.0
4
- Sat, 15 Oct 2022 04:47:20 GMT - commit 585de6d1bc569c4f1d49654cae1044cefa277fb7
3
+ Rollup.js v3.2.1
4
+ Sun, 16 Oct 2022 04:44:52 GMT - commit 46e1eaaaf05e0c2efa0ed395d7a3cfa99ef25fb5
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.0",
3
+ "version": "3.2.1",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",