@rspack/dev-server 2.0.0-beta.1 → 2.0.0-beta.2

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.
Files changed (42) hide show
  1. package/README.md +4 -3
  2. package/client/clients/WebSocketClient.d.ts +17 -0
  3. package/client/clients/WebSocketClient.js +28 -28
  4. package/client/index.d.ts +17 -0
  5. package/client/index.js +224 -363
  6. package/client/modules/logger/Logger.d.ts +40 -0
  7. package/client/modules/logger/Logger.js +123 -0
  8. package/client/modules/logger/createConsoleLogger.d.ts +12 -0
  9. package/client/modules/logger/createConsoleLogger.js +119 -0
  10. package/client/modules/logger/index.d.ts +18 -0
  11. package/client/modules/logger/index.js +20 -712
  12. package/client/modules/types.d.ts +45 -0
  13. package/client/modules/types.js +17 -0
  14. package/client/overlay.d.ts +44 -0
  15. package/client/overlay.js +241 -290
  16. package/client/progress.d.ts +11 -0
  17. package/client/progress.js +178 -111
  18. package/client/socket.d.ts +15 -0
  19. package/client/socket.js +19 -46
  20. package/client/utils/ansiHTML.d.ts +30 -0
  21. package/client/utils/ansiHTML.js +106 -153
  22. package/client/utils/log.d.ts +13 -0
  23. package/client/utils/log.js +7 -17
  24. package/client/utils/sendMessage.d.ts +11 -0
  25. package/client/utils/sendMessage.js +6 -15
  26. package/dist/0~launch-editor.js +618 -0
  27. package/dist/0~open.js +547 -0
  28. package/dist/0~p-retry.js +158 -0
  29. package/dist/131.js +1398 -0
  30. package/dist/getPort.d.ts +4 -1
  31. package/dist/index.js +1 -5
  32. package/dist/rslib-runtime.js +66 -0
  33. package/dist/server.d.ts +7 -7
  34. package/dist/servers/WebsocketServer.d.ts +8 -1
  35. package/dist/types.d.ts +7 -5
  36. package/package.json +55 -58
  37. package/dist/config.js +0 -2
  38. package/dist/getPort.js +0 -141
  39. package/dist/server.js +0 -1971
  40. package/dist/servers/BaseServer.js +0 -20
  41. package/dist/servers/WebsocketServer.js +0 -72
  42. package/dist/types.js +0 -5
