rollup 2.60.1 → 2.62.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.
package/dist/rollup.d.ts CHANGED
@@ -169,6 +169,7 @@ interface ModuleInfo {
169
169
  importers: readonly string[];
170
170
  isEntry: boolean;
171
171
  isExternal: boolean;
172
+ isIncluded: boolean | null;
172
173
  meta: CustomPluginOptions;
173
174
  syntheticNamedExports: boolean | string;
174
175
  }
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.60.1
4
- Mon, 22 Nov 2021 07:50:11 GMT - commit 649074e14131b490ff9dfe26e94632ff458c4970
3
+ Rollup.js v2.62.0
4
+ Fri, 24 Dec 2021 06:27:02 GMT - commit 81ce56f87de5fae51c00c4a0a977830ee93c5987
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.60.1
4
- Mon, 22 Nov 2021 07:50:11 GMT - commit 649074e14131b490ff9dfe26e94632ff458c4970
3
+ Rollup.js v2.62.0
4
+ Fri, 24 Dec 2021 06:27:02 GMT - commit 81ce56f87de5fae51c00c4a0a977830ee93c5987
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.60.1
4
- Mon, 22 Nov 2021 07:50:11 GMT - commit 649074e14131b490ff9dfe26e94632ff458c4970
3
+ Rollup.js v2.62.0
4
+ Fri, 24 Dec 2021 06:27:02 GMT - commit 81ce56f87de5fae51c00c4a0a977830ee93c5987
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -13,6 +13,7 @@
13
13
  const fs = require('fs');
14
14
  const path = require('path');
15
15
  const url = require('url');
16
+ const process$1 = require('process');
16
17
  const tty = require('tty');
17
18
  const rollup = require('./rollup.js');
18
19
  const mergeOptions = require('./mergeOptions.js');
@@ -32,58 +33,116 @@ const fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
32
33
  const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
33
34
  const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
34
35
 
35
- const env = process.env;
36
+ const env = process.env || {};
37
+ const argv = process.argv || [];
36
38
 
37
- const isDisabled = "NO_COLOR" in env;
38
- const isForced = "FORCE_COLOR" in env;
39
+ const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
40
+ const isForced = "FORCE_COLOR" in env || argv.includes("--color");
39
41
  const isWindows = process.platform === "win32";
40
42
 
41
43
  const isCompatibleTerminal =
42
- tty__namespace && tty__namespace.isatty(1) && env.TERM && env.TERM !== "dumb";
44
+ tty__namespace && tty__namespace.isatty && tty__namespace.isatty(1) && env.TERM && env.TERM !== "dumb";
43
45
 
44
46
  const isCI =
45
47
  "CI" in env &&
46
48
  ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
47
49
 
48
- let enabled =
50
+ const isColorSupported =
49
51
  !isDisabled && (isForced || isWindows || isCompatibleTerminal || isCI);
50
52
 
51
- const raw = (open, close, searchRegex, replaceValue) => (s) =>
52
- enabled
53
- ? open +
54
- (~(s += "").indexOf(close, 4) // skip opening \x1b[
55
- ? s.replace(searchRegex, replaceValue)
56
- : s) +
57
- close
58
- : s;
53
+ const replaceClose = (
54
+ index,
55
+ string,
56
+ close,
57
+ replace,
58
+ head = string.substring(0, index) + replace,
59
+ tail = string.substring(index + close.length),
60
+ next = tail.indexOf(close)
61
+ ) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
59
62
 
