@rspack/dev-server 2.2.1 → 2.2.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.
- package/client/index.js +8 -6
- package/dist/{0~chokidar.js → chokidar~0.js} +3 -3
- package/dist/{0~connect-history-api-fallback.js → connect-history-api-fallback~0.js} +8 -8
- package/dist/{0~connect-next.js → connect-next~0.js} +1 -1
- package/dist/{0~debug.js → debug~0.js} +8 -7
- package/dist/{0~http-proxy-middleware.js → http-proxy-middleware~0.js} +32 -24
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -1
- package/dist/{0~launch-editor.js → launch-editor~0.js} +225 -99
- package/dist/{0~open.js → open~0.js} +14 -10
- package/dist/{0~serve-static.js → serve-static~0.js} +22 -20
- package/dist/{619.js → t~0.js} +119 -156
- package/package.json +23 -40
- /package/dist/{0~chokidar.js.LICENSE.txt → chokidar~0.js.LICENSE.txt} +0 -0
- /package/dist/{0~connect-next.js.LICENSE.txt → connect-next~0.js.LICENSE.txt} +0 -0
- /package/dist/{0~http-proxy-middleware.js.LICENSE.txt → http-proxy-middleware~0.js.LICENSE.txt} +0 -0
- /package/dist/{0~p-retry.js → p-retry~0.js} +0 -0
- /package/dist/{0~serve-static.js.LICENSE.txt → serve-static~0.js.LICENSE.txt} +0 -0
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
import { __webpack_require__ } from "./
|
|
2
|
-
import "
|
|
1
|
+
import { __webpack_require__ } from "./t~0.js";
|
|
2
|
+
import { createRequire as __rspack_createRequire } from "node:module";
|
|
3
|
+
const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
3
4
|
__webpack_require__.add({
|
|
4
|
-
"./node_modules/.pnpm/launch-editor@2.14.
|
|
5
|
+
"./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/construct-windows-launch-command.js" (module) {
|
|
6
|
+
function escapeCmdArgs(cmdArgs) {
|
|
7
|
+
return cmdArgs.replace(/([&|<>,;=^])/g, '^$1');
|
|
8
|
+
}
|
|
9
|
+
function doubleQuoteIfNeeded(str) {
|
|
10
|
+
if (str.includes('^')) return `^"${str}^"`;
|
|
11
|
+
else if (str.includes(' ')) return `"${str}"`;
|
|
12
|
+
return str;
|
|
13
|
+
}
|
|
14
|
+
function constructWindowsLaunchCommand(editor, args) {
|
|
15
|
+
if (args.some((arg)=>/[\r\n]/.test(arg))) throw new Error('Cannot launch an editor with an argument containing a line break');
|
|
16
|
+
if (args.some((arg)=>arg.includes('%'))) throw new Error('Cannot launch an editor with an argument containing "%"');
|
|
17
|
+
return [
|
|
18
|
+
editor,
|
|
19
|
+
...args.map(escapeCmdArgs)
|
|
20
|
+
].map(doubleQuoteIfNeeded).join(' ');
|
|
21
|
+
}
|
|
22
|
+
module.exports = constructWindowsLaunchCommand;
|
|
23
|
+
},
|
|
24
|
+
"./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/linux.js" (module) {
|
|
5
25
|
module.exports = {
|
|
6
26
|
atom: 'atom',
|
|
7
27
|
Brackets: 'brackets',
|
|
@@ -33,7 +53,7 @@ __webpack_require__.add({
|
|
|
33
53
|
zed: 'zed'
|
|
34
54
|
};
|
|
35
55
|
},
|
|
36
|
-
"./node_modules/.pnpm/launch-editor@2.14.
|
|
56
|
+
"./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/macos.js" (module) {
|
|
37
57
|
module.exports = {
|
|
38
58
|
'/Applications/Atom.app/Contents/MacOS/Atom': 'atom',
|
|
39
59
|
'/Applications/Atom Beta.app/Contents/MacOS/Atom Beta': '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
|
|
@@ -66,7 +86,7 @@ __webpack_require__.add({
|
|
|
66
86
|
'/Applications/Zed.app/Contents/MacOS/zed': 'zed'
|
|
67
87
|
};
|
|
68
88
|
},
|
|
69
|
-
"./node_modules/.pnpm/launch-editor@2.14.
|
|
89
|
+
"./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/windows.js" (module) {
|
|
70
90
|
module.exports = [
|
|
71
91
|
'Brackets.exe',
|
|
72
92
|
'Code.exe',
|
|
@@ -97,9 +117,15 @@ __webpack_require__.add({
|
|
|
97
117
|
'Antigravity.exe'
|
|
98
118
|
];
|
|
99
119
|
},
|
|
100
|
-
"./node_modules/.pnpm/launch-editor@2.14.
|
|
101
|
-
const
|
|
120
|
+
"./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/get-args.js" (module) {
|
|
121
|
+
const os = __rspack_createRequire_require("os");
|
|
122
|
+
const path = __rspack_createRequire_require("path");
|
|
102
123
|
module.exports = function(editor, fileName, lineNumber, columnNumber = 1) {
|
|
124
|
+
fileName = path.resolve(fileName);
|
|
125
|
+
if ('linux' === process.platform && fileName.startsWith('/mnt/') && /Microsoft/i.test(os.release())) fileName = `./${path.relative('', fileName)}`;
|
|
126
|
+
if (!lineNumber) return [
|
|
127
|
+
fileName
|
|
128
|
+
];
|
|
103
129
|
const editorBasename = path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '');
|
|
104
130
|
switch(editorBasename){
|
|
105
131
|
case 'atom':
|
|
@@ -196,13 +222,13 @@ __webpack_require__.add({
|
|
|
196
222
|
];
|
|
197
223
|
};
|
|
198
224
|
},
|
|
199
|
-
"./node_modules/.pnpm/launch-editor@2.14.
|
|
200
|
-
const path =
|
|
201
|
-
const shellQuote = __webpack_require__("./node_modules/.pnpm/shell-quote@1.
|
|
202
|
-
const childProcess =
|
|
203
|
-
const COMMON_EDITORS_MACOS = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.
|
|
204
|
-
const COMMON_EDITORS_LINUX = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.
|
|
205
|
-
const COMMON_EDITORS_WIN = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.
|
|
225
|
+
"./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/guess.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
226
|
+
const path = __rspack_createRequire_require("path");
|
|
227
|
+
const shellQuote = __webpack_require__("./node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/index.js");
|
|
228
|
+
const childProcess = __rspack_createRequire_require("child_process");
|
|
229
|
+
const COMMON_EDITORS_MACOS = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/macos.js");
|
|
230
|
+
const COMMON_EDITORS_LINUX = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/linux.js");
|
|
231
|
+
const COMMON_EDITORS_WIN = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/editor-info/windows.js");
|
|
206
232
|
function getEditorFromMacProcesses(output) {
|
|
207
233
|
const processNames = Object.keys(COMMON_EDITORS_MACOS);
|
|
208
234
|
const processList = output.split('\n');
|
|
@@ -282,7 +308,7 @@ __webpack_require__.add({
|
|
|
282
308
|
if (process.env.VISUAL) return [
|
|
283
309
|
process.env.VISUAL
|
|
284
310
|
];
|
|
285
|
-
if (process.env.EDITOR) return [
|
|
311
|
+
else if (process.env.EDITOR) return [
|
|
286
312
|
process.env.EDITOR
|
|
287
313
|
];
|
|
288
314
|
return [
|
|
@@ -294,14 +320,15 @@ __webpack_require__.add({
|
|
|
294
320
|
module.exports.getEditorFromWindowsProcesses = getEditorFromWindowsProcesses;
|
|
295
321
|
module.exports.getEditorFromLinuxProcesses = getEditorFromLinuxProcesses;
|
|
296
322
|
},
|
|
297
|
-
"./node_modules/.pnpm/launch-editor@2.14.
|
|
298
|
-
const fs =
|
|
299
|
-
const
|
|
300
|
-
const path = __webpack_require__("path");
|
|
323
|
+
"./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
324
|
+
const fs = __rspack_createRequire_require("fs");
|
|
325
|
+
const path = __rspack_createRequire_require("path");
|
|
301
326
|
const colors = __webpack_require__("./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
302
|
-
const childProcess =
|
|
303
|
-
const guessEditor = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.
|
|
304
|
-
const
|
|
327
|
+
const childProcess = __rspack_createRequire_require("child_process");
|
|
328
|
+
const guessEditor = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/guess.js");
|
|
329
|
+
const getArgumentsForFile = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/get-args.js");
|
|
330
|
+
const constructWindowsLaunchCommand = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/construct-windows-launch-command.js");
|
|
331
|
+
const parseFile = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/parse-file.js");
|
|
305
332
|
function wrapErrorCallback(cb) {
|
|
306
333
|
return (fileName, errorMessage)=>{
|
|
307
334
|
console.log();
|
|
@@ -323,57 +350,32 @@ __webpack_require__.add({
|
|
|
323
350
|
}
|
|
324
351
|
return false;
|
|
325
352
|
}
|
|
326
|
-
const positionRE = /:(\d+)(:(\d+))?$/;
|
|
327
|
-
function parseFile(file) {
|
|
328
|
-
if (file.startsWith('file://')) file = __webpack_require__("url?b918").fileURLToPath(file);
|
|
329
|
-
const fileName = file.replace(positionRE, '');
|
|
330
|
-
const match = file.match(positionRE);
|
|
331
|
-
const lineNumber = match && match[1];
|
|
332
|
-
const columnNumber = match && match[3];
|
|
333
|
-
return {
|
|
334
|
-
fileName,
|
|
335
|
-
lineNumber,
|
|
336
|
-
columnNumber
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
353
|
let currentChildProcess = null;
|
|
340
354
|
function launchEditor(file, specifiedEditor, onErrorCallback) {
|
|
341
|
-
const
|
|
342
|
-
let { fileName } = parsed;
|
|
343
|
-
const { lineNumber, columnNumber } = parsed;
|
|
344
|
-
if ('win32' === process.platform && path.resolve(fileName).startsWith('\\\\')) return onErrorCallback(fileName, "UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");
|
|
345
|
-
if (!fs.existsSync(fileName)) return;
|
|
355
|
+
const { fileName, lineNumber, columnNumber } = parseFile(file);
|
|
346
356
|
if ('function' == typeof specifiedEditor) {
|
|
347
357
|
onErrorCallback = specifiedEditor;
|
|
348
358
|
specifiedEditor = void 0;
|
|
349
359
|
}
|
|
350
360
|
onErrorCallback = wrapErrorCallback(onErrorCallback);
|
|
361
|
+
if ('win32' === process.platform && fileName.startsWith('\\\\')) return onErrorCallback(fileName, "UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");
|
|
362
|
+
if (!fs.existsSync(fileName)) return;
|
|
351
363
|
const [editor, ...args] = guessEditor(specifiedEditor);
|
|
352
364
|
if (!editor) return void onErrorCallback(fileName, null);
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
365
|
+
const extraArgs = getArgumentsForFile(editor, fileName, lineNumber, columnNumber);
|
|
366
|
+
args.push.apply(args, extraArgs);
|
|
367
|
+
let launchCommand;
|
|
368
|
+
if ('win32' === process.platform) try {
|
|
369
|
+
launchCommand = constructWindowsLaunchCommand(editor, args);
|
|
370
|
+
} catch (error) {
|
|
371
|
+
onErrorCallback(fileName, error.message);
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
358
374
|
if (currentChildProcess && isTerminalEditor(editor)) currentChildProcess.kill('SIGKILL');
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
function doubleQuoteIfNeeded(str) {
|
|
364
|
-
if (str.includes('^')) return `^"${str}^"`;
|
|
365
|
-
if (str.includes(' ')) return `"${str}"`;
|
|
366
|
-
return str;
|
|
367
|
-
}
|
|
368
|
-
const launchCommand = [
|
|
369
|
-
editor,
|
|
370
|
-
...args.map(escapeCmdArgs)
|
|
371
|
-
].map(doubleQuoteIfNeeded).join(' ');
|
|
372
|
-
currentChildProcess = childProcess.exec(launchCommand, {
|
|
373
|
-
stdio: 'inherit',
|
|
374
|
-
shell: true
|
|
375
|
-
});
|
|
376
|
-
} else currentChildProcess = childProcess.spawn(editor, args, {
|
|
375
|
+
currentChildProcess = 'win32' === process.platform ? childProcess.exec(launchCommand, {
|
|
376
|
+
stdio: 'inherit',
|
|
377
|
+
shell: true
|
|
378
|
+
}) : childProcess.spawn(editor, args, {
|
|
377
379
|
stdio: 'inherit'
|
|
378
380
|
});
|
|
379
381
|
currentChildProcess.on('exit', function(errorCode) {
|
|
@@ -388,6 +390,23 @@ __webpack_require__.add({
|
|
|
388
390
|
}
|
|
389
391
|
module.exports = launchEditor;
|
|
390
392
|
},
|
|
393
|
+
"./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/parse-file.js" (module) {
|
|
394
|
+
const path = __rspack_createRequire_require("path");
|
|
395
|
+
const positionRE = /:(\d+)(:(\d+))?$/;
|
|
396
|
+
module.exports = function(file) {
|
|
397
|
+
if (file.startsWith('file://')) file = __rspack_createRequire_require("url").fileURLToPath(file);
|
|
398
|
+
const unresolvedFileName = file.replace(positionRE, '');
|
|
399
|
+
const fileName = unresolvedFileName ? path.resolve(unresolvedFileName) : '';
|
|
400
|
+
const match = file.match(positionRE);
|
|
401
|
+
const lineNumber = match && match[1];
|
|
402
|
+
const columnNumber = match && match[3];
|
|
403
|
+
return {
|
|
404
|
+
fileName,
|
|
405
|
+
lineNumber,
|
|
406
|
+
columnNumber
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
},
|
|
391
410
|
"./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
392
411
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
393
412
|
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);
|
|
@@ -454,16 +473,20 @@ __webpack_require__.add({
|
|
|
454
473
|
module.exports = createColors();
|
|
455
474
|
module.exports.createColors = createColors;
|
|
456
475
|
},
|
|
457
|
-
"./node_modules/.pnpm/shell-quote@1.
|
|
458
|
-
__webpack_require__("./node_modules/.pnpm/shell-quote@1.
|
|
459
|
-
exports.parse = __webpack_require__("./node_modules/.pnpm/shell-quote@1.
|
|
476
|
+
"./node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
477
|
+
__webpack_require__("./node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/quote.js");
|
|
478
|
+
exports.parse = __webpack_require__("./node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/parse.js");
|
|
460
479
|
},
|
|
461
|
-
"./node_modules/.pnpm/shell-quote@1.
|
|
462
|
-
var CONTROL = "(
|
|
480
|
+
"./node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/parse.js" (module) {
|
|
481
|
+
var CONTROL = "(?:\\|\\||\\&(?:\\&|>>?)|;;\\&?|[;|]\\&|\\<\\(|\\<\\<\\<|\\<\\<-|\\<\\<(?!\\()|>>|>[&|(]|<[&>]|[&;()|<>])";
|
|
463
482
|
var controlRE = new RegExp('^' + CONTROL + '$');
|
|
464
483
|
var META = '|&;()<> \\t';
|
|
465
|
-
var SINGLE_QUOTE = '
|
|
466
|
-
var
|
|
484
|
+
var SINGLE_QUOTE = '\'([^\']*?)\'';
|
|
485
|
+
var ANSI_C_BODY = '(?:\\\\[\\s\\S]|[^\\\\\'])*?';
|
|
486
|
+
var ANSI_C_QUOTE = '\\$\'' + ANSI_C_BODY + '\'';
|
|
487
|
+
var ansiCAt = new RegExp('\\$\'' + ANSI_C_BODY + '(?:(\')|\\\\?$)', 'g');
|
|
488
|
+
var ANSI_C_LETTERS = 'abeEfnrtv';
|
|
489
|
+
var ANSI_C_CHARS = '\x07\b\x1B\x1B\f\n\r\t\v';
|
|
467
490
|
var hash = /^#$/;
|
|
468
491
|
var SQ = "'";
|
|
469
492
|
var DQ = '"';
|
|
@@ -477,7 +500,7 @@ __webpack_require__.add({
|
|
|
477
500
|
var matches = [];
|
|
478
501
|
var matchObj;
|
|
479
502
|
while(matchObj = r.exec(s)){
|
|
480
|
-
matches.
|
|
503
|
+
matches[matches.length] = matchObj;
|
|
481
504
|
if (r.lastIndex === matchObj.index) r.lastIndex += 1;
|
|
482
505
|
}
|
|
483
506
|
r.lastIndex = origIndex;
|
|
@@ -490,13 +513,43 @@ __webpack_require__.add({
|
|
|
490
513
|
if ('object' == typeof r) return pre + TOKEN + JSON.stringify(r) + TOKEN;
|
|
491
514
|
return pre + r;
|
|
492
515
|
}
|
|
516
|
+
var ansiCEscape = /\\([0-7]{1,3}|x[\dA-Fa-f]{1,2}|u[\dA-Fa-f]{1,4}|U[\dA-Fa-f]{1,8}|c(?:\\\\|[\s\S])|[abeEfnrtv\\'"?])/g;
|
|
517
|
+
function expandAnsiCEscape(m, escape) {
|
|
518
|
+
var kind = escape.charAt(0);
|
|
519
|
+
if ('c' === kind) {
|
|
520
|
+
var ctrl = escape.charAt(1);
|
|
521
|
+
return '?' === ctrl ? '\x7F' : String.fromCharCode(0x1F & ctrl.charCodeAt(0));
|
|
522
|
+
}
|
|
523
|
+
if ('x' === kind || 'u' === kind || 'U' === kind) {
|
|
524
|
+
var cp = parseInt(escape.slice(1), 16);
|
|
525
|
+
if (cp > 0x10FFFF) return m;
|
|
526
|
+
return String.fromCharCode.apply(null, cp > 0xFFFF ? [
|
|
527
|
+
0xD7C0 + (cp >> 10),
|
|
528
|
+
0xDC00 + (0x3FF & cp)
|
|
529
|
+
] : [
|
|
530
|
+
cp
|
|
531
|
+
]);
|
|
532
|
+
}
|
|
533
|
+
if (kind >= '0' && kind <= '7') return String.fromCharCode(0xFF & parseInt(escape, 8));
|
|
534
|
+
var letter = ANSI_C_LETTERS.indexOf(escape);
|
|
535
|
+
return letter < 0 ? escape : ANSI_C_CHARS.charAt(letter);
|
|
536
|
+
}
|
|
537
|
+
function expandAnsiC(body) {
|
|
538
|
+
return body.replace(ansiCEscape, expandAnsiCEscape).split('\0')[0];
|
|
539
|
+
}
|
|
540
|
+
function closesAnsiC(s, i) {
|
|
541
|
+
ansiCAt.lastIndex = i;
|
|
542
|
+
return !!ansiCAt.exec(s)[1];
|
|
543
|
+
}
|
|
493
544
|
function parseInternal(string, env, opts) {
|
|
494
545
|
if (!opts) opts = {};
|
|
495
546
|
var BS = opts.escape || '\\';
|
|
496
|
-
var
|
|
547
|
+
var ifs = true === opts.splitUnquoted ? ' \t\n' : 'string' == typeof opts.splitUnquoted ? opts.splitUnquoted : '';
|
|
548
|
+
var BAREWORD = '(\\' + BS + '[\'"$\\' + BS + META + ']|\\$\\$|\\$(?!' + ANSI_C_QUOTE.slice(2) + ')|[^\\s\'"$' + META + '])+';
|
|
549
|
+
var DOUBLE_QUOTE = '"(?:\\' + BS + '[\\s\\S]|[^"\\' + BS + '])*"';
|
|
497
550
|
var chunker = new RegExp([
|
|
498
551
|
'(' + CONTROL + ')',
|
|
499
|
-
'(' +
|
|
552
|
+
'(' + ANSI_C_QUOTE + '|' + BAREWORD + '|' + DOUBLE_QUOTE + '|' + SINGLE_QUOTE + ')+'
|
|
500
553
|
].join('|'), 'g');
|
|
501
554
|
var matches = matchAll(string, chunker);
|
|
502
555
|
if (0 === matches.length) return [];
|
|
@@ -511,6 +564,9 @@ __webpack_require__.add({
|
|
|
511
564
|
var quote = false;
|
|
512
565
|
var esc = false;
|
|
513
566
|
var out = '';
|
|
567
|
+
var words = [];
|
|
568
|
+
var sawQuote = false;
|
|
569
|
+
var pendingNw = null;
|
|
514
570
|
var isGlob = false;
|
|
515
571
|
var i;
|
|
516
572
|
function parseEnvVar() {
|
|
@@ -521,14 +577,19 @@ __webpack_require__.add({
|
|
|
521
577
|
if ('{' === char) {
|
|
522
578
|
i += 1;
|
|
523
579
|
if ('}' === s.charAt(i)) throw new Error('Bad substitution: ' + s.slice(i - 2, i + 1));
|
|
524
|
-
|
|
525
|
-
|
|
580
|
+
var depth = 1;
|
|
581
|
+
varend = i;
|
|
582
|
+
while(depth > 0 && varend < s.length){
|
|
583
|
+
if ('{' === s.charAt(varend) && '$' === s.charAt(varend - 1)) depth += 1;
|
|
584
|
+
else if ('}' === s.charAt(varend)) depth -= 1;
|
|
585
|
+
varend += 1;
|
|
586
|
+
}
|
|
587
|
+
if (0 !== depth) throw new Error('Bad substitution: ' + s.slice(i));
|
|
588
|
+
varend -= 1;
|
|
526
589
|
varname = s.slice(i, varend);
|
|
527
590
|
i = varend;
|
|
528
|
-
} else if (/[
|
|
529
|
-
|
|
530
|
-
i += 1;
|
|
531
|
-
} else {
|
|
591
|
+
} else if (/[*@#?$!-]/.test(char)) varname = char;
|
|
592
|
+
else {
|
|
532
593
|
var slicedFromI = s.slice(i);
|
|
533
594
|
varend = slicedFromI.match(/[^\w\d_]/);
|
|
534
595
|
if (varend) {
|
|
@@ -541,8 +602,23 @@ __webpack_require__.add({
|
|
|
541
602
|
}
|
|
542
603
|
return getVar(env, '', varname);
|
|
543
604
|
}
|
|
605
|
+
function flushRun() {
|
|
606
|
+
if (null === pendingNw) return;
|
|
607
|
+
if (0 === pendingNw) {
|
|
608
|
+
if ('' !== out) {
|
|
609
|
+
words[words.length] = out;
|
|
610
|
+
out = '';
|
|
611
|
+
}
|
|
612
|
+
} else {
|
|
613
|
+
words[words.length] = out;
|
|
614
|
+
out = '';
|
|
615
|
+
for(var fe = 1; fe < pendingNw; fe += 1)words[words.length] = '';
|
|
616
|
+
}
|
|
617
|
+
pendingNw = null;
|
|
618
|
+
}
|
|
544
619
|
for(i = 0; i < s.length; i++){
|
|
545
620
|
var c = s.charAt(i);
|
|
621
|
+
if (ifs && c !== DS) flushRun();
|
|
546
622
|
isGlob = isGlob || !quote && ('*' === c || '?' === c);
|
|
547
623
|
if (esc) {
|
|
548
624
|
out += c;
|
|
@@ -556,8 +632,10 @@ __webpack_require__.add({
|
|
|
556
632
|
else out += BS + c;
|
|
557
633
|
} else if (c === DS) out += parseEnvVar();
|
|
558
634
|
else out += c;
|
|
559
|
-
else if (c === DQ || c === SQ)
|
|
560
|
-
|
|
635
|
+
else if (c === DQ || c === SQ) {
|
|
636
|
+
quote = c;
|
|
637
|
+
sawQuote = true;
|
|
638
|
+
} else if (controlRE.test(c)) return {
|
|
561
639
|
op: s
|
|
562
640
|
};
|
|
563
641
|
else if (hash.test(c)) {
|
|
@@ -573,43 +651,86 @@ __webpack_require__.add({
|
|
|
573
651
|
commentObj
|
|
574
652
|
];
|
|
575
653
|
} else if (c === BS) esc = true;
|
|
576
|
-
else if (c === DS)
|
|
577
|
-
|
|
654
|
+
else if (c === DS && s.charAt(i + 1) === SQ && closesAnsiC(s, i)) {
|
|
655
|
+
flushRun();
|
|
656
|
+
sawQuote = true;
|
|
657
|
+
out += expandAnsiC(s.slice(i + 2, ansiCAt.lastIndex - 1));
|
|
658
|
+
i = ansiCAt.lastIndex - 1;
|
|
659
|
+
} else if (c === DS) {
|
|
660
|
+
var value = parseEnvVar();
|
|
661
|
+
if (ifs) for(var vi = 0; vi < value.length; vi += 1){
|
|
662
|
+
var vc = value.charAt(vi);
|
|
663
|
+
if (ifs.indexOf(vc) < 0) {
|
|
664
|
+
flushRun();
|
|
665
|
+
out += vc;
|
|
666
|
+
} else if (null === pendingNw) pendingNw = ' ' === vc || '\t' === vc || '\n' === vc ? 0 : 1;
|
|
667
|
+
else if (' ' !== vc && '\t' !== vc && '\n' !== vc) pendingNw += 1;
|
|
668
|
+
}
|
|
669
|
+
else out += value;
|
|
670
|
+
} else out += c;
|
|
578
671
|
}
|
|
579
672
|
if (isGlob) return {
|
|
580
673
|
op: 'glob',
|
|
581
674
|
pattern: out
|
|
582
675
|
};
|
|
676
|
+
if (ifs) {
|
|
677
|
+
if (null !== pendingNw && pendingNw > 0) {
|
|
678
|
+
words[words.length] = out;
|
|
679
|
+
out = '';
|
|
680
|
+
for(var te = 1; te < pendingNw; te += 1)words[words.length] = '';
|
|
681
|
+
}
|
|
682
|
+
if ('' !== out || sawQuote && 0 === words.length) words[words.length] = out;
|
|
683
|
+
return words;
|
|
684
|
+
}
|
|
583
685
|
return out;
|
|
584
686
|
}).reduce(function(prev, arg) {
|
|
585
|
-
|
|
687
|
+
if (void 0 === arg) return prev;
|
|
688
|
+
[].concat(arg).forEach(function(entry) {
|
|
689
|
+
prev[prev.length] = entry;
|
|
690
|
+
});
|
|
691
|
+
return prev;
|
|
586
692
|
}, []);
|
|
587
693
|
}
|
|
588
694
|
module.exports = function(s, env, opts) {
|
|
589
695
|
var mapped = parseInternal(s, env, opts);
|
|
590
696
|
if ('function' != typeof env) return mapped;
|
|
591
697
|
return mapped.reduce(function(acc, s) {
|
|
592
|
-
if ('object' == typeof s)
|
|
698
|
+
if ('object' == typeof s) {
|
|
699
|
+
acc[acc.length] = s;
|
|
700
|
+
return acc;
|
|
701
|
+
}
|
|
593
702
|
var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g'));
|
|
594
|
-
if (1 === xs.length)
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
703
|
+
if (1 === xs.length) {
|
|
704
|
+
acc[acc.length] = xs[0];
|
|
705
|
+
return acc;
|
|
706
|
+
}
|
|
707
|
+
xs.filter(Boolean).forEach(function(x) {
|
|
708
|
+
acc[acc.length] = startsWithToken.test(x) ? JSON.parse(x.split(TOKEN)[1]) : x;
|
|
709
|
+
});
|
|
710
|
+
return acc;
|
|
599
711
|
}, []);
|
|
600
712
|
};
|
|
601
713
|
},
|
|
602
|
-
"./node_modules/.pnpm/shell-quote@1.
|
|
714
|
+
"./node_modules/.pnpm/shell-quote@1.12.0/node_modules/shell-quote/quote.js" (module) {
|
|
603
715
|
var OPS = [
|
|
604
716
|
'||',
|
|
605
717
|
'&&',
|
|
718
|
+
';;&',
|
|
606
719
|
';;',
|
|
720
|
+
';&',
|
|
607
721
|
'|&',
|
|
608
722
|
'<(',
|
|
723
|
+
'>(',
|
|
609
724
|
'<<<',
|
|
725
|
+
'<<-',
|
|
726
|
+
'<<',
|
|
610
727
|
'>>',
|
|
611
728
|
'>&',
|
|
729
|
+
'>|',
|
|
730
|
+
'&>>',
|
|
731
|
+
'&>',
|
|
612
732
|
'<&',
|
|
733
|
+
'<>',
|
|
613
734
|
'&',
|
|
614
735
|
';',
|
|
615
736
|
'(',
|
|
@@ -619,31 +740,36 @@ __webpack_require__.add({
|
|
|
619
740
|
'>'
|
|
620
741
|
];
|
|
621
742
|
var LINE_TERMINATORS = /[\n\r\u2028\u2029]/;
|
|
622
|
-
var GLOB_SHELL_SPECIAL = /[\s#!"$&'()
|
|
743
|
+
var GLOB_SHELL_SPECIAL = /[\s#!"$&'():;<=>@\\^`|~]/g;
|
|
623
744
|
module.exports = function(xs) {
|
|
745
|
+
var sawComment = false;
|
|
624
746
|
return xs.map(function(s) {
|
|
747
|
+
if (sawComment && 'string' == typeof s && LINE_TERMINATORS.test(s)) throw new TypeError('a token after a `comment` must not contain line terminators');
|
|
625
748
|
if ('' === s) return '\'\'';
|
|
626
749
|
if (s && 'object' == typeof s) {
|
|
627
|
-
if ('glob' === s.op) {
|
|
750
|
+
if ('op' in s && 'glob' === s.op) {
|
|
628
751
|
if ('string' != typeof s.pattern) throw new TypeError('glob token requires a string `pattern`');
|
|
629
752
|
if (LINE_TERMINATORS.test(s.pattern)) throw new TypeError('glob `pattern` must not contain line terminators');
|
|
753
|
+
if ('' === s.pattern) return '\'\'';
|
|
630
754
|
return s.pattern.replace(GLOB_SHELL_SPECIAL, '\\$&');
|
|
631
755
|
}
|
|
632
|
-
if ('string' == typeof s.op) {
|
|
756
|
+
if ('op' in s && 'string' == typeof s.op) {
|
|
633
757
|
if (OPS.indexOf(s.op) < 0) throw new TypeError('invalid `op` value: ' + JSON.stringify(s.op));
|
|
634
758
|
return s.op.replace(/[\s\S]/g, '\\$&');
|
|
635
759
|
}
|
|
636
|
-
if ('string' == typeof s.comment) {
|
|
760
|
+
if ('comment' in s && 'string' == typeof s.comment) {
|
|
637
761
|
if (LINE_TERMINATORS.test(s.comment)) throw new TypeError('`comment` must not contain line terminators');
|
|
762
|
+
sawComment = true;
|
|
638
763
|
return '#' + s.comment;
|
|
639
764
|
}
|
|
640
765
|
throw new TypeError('unrecognized object token shape');
|
|
641
766
|
}
|
|
642
|
-
if (/
|
|
643
|
-
if (/["
|
|
644
|
-
|
|
767
|
+
if (/'/.test(s) && /!/.test(s)) return "'" + s.replace(/'/g, "'\"'\"'") + "'";
|
|
768
|
+
if (/["\s\\]/.test(s) && !/'/.test(s)) return "'" + s + "'";
|
|
769
|
+
if (/["'\s]/.test(s)) return '"' + s.replace(/(["\\$`])/g, '\\$1') + '"';
|
|
770
|
+
return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g, '$1\\$2');
|
|
645
771
|
}).join(' ');
|
|
646
772
|
};
|
|
647
773
|
}
|
|
648
774
|
});
|
|
649
|
-
__webpack_require__("./node_modules/.pnpm/launch-editor@2.14.
|
|
775
|
+
__webpack_require__("./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/index.js");
|
|
@@ -169,17 +169,19 @@ const argumentsPrefix = [
|
|
|
169
169
|
'-EncodedCommand'
|
|
170
170
|
];
|
|
171
171
|
const encodeCommand = (command)=>Buffer.from(command, 'utf16le').toString('base64');
|
|
172
|
-
const escapeArgument = (value)=>`'${String(value).replaceAll('
|
|
172
|
+
const escapeArgument = (value)=>`'${String(value).replaceAll(/['‘’‚‛]/g, (match)=>match + match)}'`;
|
|
173
173
|
const createArguments = (command)=>[
|
|
174
174
|
...argumentsPrefix,
|
|
175
175
|
encodeCommand(command)
|
|
176
176
|
];
|
|
177
|
-
const
|
|
178
|
-
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
179
|
-
return powershell_utils_execFile(psPath ?? powershell_utils_powerShellPath(), createArguments(command), {
|
|
177
|
+
const createExecFileOptions = (options)=>({
|
|
180
178
|
encoding: 'utf8',
|
|
181
|
-
...
|
|
179
|
+
...options,
|
|
180
|
+
shell: false
|
|
182
181
|
});
|
|
182
|
+
const powershell_utils_executePowerShell = async (command, options = {})=>{
|
|
183
|
+
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
184
|
+
return powershell_utils_execFile(psPath ?? powershell_utils_powerShellPath(), createArguments(command), createExecFileOptions(execFileOptions));
|
|
183
185
|
};
|
|
184
186
|
powershell_utils_executePowerShell.argumentsPrefix = argumentsPrefix;
|
|
185
187
|
powershell_utils_executePowerShell.encodeCommand = encodeCommand;
|
|
@@ -307,7 +309,8 @@ const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
|
|
|
307
309
|
class UnknownBrowserError extends Error {
|
|
308
310
|
}
|
|
309
311
|
async function defaultBrowser(_execFileAsync = windows_execFileAsync) {
|
|
310
|
-
const {
|
|
312
|
+
const regPath = `${node_process.env.SYSTEMROOT ?? node_process.env.windir ?? 'C:\\Windows'}\\System32\\reg.exe`;
|
|
313
|
+
const { stdout } = await _execFileAsync(regPath, [
|
|
311
314
|
'QUERY',
|
|
312
315
|
' HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice',
|
|
313
316
|
'/v',
|
|
@@ -420,8 +423,9 @@ const baseOpen = async (options)=>{
|
|
|
420
423
|
const browserInfo = _windowsBrowserProgIdMap.get(progId);
|
|
421
424
|
browser = browserInfo ?? {};
|
|
422
425
|
} else browser = await default_browser_defaultBrowser();
|
|
423
|
-
|
|
424
|
-
|
|
426
|
+
const browserId = browser.id?.toLowerCase();
|
|
427
|
+
if (Object.hasOwn(ids, browserId)) {
|
|
428
|
+
const browserName = ids[browserId];
|
|
425
429
|
if ('browserPrivate' === app) {
|
|
426
430
|
if ('safari' === browserName) throw new Error('Safari doesn\'t support opening in private mode via command line');
|
|
427
431
|
appArguments.push(flags[browserName]);
|
|
@@ -496,12 +500,12 @@ const baseOpen = async (options)=>{
|
|
|
496
500
|
resolve(subprocess);
|
|
497
501
|
});
|
|
498
502
|
});
|
|
499
|
-
if (isFallbackAttempt) return new Promise((resolve, reject)=>{
|
|
503
|
+
if (isFallbackAttempt || 'win32' === platform || shouldUseWindowsInWsl) return new Promise((resolve, reject)=>{
|
|
500
504
|
subprocess.once('error', reject);
|
|
501
505
|
subprocess.once('spawn', ()=>{
|
|
502
506
|
subprocess.once('close', (exitCode)=>{
|
|
503
507
|
subprocess.off('error', reject);
|
|
504
|
-
if (0 !== exitCode) return void reject(new Error(`Exited with code ${exitCode}`));
|
|
508
|
+
if (isFallbackAttempt && 0 !== exitCode) return void reject(new Error(`Exited with code ${exitCode}`));
|
|
505
509
|
subprocess.unref();
|
|
506
510
|
resolve(subprocess);
|
|
507
511
|
});
|