@@ -0,0 +1,618 @@
1
+ import * as __rspack_external_child_process from "child_process";
2
+ import * as __rspack_external_fs from "fs";
3
+ import * as __rspack_external_os from "os";
4
+ import * as __rspack_external_path from "path";
5
+ import * as __rspack_external_url from "url";
6
+ import { __webpack_require__ } from "./rslib-runtime.js";
7
+ __webpack_require__.add({
8
+ "./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/linux.js" (module) {
9
+ module.exports = {
10
+ atom: 'atom',
11
+ Brackets: 'brackets',
12
+ 'code-insiders': 'code-insiders',
13
+ code: 'code',
14
+ vscodium: 'vscodium',
15
+ codium: 'codium',
16
+ cursor: 'cursor',
17
+ trae: 'trae',
18
+ antigravity: 'antigravity',
19
+ emacs: 'emacs',
20
+ gvim: 'gvim',
21
+ idea: 'idea',
22
+ 'idea.sh': 'idea',
23
+ phpstorm: 'phpstorm',
24
+ 'phpstorm.sh': 'phpstorm',
25
+ pycharm: 'pycharm',
26
+ 'pycharm.sh': 'pycharm',
27
+ rubymine: 'rubymine',
28
+ 'rubymine.sh': 'rubymine',
29
+ sublime_text: 'subl',
30
+ vim: 'vim',
31
+ webstorm: 'webstorm',
32
+ 'webstorm.sh': 'webstorm',
33
+ goland: 'goland',
34
+ 'goland.sh': 'goland',
35
+ rider: 'rider',
36
+ 'rider.sh': 'rider',
37
+ zed: 'zed'
38
+ };
39
+ },
40
+ "./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/macos.js" (module) {
41
+ module.exports = {
42
+ '/Applications/Atom.app/Contents/MacOS/Atom': 'atom',
43
+ '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta': '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
44
+ '/Applications/Brackets.app/Contents/MacOS/Brackets': 'brackets',
45
+ '/Applications/Sublime Text.app/Contents/MacOS/Sublime Text': '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
46
+ '/Applications/Sublime Text.app/Contents/MacOS/sublime_text': '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
47
+ '/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2': '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',
48
+ '/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text': '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl',
49
+ '/Applications/Visual Studio Code.app/Contents/MacOS/Electron': 'code',
50
+ '/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - Insiders': 'code-insiders',
51
+ '/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron': 'code-insiders',
52
+ '/Applications/VSCodium.app/Contents/MacOS/Electron': 'codium',
53
+ '/Applications/Cursor.app/Contents/MacOS/Cursor': 'cursor',
54
+ '/Applications/Trae.app/Contents/MacOS/Electron': 'trae',
55
+ '/Applications/Antigravity.app/Contents/MacOS/Electron': 'antigravity',
56
+ '/Applications/AppCode.app/Contents/MacOS/appcode': '/Applications/AppCode.app/Contents/MacOS/appcode',
57
+ '/Applications/CLion.app/Contents/MacOS/clion': '/Applications/CLion.app/Contents/MacOS/clion',
58
+ '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
59
+ '/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea',
60
+ '/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea',
61
+ '/Applications/PhpStorm.app/Contents/MacOS/phpstorm': '/Applications/PhpStorm.app/Contents/MacOS/phpstorm',
62
+ '/Applications/PyCharm.app/Contents/MacOS/pycharm': '/Applications/PyCharm.app/Contents/MacOS/pycharm',
63
+ '/Applications/PyCharm CE.app/Contents/MacOS/pycharm': '/Applications/PyCharm CE.app/Contents/MacOS/pycharm',
64
+ '/Applications/RubyMine.app/Contents/MacOS/rubymine': '/Applications/RubyMine.app/Contents/MacOS/rubymine',
65
+ '/Applications/WebStorm.app/Contents/MacOS/webstorm': '/Applications/WebStorm.app/Contents/MacOS/webstorm',
66
+ '/Applications/MacVim.app/Contents/MacOS/MacVim': 'mvim',
67
+ '/Applications/GoLand.app/Contents/MacOS/goland': '/Applications/GoLand.app/Contents/MacOS/goland',
68
+ '/Applications/Rider.app/Contents/MacOS/rider': '/Applications/Rider.app/Contents/MacOS/rider',
69
+ '/Applications/Zed.app/Contents/MacOS/zed': 'zed'
70
+ };
71
+ },
72
+ "./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/windows.js" (module) {
73
+ module.exports = [
74
+ 'Brackets.exe',
75
+ 'Code.exe',
76
+ 'Code - Insiders.exe',
77
+ 'VSCodium.exe',
78
+ 'Cursor.exe',
79
+ 'atom.exe',
80
+ 'sublime_text.exe',
81
+ 'notepad++.exe',
82
+ 'clion.exe',
83
+ 'clion64.exe',
84
+ 'idea.exe',
85
+ 'idea64.exe',
86
+ 'phpstorm.exe',
87
+ 'phpstorm64.exe',
88
+ 'pycharm.exe',
89
+ 'pycharm64.exe',
90
+ 'rubymine.exe',
91
+ 'rubymine64.exe',
92
+ 'webstorm.exe',
93
+ 'webstorm64.exe',
94
+ 'goland.exe',
95
+ 'goland64.exe',
96
+ 'rider.exe',
97
+ 'rider64.exe',
98
+ 'trae.exe',
99
+ 'zed.exe',
100
+ 'Antigravity.exe'
101
+ ];
102
+ },
103
+ "./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/get-args.js" (module, __unused_rspack_exports, __webpack_require__) {
104
+ const path = __webpack_require__("path");
105
+ module.exports = function(editor, fileName, lineNumber, columnNumber = 1) {
106
+ const editorBasename = path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '');
107
+ switch(editorBasename){
108
+ case 'atom':
109
+ case 'Atom':
110
+ case 'Atom Beta':
111
+ case 'subl':
112
+ case 'sublime':
113
+ case 'sublime_text':
114
+ case 'wstorm':
115
+ case 'charm':
116
+ case 'zed':
117
+ return [
118
+ `${fileName}:${lineNumber}:${columnNumber}`
119
+ ];
120
+ case 'notepad++':
121
+ return [
122
+ '-n' + lineNumber,
123
+ '-c' + columnNumber,
124
+ fileName
125
+ ];
126
+ case 'vim':
127
+ case 'mvim':
128
+ return [
129
+ `+call cursor(${lineNumber}, ${columnNumber})`,
130
+ fileName
131
+ ];
132
+ case 'joe':
133
+ case 'gvim':
134
+ return [
135
+ `+${lineNumber}`,
136
+ fileName
137
+ ];
138
+ case 'emacs':
139
+ case 'emacsclient':
140
+ return [
141
+ `+${lineNumber}:${columnNumber}`,
142
+ fileName
143
+ ];
144
+ case 'rmate':
145
+ case 'mate':
146
+ case 'mine':
147
+ return [
148
+ '--line',
149
+ lineNumber,
150
+ fileName
151
+ ];
152
+ case 'code':
153
+ case 'Code':
154
+ case 'code-insiders':
155
+ case 'Code - Insiders':
156
+ case 'codium':
157
+ case 'trae':
158
+ case 'antigravity':
159
+ case 'cursor':
160
+ case 'vscodium':
161
+ case 'VSCodium':
162
+ return [
163
+ '-r',
164
+ '-g',
165
+ `${fileName}:${lineNumber}:${columnNumber}`
166
+ ];
167
+ case 'appcode':
168
+ case 'clion':
169
+ case 'clion64':
170
+ case 'idea':
171
+ case 'idea64':
172
+ case 'phpstorm':
173
+ case 'phpstorm64':
174
+ case 'pycharm':
175
+ case 'pycharm64':
176
+ case 'rubymine':
177
+ case 'rubymine64':
178
+ case 'webstorm':
179
+ case 'webstorm64':
180
+ case 'goland':
181
+ case 'goland64':
182
+ case 'rider':
183
+ case 'rider64':
184
+ return [
185
+ '--line',
186
+ lineNumber,
187
+ '--column',
188
+ columnNumber,
189
+ fileName
190
+ ];
191
+ }
192
+ if (process.env.LAUNCH_EDITOR) return [
193
+ fileName,
194
+ lineNumber,
195
+ columnNumber
196
+ ];
197
+ return [
198
+ fileName
199
+ ];
200
+ };
201
+ },
202
+ "./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/guess.js" (module, __unused_rspack_exports, __webpack_require__) {
203
+ const path = __webpack_require__("path");
204
+ const shellQuote = __webpack_require__("./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js");
205
+ const childProcess = __webpack_require__("child_process");
206
+ const COMMON_EDITORS_MACOS = __webpack_require__("./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/macos.js");
207
+ const COMMON_EDITORS_LINUX = __webpack_require__("./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/linux.js");
208
+ const COMMON_EDITORS_WIN = __webpack_require__("./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/windows.js");
209
+ module.exports = function(specifiedEditor) {
210
+ if (specifiedEditor) return shellQuote.parse(specifiedEditor);
211
+ if (process.env.LAUNCH_EDITOR) return [
212
+ process.env.LAUNCH_EDITOR
213
+ ];
214
+ if (process.versions.webcontainer) return [
215
+ process.env.EDITOR || 'code'
216
+ ];
217
+ try {
218
+ if ('darwin' === process.platform) {
219
+ const output = childProcess.execSync('ps x -o comm=', {
220
+ stdio: [
221
+ 'pipe',
222
+ 'pipe',
223
+ 'ignore'
224
+ ]
225
+ }).toString();
226
+ const processNames = Object.keys(COMMON_EDITORS_MACOS);
227
+ const processList = output.split('\n');
228
+ for(let i = 0; i < processNames.length; i++){
229
+ const processName = processNames[i];
230
+ if (processList.includes(processName)) return [
231
+ COMMON_EDITORS_MACOS[processName]
232
+ ];
233
+ const processNameWithoutApplications = processName.replace('/Applications', '');
234
+ if (-1 !== output.indexOf(processNameWithoutApplications)) {
235
+ if (processName !== COMMON_EDITORS_MACOS[processName]) return [
236
+ COMMON_EDITORS_MACOS[processName]
237
+ ];
238
+ const runningProcess = processList.find((procName)=>procName.endsWith(processNameWithoutApplications));
239
+ if (void 0 !== runningProcess) return [
240
+ runningProcess
241
+ ];
242
+ }
243
+ }
244
+ } else if ('win32' === process.platform) {
245
+ const output = childProcess.execSync('powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"', {
246
+ stdio: [
247
+ 'pipe',
248
+ 'pipe',
249
+ 'ignore'
250
+ ]
251
+ }).toString();
252
+ const runningProcesses = output.split('\r\n');
253
+ for(let i = 0; i < runningProcesses.length; i++){
254
+ const fullProcessPath = runningProcesses[i].trim();
255
+ const shortProcessName = path.basename(fullProcessPath);
256
+ if (-1 !== COMMON_EDITORS_WIN.indexOf(shortProcessName)) return [
257
+ fullProcessPath
258
+ ];
259
+ }
260
+ } else if ('linux' === process.platform) {
261
+ const output = childProcess.execSync('ps x --no-heading -o comm --sort=comm', {
262
+ stdio: [
263
+ 'pipe',
264
+ 'pipe',
265
+ 'ignore'
266
+ ]
267
+ }).toString();
268
+ const processNames = Object.keys(COMMON_EDITORS_LINUX);
269
+ for(let i = 0; i < processNames.length; i++){
270
+ const processName = processNames[i];
271
+ if (-1 !== output.indexOf(processName)) return [
272
+ COMMON_EDITORS_LINUX[processName]
273
+ ];
274
+ }
275
+ }
276
+ } catch (ignoreError) {}
277
+ if (process.env.VISUAL) return [
278
+ process.env.VISUAL
279
+ ];
280
+ if (process.env.EDITOR) return [
281
+ process.env.EDITOR
282
+ ];
283
+ return [
284
+ null
285
+ ];
286
+ };
287
+ },
288
+ "./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/index.js" (module, __unused_rspack_exports, __webpack_require__) {
289
+ const fs = __webpack_require__("fs");
290
+ const os = __webpack_require__("os");
291
+ const path = __webpack_require__("path");
292
+ const colors = __webpack_require__("./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
293
+ const childProcess = __webpack_require__("child_process");
294
+ const guessEditor = __webpack_require__("./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/guess.js");
295
+ const getArgumentsForPosition = __webpack_require__("./node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/get-args.js");
296
+ function wrapErrorCallback(cb) {
297
+ return (fileName, errorMessage)=>{
298
+ console.log();
299
+ console.log(colors.red('Could not open ' + path.basename(fileName) + ' in the editor.'));
300
+ if (errorMessage) {
301
+ if ('.' !== errorMessage[errorMessage.length - 1]) errorMessage += '.';
302
+ console.log(colors.red('The editor process exited with an error: ' + errorMessage));
303
+ }
304
+ console.log();
305
+ if (cb) cb(fileName, errorMessage);
306
+ };
307
+ }
308
+ function isTerminalEditor(editor) {
309
+ switch(editor){
310
+ case 'vim':
311
+ case 'emacs':
312
+ case 'nano':
313
+ return true;
314
+ }
315
+ return false;
316
+ }
317
+ const positionRE = /:(\d+)(:(\d+))?$/;
318
+ function parseFile(file) {
319
+ if (file.startsWith('file://')) file = __webpack_require__("url").fileURLToPath(file);
320
+ const fileName = file.replace(positionRE, '');
321
+ const match = file.match(positionRE);
322
+ const lineNumber = match && match[1];
323
+ const columnNumber = match && match[3];
324
+ return {
325
+ fileName,
326
+ lineNumber,
327
+ columnNumber
328
+ };
329
+ }
330
+ let _childProcess = null;
331
+ function launchEditor(file, specifiedEditor, onErrorCallback) {
332
+ const parsed = parseFile(file);
333
+ let { fileName } = parsed;
334
+ const { lineNumber, columnNumber } = parsed;
335
+ if (!fs.existsSync(fileName)) return;
336
+ if ('function' == typeof specifiedEditor) {
337
+ onErrorCallback = specifiedEditor;
338
+ specifiedEditor = void 0;
339
+ }
340
+ onErrorCallback = wrapErrorCallback(onErrorCallback);
341
+ const [editor, ...args] = guessEditor(specifiedEditor);
342
+ if (!editor) return void onErrorCallback(fileName, null);
343
+ if ('linux' === process.platform && fileName.startsWith('/mnt/') && /Microsoft/i.test(os.release())) fileName = path.relative('', fileName);
344
+ if (lineNumber) {
345
+ const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber);
346
+ args.push.apply(args, extraArgs);
347
+ } else args.push(fileName);
348
+ if (_childProcess && isTerminalEditor(editor)) _childProcess.kill('SIGKILL');
349
+ if ('win32' === process.platform) {
350
+ function escapeCmdArgs(cmdArgs) {
351
+ return cmdArgs.replace(/([&|<>,;=^])/g, '^$1');
352
+ }
353
+ function doubleQuoteIfNeeded(str) {
354
+ if (str.includes('^')) return `^"${str}^"`;
355
+ if (str.includes(' ')) return `"${str}"`;
356
+ return str;
357
+ }
358
+ const launchCommand = [
359
+ editor,
360
+ ...args.map(escapeCmdArgs)
361
+ ].map(doubleQuoteIfNeeded).join(' ');
362
+ _childProcess = childProcess.exec(launchCommand, {
363
+ stdio: 'inherit',
364
+ shell: true
365
+ });
366
+ } else _childProcess = childProcess.spawn(editor, args, {
367
+ stdio: 'inherit'
368
+ });
369
+ _childProcess.on('exit', function(errorCode) {
370
+ _childProcess = null;
371
+ if (errorCode) onErrorCallback(fileName, '(code ' + errorCode + ')');
372
+ });
373
+ _childProcess.on('error', function(error) {
374
+ let { code, message } = error;
375
+ if ('ENOENT' === code) message = `${message} ('${editor}' command does not exist in 'PATH')`;
376
+ onErrorCallback(fileName, message);
377
+ });
378
+ }
379
+ module.exports = launchEditor;
380
+ },
381
+ "./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
382
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
383
+ 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);
384
+ let formatter = (open, close, replace = open)=>(input)=>{
385
+ let string = "" + input, index = string.indexOf(close, open.length);
386
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
387
+ };
388
+ let replaceClose = (string, close, replace, index)=>{
389
+ let result = "", cursor = 0;
390
+ do {
391
+ result += string.substring(cursor, index) + replace;
392
+ cursor = index + close.length;
393
+ index = string.indexOf(close, cursor);
394
+ }while (~index);
395
+ return result + string.substring(cursor);
396
+ };
397
+ let createColors = (enabled = isColorSupported)=>{
398
+ let f = enabled ? formatter : ()=>String;
399
+ return {
400
+ isColorSupported: enabled,
401
+ reset: f("\x1b[0m", "\x1b[0m"),
402
+ bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
403
+ dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
404
+ italic: f("\x1b[3m", "\x1b[23m"),
405
+ underline: f("\x1b[4m", "\x1b[24m"),
406
+ inverse: f("\x1b[7m", "\x1b[27m"),
407
+ hidden: f("\x1b[8m", "\x1b[28m"),
408
+ strikethrough: f("\x1b[9m", "\x1b[29m"),
409
+ black: f("\x1b[30m", "\x1b[39m"),
410
+ red: f("\x1b[31m", "\x1b[39m"),
411
+ green: f("\x1b[32m", "\x1b[39m"),
412
+ yellow: f("\x1b[33m", "\x1b[39m"),
413
+ blue: f("\x1b[34m", "\x1b[39m"),
414
+ magenta: f("\x1b[35m", "\x1b[39m"),
415
+ cyan: f("\x1b[36m", "\x1b[39m"),
416
+ white: f("\x1b[37m", "\x1b[39m"),
417
+ gray: f("\x1b[90m", "\x1b[39m"),
418
+ bgBlack: f("\x1b[40m", "\x1b[49m"),
419
+ bgRed: f("\x1b[41m", "\x1b[49m"),
420
+ bgGreen: f("\x1b[42m", "\x1b[49m"),
421
+ bgYellow: f("\x1b[43m", "\x1b[49m"),
422
+ bgBlue: f("\x1b[44m", "\x1b[49m"),
423
+ bgMagenta: f("\x1b[45m", "\x1b[49m"),
424
+ bgCyan: f("\x1b[46m", "\x1b[49m"),
425
+ bgWhite: f("\x1b[47m", "\x1b[49m"),
426
+ blackBright: f("\x1b[90m", "\x1b[39m"),
427
+ redBright: f("\x1b[91m", "\x1b[39m"),
428
+ greenBright: f("\x1b[92m", "\x1b[39m"),
429
+ yellowBright: f("\x1b[93m", "\x1b[39m"),
430
+ blueBright: f("\x1b[94m", "\x1b[39m"),
431
+ magentaBright: f("\x1b[95m", "\x1b[39m"),
432
+ cyanBright: f("\x1b[96m", "\x1b[39m"),
433
+ whiteBright: f("\x1b[97m", "\x1b[39m"),
434
+ bgBlackBright: f("\x1b[100m", "\x1b[49m"),
435
+ bgRedBright: f("\x1b[101m", "\x1b[49m"),
436
+ bgGreenBright: f("\x1b[102m", "\x1b[49m"),
437
+ bgYellowBright: f("\x1b[103m", "\x1b[49m"),
438
+ bgBlueBright: f("\x1b[104m", "\x1b[49m"),
439
+ bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
440
+ bgCyanBright: f("\x1b[106m", "\x1b[49m"),
441
+ bgWhiteBright: f("\x1b[107m", "\x1b[49m")
442
+ };
443
+ };
444
+ module.exports = createColors();
445
+ module.exports.createColors = createColors;
446
+ },
447
+ "./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js" (__unused_rspack_module, exports, __webpack_require__) {
448
+ exports.quote = __webpack_require__("./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js");
449
+ exports.parse = __webpack_require__("./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js");
450
+ },
451
+ "./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js" (module) {
452
+ var CONTROL = "(?:\\|\\||\\&\\&|;;|\\|\\&|\\<\\(|\\<\\<\\<|>>|>\\&|<\\&|[&;()|<>])";
453
+ var controlRE = new RegExp('^' + CONTROL + '$');
454
+ var META = '|&;()<> \\t';
455
+ var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
456
+ var DOUBLE_QUOTE = '\'((\\\\\'|[^\'])*?)\'';
457
+ var hash = /^#$/;
458
+ var SQ = "'";
459
+ var DQ = '"';
460
+ var DS = '$';
461
+ var TOKEN = '';
462
+ var mult = 0x100000000;
463
+ for(var i = 0; i < 4; i++)TOKEN += (mult * Math.random()).toString(16);
464
+ var startsWithToken = new RegExp('^' + TOKEN);
465
+ function matchAll(s, r) {
466
+ var origIndex = r.lastIndex;
467
+ var matches = [];
468
+ var matchObj;
469
+ while(matchObj = r.exec(s)){
470
+ matches.push(matchObj);
471
+ if (r.lastIndex === matchObj.index) r.lastIndex += 1;
472
+ }
473
+ r.lastIndex = origIndex;
474
+ return matches;
475
+ }
476
+ function getVar(env, pre, key) {
477
+ var r = 'function' == typeof env ? env(key) : env[key];
478
+ if (void 0 === r && '' != key) r = '';
479
+ else if (void 0 === r) r = '$';
480
+ if ('object' == typeof r) return pre + TOKEN + JSON.stringify(r) + TOKEN;
481
+ return pre + r;
482
+ }
483
+ function parseInternal(string, env, opts) {
484
+ if (!opts) opts = {};
485
+ var BS = opts.escape || '\\';
486
+ var BAREWORD = '(\\' + BS + '[\'"' + META + ']|[^\\s\'"' + META + '])+';
487
+ var chunker = new RegExp([
488
+ '(' + CONTROL + ')',
489
+ '(' + BAREWORD + '|' + SINGLE_QUOTE + '|' + DOUBLE_QUOTE + ')+'
490
+ ].join('|'), 'g');
491
+ var matches = matchAll(string, chunker);
492
+ if (0 === matches.length) return [];
493
+ if (!env) env = {};
494
+ var commented = false;
495
+ return matches.map(function(match) {
496
+ var s = match[0];
497
+ if (!s || commented) return;
498
+ if (controlRE.test(s)) return {
499
+ op: s
500
+ };
501
+ var quote = false;
502
+ var esc = false;
503
+ var out = '';
504
+ var isGlob = false;
505
+ var i;
506
+ function parseEnvVar() {
507
+ i += 1;
508
+ var varend;
509
+ var varname;
510
+ var char = s.charAt(i);
511
+ if ('{' === char) {
512
+ i += 1;
513
+ if ('}' === s.charAt(i)) throw new Error('Bad substitution: ' + s.slice(i - 2, i + 1));
514
+ varend = s.indexOf('}', i);
515
+ if (varend < 0) throw new Error('Bad substitution: ' + s.slice(i));
516
+ varname = s.slice(i, varend);
517
+ i = varend;
518
+ } else if (/[*@#?$!_-]/.test(char)) {
519
+ varname = char;
520
+ i += 1;
521
+ } else {
522
+ var slicedFromI = s.slice(i);
523
+ varend = slicedFromI.match(/[^\w\d_]/);
524
+ if (varend) {
525
+ varname = slicedFromI.slice(0, varend.index);
526
+ i += varend.index - 1;
527
+ } else {
528
+ varname = slicedFromI;
529
+ i = s.length;
530
+ }
531
+ }
532
+ return getVar(env, '', varname);
533
+ }
534
+ for(i = 0; i < s.length; i++){
535
+ var c = s.charAt(i);
536
+ isGlob = isGlob || !quote && ('*' === c || '?' === c);
537
+ if (esc) {
538
+ out += c;
539
+ esc = false;
540
+ } else if (quote) if (c === quote) quote = false;
541
+ else if (quote == SQ) out += c;
542
+ else if (c === BS) {
543
+ i += 1;
544
+ c = s.charAt(i);
545
+ if (c === DQ || c === BS || c === DS) out += c;
546
+ else out += BS + c;
547
+ } else if (c === DS) out += parseEnvVar();
548
+ else out += c;
549
+ else if (c === DQ || c === SQ) quote = c;
550
+ else if (controlRE.test(c)) return {
551
+ op: s
552
+ };
553
+ else if (hash.test(c)) {
554
+ commented = true;
555
+ var commentObj = {
556
+ comment: string.slice(match.index + i + 1)
557
+ };
558
+ if (out.length) return [
559
+ out,
560
+ commentObj
561
+ ];
562
+ return [
563
+ commentObj
564
+ ];
565
+ } else if (c === BS) esc = true;
566
+ else if (c === DS) out += parseEnvVar();
567
+ else out += c;
568
+ }
569
+ if (isGlob) return {
570
+ op: 'glob',
571
+ pattern: out
572
+ };
573
+ return out;
574
+ }).reduce(function(prev, arg) {
575
+ return void 0 === arg ? prev : prev.concat(arg);
576
+ }, []);
577
+ }
578
+ module.exports = function(s, env, opts) {
579
+ var mapped = parseInternal(s, env, opts);
580
+ if ('function' != typeof env) return mapped;
581
+ return mapped.reduce(function(acc, s) {
582
+ if ('object' == typeof s) return acc.concat(s);
583
+ var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g'));
584
+ if (1 === xs.length) return acc.concat(xs[0]);
585
+ return acc.concat(xs.filter(Boolean).map(function(x) {
586
+ if (startsWithToken.test(x)) return JSON.parse(x.split(TOKEN)[1]);
587
+ return x;
588
+ }));
589
+ }, []);
590
+ };
591
+ },
592
+ "./node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js" (module) {
593
+ module.exports = function(xs) {
594
+ return xs.map(function(s) {
595
+ if ('' === s) return '\'\'';
596
+ if (s && 'object' == typeof s) return s.op.replace(/(.)/g, '\\$1');
597
+ if (/["\s\\]/.test(s) && !/'/.test(s)) return "'" + s.replace(/(['])/g, '\\$1') + "'";
598
+ if (/["'\s]/.test(s)) return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
599
+ return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, '$1\\$2');
600
+ }).join(' ');
601
+ };
602
+ },
603
+ child_process (module) {
604
+ module.exports = __rspack_external_child_process;
605
+ },
606
+ fs (module) {
607
+ module.exports = __rspack_external_fs;
608
+ },
609
+ os (module) {
610
+ module.exports = __rspack_external_os;
611
+ },
612
+ path (module) {
613
+ module.exports = __rspack_external_path;
614
+ },
615
+ url (module) {
616
+ module.exports = __rspack_external_url;
617
+ }
618
+ });