版博士V2.0程序
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

1721 satır
37 KiB

  1. import require$$0 from 'fs';
  2. import k from 'path';
  3. import require$$0$1 from 'util';
  4. import require$$0$3 from 'child_process';
  5. import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.2cbcdd1e.js';
  6. import { o as onetime$1 } from './chunk-node-pkg.30d8b37e.js';
  7. import require$$0$2 from 'os';
  8. import 'node:buffer';
  9. import 'node:path';
  10. import 'node:child_process';
  11. import 'node:process';
  12. import './vendor-_commonjsHelpers.addc3445.js';
  13. import 'node:url';
  14. import 'node:os';
  15. import 'assert';
  16. import 'events';
  17. import 'buffer';
  18. import 'stream';
  19. import 'pathe';
  20. import './chunk-constants.bc18a549.js';
  21. import './chunk-integrations-coverage.d93ee824.js';
  22. import './chunk-env-node.affdd278.js';
  23. import 'node:console';
  24. import 'local-pkg';
  25. import 'picocolors';
  26. import './chunk-utils-env.6b856dbf.js';
  27. import 'std-env';
  28. import '@vitest/runner/utils';
  29. import './chunk-utils-global.fd174983.js';
  30. import '@vitest/utils';
  31. import 'vite';
  32. import 'node:fs';
  33. import 'vite-node/utils';
  34. import 'vite-node/client';
  35. import 'node:fs/promises';
  36. import 'source-map';
  37. import 'module';
  38. import 'acorn';
  39. import 'acorn-walk';
  40. import './chunk-utils-base.b5ddfcc9.js';
  41. import 'crypto';
  42. import './chunk-paths.e36446b4.js';
  43. import 'node:v8';
  44. import './vendor-index.783e7f3e.js';
  45. import 'node:worker_threads';
  46. import 'tinypool';
  47. import 'perf_hooks';
  48. import './chunk-utils-tasks.8781fd71.js';
  49. import '@vitest/utils/diff';
  50. import 'vite-node/server';
  51. import './vendor-magic-string.es.b3bc5745.js';
  52. import 'node:module';
  53. import 'node:crypto';
  54. import 'strip-literal';
  55. import 'readline';
  56. var findUp$1 = {exports: {}};
  57. var locatePath = {exports: {}};
  58. class Node {
  59. /// value;
  60. /// next;
  61. constructor(value) {
  62. this.value = value;
  63. // TODO: Remove this when targeting Node.js 12.
  64. this.next = undefined;
  65. }
  66. }
  67. class Queue$1 {
  68. // TODO: Use private class fields when targeting Node.js 12.
  69. // #_head;
  70. // #_tail;
  71. // #_size;
  72. constructor() {
  73. this.clear();
  74. }
  75. enqueue(value) {
  76. const node = new Node(value);
  77. if (this._head) {
  78. this._tail.next = node;
  79. this._tail = node;
  80. } else {
  81. this._head = node;
  82. this._tail = node;
  83. }
  84. this._size++;
  85. }
  86. dequeue() {
  87. const current = this._head;
  88. if (!current) {
  89. return;
  90. }
  91. this._head = this._head.next;
  92. this._size--;
  93. return current.value;
  94. }
  95. clear() {
  96. this._head = undefined;
  97. this._tail = undefined;
  98. this._size = 0;
  99. }
  100. get size() {
  101. return this._size;
  102. }
  103. * [Symbol.iterator]() {
  104. let current = this._head;
  105. while (current) {
  106. yield current.value;
  107. current = current.next;
  108. }
  109. }
  110. }
  111. var yoctoQueue = Queue$1;
  112. const Queue = yoctoQueue;
  113. const pLimit$1 = concurrency => {
  114. if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
  115. throw new TypeError('Expected `concurrency` to be a number from 1 and up');
  116. }
  117. const queue = new Queue();
  118. let activeCount = 0;
  119. const next = () => {
  120. activeCount--;
  121. if (queue.size > 0) {
  122. queue.dequeue()();
  123. }
  124. };
  125. const run = async (fn, resolve, ...args) => {
  126. activeCount++;
  127. const result = (async () => fn(...args))();
  128. resolve(result);
  129. try {
  130. await result;
  131. } catch {}
  132. next();
  133. };
  134. const enqueue = (fn, resolve, ...args) => {
  135. queue.enqueue(run.bind(null, fn, resolve, ...args));
  136. (async () => {
  137. // This function needs to wait until the next microtask before comparing
  138. // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
  139. // when the run function is dequeued and called. The comparison in the if-statement
  140. // needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
  141. await Promise.resolve();
  142. if (activeCount < concurrency && queue.size > 0) {
  143. queue.dequeue()();
  144. }
  145. })();
  146. };
  147. const generator = (fn, ...args) => new Promise(resolve => {
  148. enqueue(fn, resolve, ...args);
  149. });
  150. Object.defineProperties(generator, {
  151. activeCount: {
  152. get: () => activeCount
  153. },
  154. pendingCount: {
  155. get: () => queue.size
  156. },
  157. clearQueue: {
  158. value: () => {
  159. queue.clear();
  160. }
  161. }
  162. });
  163. return generator;
  164. };
  165. var pLimit_1 = pLimit$1;
  166. const pLimit = pLimit_1;
  167. class EndError extends Error {
  168. constructor(value) {
  169. super();
  170. this.value = value;
  171. }
  172. }
  173. // The input can also be a promise, so we await it
  174. const testElement = async (element, tester) => tester(await element);
  175. // The input can also be a promise, so we `Promise.all()` them both
  176. const finder = async element => {
  177. const values = await Promise.all(element);
  178. if (values[1] === true) {
  179. throw new EndError(values[0]);
  180. }
  181. return false;
  182. };
  183. const pLocate$1 = async (iterable, tester, options) => {
  184. options = {
  185. concurrency: Infinity,
  186. preserveOrder: true,
  187. ...options
  188. };
  189. const limit = pLimit(options.concurrency);
  190. // Start all the promises concurrently with optional limit
  191. const items = [...iterable].map(element => [element, limit(testElement, element, tester)]);
  192. // Check the promises either serially or concurrently
  193. const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
  194. try {
  195. await Promise.all(items.map(element => checkLimit(finder, element)));
  196. } catch (error) {
  197. if (error instanceof EndError) {
  198. return error.value;
  199. }
  200. throw error;
  201. }
  202. };
  203. var pLocate_1 = pLocate$1;
  204. const path$1 = k;
  205. const fs$1 = require$$0;
  206. const {promisify: promisify$1} = require$$0$1;
  207. const pLocate = pLocate_1;
  208. const fsStat = promisify$1(fs$1.stat);
  209. const fsLStat = promisify$1(fs$1.lstat);
  210. const typeMappings = {
  211. directory: 'isDirectory',
  212. file: 'isFile'
  213. };
  214. function checkType({type}) {
  215. if (type in typeMappings) {
  216. return;
  217. }
  218. throw new Error(`Invalid type specified: ${type}`);
  219. }
  220. const matchType = (type, stat) => type === undefined || stat[typeMappings[type]]();
  221. locatePath.exports = async (paths, options) => {
  222. options = {
  223. cwd: process.cwd(),
  224. type: 'file',
  225. allowSymlinks: true,
  226. ...options
  227. };
  228. checkType(options);
  229. const statFn = options.allowSymlinks ? fsStat : fsLStat;
  230. return pLocate(paths, async path_ => {
  231. try {
  232. const stat = await statFn(path$1.resolve(options.cwd, path_));
  233. return matchType(options.type, stat);
  234. } catch {
  235. return false;
  236. }
  237. }, options);
  238. };
  239. locatePath.exports.sync = (paths, options) => {
  240. options = {
  241. cwd: process.cwd(),
  242. allowSymlinks: true,
  243. type: 'file',
  244. ...options
  245. };
  246. checkType(options);
  247. const statFn = options.allowSymlinks ? fs$1.statSync : fs$1.lstatSync;
  248. for (const path_ of paths) {
  249. try {
  250. const stat = statFn(path$1.resolve(options.cwd, path_));
  251. if (matchType(options.type, stat)) {
  252. return path_;
  253. }
  254. } catch {}
  255. }
  256. };
  257. var pathExists = {exports: {}};
  258. const fs = require$$0;
  259. const {promisify} = require$$0$1;
  260. const pAccess = promisify(fs.access);
  261. pathExists.exports = async path => {
  262. try {
  263. await pAccess(path);
  264. return true;
  265. } catch (_) {
  266. return false;
  267. }
  268. };
  269. pathExists.exports.sync = path => {
  270. try {
  271. fs.accessSync(path);
  272. return true;
  273. } catch (_) {
  274. return false;
  275. }
  276. };
  277. (function (module) {
  278. const path = k;
  279. const locatePath$1 = locatePath.exports;
  280. const pathExists$1 = pathExists.exports;
  281. const stop = Symbol('findUp.stop');
  282. module.exports = async (name, options = {}) => {
  283. let directory = path.resolve(options.cwd || '');
  284. const {root} = path.parse(directory);
  285. const paths = [].concat(name);
  286. const runMatcher = async locateOptions => {
  287. if (typeof name !== 'function') {
  288. return locatePath$1(paths, locateOptions);
  289. }
  290. const foundPath = await name(locateOptions.cwd);
  291. if (typeof foundPath === 'string') {
  292. return locatePath$1([foundPath], locateOptions);
  293. }
  294. return foundPath;
  295. };
  296. // eslint-disable-next-line no-constant-condition
  297. while (true) {
  298. // eslint-disable-next-line no-await-in-loop
  299. const foundPath = await runMatcher({...options, cwd: directory});
  300. if (foundPath === stop) {
  301. return;
  302. }
  303. if (foundPath) {
  304. return path.resolve(directory, foundPath);
  305. }
  306. if (directory === root) {
  307. return;
  308. }
  309. directory = path.dirname(directory);
  310. }
  311. };
  312. module.exports.sync = (name, options = {}) => {
  313. let directory = path.resolve(options.cwd || '');
  314. const {root} = path.parse(directory);
  315. const paths = [].concat(name);
  316. const runMatcher = locateOptions => {
  317. if (typeof name !== 'function') {
  318. return locatePath$1.sync(paths, locateOptions);
  319. }
  320. const foundPath = name(locateOptions.cwd);
  321. if (typeof foundPath === 'string') {
  322. return locatePath$1.sync([foundPath], locateOptions);
  323. }
  324. return foundPath;
  325. };
  326. // eslint-disable-next-line no-constant-condition
  327. while (true) {
  328. const foundPath = runMatcher({...options, cwd: directory});
  329. if (foundPath === stop) {
  330. return;
  331. }
  332. if (foundPath) {
  333. return path.resolve(directory, foundPath);
  334. }
  335. if (directory === root) {
  336. return;
  337. }
  338. directory = path.dirname(directory);
  339. }
  340. };
  341. module.exports.exists = pathExists$1;
  342. module.exports.sync.exists = pathExists$1.sync;
  343. module.exports.stop = stop;
  344. } (findUp$1));
  345. var findUp = findUp$1.exports;
  346. var execa$1 = {exports: {}};
  347. var stripFinalNewline$1 = input => {
  348. const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
  349. const CR = typeof input === 'string' ? '\r' : '\r'.charCodeAt();
  350. if (input[input.length - 1] === LF) {
  351. input = input.slice(0, input.length - 1);
  352. }
  353. if (input[input.length - 1] === CR) {
  354. input = input.slice(0, input.length - 1);
  355. }
  356. return input;
  357. };
  358. var npmRunPath$1 = {exports: {}};
  359. (function (module) {
  360. const path = k;
  361. const pathKey$1 = pathKey.exports;
  362. const npmRunPath = options => {
  363. options = {
  364. cwd: process.cwd(),
  365. path: process.env[pathKey$1()],
  366. execPath: process.execPath,
  367. ...options
  368. };
  369. let previous;
  370. let cwdPath = path.resolve(options.cwd);
  371. const result = [];
  372. while (previous !== cwdPath) {
  373. result.push(path.join(cwdPath, 'node_modules/.bin'));
  374. previous = cwdPath;
  375. cwdPath = path.resolve(cwdPath, '..');
  376. }
  377. // Ensure the running `node` binary is used
  378. const execPathDir = path.resolve(options.cwd, options.execPath, '..');
  379. result.push(execPathDir);
  380. return result.concat(options.path).join(path.delimiter);
  381. };
  382. module.exports = npmRunPath;
  383. // TODO: Remove this for the next major release
  384. module.exports.default = npmRunPath;
  385. module.exports.env = options => {
  386. options = {
  387. env: process.env,
  388. ...options
  389. };
  390. const env = {...options.env};
  391. const path = pathKey$1({env});
  392. options.path = env[path];
  393. env[path] = module.exports(options);
  394. return env;
  395. };
  396. } (npmRunPath$1));
  397. var main = {};
  398. var signals = {};
  399. var core = {};
  400. Object.defineProperty(core,"__esModule",{value:true});core.SIGNALS=void 0;
  401. const SIGNALS=[
  402. {
  403. name:"SIGHUP",
  404. number:1,
  405. action:"terminate",
  406. description:"Terminal closed",
  407. standard:"posix"},
  408. {
  409. name:"SIGINT",
  410. number:2,
  411. action:"terminate",
  412. description:"User interruption with CTRL-C",
  413. standard:"ansi"},
  414. {
  415. name:"SIGQUIT",
  416. number:3,
  417. action:"core",
  418. description:"User interruption with CTRL-\\",
  419. standard:"posix"},
  420. {
  421. name:"SIGILL",
  422. number:4,
  423. action:"core",
  424. description:"Invalid machine instruction",
  425. standard:"ansi"},
  426. {
  427. name:"SIGTRAP",
  428. number:5,
  429. action:"core",
  430. description:"Debugger breakpoint",
  431. standard:"posix"},
  432. {
  433. name:"SIGABRT",
  434. number:6,
  435. action:"core",
  436. description:"Aborted",
  437. standard:"ansi"},
  438. {
  439. name:"SIGIOT",
  440. number:6,
  441. action:"core",
  442. description:"Aborted",
  443. standard:"bsd"},
  444. {
  445. name:"SIGBUS",
  446. number:7,
  447. action:"core",
  448. description:
  449. "Bus error due to misaligned, non-existing address or paging error",
  450. standard:"bsd"},
  451. {
  452. name:"SIGEMT",
  453. number:7,
  454. action:"terminate",
  455. description:"Command should be emulated but is not implemented",
  456. standard:"other"},
  457. {
  458. name:"SIGFPE",
  459. number:8,
  460. action:"core",
  461. description:"Floating point arithmetic error",
  462. standard:"ansi"},
  463. {
  464. name:"SIGKILL",
  465. number:9,
  466. action:"terminate",
  467. description:"Forced termination",
  468. standard:"posix",
  469. forced:true},
  470. {
  471. name:"SIGUSR1",
  472. number:10,
  473. action:"terminate",
  474. description:"Application-specific signal",
  475. standard:"posix"},
  476. {
  477. name:"SIGSEGV",
  478. number:11,
  479. action:"core",
  480. description:"Segmentation fault",
  481. standard:"ansi"},
  482. {
  483. name:"SIGUSR2",
  484. number:12,
  485. action:"terminate",
  486. description:"Application-specific signal",
  487. standard:"posix"},
  488. {
  489. name:"SIGPIPE",
  490. number:13,
  491. action:"terminate",
  492. description:"Broken pipe or socket",
  493. standard:"posix"},
  494. {
  495. name:"SIGALRM",
  496. number:14,
  497. action:"terminate",
  498. description:"Timeout or timer",
  499. standard:"posix"},
  500. {
  501. name:"SIGTERM",
  502. number:15,
  503. action:"terminate",
  504. description:"Termination",
  505. standard:"ansi"},
  506. {
  507. name:"SIGSTKFLT",
  508. number:16,
  509. action:"terminate",
  510. description:"Stack is empty or overflowed",
  511. standard:"other"},
  512. {
  513. name:"SIGCHLD",
  514. number:17,
  515. action:"ignore",
  516. description:"Child process terminated, paused or unpaused",
  517. standard:"posix"},
  518. {
  519. name:"SIGCLD",
  520. number:17,
  521. action:"ignore",
  522. description:"Child process terminated, paused or unpaused",
  523. standard:"other"},
  524. {
  525. name:"SIGCONT",
  526. number:18,
  527. action:"unpause",
  528. description:"Unpaused",
  529. standard:"posix",
  530. forced:true},
  531. {
  532. name:"SIGSTOP",
  533. number:19,
  534. action:"pause",
  535. description:"Paused",
  536. standard:"posix",
  537. forced:true},
  538. {
  539. name:"SIGTSTP",
  540. number:20,
  541. action:"pause",
  542. description:"Paused using CTRL-Z or \"suspend\"",
  543. standard:"posix"},
  544. {
  545. name:"SIGTTIN",
  546. number:21,
  547. action:"pause",
  548. description:"Background process cannot read terminal input",
  549. standard:"posix"},
  550. {
  551. name:"SIGBREAK",
  552. number:21,
  553. action:"terminate",
  554. description:"User interruption with CTRL-BREAK",
  555. standard:"other"},
  556. {
  557. name:"SIGTTOU",
  558. number:22,
  559. action:"pause",
  560. description:"Background process cannot write to terminal output",
  561. standard:"posix"},
  562. {
  563. name:"SIGURG",
  564. number:23,
  565. action:"ignore",
  566. description:"Socket received out-of-band data",
  567. standard:"bsd"},
  568. {
  569. name:"SIGXCPU",
  570. number:24,
  571. action:"core",
  572. description:"Process timed out",
  573. standard:"bsd"},
  574. {
  575. name:"SIGXFSZ",
  576. number:25,
  577. action:"core",
  578. description:"File too big",
  579. standard:"bsd"},
  580. {
  581. name:"SIGVTALRM",
  582. number:26,
  583. action:"terminate",
  584. description:"Timeout or timer",
  585. standard:"bsd"},
  586. {
  587. name:"SIGPROF",
  588. number:27,
  589. action:"terminate",
  590. description:"Timeout or timer",
  591. standard:"bsd"},
  592. {
  593. name:"SIGWINCH",
  594. number:28,
  595. action:"ignore",
  596. description:"Terminal window size changed",
  597. standard:"bsd"},
  598. {
  599. name:"SIGIO",
  600. number:29,
  601. action:"terminate",
  602. description:"I/O is available",
  603. standard:"other"},
  604. {
  605. name:"SIGPOLL",
  606. number:29,
  607. action:"terminate",
  608. description:"Watched event",
  609. standard:"other"},
  610. {
  611. name:"SIGINFO",
  612. number:29,
  613. action:"ignore",
  614. description:"Request for process information",
  615. standard:"other"},
  616. {
  617. name:"SIGPWR",
  618. number:30,
  619. action:"terminate",
  620. description:"Device running out of power",
  621. standard:"systemv"},
  622. {
  623. name:"SIGSYS",
  624. number:31,
  625. action:"core",
  626. description:"Invalid system call",
  627. standard:"other"},
  628. {
  629. name:"SIGUNUSED",
  630. number:31,
  631. action:"terminate",
  632. description:"Invalid system call",
  633. standard:"other"}];core.SIGNALS=SIGNALS;
  634. var realtime = {};
  635. Object.defineProperty(realtime,"__esModule",{value:true});realtime.SIGRTMAX=realtime.getRealtimeSignals=void 0;
  636. const getRealtimeSignals=function(){
  637. const length=SIGRTMAX-SIGRTMIN+1;
  638. return Array.from({length},getRealtimeSignal);
  639. };realtime.getRealtimeSignals=getRealtimeSignals;
  640. const getRealtimeSignal=function(value,index){
  641. return {
  642. name:`SIGRT${index+1}`,
  643. number:SIGRTMIN+index,
  644. action:"terminate",
  645. description:"Application-specific signal (realtime)",
  646. standard:"posix"};
  647. };
  648. const SIGRTMIN=34;
  649. const SIGRTMAX=64;realtime.SIGRTMAX=SIGRTMAX;
  650. Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0$2;
  651. var _core=core;
  652. var _realtime$1=realtime;
  653. const getSignals=function(){
  654. const realtimeSignals=(0, _realtime$1.getRealtimeSignals)();
  655. const signals=[..._core.SIGNALS,...realtimeSignals].map(normalizeSignal);
  656. return signals;
  657. };signals.getSignals=getSignals;
  658. const normalizeSignal=function({
  659. name,
  660. number:defaultNumber,
  661. description,
  662. action,
  663. forced=false,
  664. standard})
  665. {
  666. const{
  667. signals:{[name]:constantSignal}}=
  668. _os$1.constants;
  669. const supported=constantSignal!==undefined;
  670. const number=supported?constantSignal:defaultNumber;
  671. return {name,number,description,supported,action,forced,standard};
  672. };
  673. Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0$2;
  674. var _signals=signals;
  675. var _realtime=realtime;
  676. const getSignalsByName=function(){
  677. const signals=(0, _signals.getSignals)();
  678. return signals.reduce(getSignalByName,{});
  679. };
  680. const getSignalByName=function(
  681. signalByNameMemo,
  682. {name,number,description,supported,action,forced,standard})
  683. {
  684. return {
  685. ...signalByNameMemo,
  686. [name]:{name,number,description,supported,action,forced,standard}};
  687. };
  688. const signalsByName$1=getSignalsByName();main.signalsByName=signalsByName$1;
  689. const getSignalsByNumber=function(){
  690. const signals=(0, _signals.getSignals)();
  691. const length=_realtime.SIGRTMAX+1;
  692. const signalsA=Array.from({length},(value,number)=>
  693. getSignalByNumber(number,signals));
  694. return Object.assign({},...signalsA);
  695. };
  696. const getSignalByNumber=function(number,signals){
  697. const signal=findSignalByNumber(number,signals);
  698. if(signal===undefined){
  699. return {};
  700. }
  701. const{name,description,supported,action,forced,standard}=signal;
  702. return {
  703. [number]:{
  704. name,
  705. number,
  706. description,
  707. supported,
  708. action,
  709. forced,
  710. standard}};
  711. };
  712. const findSignalByNumber=function(number,signals){
  713. const signal=signals.find(({name})=>_os.constants.signals[name]===number);
  714. if(signal!==undefined){
  715. return signal;
  716. }
  717. return signals.find(signalA=>signalA.number===number);
  718. };
  719. const signalsByNumber=getSignalsByNumber();main.signalsByNumber=signalsByNumber;
  720. const {signalsByName} = main;
  721. const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => {
  722. if (timedOut) {
  723. return `timed out after ${timeout} milliseconds`;
  724. }
  725. if (isCanceled) {
  726. return 'was canceled';
  727. }
  728. if (errorCode !== undefined) {
  729. return `failed with ${errorCode}`;
  730. }
  731. if (signal !== undefined) {
  732. return `was killed with ${signal} (${signalDescription})`;
  733. }
  734. if (exitCode !== undefined) {
  735. return `failed with exit code ${exitCode}`;
  736. }
  737. return 'failed';
  738. };
  739. const makeError$1 = ({
  740. stdout,
  741. stderr,
  742. all,
  743. error,
  744. signal,
  745. exitCode,
  746. command,
  747. escapedCommand,
  748. timedOut,
  749. isCanceled,
  750. killed,
  751. parsed: {options: {timeout}}
  752. }) => {
  753. // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`.
  754. // We normalize them to `undefined`
  755. exitCode = exitCode === null ? undefined : exitCode;
  756. signal = signal === null ? undefined : signal;
  757. const signalDescription = signal === undefined ? undefined : signalsByName[signal].description;
  758. const errorCode = error && error.code;
  759. const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled});
  760. const execaMessage = `Command ${prefix}: ${command}`;
  761. const isError = Object.prototype.toString.call(error) === '[object Error]';
  762. const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage;
  763. const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n');
  764. if (isError) {
  765. error.originalMessage = error.message;
  766. error.message = message;
  767. } else {
  768. error = new Error(message);
  769. }
  770. error.shortMessage = shortMessage;
  771. error.command = command;
  772. error.escapedCommand = escapedCommand;
  773. error.exitCode = exitCode;
  774. error.signal = signal;
  775. error.signalDescription = signalDescription;
  776. error.stdout = stdout;
  777. error.stderr = stderr;
  778. if (all !== undefined) {
  779. error.all = all;
  780. }
  781. if ('bufferedData' in error) {
  782. delete error.bufferedData;
  783. }
  784. error.failed = true;
  785. error.timedOut = Boolean(timedOut);
  786. error.isCanceled = isCanceled;
  787. error.killed = killed && !timedOut;
  788. return error;
  789. };
  790. var error = makeError$1;
  791. var stdio = {exports: {}};
  792. const aliases = ['stdin', 'stdout', 'stderr'];
  793. const hasAlias = options => aliases.some(alias => options[alias] !== undefined);
  794. const normalizeStdio$1 = options => {
  795. if (!options) {
  796. return;
  797. }
  798. const {stdio} = options;
  799. if (stdio === undefined) {
  800. return aliases.map(alias => options[alias]);
  801. }
  802. if (hasAlias(options)) {
  803. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`);
  804. }
  805. if (typeof stdio === 'string') {
  806. return stdio;
  807. }
  808. if (!Array.isArray(stdio)) {
  809. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  810. }
  811. const length = Math.max(stdio.length, aliases.length);
  812. return Array.from({length}, (value, index) => stdio[index]);
  813. };
  814. stdio.exports = normalizeStdio$1;
  815. // `ipc` is pushed unless it is already present
  816. stdio.exports.node = options => {
  817. const stdio = normalizeStdio$1(options);
  818. if (stdio === 'ipc') {
  819. return 'ipc';
  820. }
  821. if (stdio === undefined || typeof stdio === 'string') {
  822. return [stdio, stdio, stdio, 'ipc'];
  823. }
  824. if (stdio.includes('ipc')) {
  825. return stdio;
  826. }
  827. return [...stdio, 'ipc'];
  828. };
  829. const os = require$$0$2;
  830. const onExit = signalExit.exports;
  831. const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;
  832. // Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior
  833. const spawnedKill$1 = (kill, signal = 'SIGTERM', options = {}) => {
  834. const killResult = kill(signal);
  835. setKillTimeout(kill, signal, options, killResult);
  836. return killResult;
  837. };
  838. const setKillTimeout = (kill, signal, options, killResult) => {
  839. if (!shouldForceKill(signal, options, killResult)) {
  840. return;
  841. }
  842. const timeout = getForceKillAfterTimeout(options);
  843. const t = setTimeout(() => {
  844. kill('SIGKILL');
  845. }, timeout);
  846. // Guarded because there's no `.unref()` when `execa` is used in the renderer
  847. // process in Electron. This cannot be tested since we don't run tests in
  848. // Electron.
  849. // istanbul ignore else
  850. if (t.unref) {
  851. t.unref();
  852. }
  853. };
  854. const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => {
  855. return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
  856. };
  857. const isSigterm = signal => {
  858. return signal === os.constants.signals.SIGTERM ||
  859. (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM');
  860. };
  861. const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => {
  862. if (forceKillAfterTimeout === true) {
  863. return DEFAULT_FORCE_KILL_TIMEOUT;
  864. }
  865. if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
  866. throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
  867. }
  868. return forceKillAfterTimeout;
  869. };
  870. // `childProcess.cancel()`
  871. const spawnedCancel$1 = (spawned, context) => {
  872. const killResult = spawned.kill();
  873. if (killResult) {
  874. context.isCanceled = true;
  875. }
  876. };
  877. const timeoutKill = (spawned, signal, reject) => {
  878. spawned.kill(signal);
  879. reject(Object.assign(new Error('Timed out'), {timedOut: true, signal}));
  880. };
  881. // `timeout` option handling
  882. const setupTimeout$1 = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => {
  883. if (timeout === 0 || timeout === undefined) {
  884. return spawnedPromise;
  885. }
  886. let timeoutId;
  887. const timeoutPromise = new Promise((resolve, reject) => {
  888. timeoutId = setTimeout(() => {
  889. timeoutKill(spawned, killSignal, reject);
  890. }, timeout);
  891. });
  892. const safeSpawnedPromise = spawnedPromise.finally(() => {
  893. clearTimeout(timeoutId);
  894. });
  895. return Promise.race([timeoutPromise, safeSpawnedPromise]);
  896. };
  897. const validateTimeout$1 = ({timeout}) => {
  898. if (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) {
  899. throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
  900. }
  901. };
  902. // `cleanup` option handling
  903. const setExitHandler$1 = async (spawned, {cleanup, detached}, timedPromise) => {
  904. if (!cleanup || detached) {
  905. return timedPromise;
  906. }
  907. const removeExitHandler = onExit(() => {
  908. spawned.kill();
  909. });
  910. return timedPromise.finally(() => {
  911. removeExitHandler();
  912. });
  913. };
  914. var kill = {
  915. spawnedKill: spawnedKill$1,
  916. spawnedCancel: spawnedCancel$1,
  917. setupTimeout: setupTimeout$1,
  918. validateTimeout: validateTimeout$1,
  919. setExitHandler: setExitHandler$1
  920. };
  921. const isStream$1 = stream =>
  922. stream !== null &&
  923. typeof stream === 'object' &&
  924. typeof stream.pipe === 'function';
  925. isStream$1.writable = stream =>
  926. isStream$1(stream) &&
  927. stream.writable !== false &&
  928. typeof stream._write === 'function' &&
  929. typeof stream._writableState === 'object';
  930. isStream$1.readable = stream =>
  931. isStream$1(stream) &&
  932. stream.readable !== false &&
  933. typeof stream._read === 'function' &&
  934. typeof stream._readableState === 'object';
  935. isStream$1.duplex = stream =>
  936. isStream$1.writable(stream) &&
  937. isStream$1.readable(stream);
  938. isStream$1.transform = stream =>
  939. isStream$1.duplex(stream) &&
  940. typeof stream._transform === 'function';
  941. var isStream_1 = isStream$1;
  942. const isStream = isStream_1;
  943. const getStream = getStream$1.exports;
  944. const mergeStream = mergeStream$1;
  945. // `input` option
  946. const handleInput$1 = (spawned, input) => {
  947. // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852
  948. // @todo remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0
  949. if (input === undefined || spawned.stdin === undefined) {
  950. return;
  951. }
  952. if (isStream(input)) {
  953. input.pipe(spawned.stdin);
  954. } else {
  955. spawned.stdin.end(input);
  956. }
  957. };
  958. // `all` interleaves `stdout` and `stderr`
  959. const makeAllStream$1 = (spawned, {all}) => {
  960. if (!all || (!spawned.stdout && !spawned.stderr)) {
  961. return;
  962. }
  963. const mixed = mergeStream();
  964. if (spawned.stdout) {
  965. mixed.add(spawned.stdout);
  966. }
  967. if (spawned.stderr) {
  968. mixed.add(spawned.stderr);
  969. }
  970. return mixed;
  971. };
  972. // On failure, `result.stdout|stderr|all` should contain the currently buffered stream
  973. const getBufferedData = async (stream, streamPromise) => {
  974. if (!stream) {
  975. return;
  976. }
  977. stream.destroy();
  978. try {
  979. return await streamPromise;
  980. } catch (error) {
  981. return error.bufferedData;
  982. }
  983. };
  984. const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => {
  985. if (!stream || !buffer) {
  986. return;
  987. }
  988. if (encoding) {
  989. return getStream(stream, {encoding, maxBuffer});
  990. }
  991. return getStream.buffer(stream, {maxBuffer});
  992. };
  993. // Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all)
  994. const getSpawnedResult$1 = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => {
  995. const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer});
  996. const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer});
  997. const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2});
  998. try {
  999. return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
  1000. } catch (error) {
  1001. return Promise.all([
  1002. {error, signal: error.signal, timedOut: error.timedOut},
  1003. getBufferedData(stdout, stdoutPromise),
  1004. getBufferedData(stderr, stderrPromise),
  1005. getBufferedData(all, allPromise)
  1006. ]);
  1007. }
  1008. };
  1009. const validateInputSync$1 = ({input}) => {
  1010. if (isStream(input)) {
  1011. throw new TypeError('The `input` option cannot be a stream in sync mode');
  1012. }
  1013. };
  1014. var stream = {
  1015. handleInput: handleInput$1,
  1016. makeAllStream: makeAllStream$1,
  1017. getSpawnedResult: getSpawnedResult$1,
  1018. validateInputSync: validateInputSync$1
  1019. };
  1020. const nativePromisePrototype = (async () => {})().constructor.prototype;
  1021. const descriptors = ['then', 'catch', 'finally'].map(property => [
  1022. property,
  1023. Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
  1024. ]);
  1025. // The return value is a mixin of `childProcess` and `Promise`
  1026. const mergePromise$1 = (spawned, promise) => {
  1027. for (const [property, descriptor] of descriptors) {
  1028. // Starting the main `promise` is deferred to avoid consuming streams
  1029. const value = typeof promise === 'function' ?
  1030. (...args) => Reflect.apply(descriptor.value, promise(), args) :
  1031. descriptor.value.bind(promise);
  1032. Reflect.defineProperty(spawned, property, {...descriptor, value});
  1033. }
  1034. return spawned;
  1035. };
  1036. // Use promises instead of `child_process` events
  1037. const getSpawnedPromise$1 = spawned => {
  1038. return new Promise((resolve, reject) => {
  1039. spawned.on('exit', (exitCode, signal) => {
  1040. resolve({exitCode, signal});
  1041. });
  1042. spawned.on('error', error => {
  1043. reject(error);
  1044. });
  1045. if (spawned.stdin) {
  1046. spawned.stdin.on('error', error => {
  1047. reject(error);
  1048. });
  1049. }
  1050. });
  1051. };
  1052. var promise = {
  1053. mergePromise: mergePromise$1,
  1054. getSpawnedPromise: getSpawnedPromise$1
  1055. };
  1056. const normalizeArgs = (file, args = []) => {
  1057. if (!Array.isArray(args)) {
  1058. return [file];
  1059. }
  1060. return [file, ...args];
  1061. };
  1062. const NO_ESCAPE_REGEXP = /^[\w.-]+$/;
  1063. const DOUBLE_QUOTES_REGEXP = /"/g;
  1064. const escapeArg = arg => {
  1065. if (typeof arg !== 'string' || NO_ESCAPE_REGEXP.test(arg)) {
  1066. return arg;
  1067. }
  1068. return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`;
  1069. };
  1070. const joinCommand$1 = (file, args) => {
  1071. return normalizeArgs(file, args).join(' ');
  1072. };
  1073. const getEscapedCommand$1 = (file, args) => {
  1074. return normalizeArgs(file, args).map(arg => escapeArg(arg)).join(' ');
  1075. };
  1076. const SPACES_REGEXP = / +/g;
  1077. // Handle `execa.command()`
  1078. const parseCommand$1 = command => {
  1079. const tokens = [];
  1080. for (const token of command.trim().split(SPACES_REGEXP)) {
  1081. // Allow spaces to be escaped by a backslash if not meant as a delimiter
  1082. const previousToken = tokens[tokens.length - 1];
  1083. if (previousToken && previousToken.endsWith('\\')) {
  1084. // Merge previous token with current one
  1085. tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
  1086. } else {
  1087. tokens.push(token);
  1088. }
  1089. }
  1090. return tokens;
  1091. };
  1092. var command = {
  1093. joinCommand: joinCommand$1,
  1094. getEscapedCommand: getEscapedCommand$1,
  1095. parseCommand: parseCommand$1
  1096. };
  1097. const path = k;
  1098. const childProcess = require$$0$3;
  1099. const crossSpawn = crossSpawn$1.exports;
  1100. const stripFinalNewline = stripFinalNewline$1;
  1101. const npmRunPath = npmRunPath$1.exports;
  1102. const onetime = onetime$1.exports;
  1103. const makeError = error;
  1104. const normalizeStdio = stdio.exports;
  1105. const {spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler} = kill;
  1106. const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = stream;
  1107. const {mergePromise, getSpawnedPromise} = promise;
  1108. const {joinCommand, parseCommand, getEscapedCommand} = command;
  1109. const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;
  1110. const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => {
  1111. const env = extendEnv ? {...process.env, ...envOption} : envOption;
  1112. if (preferLocal) {
  1113. return npmRunPath.env({env, cwd: localDir, execPath});
  1114. }
  1115. return env;
  1116. };
  1117. const handleArguments = (file, args, options = {}) => {
  1118. const parsed = crossSpawn._parse(file, args, options);
  1119. file = parsed.command;
  1120. args = parsed.args;
  1121. options = parsed.options;
  1122. options = {
  1123. maxBuffer: DEFAULT_MAX_BUFFER,
  1124. buffer: true,
  1125. stripFinalNewline: true,
  1126. extendEnv: true,
  1127. preferLocal: false,
  1128. localDir: options.cwd || process.cwd(),
  1129. execPath: process.execPath,
  1130. encoding: 'utf8',
  1131. reject: true,
  1132. cleanup: true,
  1133. all: false,
  1134. windowsHide: true,
  1135. ...options
  1136. };
  1137. options.env = getEnv(options);
  1138. options.stdio = normalizeStdio(options);
  1139. if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') {
  1140. // #116
  1141. args.unshift('/q');
  1142. }
  1143. return {file, args, options, parsed};
  1144. };
  1145. const handleOutput = (options, value, error) => {
  1146. if (typeof value !== 'string' && !Buffer.isBuffer(value)) {
  1147. // When `execa.sync()` errors, we normalize it to '' to mimic `execa()`
  1148. return error === undefined ? undefined : '';
  1149. }
  1150. if (options.stripFinalNewline) {
  1151. return stripFinalNewline(value);
  1152. }
  1153. return value;
  1154. };
  1155. const execa = (file, args, options) => {
  1156. const parsed = handleArguments(file, args, options);
  1157. const command = joinCommand(file, args);
  1158. const escapedCommand = getEscapedCommand(file, args);
  1159. validateTimeout(parsed.options);
  1160. let spawned;
  1161. try {
  1162. spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
  1163. } catch (error) {
  1164. // Ensure the returned error is always both a promise and a child process
  1165. const dummySpawned = new childProcess.ChildProcess();
  1166. const errorPromise = Promise.reject(makeError({
  1167. error,
  1168. stdout: '',
  1169. stderr: '',
  1170. all: '',
  1171. command,
  1172. escapedCommand,
  1173. parsed,
  1174. timedOut: false,
  1175. isCanceled: false,
  1176. killed: false
  1177. }));
  1178. return mergePromise(dummySpawned, errorPromise);
  1179. }
  1180. const spawnedPromise = getSpawnedPromise(spawned);
  1181. const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
  1182. const processDone = setExitHandler(spawned, parsed.options, timedPromise);
  1183. const context = {isCanceled: false};
  1184. spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
  1185. spawned.cancel = spawnedCancel.bind(null, spawned, context);
  1186. const handlePromise = async () => {
  1187. const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
  1188. const stdout = handleOutput(parsed.options, stdoutResult);
  1189. const stderr = handleOutput(parsed.options, stderrResult);
  1190. const all = handleOutput(parsed.options, allResult);
  1191. if (error || exitCode !== 0 || signal !== null) {
  1192. const returnedError = makeError({
  1193. error,
  1194. exitCode,
  1195. signal,
  1196. stdout,
  1197. stderr,
  1198. all,
  1199. command,
  1200. escapedCommand,
  1201. parsed,
  1202. timedOut,
  1203. isCanceled: context.isCanceled,
  1204. killed: spawned.killed
  1205. });
  1206. if (!parsed.options.reject) {
  1207. return returnedError;
  1208. }
  1209. throw returnedError;
  1210. }
  1211. return {
  1212. command,
  1213. escapedCommand,
  1214. exitCode: 0,
  1215. stdout,
  1216. stderr,
  1217. all,
  1218. failed: false,
  1219. timedOut: false,
  1220. isCanceled: false,
  1221. killed: false
  1222. };
  1223. };
  1224. const handlePromiseOnce = onetime(handlePromise);
  1225. handleInput(spawned, parsed.options.input);
  1226. spawned.all = makeAllStream(spawned, parsed.options);
  1227. return mergePromise(spawned, handlePromiseOnce);
  1228. };
  1229. execa$1.exports = execa;
  1230. execa$1.exports.sync = (file, args, options) => {
  1231. const parsed = handleArguments(file, args, options);
  1232. const command = joinCommand(file, args);
  1233. const escapedCommand = getEscapedCommand(file, args);
  1234. validateInputSync(parsed.options);
  1235. let result;
  1236. try {
  1237. result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);
  1238. } catch (error) {
  1239. throw makeError({
  1240. error,
  1241. stdout: '',
  1242. stderr: '',
  1243. all: '',
  1244. command,
  1245. escapedCommand,
  1246. parsed,
  1247. timedOut: false,
  1248. isCanceled: false,
  1249. killed: false
  1250. });
  1251. }
  1252. const stdout = handleOutput(parsed.options, result.stdout, result.error);
  1253. const stderr = handleOutput(parsed.options, result.stderr, result.error);
  1254. if (result.error || result.status !== 0 || result.signal !== null) {
  1255. const error = makeError({
  1256. stdout,
  1257. stderr,
  1258. error: result.error,
  1259. signal: result.signal,
  1260. exitCode: result.status,
  1261. command,
  1262. escapedCommand,
  1263. parsed,
  1264. timedOut: result.error && result.error.code === 'ETIMEDOUT',
  1265. isCanceled: false,
  1266. killed: result.signal !== null
  1267. });
  1268. if (!parsed.options.reject) {
  1269. return error;
  1270. }
  1271. throw error;
  1272. }
  1273. return {
  1274. command,
  1275. escapedCommand,
  1276. exitCode: 0,
  1277. stdout,
  1278. stderr,
  1279. failed: false,
  1280. timedOut: false,
  1281. isCanceled: false,
  1282. killed: false
  1283. };
  1284. };
  1285. execa$1.exports.command = (command, options) => {
  1286. const [file, ...args] = parseCommand(command);
  1287. return execa(file, args, options);
  1288. };
  1289. execa$1.exports.commandSync = (command, options) => {
  1290. const [file, ...args] = parseCommand(command);
  1291. return execa.sync(file, args, options);
  1292. };
  1293. execa$1.exports.node = (scriptPath, args, options = {}) => {
  1294. if (args && !Array.isArray(args) && typeof args === 'object') {
  1295. options = args;
  1296. args = [];
  1297. }
  1298. const stdio = normalizeStdio.node(options);
  1299. const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect'));
  1300. const {
  1301. nodePath = process.execPath,
  1302. nodeOptions = defaultExecArgv
  1303. } = options;
  1304. return execa(
  1305. nodePath,
  1306. [
  1307. ...nodeOptions,
  1308. scriptPath,
  1309. ...(Array.isArray(args) ? args : [])
  1310. ],
  1311. {
  1312. ...options,
  1313. stdin: undefined,
  1314. stdout: undefined,
  1315. stderr: undefined,
  1316. stdio,
  1317. shell: false
  1318. }
  1319. );
  1320. };
  1321. // src/detect.ts
  1322. var AGENTS = ["pnpm", "yarn", "npm", "pnpm@6", "yarn@berry", "bun"];
  1323. var LOCKS = {
  1324. "bun.lockb": "bun",
  1325. "pnpm-lock.yaml": "pnpm",
  1326. "yarn.lock": "yarn",
  1327. "package-lock.json": "npm",
  1328. "npm-shrinkwrap.json": "npm"
  1329. };
  1330. async function detectPackageManager(cwd = process.cwd()) {
  1331. let agent = null;
  1332. const lockPath = await findUp(Object.keys(LOCKS), { cwd });
  1333. let packageJsonPath;
  1334. if (lockPath)
  1335. packageJsonPath = k.resolve(lockPath, "../package.json");
  1336. else
  1337. packageJsonPath = await findUp("package.json", { cwd });
  1338. if (packageJsonPath && require$$0.existsSync(packageJsonPath)) {
  1339. try {
  1340. const pkg = JSON.parse(require$$0.readFileSync(packageJsonPath, "utf8"));
  1341. if (typeof pkg.packageManager === "string") {
  1342. const [name, version] = pkg.packageManager.split("@");
  1343. if (name === "yarn" && parseInt(version) > 1)
  1344. agent = "yarn@berry";
  1345. else if (name === "pnpm" && parseInt(version) < 7)
  1346. agent = "pnpm@6";
  1347. else if (name in AGENTS)
  1348. agent = name;
  1349. else
  1350. console.warn("[ni] Unknown packageManager:", pkg.packageManager);
  1351. }
  1352. } catch {
  1353. }
  1354. }
  1355. if (!agent && lockPath)
  1356. agent = LOCKS[k.basename(lockPath)];
  1357. return agent;
  1358. }
  1359. async function installPackage(names, options = {}) {
  1360. const detectedAgent = options.packageManager || await detectPackageManager(options.cwd) || "npm";
  1361. const [agent] = detectedAgent.split("@");
  1362. if (!Array.isArray(names))
  1363. names = [names];
  1364. const args = options.additionalArgs || [];
  1365. if (options.preferOffline) {
  1366. if (detectedAgent === "yarn@berry")
  1367. args.unshift("--cached");
  1368. else
  1369. args.unshift("--prefer-offline");
  1370. }
  1371. return execa$1.exports(
  1372. agent,
  1373. [
  1374. agent === "yarn" ? "add" : "install",
  1375. options.dev ? "-D" : "",
  1376. ...args,
  1377. ...names
  1378. ].filter(Boolean),
  1379. {
  1380. stdio: options.silent ? "ignore" : "inherit",
  1381. cwd: options.cwd
  1382. }
  1383. );
  1384. }
  1385. export { detectPackageManager, installPackage };