@slidev/cli 0.33.1 → 0.34.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/README.md +2 -3
- package/dist/{build-JAORN7ES.mjs → build-F5QDKRVS.mjs} +4 -5
- package/dist/{build-OWDFSW6Q.js → build-ZRCGLMWG.js} +13 -14
- package/dist/{chunk-MVE4F2AE.mjs → chunk-4BYU5VF4.mjs} +40 -39
- package/dist/{chunk-DGFMEJWT.mjs → chunk-4NHF5SPM.mjs} +125 -63
- package/dist/{chunk-LIMOCTLS.js → chunk-EN47OEVJ.js} +172 -171
- package/dist/{chunk-IWKTUAXD.mjs → chunk-GVA336JI.mjs} +0 -32
- package/dist/{chunk-IP7ZGKHI.js → chunk-SQLX75IO.js} +1 -33
- package/dist/{chunk-WGEHDK3K.js → chunk-XIB52LE6.js} +166 -104
- package/dist/cli.js +28 -25
- package/dist/cli.mjs +9 -6
- package/dist/{export-Z44PM4CT.mjs → export-5OVMZQWE.mjs} +1 -1
- package/dist/{export-JHIU6OQI.js → export-TH7MNEXN.js} +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +16 -14
package/README.md
CHANGED
|
@@ -27,7 +27,6 @@ Presentation <b>slide</b>s for <b>dev</b>elopers 🧑💻👩💻👨
|
|
|
27
27
|
<tbody>
|
|
28
28
|
<td align="center">
|
|
29
29
|
<img width="2000" height="0"><br>
|
|
30
|
-
Status: <b>Public Beta 🎉</b><br>
|
|
31
30
|
<sub>Made possible by my <a href="https://github.com/sponsors/antfu">Sponsor Program 💖</a></sub><br>
|
|
32
31
|
<img width="2000" height="0">
|
|
33
32
|
</td>
|
|
@@ -40,7 +39,7 @@ Status: <b>Public Beta 🎉</b><br>
|
|
|
40
39
|
- 📝 [**Markdown-based**](https://sli.dev/guide/syntax.html) - use your favorite editors and workflow
|
|
41
40
|
- 🧑💻 [**Developer Friendly**](https://sli.dev/guide/syntax.html#code-blocks) - built-in syntax highlighting, live coding, etc.
|
|
42
41
|
- 🎨 [**Themable**](https://sli.dev/themes/gallery.html) - theme can be shared and used with npm packages.
|
|
43
|
-
- 🌈 [**Stylish**](https://sli.dev/guide/syntax.html#embedded-styles) - [Windi CSS](https://windicss.org/)
|
|
42
|
+
- 🌈 [**Stylish**](https://sli.dev/guide/syntax.html#embedded-styles) - on-demand utilities via [Windi CSS](https://windicss.org/) or [UnoCSS](https://github.com/unocss/unocss).
|
|
44
43
|
- 🤹 [**Interactive**](https://sli.dev/custom/directory-structure.html#components) - embedding Vue components seamlessly.
|
|
45
44
|
- 🎙 [**Presenter Mode**](https://sli.dev/guide/presenter-mode.html) - use another window, or even your phone to control your slides.
|
|
46
45
|
- 🧮 [**LaTeX**](https://sli.dev/guide/syntax.html#latex) - built-in LaTeX math equations support.
|
|
@@ -79,7 +78,7 @@ For a full example, you can check the [demo](https://github.com/slidevjs/slidev/
|
|
|
79
78
|
|
|
80
79
|
- [Vite](https://vitejs.dev) - An extremely fast frontend tooling
|
|
81
80
|
- [Vue 3](https://v3.vuejs.org/) powered [Markdown](https://daringfireball.net/projects/markdown/syntax) - Focus on the content while having the power of HTML and Vue components whenever needed
|
|
82
|
-
- [Windi CSS](https://github.com/windicss/windicss) - On-demand utility-first CSS framework, style your slides at ease
|
|
81
|
+
- [Windi CSS](https://github.com/windicss/windicss) / [UnoCSS](https://github.com/unocss/unocss) - On-demand utility-first CSS framework, style your slides at ease
|
|
83
82
|
- [Prism](https://github.com/PrismJS/prism), [Shiki](https://github.com/shikijs/shiki), [Monaco Editor](https://github.com/Microsoft/monaco-editor) - First-class code snippets support with live coding capability
|
|
84
83
|
- [RecordRTC](https://recordrtc.org) - Built-in recording and camera view
|
|
85
84
|
- [VueUse](https://vueuse.org) family - [`@vueuse/core`](https://github.com/vueuse/vueuse), [`@vueuse/head`](https://github.com/vueuse/head), [`@vueuse/motion`](https://github.com/vueuse/motion), etc.
|
|
@@ -2,13 +2,12 @@ import {
|
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml,
|
|
4
4
|
mergeViteConfigs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4NHF5SPM.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__require,
|
|
8
|
-
__spreadValues,
|
|
9
8
|
__toESM,
|
|
10
9
|
init_esm_shims
|
|
11
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GVA336JI.mjs";
|
|
12
11
|
|
|
13
12
|
// node/build.ts
|
|
14
13
|
init_esm_shims();
|
|
@@ -528,7 +527,7 @@ function is404(req, res) {
|
|
|
528
527
|
}
|
|
529
528
|
function send(req, res, file, stats, headers) {
|
|
530
529
|
let code = 200, tmp, opts = {};
|
|
531
|
-
headers =
|
|
530
|
+
headers = { ...headers };
|
|
532
531
|
for (let key in headers) {
|
|
533
532
|
tmp = res.getHeader(key);
|
|
534
533
|
if (tmp)
|
|
@@ -714,7 +713,7 @@ async function build(options, viteConfig = {}) {
|
|
|
714
713
|
await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
715
714
|
`, "utf-8");
|
|
716
715
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
717
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
716
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-5OVMZQWE.mjs")));
|
|
718
717
|
const port = 12445;
|
|
719
718
|
const app = connect();
|
|
720
719
|
const server = http.createServer(app);
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkXIB52LE6js = require('./chunk-XIB52LE6.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
var _chunkIP7ZGKHIjs = require('./chunk-IP7ZGKHI.js');
|
|
10
|
+
var _chunkSQLX75IOjs = require('./chunk-SQLX75IO.js');
|
|
12
11
|
|
|
13
12
|
// node/build.ts
|
|
14
|
-
|
|
13
|
+
_chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
15
14
|
var _path = require('path');
|
|
16
15
|
var _http = require('http'); var _http2 = _interopRequireDefault(_http);
|
|
17
16
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
@@ -19,12 +18,12 @@ var _vite = require('vite');
|
|
|
19
18
|
var _connect = require('connect'); var _connect2 = _interopRequireDefault(_connect);
|
|
20
19
|
|
|
21
20
|
// ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
|
|
22
|
-
|
|
21
|
+
_chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
23
22
|
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
// ../../node_modules/.pnpm/totalist@3.0.0/node_modules/totalist/sync/index.mjs
|
|
27
|
-
|
|
26
|
+
_chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
function totalist(dir, callback, pre = "") {
|
|
@@ -39,7 +38,7 @@ function totalist(dir, callback, pre = "") {
|
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
// ../../node_modules/.pnpm/@polka+url@1.0.0-next.21/node_modules/@polka/url/build.mjs
|
|
42
|
-
|
|
41
|
+
_chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
43
42
|
var _querystring = require('querystring'); var qs = _interopRequireWildcard(_querystring);
|
|
44
43
|
function parse2(req) {
|
|
45
44
|
let raw = req.url;
|
|
@@ -63,7 +62,7 @@ function parse2(req) {
|
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
// ../../node_modules/.pnpm/mrmime@1.0.0/node_modules/mrmime/index.mjs
|
|
66
|
-
|
|
65
|
+
_chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
67
66
|
var mimes = {
|
|
68
67
|
"ez": "application/andrew-inset",
|
|
69
68
|
"aw": "application/applixware",
|
|
@@ -528,7 +527,7 @@ function is404(req, res) {
|
|
|
528
527
|
}
|
|
529
528
|
function send(req, res, file, stats, headers) {
|
|
530
529
|
let code = 200, tmp, opts = {};
|
|
531
|
-
headers =
|
|
530
|
+
headers = { ...headers };
|
|
532
531
|
for (let key in headers) {
|
|
533
532
|
tmp = res.getHeader(key);
|
|
534
533
|
if (tmp)
|
|
@@ -656,13 +655,13 @@ async function build(options, viteConfig = {}) {
|
|
|
656
655
|
let originalIndexHTML;
|
|
657
656
|
if (_fsextra2.default.existsSync(indexPath))
|
|
658
657
|
originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
|
|
659
|
-
await _fsextra2.default.writeFile(indexPath, await
|
|
658
|
+
await _fsextra2.default.writeFile(indexPath, await _chunkXIB52LE6js.getIndexHtml.call(void 0, options), "utf-8");
|
|
660
659
|
let config = void 0;
|
|
661
660
|
try {
|
|
662
|
-
const inlineConfig = await
|
|
661
|
+
const inlineConfig = await _chunkXIB52LE6js.mergeViteConfigs.call(void 0, options, viteConfig, {
|
|
663
662
|
root: options.userRoot,
|
|
664
663
|
plugins: [
|
|
665
|
-
await
|
|
664
|
+
await _chunkXIB52LE6js.ViteSlidevPlugin.call(void 0, options, pluginOptions),
|
|
666
665
|
{
|
|
667
666
|
name: "resolve-config",
|
|
668
667
|
configResolved(_config) {
|
|
@@ -680,7 +679,7 @@ async function build(options, viteConfig = {}) {
|
|
|
680
679
|
console.log(_kolorist.yellow.call(void 0, " Monaco is disabled in the build, to enabled it, set `monaco: true` in the frontmatter"));
|
|
681
680
|
} else {
|
|
682
681
|
console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
|
|
683
|
-
await _vite.build.call(void 0, await
|
|
682
|
+
await _vite.build.call(void 0, await _chunkXIB52LE6js.mergeViteConfigs.call(void 0, options, inlineConfig, {
|
|
684
683
|
root: _path.join.call(void 0, options.clientRoot, "iframes/monaco"),
|
|
685
684
|
base: `${config.base}iframes/monaco/`,
|
|
686
685
|
build: {
|
|
@@ -714,7 +713,7 @@ async function build(options, viteConfig = {}) {
|
|
|
714
713
|
await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
715
714
|
`, "utf-8");
|
|
716
715
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
717
|
-
const { exportSlides } = await Promise.resolve().then(() =>
|
|
716
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./export-TH7MNEXN.js")));
|
|
718
717
|
const port = 12445;
|
|
719
718
|
const app = _connect2.default.call(void 0, );
|
|
720
719
|
const server = _http2.default.createServer(app);
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4NHF5SPM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__dirname,
|
|
8
|
-
__objRest,
|
|
9
8
|
__privateAdd,
|
|
10
9
|
__privateGet,
|
|
11
10
|
__privateSet,
|
|
12
11
|
__privateWrapper,
|
|
13
|
-
__spreadProps,
|
|
14
|
-
__spreadValues,
|
|
15
12
|
__toESM,
|
|
16
13
|
init_esm_shims,
|
|
17
14
|
packageExists,
|
|
18
15
|
resolveImportPath
|
|
19
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GVA336JI.mjs";
|
|
20
17
|
|
|
21
18
|
// ../../node_modules/.pnpm/semver@7.3.7/node_modules/semver/internal/constants.js
|
|
22
19
|
var require_constants = __commonJS({
|
|
@@ -2402,16 +2399,16 @@ init_esm_shims();
|
|
|
2402
2399
|
import * as parser from "@slidev/parser/fs";
|
|
2403
2400
|
|
|
2404
2401
|
// package.json
|
|
2405
|
-
var version = "0.
|
|
2402
|
+
var version = "0.34.2";
|
|
2406
2403
|
|
|
2407
2404
|
// node/themes.ts
|
|
2408
2405
|
init_esm_shims();
|
|
2409
2406
|
import prompts2 from "prompts";
|
|
2410
2407
|
|
|
2411
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.16.
|
|
2408
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.16.3/node_modules/@antfu/ni/dist/index.mjs
|
|
2412
2409
|
init_esm_shims();
|
|
2413
2410
|
|
|
2414
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.16.
|
|
2411
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.16.3/node_modules/@antfu/ni/dist/chunks/runner.mjs
|
|
2415
2412
|
init_esm_shims();
|
|
2416
2413
|
import require$$0, { resolve } from "path";
|
|
2417
2414
|
import require$$0$5 from "readline";
|
|
@@ -2431,7 +2428,7 @@ import require$$0$3 from "stream";
|
|
|
2431
2428
|
import require$$2$1 from "util";
|
|
2432
2429
|
import { promises } from "fs";
|
|
2433
2430
|
import require$$1 from "tty";
|
|
2434
|
-
var version2 = "0.16.
|
|
2431
|
+
var version2 = "0.16.3";
|
|
2435
2432
|
var npmRun = (agent) => (args) => {
|
|
2436
2433
|
if (args.length > 1)
|
|
2437
2434
|
return `${agent} run ${args[0]} -- ${args.slice(1).join(" ")}`;
|
|
@@ -2479,23 +2476,26 @@ var AGENTS = {
|
|
|
2479
2476
|
"global_uninstall": "npm uninstall -g {0}"
|
|
2480
2477
|
},
|
|
2481
2478
|
"yarn": yarn,
|
|
2482
|
-
"yarn@berry":
|
|
2479
|
+
"yarn@berry": {
|
|
2480
|
+
...yarn,
|
|
2483
2481
|
"frozen": "yarn install --immutable",
|
|
2484
2482
|
"upgrade": "yarn up {0}",
|
|
2485
2483
|
"upgrade-interactive": "yarn up -i {0}",
|
|
2486
2484
|
"global": "npm i -g {0}",
|
|
2487
2485
|
"global_uninstall": "npm uninstall -g {0}"
|
|
2488
|
-
}
|
|
2486
|
+
},
|
|
2489
2487
|
"pnpm": pnpm,
|
|
2490
|
-
"pnpm@6":
|
|
2488
|
+
"pnpm@6": {
|
|
2489
|
+
...pnpm,
|
|
2491
2490
|
run: npmRun("pnpm")
|
|
2492
|
-
}
|
|
2491
|
+
}
|
|
2493
2492
|
};
|
|
2494
2493
|
var agents = Object.keys(AGENTS);
|
|
2495
2494
|
var LOCKS = {
|
|
2496
2495
|
"pnpm-lock.yaml": "pnpm",
|
|
2497
2496
|
"yarn.lock": "yarn",
|
|
2498
|
-
"package-lock.json": "npm"
|
|
2497
|
+
"package-lock.json": "npm",
|
|
2498
|
+
"npm-shrinkwrap.json": "npm"
|
|
2499
2499
|
};
|
|
2500
2500
|
var INSTALL_PAGE = {
|
|
2501
2501
|
"pnpm": "https://pnpm.js.org/en/installation",
|
|
@@ -3108,7 +3108,7 @@ async function findUpMultiple(name, options = {}) {
|
|
|
3108
3108
|
};
|
|
3109
3109
|
const matches = [];
|
|
3110
3110
|
while (true) {
|
|
3111
|
-
const foundPath = await runMatcher(
|
|
3111
|
+
const foundPath = await runMatcher({ ...options, cwd: directory });
|
|
3112
3112
|
if (foundPath === findUpStop) {
|
|
3113
3113
|
break;
|
|
3114
3114
|
}
|
|
@@ -3123,7 +3123,7 @@ async function findUpMultiple(name, options = {}) {
|
|
|
3123
3123
|
return matches;
|
|
3124
3124
|
}
|
|
3125
3125
|
async function findUp(name, options = {}) {
|
|
3126
|
-
const matches = await findUpMultiple(name,
|
|
3126
|
+
const matches = await findUpMultiple(name, { ...options, limit: 1 });
|
|
3127
3127
|
return matches[0];
|
|
3128
3128
|
}
|
|
3129
3129
|
var customRcPath = process.env.NI_CONFIG_FILE;
|
|
@@ -3415,9 +3415,8 @@ function npmRunPath(options = {}) {
|
|
|
3415
3415
|
result.push(path$3.resolve(cwdString, execPath, ".."));
|
|
3416
3416
|
return [...result, path_].join(path$3.delimiter);
|
|
3417
3417
|
}
|
|
3418
|
-
function npmRunPathEnv(
|
|
3419
|
-
|
|
3420
|
-
env2 = __spreadValues({}, env2);
|
|
3418
|
+
function npmRunPathEnv({ env: env2 = process$2.env, ...options } = {}) {
|
|
3419
|
+
env2 = { ...env2 };
|
|
3421
3420
|
const path2 = pathKey({ env: env2 });
|
|
3422
3421
|
options.path = env2[path2];
|
|
3423
3422
|
env2[path2] = npmRunPath(options);
|
|
@@ -3455,7 +3454,7 @@ var changeToString = (to, from, name) => {
|
|
|
3455
3454
|
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
3456
3455
|
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
3457
3456
|
Object.defineProperty(newToString, "name", toStringName);
|
|
3458
|
-
Object.defineProperty(to, "toString",
|
|
3457
|
+
Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
|
|
3459
3458
|
};
|
|
3460
3459
|
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
3461
3460
|
const { name } = to;
|
|
@@ -3805,9 +3804,10 @@ var getSignalsByName = function() {
|
|
|
3805
3804
|
return signals.reduce(getSignalByName, {});
|
|
3806
3805
|
};
|
|
3807
3806
|
var getSignalByName = function(signalByNameMemo, { name, number: number2, description, supported, action: action2, forced, standard }) {
|
|
3808
|
-
return
|
|
3807
|
+
return {
|
|
3808
|
+
...signalByNameMemo,
|
|
3809
3809
|
[name]: { name, number: number2, description, supported, action: action2, forced, standard }
|
|
3810
|
-
}
|
|
3810
|
+
};
|
|
3811
3811
|
};
|
|
3812
3812
|
var signalsByName = getSignalsByName();
|
|
3813
3813
|
var getSignalsByNumber = function() {
|
|
@@ -4178,7 +4178,7 @@ function isStream(stream2) {
|
|
|
4178
4178
|
var getStream$2 = { exports: {} };
|
|
4179
4179
|
var { PassThrough: PassThroughStream } = require$$0$3;
|
|
4180
4180
|
var bufferStream$1 = (options) => {
|
|
4181
|
-
options =
|
|
4181
|
+
options = { ...options };
|
|
4182
4182
|
const { array } = options;
|
|
4183
4183
|
let { encoding } = options;
|
|
4184
4184
|
const isBuffer = encoding === "buffer";
|
|
@@ -4229,9 +4229,10 @@ async function getStream(inputStream, options) {
|
|
|
4229
4229
|
if (!inputStream) {
|
|
4230
4230
|
throw new Error("Expected a stream");
|
|
4231
4231
|
}
|
|
4232
|
-
options =
|
|
4233
|
-
maxBuffer: Infinity
|
|
4234
|
-
|
|
4232
|
+
options = {
|
|
4233
|
+
maxBuffer: Infinity,
|
|
4234
|
+
...options
|
|
4235
|
+
};
|
|
4235
4236
|
const { maxBuffer } = options;
|
|
4236
4237
|
const stream2 = bufferStream(options);
|
|
4237
4238
|
await new Promise((resolve3, reject) => {
|
|
@@ -4258,8 +4259,8 @@ async function getStream(inputStream, options) {
|
|
|
4258
4259
|
return stream2.getBufferedValue();
|
|
4259
4260
|
}
|
|
4260
4261
|
getStream$2.exports = getStream;
|
|
4261
|
-
getStream$2.exports.buffer = (stream2, options) => getStream(stream2,
|
|
4262
|
-
getStream$2.exports.array = (stream2, options) => getStream(stream2,
|
|
4262
|
+
getStream$2.exports.buffer = (stream2, options) => getStream(stream2, { ...options, encoding: "buffer" });
|
|
4263
|
+
getStream$2.exports.array = (stream2, options) => getStream(stream2, { ...options, array: true });
|
|
4263
4264
|
getStream$2.exports.MaxBufferError = MaxBufferError;
|
|
4264
4265
|
var getStream$1 = getStream$2.exports;
|
|
4265
4266
|
var { PassThrough } = require$$0$3;
|
|
@@ -4362,7 +4363,7 @@ var descriptors = ["then", "catch", "finally"].map((property) => [
|
|
|
4362
4363
|
var mergePromise = (spawned, promise) => {
|
|
4363
4364
|
for (const [property, descriptor] of descriptors) {
|
|
4364
4365
|
const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
4365
|
-
Reflect.defineProperty(spawned, property,
|
|
4366
|
+
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
4366
4367
|
}
|
|
4367
4368
|
return spawned;
|
|
4368
4369
|
};
|
|
@@ -4410,7 +4411,7 @@ var parseCommand = (command) => {
|
|
|
4410
4411
|
};
|
|
4411
4412
|
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
|
4412
4413
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
4413
|
-
const env2 = extendEnv ?
|
|
4414
|
+
const env2 = extendEnv ? { ...process$2.env, ...envOption } : envOption;
|
|
4414
4415
|
if (preferLocal) {
|
|
4415
4416
|
return npmRunPathEnv({ env: env2, cwd: localDir, execPath });
|
|
4416
4417
|
}
|
|
@@ -4421,7 +4422,7 @@ var handleArguments = (file, args, options = {}) => {
|
|
|
4421
4422
|
file = parsed.command;
|
|
4422
4423
|
args = parsed.args;
|
|
4423
4424
|
options = parsed.options;
|
|
4424
|
-
options =
|
|
4425
|
+
options = {
|
|
4425
4426
|
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
4426
4427
|
buffer: true,
|
|
4427
4428
|
stripFinalNewline: true,
|
|
@@ -4433,8 +4434,9 @@ var handleArguments = (file, args, options = {}) => {
|
|
|
4433
4434
|
reject: true,
|
|
4434
4435
|
cleanup: true,
|
|
4435
4436
|
all: false,
|
|
4436
|
-
windowsHide: true
|
|
4437
|
-
|
|
4437
|
+
windowsHide: true,
|
|
4438
|
+
...options
|
|
4439
|
+
};
|
|
4438
4440
|
options.env = getEnv(options);
|
|
4439
4441
|
options.stdio = normalizeStdio(options);
|
|
4440
4442
|
if (process$2.platform === "win32" && path$3.basename(file, ".exe") === "cmd") {
|
|
@@ -4813,8 +4815,7 @@ var supportsHyperlinks = {
|
|
|
4813
4815
|
stdout: supportsHyperlink(process.stdout),
|
|
4814
4816
|
stderr: supportsHyperlink(process.stderr)
|
|
4815
4817
|
};
|
|
4816
|
-
function terminalLink(text2, url2,
|
|
4817
|
-
var _b = _a, { target = "stdout" } = _b, options = __objRest(_b, ["target"]);
|
|
4818
|
+
function terminalLink(text2, url2, { target = "stdout", ...options } = {}) {
|
|
4818
4819
|
if (!supportsHyperlinks[target]) {
|
|
4819
4820
|
if (options.fallback === false) {
|
|
4820
4821
|
return text2;
|
|
@@ -4824,7 +4825,7 @@ function terminalLink(text2, url2, _a = {}) {
|
|
|
4824
4825
|
return ansiEscapes.link(text2, url2);
|
|
4825
4826
|
}
|
|
4826
4827
|
terminalLink.isSupported = supportsHyperlinks.stdout;
|
|
4827
|
-
terminalLink.stderr = (text2, url2, options = {}) => terminalLink(text2, url2,
|
|
4828
|
+
terminalLink.stderr = (text2, url2, options = {}) => terminalLink(text2, url2, { target: "stderr", ...options });
|
|
4828
4829
|
terminalLink.stderr.isSupported = supportsHyperlinks.stderr;
|
|
4829
4830
|
var prompts$4 = {};
|
|
4830
4831
|
var { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env;
|
|
@@ -9335,7 +9336,7 @@ async function prompt(questions = [], { onSubmit = noop, onCancel = noop } = {})
|
|
|
9335
9336
|
for (question of questions) {
|
|
9336
9337
|
({ name, type } = question);
|
|
9337
9338
|
if (typeof type === "function") {
|
|
9338
|
-
type = await type(answer,
|
|
9339
|
+
type = await type(answer, { ...answers }, question);
|
|
9339
9340
|
question["type"] = type;
|
|
9340
9341
|
}
|
|
9341
9342
|
if (!type)
|
|
@@ -9344,7 +9345,7 @@ async function prompt(questions = [], { onSubmit = noop, onCancel = noop } = {})
|
|
|
9344
9345
|
if (passOn.includes(key))
|
|
9345
9346
|
continue;
|
|
9346
9347
|
let value = question[key];
|
|
9347
|
-
question[key] = typeof value === "function" ? await value(answer,
|
|
9348
|
+
question[key] = typeof value === "function" ? await value(answer, { ...answers }, lastPrompt) : value;
|
|
9348
9349
|
}
|
|
9349
9350
|
lastPrompt = question;
|
|
9350
9351
|
if (typeof question.message !== "string") {
|
|
@@ -9460,7 +9461,7 @@ async function run(fn, args, options = {}) {
|
|
|
9460
9461
|
if (isGlobal) {
|
|
9461
9462
|
command = await fn(await getGlobalAgent(), args);
|
|
9462
9463
|
} else {
|
|
9463
|
-
let agent = await detect(
|
|
9464
|
+
let agent = await detect({ ...options, cwd }) || await getDefaultAgent();
|
|
9464
9465
|
if (agent === "prompt") {
|
|
9465
9466
|
agent = (await prompts({
|
|
9466
9467
|
name: "agent",
|