@rspack/dev-server 2.2.0 → 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.
@@ -1,7 +1,27 @@
1
- import { __webpack_require__ } from "./619.js";
2
- import "./619.js";
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.1/node_modules/launch-editor/editor-info/linux.js" (module) {
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.1/node_modules/launch-editor/editor-info/macos.js" (module) {
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.1/node_modules/launch-editor/editor-info/windows.js" (module) {
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.1/node_modules/launch-editor/get-args.js" (module, __unused_rspack_exports, __webpack_require__) {
101
- const path = __webpack_require__("path");
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.1/node_modules/launch-editor/guess.js" (module, __unused_rspack_exports, __webpack_require__) {
200
- const path = __webpack_require__("path");
201
- const shellQuote = __webpack_require__("./node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/index.js");
202
- const childProcess = __webpack_require__("child_process");
203
- const COMMON_EDITORS_MACOS = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/macos.js");
204
- const COMMON_EDITORS_LINUX = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/linux.js");
205
- const COMMON_EDITORS_WIN = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/windows.js");
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.1/node_modules/launch-editor/index.js" (module, __unused_rspack_exports, __webpack_require__) {
298
- const fs = __webpack_require__("fs");
299
- const os = __webpack_require__("os");
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 = __webpack_require__("child_process");
303
- const guessEditor = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/guess.js");
304
- const getArgumentsForPosition = __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/get-args.js");
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 parsed = parseFile(file);
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
- if ('linux' === process.platform && fileName.startsWith('/mnt/') && /Microsoft/i.test(os.release())) fileName = path.relative('', fileName);
354
- if (lineNumber) {
355
- const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber);
356
- args.push.apply(args, extraArgs);
357
- } else args.push(fileName);
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
- if ('win32' === process.platform) {
360
- function escapeCmdArgs(cmdArgs) {
361
- return cmdArgs.replace(/([&|<>,;=^])/g, '^$1');
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.8.4/node_modules/shell-quote/index.js" (__unused_rspack_module, exports, __webpack_require__) {
458
- __webpack_require__("./node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/quote.js");
459
- exports.parse = __webpack_require__("./node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/parse.js");
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.8.4/node_modules/shell-quote/parse.js" (module) {
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 DOUBLE_QUOTE = '\'((\\\\\'|[^\'])*?)\'';
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.push(matchObj);
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 BAREWORD = '(\\' + BS + '[\'"' + META + ']|[^\\s\'"' + META + '])+';
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
- '(' + BAREWORD + '|' + SINGLE_QUOTE + '|' + DOUBLE_QUOTE + ')+'
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
- varend = s.indexOf('}', i);
525
- if (varend < 0) throw new Error('Bad substitution: ' + s.slice(i));
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 (/[*@#?$!_-]/.test(char)) {
529
- varname = char;
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) quote = c;
560
- else if (controlRE.test(c)) return {
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) out += parseEnvVar();
577
- else out += c;
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
- return void 0 === arg ? prev : prev.concat(arg);
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) return acc.concat(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) return acc.concat(xs[0]);
595
- return acc.concat(xs.filter(Boolean).map(function(x) {
596
- if (startsWithToken.test(x)) return JSON.parse(x.split(TOKEN)[1]);
597
- return x;
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.8.4/node_modules/shell-quote/quote.js" (module) {
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#!"$&'():;<=>@\\^`|]/g;
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 (/["\s\\]/.test(s) && !/'/.test(s)) return "'" + s.replace(/(['])/g, '\\$1') + "'";
643
- if (/["'\s]/.test(s)) return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
644
- return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, '$1\\$2');
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.1/node_modules/launch-editor/index.js");
775
+ __webpack_require__("./node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/index.js");