rollup 3.28.0 → 3.28.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.28.0
6
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
5
+ Rollup.js v3.28.1
6
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
7
7
 
8
8
  https://github.com/rollup/rollup
9
9
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
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 v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
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 { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
16
16
  import * as tty from 'tty';
17
17
 
18
- var version$1 = "3.28.0";
18
+ var version$1 = "3.28.1";
19
19
 
20
20
  const comma = ','.charCodeAt(0);
21
21
  const semicolon = ';'.charCodeAt(0);
@@ -288,6 +288,13 @@ let Chunk$1 = class Chunk {
288
288
  this.end = index;
289
289
 
290
290
  if (this.edited) {
291
+ // after split we should save the edit content record into the correct chunk
292
+ // to make sure sourcemap correct
293
+ // For example:
294
+ // ' test'.trim()
295
+ // split -> ' ' + 'test'
296
+ // ✔️ edit -> '' + 'test'
297
+ // ✖️ edit -> 'test' + ''
291
298
  // TODO is this block necessary?...
292
299
  newChunk.edit('', false);
293
300
  this.content = '';
@@ -316,6 +323,10 @@ let Chunk$1 = class Chunk {
316
323
  if (trimmed.length) {
317
324
  if (trimmed !== this.content) {
318
325
  this.split(this.start + trimmed.length).edit('', undefined, true);
326
+ if (this.edited) {
327
+ // save the change, if it has been edited
328
+ this.edit(trimmed, this.storeName, true);
329
+ }
319
330
  }
320
331
  return true;
321
332
  } else {
@@ -334,7 +345,11 @@ let Chunk$1 = class Chunk {
334
345
 
335
346
  if (trimmed.length) {
336
347
  if (trimmed !== this.content) {
337
- this.split(this.end - trimmed.length);
348
+ const newChunk = this.split(this.end - trimmed.length);
349
+ if (this.edited) {
350
+ // save the change, if it has been edited
351
+ newChunk.edit(trimmed, this.storeName, true);
352
+ }
338
353
  this.edit('', undefined, true);
339
354
  }
340
355
  return true;
@@ -347,7 +362,7 @@ let Chunk$1 = class Chunk {
347
362
  }
348
363
  };
349
364
 
350
- function getBtoa () {
365
+ function getBtoa() {
351
366
  if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
352
367
  return (str) => window.btoa(unescape(encodeURIComponent(str)));
353
368
  } else if (typeof Buffer === 'function') {
@@ -460,6 +475,8 @@ function getLocator$1(source) {
460
475
  };
461
476
  }
462
477
 
478
+ const wordRegex = /\w/;
479
+
463
480
  class Mappings {
464
481
  constructor(hires) {
465
482
  this.hires = hires;
@@ -488,10 +505,29 @@ class Mappings {
488
505
  addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
489
506
  let originalCharIndex = chunk.start;
490
507
  let first = true;
508
+ // when iterating each char, check if it's in a word boundary
509
+ let charInHiresBoundary = false;
491
510
 
492
511
  while (originalCharIndex < chunk.end) {
493
512
  if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
494
- this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
513
+ const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
514
+
515
+ if (this.hires === 'boundary') {
516
+ // in hires "boundary", group segments per word boundary than per char
517
+ if (wordRegex.test(original[originalCharIndex])) {
518
+ // for first char in the boundary found, start the boundary by pushing a segment
519
+ if (!charInHiresBoundary) {
520
+ this.rawSegments.push(segment);
521
+ charInHiresBoundary = true;
522
+ }
523
+ } else {
524
+ // for non-word char, end the boundary by pushing a segment
525
+ this.rawSegments.push(segment);
526
+ charInHiresBoundary = false;
527
+ }
528
+ } else {
529
+ this.rawSegments.push(segment);
530
+ }
495
531
  }
496
532
 
497
533
  if (original[originalCharIndex] === '\n') {
@@ -664,7 +700,7 @@ class MagicString {
664
700
  sourceIndex,
665
701
  chunk.content,
666
702
  loc,
667
- chunk.storeName ? names.indexOf(chunk.original) : -1
703
+ chunk.storeName ? names.indexOf(chunk.original) : -1,
668
704
  );
669
705
  } else {
670
706
  mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
@@ -675,11 +711,13 @@ class MagicString {
675
711
 
676
712
  return {
677
713
  file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
678
- sources: [options.source ? getRelativePath(options.file || '', options.source) : (options.file || '')],
714
+ sources: [
715
+ options.source ? getRelativePath(options.file || '', options.source) : options.file || '',
716
+ ],
679
717
  sourcesContent: options.includeContent ? [this.original] : undefined,
680
718
  names,
681
719
  mappings: mappings.raw,
682
- x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined
720
+ x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined,
683
721
  };
684
722
  }
685
723
 
@@ -793,14 +831,14 @@ class MagicString {
793
831
 
794
832
  insert() {
795
833
  throw new Error(
796
- 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'
834
+ 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)',
797
835
  );
798
836
  }
799
837
 
800
838
  insertLeft(index, content) {
801
839
  if (!warned.insertLeft) {
802
840
  console.warn(
803
- 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'
841
+ 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',
804
842
  ); // eslint-disable-line no-console
805
843
  warned.insertLeft = true;
806
844
  }
@@ -811,7 +849,7 @@ class MagicString {
811
849
  insertRight(index, content) {
812
850
  if (!warned.insertRight) {
813
851
  console.warn(
814
- 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'
852
+ 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',
815
853
  ); // eslint-disable-line no-console
816
854
  warned.insertRight = true;
817
855
  }
@@ -870,7 +908,7 @@ class MagicString {
870
908
  if (end > this.original.length) throw new Error('end is out of bounds');
871
909
  if (start === end)
872
910
  throw new Error(
873
- 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead'
911
+ 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead',
874
912
  );
875
913
 
876
914
  this._split(start);
@@ -879,7 +917,7 @@ class MagicString {
879
917
  if (options === true) {
880
918
  if (!warned.storeName) {
881
919
  console.warn(
882
- 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'
920
+ 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',
883
921
  ); // eslint-disable-line no-console
884
922
  warned.storeName = true;
885
923
  }
@@ -1101,7 +1139,7 @@ class MagicString {
1101
1139
  // zero-length edited chunks are a special case (overlapping replacements)
1102
1140
  const loc = getLocator$1(this.original)(index);
1103
1141
  throw new Error(
1104
- `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`
1142
+ `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`,
1105
1143
  );
1106
1144
  }
1107
1145
 
@@ -1260,7 +1298,7 @@ class MagicString {
1260
1298
  this.overwrite(
1261
1299
  match.index,
1262
1300
  match.index + match[0].length,
1263
- getReplacement(match, this.original)
1301
+ getReplacement(match, this.original),
1264
1302
  );
1265
1303
  });
1266
1304
  } else {
@@ -1269,7 +1307,7 @@ class MagicString {
1269
1307
  this.overwrite(
1270
1308
  match.index,
1271
1309
  match.index + match[0].length,
1272
- getReplacement(match, this.original)
1310
+ getReplacement(match, this.original),
1273
1311
  );
1274
1312
  }
1275
1313
  return this;
@@ -1315,7 +1353,7 @@ class MagicString {
1315
1353
 
1316
1354
  if (!searchValue.global) {
1317
1355
  throw new TypeError(
1318
- 'MagicString.prototype.replaceAll called with a non-global RegExp argument'
1356
+ 'MagicString.prototype.replaceAll called with a non-global RegExp argument',
1319
1357
  );
1320
1358
  }
1321
1359
 
@@ -1345,7 +1383,7 @@ let Bundle$1 = class Bundle {
1345
1383
 
1346
1384
  if (!isObject$1(source) || !source.content) {
1347
1385
  throw new Error(
1348
- 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`'
1386
+ 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`',
1349
1387
  );
1350
1388
  }
1351
1389
 
@@ -1439,7 +1477,7 @@ let Bundle$1 = class Bundle {
1439
1477
  sourceIndex,
1440
1478
  chunk.content,
1441
1479
  loc,
1442
- chunk.storeName ? names.indexOf(chunk.original) : -1
1480
+ chunk.storeName ? names.indexOf(chunk.original) : -1,
1443
1481
  );
1444
1482
  } else {
1445
1483
  mappings.addUneditedChunk(
@@ -1447,7 +1485,7 @@ let Bundle$1 = class Bundle {
1447
1485
  chunk,
1448
1486
  magicString.original,
1449
1487
  loc,
1450
- magicString.sourcemapLocations
1488
+ magicString.sourcemapLocations,
1451
1489
  );
1452
1490
  }
1453
1491
  } else {
@@ -1565,7 +1603,7 @@ let Bundle$1 = class Bundle {
1565
1603
  length() {
1566
1604
  return this.sources.reduce(
1567
1605
  (length, source) => length + source.content.length(),
1568
- this.intro.length
1606
+ this.intro.length,
1569
1607
  );
1570
1608
  }
1571
1609
 
@@ -1673,6 +1711,10 @@ function isPathFragment(name) {
1673
1711
  }
1674
1712
  const UPPER_DIR_REGEX = /^(\.\.\/)*\.\.$/;
1675
1713
  function getImportPath(importerId, targetPath, stripJsExtension, ensureFileName) {
1714
+ while (targetPath.startsWith('../')) {
1715
+ targetPath = targetPath.slice(3);
1716
+ importerId = '_/' + importerId;
1717
+ }
1676
1718
  let relativePath = normalize(relative(dirname(importerId), targetPath));
1677
1719
  if (stripJsExtension && relativePath.endsWith('.js')) {
1678
1720
  relativePath = relativePath.slice(0, -3);
@@ -5056,7 +5098,7 @@ const normalizePath = function normalizePath(filename) {
5056
5098
  };
5057
5099
 
5058
5100
  function getMatcherString(id, resolutionBase) {
5059
- if (resolutionBase === false || isAbsolute$1(id) || id.startsWith('*')) {
5101
+ if (resolutionBase === false || isAbsolute$1(id) || id.startsWith('**')) {
5060
5102
  return normalizePath(id);
5061
5103
  }
5062
5104
  // resolve('') is valid and will default to process.cwd()
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
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.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -30,7 +30,7 @@ function _interopNamespaceDefault(e) {
30
30
 
31
31
  const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
32
32
 
33
- var version$1 = "3.28.0";
33
+ var version$1 = "3.28.1";
34
34
 
35
35
  function ensureArray$1(items) {
36
36
  if (Array.isArray(items)) {
@@ -273,6 +273,10 @@ function isPathFragment(name) {
273
273
  }
274
274
  const UPPER_DIR_REGEX = /^(\.\.\/)*\.\.$/;
275
275
  function getImportPath(importerId, targetPath, stripJsExtension, ensureFileName) {
276
+ while (targetPath.startsWith('../')) {
277
+ targetPath = targetPath.slice(3);
278
+ importerId = '_/' + importerId;
279
+ }
276
280
  let relativePath = normalize(relative(node_path.dirname(importerId), targetPath));
277
281
  if (stripJsExtension && relativePath.endsWith('.js')) {
278
282
  relativePath = relativePath.slice(0, -3);
@@ -2671,6 +2675,13 @@ let Chunk$1 = class Chunk {
2671
2675
  this.end = index;
2672
2676
 
2673
2677
  if (this.edited) {
2678
+ // after split we should save the edit content record into the correct chunk
2679
+ // to make sure sourcemap correct
2680
+ // For example:
2681
+ // ' test'.trim()
2682
+ // split -> ' ' + 'test'
2683
+ // ✔️ edit -> '' + 'test'
2684
+ // ✖️ edit -> 'test' + ''
2674
2685
  // TODO is this block necessary?...
2675
2686
  newChunk.edit('', false);
2676
2687
  this.content = '';
@@ -2699,6 +2710,10 @@ let Chunk$1 = class Chunk {
2699
2710
  if (trimmed.length) {
2700
2711
  if (trimmed !== this.content) {
2701
2712
  this.split(this.start + trimmed.length).edit('', undefined, true);
2713
+ if (this.edited) {
2714
+ // save the change, if it has been edited
2715
+ this.edit(trimmed, this.storeName, true);
2716
+ }
2702
2717
  }
2703
2718
  return true;
2704
2719
  } else {
@@ -2717,7 +2732,11 @@ let Chunk$1 = class Chunk {
2717
2732
 
2718
2733
  if (trimmed.length) {
2719
2734
  if (trimmed !== this.content) {
2720
- this.split(this.end - trimmed.length);
2735
+ const newChunk = this.split(this.end - trimmed.length);
2736
+ if (this.edited) {
2737
+ // save the change, if it has been edited
2738
+ newChunk.edit(trimmed, this.storeName, true);
2739
+ }
2721
2740
  this.edit('', undefined, true);
2722
2741
  }
2723
2742
  return true;
@@ -2730,7 +2749,7 @@ let Chunk$1 = class Chunk {
2730
2749
  }
2731
2750
  };
2732
2751
 
2733
- function getBtoa () {
2752
+ function getBtoa() {
2734
2753
  if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
2735
2754
  return (str) => window.btoa(unescape(encodeURIComponent(str)));
2736
2755
  } else if (typeof Buffer === 'function') {
@@ -2843,6 +2862,8 @@ function getLocator(source) {
2843
2862
  };
2844
2863
  }
2845
2864
 
2865
+ const wordRegex = /\w/;
2866
+
2846
2867
  class Mappings {
2847
2868
  constructor(hires) {
2848
2869
  this.hires = hires;
@@ -2871,10 +2892,29 @@ class Mappings {
2871
2892
  addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
2872
2893
  let originalCharIndex = chunk.start;
2873
2894
  let first = true;
2895
+ // when iterating each char, check if it's in a word boundary
2896
+ let charInHiresBoundary = false;
2874
2897
 
2875
2898
  while (originalCharIndex < chunk.end) {
2876
2899
  if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
2877
- this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
2900
+ const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
2901
+
2902
+ if (this.hires === 'boundary') {
2903
+ // in hires "boundary", group segments per word boundary than per char
2904
+ if (wordRegex.test(original[originalCharIndex])) {
2905
+ // for first char in the boundary found, start the boundary by pushing a segment
2906
+ if (!charInHiresBoundary) {
2907
+ this.rawSegments.push(segment);
2908
+ charInHiresBoundary = true;
2909
+ }
2910
+ } else {
2911
+ // for non-word char, end the boundary by pushing a segment
2912
+ this.rawSegments.push(segment);
2913
+ charInHiresBoundary = false;
2914
+ }
2915
+ } else {
2916
+ this.rawSegments.push(segment);
2917
+ }
2878
2918
  }
2879
2919
 
2880
2920
  if (original[originalCharIndex] === '\n') {
@@ -3047,7 +3087,7 @@ class MagicString {
3047
3087
  sourceIndex,
3048
3088
  chunk.content,
3049
3089
  loc,
3050
- chunk.storeName ? names.indexOf(chunk.original) : -1
3090
+ chunk.storeName ? names.indexOf(chunk.original) : -1,
3051
3091
  );
3052
3092
  } else {
3053
3093
  mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
@@ -3058,11 +3098,13 @@ class MagicString {
3058
3098
 
3059
3099
  return {
3060
3100
  file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
3061
- sources: [options.source ? getRelativePath(options.file || '', options.source) : (options.file || '')],
3101
+ sources: [
3102
+ options.source ? getRelativePath(options.file || '', options.source) : options.file || '',
3103
+ ],
3062
3104
  sourcesContent: options.includeContent ? [this.original] : undefined,
3063
3105
  names,
3064
3106
  mappings: mappings.raw,
3065
- x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined
3107
+ x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined,
3066
3108
  };
3067
3109
  }
3068
3110
 
@@ -3176,14 +3218,14 @@ class MagicString {
3176
3218
 
3177
3219
  insert() {
3178
3220
  throw new Error(
3179
- 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'
3221
+ 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)',
3180
3222
  );
3181
3223
  }
3182
3224
 
3183
3225
  insertLeft(index, content) {
3184
3226
  if (!warned.insertLeft) {
3185
3227
  console.warn(
3186
- 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'
3228
+ 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',
3187
3229
  ); // eslint-disable-line no-console
3188
3230
  warned.insertLeft = true;
3189
3231
  }
@@ -3194,7 +3236,7 @@ class MagicString {
3194
3236
  insertRight(index, content) {
3195
3237
  if (!warned.insertRight) {
3196
3238
  console.warn(
3197
- 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'
3239
+ 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',
3198
3240
  ); // eslint-disable-line no-console
3199
3241
  warned.insertRight = true;
3200
3242
  }
@@ -3253,7 +3295,7 @@ class MagicString {
3253
3295
  if (end > this.original.length) throw new Error('end is out of bounds');
3254
3296
  if (start === end)
3255
3297
  throw new Error(
3256
- 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead'
3298
+ 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead',
3257
3299
  );
3258
3300
 
3259
3301
  this._split(start);
@@ -3262,7 +3304,7 @@ class MagicString {
3262
3304
  if (options === true) {
3263
3305
  if (!warned.storeName) {
3264
3306
  console.warn(
3265
- 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'
3307
+ 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',
3266
3308
  ); // eslint-disable-line no-console
3267
3309
  warned.storeName = true;
3268
3310
  }
@@ -3484,7 +3526,7 @@ class MagicString {
3484
3526
  // zero-length edited chunks are a special case (overlapping replacements)
3485
3527
  const loc = getLocator(this.original)(index);
3486
3528
  throw new Error(
3487
- `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`
3529
+ `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`,
3488
3530
  );
3489
3531
  }
3490
3532
 
@@ -3643,7 +3685,7 @@ class MagicString {
3643
3685
  this.overwrite(
3644
3686
  match.index,
3645
3687
  match.index + match[0].length,
3646
- getReplacement(match, this.original)
3688
+ getReplacement(match, this.original),
3647
3689
  );
3648
3690
  });
3649
3691
  } else {
@@ -3652,7 +3694,7 @@ class MagicString {
3652
3694
  this.overwrite(
3653
3695
  match.index,
3654
3696
  match.index + match[0].length,
3655
- getReplacement(match, this.original)
3697
+ getReplacement(match, this.original),
3656
3698
  );
3657
3699
  }
3658
3700
  return this;
@@ -3698,7 +3740,7 @@ class MagicString {
3698
3740
 
3699
3741
  if (!searchValue.global) {
3700
3742
  throw new TypeError(
3701
- 'MagicString.prototype.replaceAll called with a non-global RegExp argument'
3743
+ 'MagicString.prototype.replaceAll called with a non-global RegExp argument',
3702
3744
  );
3703
3745
  }
3704
3746
 
@@ -3728,7 +3770,7 @@ let Bundle$1 = class Bundle {
3728
3770
 
3729
3771
  if (!isObject$1(source) || !source.content) {
3730
3772
  throw new Error(
3731
- 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`'
3773
+ 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`',
3732
3774
  );
3733
3775
  }
3734
3776
 
@@ -3822,7 +3864,7 @@ let Bundle$1 = class Bundle {
3822
3864
  sourceIndex,
3823
3865
  chunk.content,
3824
3866
  loc,
3825
- chunk.storeName ? names.indexOf(chunk.original) : -1
3867
+ chunk.storeName ? names.indexOf(chunk.original) : -1,
3826
3868
  );
3827
3869
  } else {
3828
3870
  mappings.addUneditedChunk(
@@ -3830,7 +3872,7 @@ let Bundle$1 = class Bundle {
3830
3872
  chunk,
3831
3873
  magicString.original,
3832
3874
  loc,
3833
- magicString.sourcemapLocations
3875
+ magicString.sourcemapLocations,
3834
3876
  );
3835
3877
  }
3836
3878
  } else {
@@ -3948,7 +3990,7 @@ let Bundle$1 = class Bundle {
3948
3990
  length() {
3949
3991
  return this.sources.reduce(
3950
3992
  (length, source) => length + source.content.length(),
3951
- this.intro.length
3993
+ this.intro.length,
3952
3994
  );
3953
3995
  }
3954
3996
 
@@ -6567,7 +6609,7 @@ const normalizePath = function normalizePath(filename) {
6567
6609
  };
6568
6610
 
6569
6611
  function getMatcherString(id, resolutionBase) {
6570
- if (resolutionBase === false || require$$0$1.isAbsolute(id) || id.startsWith('*')) {
6612
+ if (resolutionBase === false || require$$0$1.isAbsolute(id) || id.startsWith('**')) {
6571
6613
  return normalizePath(id);
6572
6614
  }
6573
6615
  // resolve('') is valid and will default to process.cwd()
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -126,7 +126,7 @@ const processOk = (process) => !!process &&
126
126
  const kExitEmitter = Symbol.for('signal-exit emitter');
127
127
  const global = globalThis;
128
128
  const ObjectDefineProperty = Object.defineProperty.bind(Object);
129
- // teeny tiny ee
129
+ // teeny special purpose ee
130
130
  class Emitter {
131
131
  emitted = {
132
132
  afterExit: false,
@@ -169,12 +169,17 @@ class Emitter {
169
169
  }
170
170
  emit(ev, code, signal) {
171
171
  if (this.emitted[ev]) {
172
- return;
172
+ return false;
173
173
  }
174
174
  this.emitted[ev] = true;
175
+ let ret = false;
175
176
  for (const fn of this.listeners[ev]) {
176
- fn(code, signal);
177
+ ret = fn(code, signal) === true || ret;
178
+ }
179
+ if (ev === 'exit') {
180
+ ret = this.emit('afterExit', code, signal) || ret;
177
181
  }
182
+ return ret;
178
183
  }
179
184
  }
180
185
  class SignalExitBase {
@@ -228,18 +233,22 @@ class SignalExit extends SignalExitBase {
228
233
  // exit v4 are not aware of each other, and each will attempt to let
229
234
  // the other handle it, so neither of them do. To correct this, we
230
235
  // detect if we're the only handler *except* for previous versions
231
- // of signal-exit.
236
+ // of signal-exit, and increment by the count of listeners it has
237
+ // created.
232
238
  /* c8 ignore start */
233
- //@ts-ignore
234
- if (typeof process.__signal_exit_emitter__ === 'object')
235
- count++;
239
+ const p = process;
240
+ if (typeof p.__signal_exit_emitter__ === 'object' &&
241
+ typeof p.__signal_exit_emitter__.count === 'number') {
242
+ count += p.__signal_exit_emitter__.count;
243
+ }
236
244
  /* c8 ignore stop */
237
245
  if (listeners.length === count) {
238
246
  this.unload();
239
- this.#emitter.emit('exit', null, sig);
240
- this.#emitter.emit('afterExit', null, sig);
247
+ const ret = this.#emitter.emit('exit', null, sig);
241
248
  /* c8 ignore start */
242
- process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig);
249
+ const s = sig === 'SIGHUP' ? this.#hupSig : sig;
250
+ if (!ret)
251
+ process.kill(process.pid, s);
243
252
  /* c8 ignore stop */
244
253
  }
245
254
  };
@@ -322,7 +331,6 @@ class SignalExit extends SignalExitBase {
322
331
  this.#process.exitCode = code || 0;
323
332
  /* c8 ignore stop */
324
333
  this.#emitter.emit('exit', this.#process.exitCode, null);
325
- this.#emitter.emit('afterExit', this.#process.exitCode, null);
326
334
  return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
327
335
  }
328
336
  #processEmit(ev, ...args) {
@@ -336,7 +344,6 @@ class SignalExit extends SignalExitBase {
336
344
  const ret = og.call(this.#process, ev, ...args);
337
345
  /* c8 ignore start */
338
346
  this.#emitter.emit('exit', this.#process.exitCode, null);
339
- this.#emitter.emit('afterExit', this.#process.exitCode, null);
340
347
  /* c8 ignore stop */
341
348
  return ret;
342
349
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.0
4
- Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
3
+ Rollup.js v3.28.1
4
+ Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
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.28.0",
3
+ "version": "3.28.1",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -65,27 +65,27 @@
65
65
  "devDependencies": {
66
66
  "@codemirror/commands": "^6.2.4",
67
67
  "@codemirror/lang-javascript": "^6.1.9",
68
- "@codemirror/language": "^6.8.0",
69
- "@codemirror/search": "^6.5.0",
68
+ "@codemirror/language": "^6.9.0",
69
+ "@codemirror/search": "^6.5.1",
70
70
  "@codemirror/state": "^6.2.1",
71
- "@codemirror/view": "^6.14.1",
71
+ "@codemirror/view": "^6.16.0",
72
72
  "@jridgewell/sourcemap-codec": "^1.4.15",
73
- "@mermaid-js/mermaid-cli": "^10.2.4",
73
+ "@mermaid-js/mermaid-cli": "^10.3.1",
74
74
  "@rollup/plugin-alias": "^5.0.0",
75
75
  "@rollup/plugin-buble": "^1.0.2",
76
- "@rollup/plugin-commonjs": "^25.0.3",
76
+ "@rollup/plugin-commonjs": "^25.0.4",
77
77
  "@rollup/plugin-json": "^6.0.0",
78
- "@rollup/plugin-node-resolve": "^15.1.0",
78
+ "@rollup/plugin-node-resolve": "^15.2.0",
79
79
  "@rollup/plugin-replace": "^5.0.2",
80
80
  "@rollup/plugin-terser": "^0.4.3",
81
81
  "@rollup/plugin-typescript": "^11.1.2",
82
- "@rollup/pluginutils": "^5.0.2",
82
+ "@rollup/pluginutils": "^5.0.3",
83
83
  "@types/estree": "1.0.1",
84
84
  "@types/mocha": "^10.0.1",
85
85
  "@types/node": "~14.18.54",
86
86
  "@types/yargs-parser": "^21.0.0",
87
- "@typescript-eslint/eslint-plugin": "^6.2.0",
88
- "@typescript-eslint/parser": "^6.2.0",
87
+ "@typescript-eslint/eslint-plugin": "^6.4.0",
88
+ "@typescript-eslint/parser": "^6.4.0",
89
89
  "@vue/eslint-config-prettier": "^8.0.0",
90
90
  "@vue/eslint-config-typescript": "^11.0.3",
91
91
  "acorn": "^8.10.0",
@@ -97,49 +97,49 @@
97
97
  "chokidar": "^3.5.3",
98
98
  "colorette": "^2.0.20",
99
99
  "concurrently": "^8.2.0",
100
- "core-js": "^3.31.1",
100
+ "core-js": "^3.32.1",
101
101
  "date-time": "^4.0.0",
102
102
  "es5-shim": "^4.6.7",
103
103
  "es6-shim": "^0.35.8",
104
- "eslint": "^8.45.0",
105
- "eslint-config-prettier": "^8.8.0",
106
- "eslint-plugin-import": "^2.27.5",
104
+ "eslint": "^8.47.0",
105
+ "eslint-config-prettier": "^9.0.0",
106
+ "eslint-plugin-import": "^2.28.1",
107
107
  "eslint-plugin-prettier": "^5.0.0",
108
- "eslint-plugin-unicorn": "^48.0.0",
109
- "eslint-plugin-vue": "^9.15.1",
108
+ "eslint-plugin-unicorn": "^48.0.1",
109
+ "eslint-plugin-vue": "^9.17.0",
110
110
  "fixturify": "^3.0.0",
111
111
  "flru": "^1.0.2",
112
112
  "fs-extra": "^11.1.1",
113
113
  "github-api": "^3.4.0",
114
114
  "hash.js": "^1.1.7",
115
115
  "husky": "^8.0.3",
116
- "inquirer": "^9.2.8",
116
+ "inquirer": "^9.2.10",
117
117
  "is-reference": "^3.0.1",
118
- "lint-staged": "^13.2.3",
118
+ "lint-staged": "^14.0.0",
119
119
  "locate-character": "^3.0.0",
120
- "magic-string": "^0.30.1",
120
+ "magic-string": "^0.30.2",
121
121
  "mocha": "^10.2.0",
122
122
  "nyc": "^15.1.0",
123
- "pinia": "^2.1.4",
124
- "prettier": "^3.0.0",
123
+ "pinia": "^2.1.6",
124
+ "prettier": "^3.0.2",
125
125
  "pretty-bytes": "^6.1.1",
126
126
  "pretty-ms": "^8.0.0",
127
127
  "requirejs": "^2.3.6",
128
- "rollup": "^3.26.3",
128
+ "rollup": "^3.28.0",
129
129
  "rollup-plugin-license": "^3.0.1",
130
130
  "rollup-plugin-string": "^3.0.0",
131
131
  "rollup-plugin-thatworks": "^1.0.4",
132
132
  "semver": "^7.5.4",
133
133
  "shx": "^0.3.4",
134
- "signal-exit": "^4.0.2",
134
+ "signal-exit": "^4.1.0",
135
135
  "source-map": "^0.7.4",
136
136
  "source-map-support": "^0.5.21",
137
- "systemjs": "^6.14.1",
137
+ "systemjs": "^6.14.2",
138
138
  "terser": "^5.19.2",
139
- "tslib": "^2.6.1",
139
+ "tslib": "^2.6.2",
140
140
  "typescript": "^5.1.6",
141
- "vite": "^4.4.7",
142
- "vitepress": "^1.0.0-beta.6",
141
+ "vite": "^4.4.9",
142
+ "vitepress": "^1.0.0-rc.4",
143
143
  "vue": "^3.3.4",
144
144
  "weak-napi": "^2.0.2",
145
145
  "yargs-parser": "^21.1.1"