@rspack-canary/cli 1.6.0-canary-e3199f44-20251020173943 → 1.6.0-canary-0eb13821-20251021173640
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/index.js +81 -95
- package/dist/index.mjs +70 -66
- package/dist/types.d.ts +2 -3
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,9 +1,75 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
3
2
|
return 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
3
|
}();
|
|
5
4
|
var __webpack_modules__ = {
|
|
5
|
+
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": function(module) {
|
|
6
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
7
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
8
|
+
let formatter = (open, close, replace = open)=>(input)=>{
|
|
9
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
10
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
11
|
+
};
|
|
12
|
+
let replaceClose = (string, close, replace, index)=>{
|
|
13
|
+
let result = "", cursor = 0;
|
|
14
|
+
do {
|
|
15
|
+
result += string.substring(cursor, index) + replace;
|
|
16
|
+
cursor = index + close.length;
|
|
17
|
+
index = string.indexOf(close, cursor);
|
|
18
|
+
}while (~index);
|
|
19
|
+
return result + string.substring(cursor);
|
|
20
|
+
};
|
|
21
|
+
let createColors = (enabled = isColorSupported)=>{
|
|
22
|
+
let f = enabled ? formatter : ()=>String;
|
|
23
|
+
return {
|
|
24
|
+
isColorSupported: enabled,
|
|
25
|
+
reset: f("\x1b[0m", "\x1b[0m"),
|
|
26
|
+
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
27
|
+
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
28
|
+
italic: f("\x1b[3m", "\x1b[23m"),
|
|
29
|
+
underline: f("\x1b[4m", "\x1b[24m"),
|
|
30
|
+
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
31
|
+
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
32
|
+
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
33
|
+
black: f("\x1b[30m", "\x1b[39m"),
|
|
34
|
+
red: f("\x1b[31m", "\x1b[39m"),
|
|
35
|
+
green: f("\x1b[32m", "\x1b[39m"),
|
|
36
|
+
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
37
|
+
blue: f("\x1b[34m", "\x1b[39m"),
|
|
38
|
+
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
39
|
+
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
40
|
+
white: f("\x1b[37m", "\x1b[39m"),
|
|
41
|
+
gray: f("\x1b[90m", "\x1b[39m"),
|
|
42
|
+
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
43
|
+
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
44
|
+
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
45
|
+
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
46
|
+
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
47
|
+
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
48
|
+
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
49
|
+
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
50
|
+
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
51
|
+
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
52
|
+
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
53
|
+
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
54
|
+
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
55
|
+
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
56
|
+
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
57
|
+
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
58
|
+
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
59
|
+
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
60
|
+
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
61
|
+
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
62
|
+
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
63
|
+
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
64
|
+
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
65
|
+
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
module.exports = createColors();
|
|
69
|
+
module.exports.createColors = createColors;
|
|
70
|
+
},
|
|
6
71
|
"../../node_modules/.pnpm/pirates@4.0.7/node_modules/pirates/lib/index.js": function(module, exports1, __webpack_require__) {
|
|
72
|
+
"use strict";
|
|
7
73
|
module = __webpack_require__.nmd(module);
|
|
8
74
|
const BuiltinModule = __webpack_require__("module");
|
|
9
75
|
const path = __webpack_require__("path");
|
|
@@ -64,6 +130,7 @@ var __webpack_modules__ = {
|
|
|
64
130
|
exports1.addHook = addHook;
|
|
65
131
|
},
|
|
66
132
|
"./src/utils/rspackCore.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
133
|
+
"use strict";
|
|
67
134
|
__webpack_require__.d(__webpack_exports__, {
|
|
68
135
|
Z: ()=>rspack
|
|
69
136
|
});
|
|
@@ -72,33 +139,41 @@ var __webpack_modules__ = {
|
|
|
72
139
|
const rspack = rspackCore_require("@rspack/core");
|
|
73
140
|
},
|
|
74
141
|
module: function(module) {
|
|
142
|
+
"use strict";
|
|
75
143
|
module.exports = require("module");
|
|
76
144
|
},
|
|
77
145
|
"node:fs": function(module) {
|
|
146
|
+
"use strict";
|
|
78
147
|
module.exports = require("node:fs");
|
|
79
148
|
},
|
|
80
149
|
"node:path": function(module) {
|
|
150
|
+
"use strict";
|
|
81
151
|
module.exports = require("node:path");
|
|
82
152
|
},
|
|
83
153
|
path: function(module) {
|
|
154
|
+
"use strict";
|
|
84
155
|
module.exports = require("path");
|
|
85
156
|
},
|
|
86
157
|
"@discoveryjs/json-ext": function(module) {
|
|
158
|
+
"use strict";
|
|
87
159
|
module.exports = import("@discoveryjs/json-ext").then(function(module) {
|
|
88
160
|
return module;
|
|
89
161
|
});
|
|
90
162
|
},
|
|
91
163
|
"@rspack/dev-server": function(module) {
|
|
164
|
+
"use strict";
|
|
92
165
|
module.exports = import("@rspack/dev-server").then(function(module) {
|
|
93
166
|
return module;
|
|
94
167
|
});
|
|
95
168
|
},
|
|
96
169
|
"exit-hook": function(module) {
|
|
170
|
+
"use strict";
|
|
97
171
|
module.exports = import("exit-hook").then(function(module) {
|
|
98
172
|
return module;
|
|
99
173
|
});
|
|
100
174
|
},
|
|
101
175
|
"webpack-bundle-analyzer": function(module) {
|
|
176
|
+
"use strict";
|
|
102
177
|
module.exports = import("webpack-bundle-analyzer").then(function(module) {
|
|
103
178
|
return module;
|
|
104
179
|
});
|
|
@@ -127,33 +202,6 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
127
202
|
return getter;
|
|
128
203
|
};
|
|
129
204
|
})();
|
|
130
|
-
(()=>{
|
|
131
|
-
var getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
|
|
132
|
-
var leafPrototypes;
|
|
133
|
-
__webpack_require__.t = function(value, mode) {
|
|
134
|
-
if (1 & mode) value = this(value);
|
|
135
|
-
if (8 & mode) return value;
|
|
136
|
-
if ('object' == typeof value && value) {
|
|
137
|
-
if (4 & mode && value.__esModule) return value;
|
|
138
|
-
if (16 & mode && 'function' == typeof value.then) return value;
|
|
139
|
-
}
|
|
140
|
-
var ns = Object.create(null);
|
|
141
|
-
__webpack_require__.r(ns);
|
|
142
|
-
var def = {};
|
|
143
|
-
leafPrototypes = leafPrototypes || [
|
|
144
|
-
null,
|
|
145
|
-
getProto({}),
|
|
146
|
-
getProto([]),
|
|
147
|
-
getProto(getProto)
|
|
148
|
-
];
|
|
149
|
-
for(var current = 2 & mode && value; 'object' == typeof current && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
|
|
150
|
-
def[key] = ()=>value[key];
|
|
151
|
-
});
|
|
152
|
-
def['default'] = ()=>value;
|
|
153
|
-
__webpack_require__.d(ns, def);
|
|
154
|
-
return ns;
|
|
155
|
-
};
|
|
156
|
-
})();
|
|
157
205
|
(()=>{
|
|
158
206
|
__webpack_require__.d = (exports1, definition)=>{
|
|
159
207
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -208,6 +256,7 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
208
256
|
})();
|
|
209
257
|
var __webpack_exports__ = {};
|
|
210
258
|
(()=>{
|
|
259
|
+
"use strict";
|
|
211
260
|
__webpack_require__.r(__webpack_exports__);
|
|
212
261
|
__webpack_require__.d(__webpack_exports__, {
|
|
213
262
|
defineConfig: ()=>defineConfig,
|
|
@@ -704,68 +753,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
704
753
|
}
|
|
705
754
|
const cac = (name = "")=>new CAC(name);
|
|
706
755
|
const dist = cac;
|
|
707
|
-
|
|
708
|
-
var external_tty_namespaceObject_0 = /*#__PURE__*/ __webpack_require__.t(external_tty_namespaceObject, 2);
|
|
709
|
-
const { env: colorette_env = {}, argv: colorette_argv = [], platform = "" } = "undefined" == typeof process ? {} : process;
|
|
710
|
-
const isDisabled = "NO_COLOR" in colorette_env || colorette_argv.includes("--no-color");
|
|
711
|
-
const isForced = "FORCE_COLOR" in colorette_env || colorette_argv.includes("--color");
|
|
712
|
-
const isWindows = "win32" === platform;
|
|
713
|
-
const isDumbTerminal = "dumb" === colorette_env.TERM;
|
|
714
|
-
const isCompatibleTerminal = external_tty_namespaceObject_0 && external_tty_namespaceObject.isatty && external_tty_namespaceObject.isatty(1) && colorette_env.TERM && !isDumbTerminal;
|
|
715
|
-
const isCI = "CI" in colorette_env && ("GITHUB_ACTIONS" in colorette_env || "GITLAB_CI" in colorette_env || "CIRCLECI" in colorette_env);
|
|
716
|
-
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
717
|
-
const replaceClose = (index, string, close, replace, head = string.substring(0, index) + replace, tail = string.substring(index + close.length), next = tail.indexOf(close))=>head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
718
|
-
const clearBleed = (index, string, open, close, replace)=>index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
719
|
-
const filterEmpty = (open, close, replace = open, at = open.length + 1)=>(string)=>string || !("" === string || void 0 === string) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
720
|
-
const init = (open, close, replace)=>filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
721
|
-
const colorette_colors = {
|
|
722
|
-
reset: init(0, 0),
|
|
723
|
-
bold: init(1, 22, "\x1b[22m\x1b[1m"),
|
|
724
|
-
dim: init(2, 22, "\x1b[22m\x1b[2m"),
|
|
725
|
-
italic: init(3, 23),
|
|
726
|
-
underline: init(4, 24),
|
|
727
|
-
inverse: init(7, 27),
|
|
728
|
-
hidden: init(8, 28),
|
|
729
|
-
strikethrough: init(9, 29),
|
|
730
|
-
black: init(30, 39),
|
|
731
|
-
red: init(31, 39),
|
|
732
|
-
green: init(32, 39),
|
|
733
|
-
yellow: init(33, 39),
|
|
734
|
-
blue: init(34, 39),
|
|
735
|
-
magenta: init(35, 39),
|
|
736
|
-
cyan: init(36, 39),
|
|
737
|
-
white: init(37, 39),
|
|
738
|
-
gray: init(90, 39),
|
|
739
|
-
bgBlack: init(40, 49),
|
|
740
|
-
bgRed: init(41, 49),
|
|
741
|
-
bgGreen: init(42, 49),
|
|
742
|
-
bgYellow: init(43, 49),
|
|
743
|
-
bgBlue: init(44, 49),
|
|
744
|
-
bgMagenta: init(45, 49),
|
|
745
|
-
bgCyan: init(46, 49),
|
|
746
|
-
bgWhite: init(47, 49),
|
|
747
|
-
blackBright: init(90, 39),
|
|
748
|
-
redBright: init(91, 39),
|
|
749
|
-
greenBright: init(92, 39),
|
|
750
|
-
yellowBright: init(93, 39),
|
|
751
|
-
blueBright: init(94, 39),
|
|
752
|
-
magentaBright: init(95, 39),
|
|
753
|
-
cyanBright: init(96, 39),
|
|
754
|
-
whiteBright: init(97, 39),
|
|
755
|
-
bgBlackBright: init(100, 49),
|
|
756
|
-
bgRedBright: init(101, 49),
|
|
757
|
-
bgGreenBright: init(102, 49),
|
|
758
|
-
bgYellowBright: init(103, 49),
|
|
759
|
-
bgBlueBright: init(104, 49),
|
|
760
|
-
bgMagentaBright: init(105, 49),
|
|
761
|
-
bgCyanBright: init(106, 49),
|
|
762
|
-
bgWhiteBright: init(107, 49)
|
|
763
|
-
};
|
|
764
|
-
const createColors = ({ useColor = isColorSupported } = {})=>useColor ? colorette_colors : Object.keys(colorette_colors).reduce((colors, key)=>({
|
|
765
|
-
...colors,
|
|
766
|
-
[key]: String
|
|
767
|
-
}), {});
|
|
768
|
-
const { reset: colorette_reset, bold, dim, italic, underline, inverse, hidden: colorette_hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = createColors();
|
|
756
|
+
var picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
769
757
|
var external_node_fs_ = __webpack_require__("node:fs");
|
|
770
758
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_);
|
|
771
759
|
const commonOptions = (command)=>command.option("-c, --config <path>", "config file").option("--config-name <name>", "Name(s) of the configuration to use.", {
|
|
@@ -1222,7 +1210,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
1222
1210
|
this.colors = this.createColors();
|
|
1223
1211
|
this.program = program;
|
|
1224
1212
|
program.help();
|
|
1225
|
-
program.version("1.6.0-canary-
|
|
1213
|
+
program.version("1.6.0-canary-0eb13821-20251021173640");
|
|
1226
1214
|
}
|
|
1227
1215
|
async createCompiler(options, rspackCommand, callback) {
|
|
1228
1216
|
let { config, pathMap } = await this.loadConfig(options);
|
|
@@ -1246,11 +1234,9 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
1246
1234
|
return compiler;
|
|
1247
1235
|
}
|
|
1248
1236
|
createColors(useColor) {
|
|
1249
|
-
const shouldUseColor = useColor || isColorSupported;
|
|
1237
|
+
const shouldUseColor = useColor || picocolors.isColorSupported;
|
|
1250
1238
|
return {
|
|
1251
|
-
...createColors(
|
|
1252
|
-
useColor: shouldUseColor
|
|
1253
|
-
}),
|
|
1239
|
+
...(0, picocolors.createColors)(shouldUseColor),
|
|
1254
1240
|
isColorSupported: shouldUseColor
|
|
1255
1241
|
};
|
|
1256
1242
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -4,10 +4,75 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__ from "node:util";
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_events__ from "events";
|
|
7
|
-
import * as __WEBPACK_EXTERNAL_MODULE_tty__ from "tty";
|
|
8
7
|
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
|
|
9
8
|
import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
|
|
10
9
|
var __webpack_modules__ = {
|
|
10
|
+
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": function(module) {
|
|
11
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
12
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
13
|
+
let formatter = (open, close, replace = open)=>(input)=>{
|
|
14
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
15
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
16
|
+
};
|
|
17
|
+
let replaceClose = (string, close, replace, index)=>{
|
|
18
|
+
let result = "", cursor = 0;
|
|
19
|
+
do {
|
|
20
|
+
result += string.substring(cursor, index) + replace;
|
|
21
|
+
cursor = index + close.length;
|
|
22
|
+
index = string.indexOf(close, cursor);
|
|
23
|
+
}while (~index);
|
|
24
|
+
return result + string.substring(cursor);
|
|
25
|
+
};
|
|
26
|
+
let createColors = (enabled = isColorSupported)=>{
|
|
27
|
+
let f = enabled ? formatter : ()=>String;
|
|
28
|
+
return {
|
|
29
|
+
isColorSupported: enabled,
|
|
30
|
+
reset: f("\x1b[0m", "\x1b[0m"),
|
|
31
|
+
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
32
|
+
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
33
|
+
italic: f("\x1b[3m", "\x1b[23m"),
|
|
34
|
+
underline: f("\x1b[4m", "\x1b[24m"),
|
|
35
|
+
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
36
|
+
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
37
|
+
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
38
|
+
black: f("\x1b[30m", "\x1b[39m"),
|
|
39
|
+
red: f("\x1b[31m", "\x1b[39m"),
|
|
40
|
+
green: f("\x1b[32m", "\x1b[39m"),
|
|
41
|
+
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
42
|
+
blue: f("\x1b[34m", "\x1b[39m"),
|
|
43
|
+
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
44
|
+
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
45
|
+
white: f("\x1b[37m", "\x1b[39m"),
|
|
46
|
+
gray: f("\x1b[90m", "\x1b[39m"),
|
|
47
|
+
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
48
|
+
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
49
|
+
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
50
|
+
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
51
|
+
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
52
|
+
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
53
|
+
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
54
|
+
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
55
|
+
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
56
|
+
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
57
|
+
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
58
|
+
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
59
|
+
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
60
|
+
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
61
|
+
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
62
|
+
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
63
|
+
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
64
|
+
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
65
|
+
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
66
|
+
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
67
|
+
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
68
|
+
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
69
|
+
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
70
|
+
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
module.exports = createColors();
|
|
74
|
+
module.exports.createColors = createColors;
|
|
75
|
+
},
|
|
11
76
|
"../../node_modules/.pnpm/pirates@4.0.7/node_modules/pirates/lib/index.js": function(module, exports, __webpack_require__) {
|
|
12
77
|
module = __webpack_require__.nmd(module);
|
|
13
78
|
const BuiltinModule = __webpack_require__("module");
|
|
@@ -653,66 +718,7 @@ class CAC extends __WEBPACK_EXTERNAL_MODULE_events__.EventEmitter {
|
|
|
653
718
|
}
|
|
654
719
|
const cac = (name = "")=>new CAC(name);
|
|
655
720
|
const dist = cac;
|
|
656
|
-
|
|
657
|
-
const isDisabled = "NO_COLOR" in colorette_env || colorette_argv.includes("--no-color");
|
|
658
|
-
const isForced = "FORCE_COLOR" in colorette_env || colorette_argv.includes("--color");
|
|
659
|
-
const isWindows = "win32" === platform;
|
|
660
|
-
const isDumbTerminal = "dumb" === colorette_env.TERM;
|
|
661
|
-
const isCompatibleTerminal = __WEBPACK_EXTERNAL_MODULE_tty__ && __WEBPACK_EXTERNAL_MODULE_tty__.isatty && __WEBPACK_EXTERNAL_MODULE_tty__.isatty(1) && colorette_env.TERM && !isDumbTerminal;
|
|
662
|
-
const isCI = "CI" in colorette_env && ("GITHUB_ACTIONS" in colorette_env || "GITLAB_CI" in colorette_env || "CIRCLECI" in colorette_env);
|
|
663
|
-
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
664
|
-
const replaceClose = (index, string, close, replace, head = string.substring(0, index) + replace, tail = string.substring(index + close.length), next = tail.indexOf(close))=>head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
665
|
-
const clearBleed = (index, string, open, close, replace)=>index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
666
|
-
const filterEmpty = (open, close, replace = open, at = open.length + 1)=>(string)=>string || !("" === string || void 0 === string) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
667
|
-
const init = (open, close, replace)=>filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
668
|
-
const colorette_colors = {
|
|
669
|
-
reset: init(0, 0),
|
|
670
|
-
bold: init(1, 22, "\x1b[22m\x1b[1m"),
|
|
671
|
-
dim: init(2, 22, "\x1b[22m\x1b[2m"),
|
|
672
|
-
italic: init(3, 23),
|
|
673
|
-
underline: init(4, 24),
|
|
674
|
-
inverse: init(7, 27),
|
|
675
|
-
hidden: init(8, 28),
|
|
676
|
-
strikethrough: init(9, 29),
|
|
677
|
-
black: init(30, 39),
|
|
678
|
-
red: init(31, 39),
|
|
679
|
-
green: init(32, 39),
|
|
680
|
-
yellow: init(33, 39),
|
|
681
|
-
blue: init(34, 39),
|
|
682
|
-
magenta: init(35, 39),
|
|
683
|
-
cyan: init(36, 39),
|
|
684
|
-
white: init(37, 39),
|
|
685
|
-
gray: init(90, 39),
|
|
686
|
-
bgBlack: init(40, 49),
|
|
687
|
-
bgRed: init(41, 49),
|
|
688
|
-
bgGreen: init(42, 49),
|
|
689
|
-
bgYellow: init(43, 49),
|
|
690
|
-
bgBlue: init(44, 49),
|
|
691
|
-
bgMagenta: init(45, 49),
|
|
692
|
-
bgCyan: init(46, 49),
|
|
693
|
-
bgWhite: init(47, 49),
|
|
694
|
-
blackBright: init(90, 39),
|
|
695
|
-
redBright: init(91, 39),
|
|
696
|
-
greenBright: init(92, 39),
|
|
697
|
-
yellowBright: init(93, 39),
|
|
698
|
-
blueBright: init(94, 39),
|
|
699
|
-
magentaBright: init(95, 39),
|
|
700
|
-
cyanBright: init(96, 39),
|
|
701
|
-
whiteBright: init(97, 39),
|
|
702
|
-
bgBlackBright: init(100, 49),
|
|
703
|
-
bgRedBright: init(101, 49),
|
|
704
|
-
bgGreenBright: init(102, 49),
|
|
705
|
-
bgYellowBright: init(103, 49),
|
|
706
|
-
bgBlueBright: init(104, 49),
|
|
707
|
-
bgMagentaBright: init(105, 49),
|
|
708
|
-
bgCyanBright: init(106, 49),
|
|
709
|
-
bgWhiteBright: init(107, 49)
|
|
710
|
-
};
|
|
711
|
-
const createColors = ({ useColor = isColorSupported } = {})=>useColor ? colorette_colors : Object.keys(colorette_colors).reduce((colors, key)=>({
|
|
712
|
-
...colors,
|
|
713
|
-
[key]: String
|
|
714
|
-
}), {});
|
|
715
|
-
const { reset: colorette_reset, bold, dim, italic, underline, inverse, hidden: colorette_hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = createColors();
|
|
721
|
+
var picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
716
722
|
var external_node_fs_ = __webpack_require__("node:fs");
|
|
717
723
|
const commonOptions = (command)=>command.option("-c, --config <path>", "config file").option("--config-name <name>", "Name(s) of the configuration to use.", {
|
|
718
724
|
type: [
|
|
@@ -1167,7 +1173,7 @@ class RspackCLI {
|
|
|
1167
1173
|
this.colors = this.createColors();
|
|
1168
1174
|
this.program = program;
|
|
1169
1175
|
program.help();
|
|
1170
|
-
program.version("1.6.0-canary-
|
|
1176
|
+
program.version("1.6.0-canary-0eb13821-20251021173640");
|
|
1171
1177
|
}
|
|
1172
1178
|
async createCompiler(options, rspackCommand, callback) {
|
|
1173
1179
|
let { config, pathMap } = await this.loadConfig(options);
|
|
@@ -1191,11 +1197,9 @@ class RspackCLI {
|
|
|
1191
1197
|
return compiler;
|
|
1192
1198
|
}
|
|
1193
1199
|
createColors(useColor) {
|
|
1194
|
-
const shouldUseColor = useColor || isColorSupported;
|
|
1200
|
+
const shouldUseColor = useColor || picocolors.isColorSupported;
|
|
1195
1201
|
return {
|
|
1196
|
-
...createColors(
|
|
1197
|
-
useColor: shouldUseColor
|
|
1198
|
-
}),
|
|
1202
|
+
...(0, picocolors.createColors)(shouldUseColor),
|
|
1199
1203
|
isColorSupported: shouldUseColor
|
|
1200
1204
|
};
|
|
1201
1205
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { Colorette } from "colorette";
|
|
2
1
|
import type { RspackCLI } from "./cli";
|
|
3
2
|
export type { Configuration } from "@rspack/core";
|
|
4
3
|
export type LogHandler = (value: any) => void;
|
|
5
|
-
export
|
|
4
|
+
export type RspackCLIColors = {
|
|
6
5
|
isColorSupported: boolean;
|
|
7
|
-
}
|
|
6
|
+
} & Omit<typeof import("picocolors"), "createColors">;
|
|
8
7
|
export interface RspackCLILogger {
|
|
9
8
|
error: LogHandler;
|
|
10
9
|
warn: LogHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/cli",
|
|
3
|
-
"version": "1.6.0-canary-
|
|
3
|
+
"version": "1.6.0-canary-0eb13821-20251021173640",
|
|
4
4
|
"description": "CLI for rspack",
|
|
5
5
|
"homepage": "https://rspack.rs",
|
|
6
6
|
"bugs": "https://github.com/web-infra-dev/rspack/issues",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"@rslib/core": "0.15.1",
|
|
38
38
|
"@types/webpack-bundle-analyzer": "^4.7.0",
|
|
39
39
|
"cac": "^6.7.14",
|
|
40
|
-
"colorette": "2.0.20",
|
|
41
40
|
"concat-stream": "^2.0.0",
|
|
42
41
|
"cross-env": "^10.1.0",
|
|
43
42
|
"execa": "^5.1.1",
|
|
43
|
+
"picocolors": "^1.1.1",
|
|
44
44
|
"pirates": "^4.0.7",
|
|
45
45
|
"ts-node": "^10.9.2",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
|
-
"@rspack/
|
|
48
|
-
"@rspack/
|
|
47
|
+
"@rspack/core": "npm:@rspack-canary/core@1.6.0-canary-0eb13821-20251021173640",
|
|
48
|
+
"@rspack/test-tools": "npm:@rspack-canary/test-tools@1.6.0-canary-0eb13821-20251021173640"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@rspack/core": "^1.0.0-alpha || ^1.x"
|