60
- const init = (open, close) => {
61
- return raw(
62
- `\x1b[${open}m`,
63
- `\x1b[${close}m`,
64
- new RegExp(`\\x1b\\[${close}m`, "g"),
65
- `\x1b[${open}m`
66
- )
63
+ const clearBleed = (index, string, open, close, replace) =>
64
+ index < 0
65
+ ? open + string + close
66
+ : open + replaceClose(index, string, close, replace) + close;
67
+
68
+ const filterEmpty =
69
+ (open, close, replace = open, at = open.length + 1) =>
70
+ (string) =>
71
+ string || !(string === "" || string === undefined)
72
+ ? clearBleed(
73
+ ("" + string).indexOf(close, at),
74
+ string,
75
+ open,
76
+ close,
77
+ replace
78
+ )
79
+ : "";
80
+
81
+ const init = (open, close, replace) =>
82
+ filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
83
+
84
+ const colors = {
85
+ reset: init(0, 0),
86
+ bold: init(1, 22, "\x1b[22m\x1b[1m"),
87
+ dim: init(2, 22, "\x1b[22m\x1b[2m"),
88
+ italic: init(3, 23),
89
+ underline: init(4, 24),
90
+ inverse: init(7, 27),
91
+ hidden: init(8, 28),
92
+ strikethrough: init(9, 29),
93
+ black: init(30, 39),
94
+ red: init(31, 39),
95
+ green: init(32, 39),
96
+ yellow: init(33, 39),
97
+ blue: init(34, 39),
98
+ magenta: init(35, 39),
99
+ cyan: init(36, 39),
100
+ white: init(37, 39),
101
+ gray: init(90, 39),
102
+ bgBlack: init(40, 49),
103
+ bgRed: init(41, 49),
104
+ bgGreen: init(42, 49),
105
+ bgYellow: init(43, 49),
106
+ bgBlue: init(44, 49),
107
+ bgMagenta: init(45, 49),
108
+ bgCyan: init(46, 49),
109
+ bgWhite: init(47, 49),
110
+ blackBright: init(90, 39),
111
+ redBright: init(91, 39),
112
+ greenBright: init(92, 39),
113
+ yellowBright: init(93, 39),
114
+ blueBright: init(94, 39),
115
+ magentaBright: init(95, 39),
116
+ cyanBright: init(96, 39),
117
+ whiteBright: init(97, 39),
118
+ bgBlackBright: init(100, 49),
119
+ bgRedBright: init(101, 49),
120
+ bgGreenBright: init(102, 49),
121
+ bgYellowBright: init(103, 49),
122
+ bgBlueBright: init(104, 49),
123
+ bgMagentaBright: init(105, 49),
124
+ bgCyanBright: init(106, 49),
125
+ bgWhiteBright: init(107, 49),
67
126
  };
68
127
 
69
- const options = Object.defineProperty({}, "enabled", {
70
- get: () => enabled,
71
- set: (value) => (enabled = value),
72
- });
73
- const bold = raw("\x1b[1m", "\x1b[22m", /\x1b\[22m/g, "\x1b[22m\x1b[1m");
74
- const dim = raw("\x1b[2m", "\x1b[22m", /\x1b\[22m/g, "\x1b[22m\x1b[2m");
75
- const underline = init(4, 24);
76
- const red = init(31, 39);
77
- const green = init(32, 39);
78
- const yellow = init(33, 39);
79
- const cyan = init(36, 39);
80
- const gray = init(90, 39);
128
+ const none = (any) => any;
129
+
130
+ const createColors = ({ useColor = isColorSupported } = {}) =>
131
+ useColor
132
+ ? colors
133
+ : Object.keys(colors).reduce(
134
+ (colors, key) => ({ ...colors, [key]: none }),
135
+ {}
136
+ );
137
+
138
+ createColors();
81
139
 
82
140
  // @see https://no-color.org
83
141
  // @see https://www.npmjs.com/package/chalk
84
- if (process.env.FORCE_COLOR === '0' || process.env.NO_COLOR) {
85
- options.enabled = false;
86
- }
142
+ const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({
143
+ useColor: process$1.env.FORCE_COLOR !== '0' && !process$1.env.NO_COLOR
144
+ });
145
+
87
146
  // log to stderr to keep `rollup main.js > bundle.js` from breaking
88
147
  const stderr = console.error.bind(console);
89
148
  function handleError(err, recover = false) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.60.1
4
- Mon, 22 Nov 2021 07:50:11 GMT - commit 649074e14131b490ff9dfe26e94632ff458c4970
3
+ Rollup.js v2.62.0
4
+ Fri, 24 Dec 2021 06:27:02 GMT - commit 81ce56f87de5fae51c00c4a0a977830ee93c5987
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup