rollup 2.38.4 → 2.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.38.4
4
- Tue, 02 Feb 2021 05:54:38 GMT - commit 991bb98fad1f3f76226bfe6243fd6cc45a19a39b
3
+ Rollup.js v2.40.0
4
+ Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -14,9 +14,9 @@ var index = require('./index.js');
14
14
  var loadConfigFile_js = require('./loadConfigFile.js');
15
15
  var fs = require('fs');
16
16
  var cli = require('../bin/rollup');
17
- var assert = require('assert');
17
+ var require$$0 = require('assert');
18
+ var require$$0$1 = require('events');
18
19
  var rollup = require('./rollup.js');
19
- var require$$0 = require('events');
20
20
  require('path');
21
21
  require('util');
22
22
  require('stream');
@@ -26,7 +26,9 @@ require('./mergeOptions.js');
26
26
  require('module');
27
27
  require('crypto');
28
28
 
29
- var timeZone = date => {
29
+ var dateTime$2 = {exports: {}};
30
+
31
+ var timeZone$1 = date => {
30
32
  const offset = (date || new Date()).getTimezoneOffset();
31
33
  const absOffset = Math.abs(offset);
32
34
  const hours = Math.floor(absOffset / 60);
@@ -36,6 +38,8 @@ var timeZone = date => {
36
38
  return (offset < 0 ? '+' : '-') + hours + minutesOut;
37
39
  };
38
40
 
41
+ const timeZone = timeZone$1;
42
+
39
43
  const dateTime = options => {
40
44
  options = Object.assign({
41
45
  date: new Date(),
@@ -67,12 +71,17 @@ const dateTime = options => {
67
71
  .replace(/\..+/, end);
68
72
  };
69
73
 
70
- var dateTime_1 = dateTime;
74
+ dateTime$2.exports = dateTime;
71
75
  // TODO: Remove this for the next major release
72
- var _default = dateTime;
73
- dateTime_1.default = _default;
76
+ dateTime$2.exports.default = dateTime;
77
+
78
+ var dateTime$1 = dateTime$2.exports;
79
+
80
+ var signalExit = {exports: {}};
74
81
 
75
- var signals = rollup.createCommonjsModule(function (module) {
82
+ var signals$1 = {exports: {}};
83
+
84
+ (function (module) {
76
85
  // This is not the set of all possible signals.
77
86
  //
78
87
  // It IS, however, the set of all signals that trigger
@@ -126,16 +135,16 @@ if (process.platform === 'linux') {
126
135
  'SIGUNUSED'
127
136
  );
128
137
  }
129
- });
138
+ }(signals$1));
130
139
 
131
140
  // Note: since nyc uses this module to output coverage, any lines
132
141
  // that are in the direct sync flow of nyc's outputCoverage are
133
142
  // ignored, since we can never get coverage for them.
134
-
135
- var signals$1 = signals;
143
+ var assert = require$$0;
144
+ var signals = signals$1.exports;
136
145
  var isWin = /^win/i.test(process.platform);
137
146
 
138
- var EE = require$$0;
147
+ var EE = require$$0$1;
139
148
  /* istanbul ignore if */
140
149
  if (typeof EE !== 'function') {
141
150
  EE = EE.EventEmitter;
@@ -159,7 +168,7 @@ if (!emitter.infinite) {
159
168
  emitter.infinite = true;
160
169
  }
161
170
 
162
- var signalExit = function (cb, opts) {
171
+ signalExit.exports = function (cb, opts) {
163
172
  assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler');
164
173
 
165
174
  if (loaded === false) {
@@ -183,14 +192,14 @@ var signalExit = function (cb, opts) {
183
192
  return remove
184
193
  };
185
194
 
186
- var unload_1 = unload;
195
+ signalExit.exports.unload = unload;
187
196
  function unload () {
188
197
  if (!loaded) {
189
198
  return
190
199
  }
191
200
  loaded = false;
192
201
 
193
- signals$1.forEach(function (sig) {
202
+ signals.forEach(function (sig) {
194
203
  try {
195
204
  process.removeListener(sig, sigListeners[sig]);
196
205
  } catch (er) {}
@@ -210,7 +219,7 @@ function emit (event, code, signal) {
210
219
 
211
220
  // { <signal>: <listener fn>, ... }
212
221
  var sigListeners = {};
213
- signals$1.forEach(function (sig) {
222
+ signals.forEach(function (sig) {
214
223
  sigListeners[sig] = function listener () {
215
224
  // If there are no other listeners, an exit is coming!
216
225
  // Simplest way: remove us and then re-send the signal.
@@ -233,11 +242,11 @@ signals$1.forEach(function (sig) {
233
242
  };
234
243
  });
235
244
 
236
- var signals_1 = function () {
237
- return signals$1
245
+ signalExit.exports.signals = function () {
246
+ return signals
238
247
  };
239
248
 
240
- var load_1 = load;
249
+ signalExit.exports.load = load;
241
250
 
242
251
  var loaded = false;
243
252
 
@@ -253,7 +262,7 @@ function load () {
253
262
  // handle it instead of us.
254
263
  emitter.count += 1;
255
264
 
256
- signals$1 = signals$1.filter(function (sig) {
265
+ signals = signals.filter(function (sig) {
257
266
  try {
258
267
  process.on(sig, sigListeners[sig]);
259
268
  return true
@@ -291,9 +300,8 @@ function processEmit (ev, arg) {
291
300
  return originalProcessEmit.apply(this, arguments)
292
301
  }
293
302
  }
294
- signalExit.unload = unload_1;
295
- signalExit.signals = signals_1;
296
- signalExit.load = load_1;
303
+
304
+ var onExit = signalExit.exports;
297
305
 
298
306
  const CLEAR_SCREEN = '\u001Bc';
299
307
  function getResetScreen(configs, allowClearScreen) {
@@ -324,7 +332,7 @@ async function watch(command) {
324
332
  let watcher;
325
333
  let configWatcher;
326
334
  const configFile = command.config ? cli.getConfigPath(command.config) : null;
327
- signalExit(close);
335
+ onExit(close);
328
336
  process.on('uncaughtException', close);
329
337
  if (!process.stdin.isTTY) {
330
338
  process.stdin.on('end', close);
@@ -418,7 +426,7 @@ async function watch(command) {
418
426
  break;
419
427
  case 'END':
420
428
  if (!silent && isTTY) {
421
- loadConfigFile_js.stderr(`\n[${dateTime_1()}] waiting for changes...`);
429
+ loadConfigFile_js.stderr(`\n[${dateTime$1()}] waiting for changes...`);
422
430
  }
423
431
  }
424
432
  if ('result' in event && event.result) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.38.4
4
- Tue, 02 Feb 2021 05:54:38 GMT - commit 991bb98fad1f3f76226bfe6243fd6cc45a19a39b
3
+ Rollup.js v2.40.0
4
+ Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -10,17 +10,21 @@
10
10
  */
11
11
  'use strict';
12
12
 
13
- var sysPath = require('path');
14
- var util = require('util');
13
+ var path = require('path');
14
+ var require$$0 = require('util');
15
15
  var index = require('./index.js');
16
16
  var rollup = require('./rollup.js');
17
17
  var mergeOptions = require('./mergeOptions.js');
18
- var require$$1 = require('os');
18
+ var require$$2 = require('os');
19
19
  require('events');
20
20
  require('fs');
21
21
  require('stream');
22
22
  require('crypto');
23
23
 
24
+ const util = require$$0;
25
+ const braces = index.braces_1;
26
+ const picomatch = index.picomatch;
27
+ const utils = index.utils;
24
28
  const isEmptyString = val => typeof val === 'string' && (val === '' || val === './');
25
29
 
26
30
  /**
@@ -58,7 +62,7 @@ const micromatch = (list, patterns, options) => {
58
62
  };
59
63
 
60
64
  for (let i = 0; i < patterns.length; i++) {
61
- let isMatch = index.picomatch(String(patterns[i]), { ...options, onResult }, true);
65
+ let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
62
66
  let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
63
67
  if (negated) negatives++;
64
68
 
@@ -118,7 +122,7 @@ micromatch.match = micromatch;
118
122
  * @api public
119
123
  */
120
124
 
121
- micromatch.matcher = (pattern, options) => index.picomatch(pattern, options);
125
+ micromatch.matcher = (pattern, options) => picomatch(pattern, options);
122
126
 
123
127
  /**
124
128
  * Returns true if **any** of the given glob `patterns` match the specified `string`.
@@ -137,7 +141,7 @@ micromatch.matcher = (pattern, options) => index.picomatch(pattern, options);
137
141
  * @api public
138
142
  */
139
143
 
140
- micromatch.isMatch = (str, patterns, options) => index.picomatch(patterns, options)(str);
144
+ micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
141
145
 
142
146
  /**
143
147
  * Backwards compatibility
@@ -245,7 +249,7 @@ micromatch.contains = (str, pattern, options) => {
245
249
  */
246
250
 
247
251
  micromatch.matchKeys = (obj, patterns, options) => {
248
- if (!index.utils.isObject(obj)) {
252
+ if (!utils.isObject(obj)) {
249
253
  throw new TypeError('Expected the first argument to be an object');
250
254
  }
251
255
  let keys = micromatch(Object.keys(obj), patterns, options);
@@ -277,7 +281,7 @@ micromatch.some = (list, patterns, options) => {
277
281
  let items = [].concat(list);
278
282
 
279
283
  for (let pattern of [].concat(patterns)) {
280
- let isMatch = index.picomatch(String(pattern), options);
284
+ let isMatch = picomatch(String(pattern), options);
281
285
  if (items.some(item => isMatch(item))) {
282
286
  return true;
283
287
  }
@@ -313,7 +317,7 @@ micromatch.every = (list, patterns, options) => {
313
317
  let items = [].concat(list);
314
318
 
315
319
  for (let pattern of [].concat(patterns)) {
316
- let isMatch = index.picomatch(String(pattern), options);
320
+ let isMatch = picomatch(String(pattern), options);
317
321
  if (!items.every(item => isMatch(item))) {
318
322
  return false;
319
323
  }
@@ -353,7 +357,7 @@ micromatch.all = (str, patterns, options) => {
353
357
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
354
358
  }
355
359
 
356
- return [].concat(patterns).every(p => index.picomatch(p, options)(str));
360
+ return [].concat(patterns).every(p => picomatch(p, options)(str));
357
361
  };
358
362
 
359
363
  /**
@@ -376,9 +380,9 @@ micromatch.all = (str, patterns, options) => {
376
380
  */
377
381
 
378
382
  micromatch.capture = (glob, input, options) => {
379
- let posix = index.utils.isWindows(options);
380
- let regex = index.picomatch.makeRe(String(glob), { ...options, capture: true });
381
- let match = regex.exec(posix ? index.utils.toPosixSlashes(input) : input);
383
+ let posix = utils.isWindows(options);
384
+ let regex = picomatch.makeRe(String(glob), { ...options, capture: true });
385
+ let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
382
386
 
383
387
  if (match) {
384
388
  return match.slice(1).map(v => v === void 0 ? '' : v);
@@ -401,7 +405,7 @@ micromatch.capture = (glob, input, options) => {
401
405
  * @api public
402
406
  */
403
407
 
404
- micromatch.makeRe = (...args) => index.picomatch.makeRe(...args);
408
+ micromatch.makeRe = (...args) => picomatch.makeRe(...args);
405
409
 
406
410
  /**
407
411
  * Scan a glob pattern to separate the pattern into segments. Used
@@ -417,7 +421,7 @@ micromatch.makeRe = (...args) => index.picomatch.makeRe(...args);
417
421
  * @api public
418
422
  */
419
423
 
420
- micromatch.scan = (...args) => index.picomatch.scan(...args);
424
+ micromatch.scan = (...args) => picomatch.scan(...args);
421
425
 
422
426
  /**
423
427
  * Parse a glob pattern to create the source string for a regular
@@ -436,8 +440,8 @@ micromatch.scan = (...args) => index.picomatch.scan(...args);
436
440
  micromatch.parse = (patterns, options) => {
437
441
  let res = [];
438
442
  for (let pattern of [].concat(patterns || [])) {
439
- for (let str of index.braces_1(String(pattern), options)) {
440
- res.push(index.picomatch.parse(str, options));
443
+ for (let str of braces(String(pattern), options)) {
444
+ res.push(picomatch.parse(str, options));
441
445
  }
442
446
  }
443
447
  return res;
@@ -465,7 +469,7 @@ micromatch.braces = (pattern, options) => {
465
469
  if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) {
466
470
  return [pattern];
467
471
  }
468
- return index.braces_1(pattern, options);
472
+ return braces(pattern, options);
469
473
  };
470
474
 
471
475
  /**
@@ -495,7 +499,7 @@ function getMatcherString(id, resolutionBase) {
495
499
  if (resolutionBase === false) {
496
500
  return id;
497
501
  }
498
- return sysPath.resolve(...(typeof resolutionBase === 'string' ? [resolutionBase, id] : [id]));
502
+ return path.resolve(...(typeof resolutionBase === 'string' ? [resolutionBase, id] : [id]));
499
503
  }
500
504
  const createFilter = function createFilter(include, exclude, options) {
501
505
  const resolutionBase = options && options.resolve;
@@ -504,7 +508,7 @@ const createFilter = function createFilter(include, exclude, options) {
504
508
  ? id
505
509
  : {
506
510
  test: micromatch_1.matcher(getMatcherString(id, resolutionBase)
507
- .split(sysPath.sep)
511
+ .split(path.sep)
508
512
  .join('/'), { dot: true })
509
513
  };
510
514
  };
@@ -515,7 +519,7 @@ const createFilter = function createFilter(include, exclude, options) {
515
519
  return false;
516
520
  if (/\0/.test(id))
517
521
  return false;
518
- id = id.split(sysPath.sep).join('/');
522
+ id = id.split(path.sep).join('/');
519
523
  for (let i = 0; i < excludeMatchers.length; ++i) {
520
524
  const matcher = excludeMatchers[i];
521
525
  if (matcher.test(id))
@@ -563,7 +567,7 @@ class FileWatcher {
563
567
  }
564
568
  createWatcher(transformWatcherId) {
565
569
  const task = this.task;
566
- const isLinux = require$$1.platform() === 'linux';
570
+ const isLinux = require$$2.platform() === 'linux';
567
571
  const isTransformDependency = transformWatcherId !== null;
568
572
  const handleChange = (id, event) => {
569
573
  const changedId = transformWatcherId || id;
@@ -688,7 +692,7 @@ class Task {
688
692
  this.outputs = this.options.output;
689
693
  this.outputFiles = this.outputs.map(output => {
690
694
  if (output.file || output.dir)
691
- return sysPath.resolve(output.file || output.dir);
695
+ return path.resolve(output.file || output.dir);
692
696
  return undefined;
693
697
  });
694
698
  const watchOptions = this.options.watch || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "2.38.4",
3
+ "version": "2.40.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -24,7 +24,10 @@
24
24
  "perf": "npm run build:cjs && node --expose-gc scripts/perf.js",
25
25
  "perf:debug": "node --inspect-brk scripts/perf-debug.js",
26
26
  "perf:init": "node scripts/perf-init.js",
27
- "prepare": "npm run build:cjs && npm run build:bootstrap",
27
+ "_postinstall": "husky install",
28
+ "postpublish": "pinst --enable",
29
+ "prepare": "npm run build",
30
+ "prepublishOnly": "pinst --disable && npm ci && npm run lint:nofix && npm run security && npm run build:bootstrap && npm run test:all",
28
31
  "security": "npm audit",
29
32
  "test": "npm run build && npm run test:all",
30
33
  "test:cjs": "npm run build:cjs && npm run test:only",
@@ -57,51 +60,52 @@
57
60
  "fsevents": "~2.3.1"
58
61
  },
59
62
  "devDependencies": {
60
- "@rollup/plugin-alias": "^3.1.1",
63
+ "@rollup/plugin-alias": "^3.1.2",
61
64
  "@rollup/plugin-buble": "^0.21.3",
62
- "@rollup/plugin-commonjs": "^17.0.0",
65
+ "@rollup/plugin-commonjs": "^18.0.0-1",
63
66
  "@rollup/plugin-json": "^4.1.0",
64
- "@rollup/plugin-node-resolve": "^11.1.0",
67
+ "@rollup/plugin-node-resolve": "^11.1.1",
65
68
  "@rollup/plugin-replace": "^2.3.4",
66
69
  "@types/micromatch": "^4.0.1",
67
70
  "@types/node": "^10.17.51",
68
71
  "@types/require-relative": "^0.8.0",
69
72
  "@types/signal-exit": "^3.0.0",
70
73
  "@types/yargs-parser": "^20.2.0",
71
- "acorn": "^8.0.4",
72
- "acorn-class-fields": "^0.3.7",
74
+ "acorn": "^8.0.5",
75
+ "acorn-class-fields": "^1.0.0",
73
76
  "acorn-jsx": "^5.3.1",
74
- "acorn-static-class-features": "^0.2.4",
75
- "acorn-walk": "^8.0.1",
77
+ "acorn-static-class-features": "^1.0.0",
78
+ "acorn-walk": "^8.0.2",
76
79
  "buble": "^0.20.0",
77
80
  "chokidar": "^3.5.1",
78
81
  "codecov": "^3.8.1",
79
82
  "colorette": "^1.2.1",
80
- "core-js": "^3.8.2",
83
+ "core-js": "^3.8.3",
81
84
  "date-time": "^3.1.0",
82
85
  "es5-shim": "^4.5.15",
83
86
  "es6-shim": "^0.35.6",
84
- "eslint": "^7.18.0",
87
+ "eslint": "^7.19.0",
85
88
  "eslint-plugin-import": "^2.22.1",
86
89
  "execa": "^5.0.0",
87
90
  "fixturify": "^2.1.0",
88
91
  "hash.js": "^1.1.7",
89
- "husky": "^4.3.8",
90
- "is-reference": "^1.2.1",
91
- "lint-staged": "^10.5.3",
92
+ "husky": "^5.0.9",
93
+ "is-reference": "lukastaegert/is-reference#update-class-features",
94
+ "lint-staged": "^10.5.4",
92
95
  "locate-character": "^2.0.5",
93
96
  "magic-string": "^0.25.7",
94
97
  "markdownlint-cli": "^0.26.0",
95
98
  "micromatch": "^4.0.2",
96
- "mocha": "^8.2.1",
99
+ "mocha": "^8.3.0",
97
100
  "node-fetch": "^2.6.1",
98
101
  "nyc": "^15.1.0",
102
+ "pinst": "^2.1.4",
99
103
  "prettier": "^2.2.1",
100
104
  "pretty-bytes": "^5.5.0",
101
105
  "pretty-ms": "^7.0.1",
102
106
  "require-relative": "^0.8.7",
103
107
  "requirejs": "^2.3.6",
104
- "rollup": "^2.36.2",
108
+ "rollup": "^2.38.5",
105
109
  "rollup-plugin-license": "^2.2.0",
106
110
  "rollup-plugin-string": "^3.0.0",
107
111
  "rollup-plugin-terser": "^7.0.2",
@@ -115,10 +119,10 @@
115
119
  "source-map-support": "^0.5.19",
116
120
  "sourcemap-codec": "^1.4.8",
117
121
  "systemjs": "^6.8.3",
118
- "terser": "^5.5.1",
122
+ "terser": "^5.6.0-beta",
119
123
  "tslib": "^2.1.0",
120
124
  "tslint": "^6.1.3",
121
- "typescript": "^4.1.3",
125
+ "typescript": "^4.1.5",
122
126
  "url-parse": "^1.4.7",
123
127
  "weak-napi": "^2.0.2",
124
128
  "yargs-parser": "^20.2.4"