@slidev/cli 0.43.0-beta.3 → 0.43.0-beta.5
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/dist/{build-BMJKCMWK.js → build-2HVDTXMU.js} +5 -5
- package/dist/{build-4JRH4QXK.mjs → build-UUIAUK3H.mjs} +1 -1
- package/dist/{chunk-O2663AU4.js → chunk-2BMKFV7C.js} +33 -15
- package/dist/{chunk-SWZ5SM6V.mjs → chunk-BAK2YZDZ.mjs} +28 -10
- package/dist/chunk-DXJWPFLI.js +1640 -0
- package/dist/chunk-IMVZEGBY.mjs +1640 -0
- package/dist/cli.js +29 -28
- package/dist/cli.mjs +5 -4
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +9 -9
- package/dist/chunk-WAD6PHVC.mjs +0 -4842
- package/dist/chunk-XPOF53GO.js +0 -4842
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkDXJWPFLIjs = require('./chunk-DXJWPFLI.js');
|
|
6
6
|
require('./chunk-KKGXM3XL.js');
|
|
7
7
|
require('./chunk-JQHGZJGJ.js');
|
|
8
8
|
require('./chunk-YUG22S6W.js');
|
|
@@ -651,16 +651,16 @@ async function build(options, viteConfig = {}, args) {
|
|
|
651
651
|
let originalIndexHTML;
|
|
652
652
|
if (_fsextra2.default.existsSync(indexPath))
|
|
653
653
|
originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
|
|
654
|
-
await _fsextra2.default.writeFile(indexPath, await
|
|
654
|
+
await _fsextra2.default.writeFile(indexPath, await _chunkDXJWPFLIjs.getIndexHtml.call(void 0, options), "utf-8");
|
|
655
655
|
let config = void 0;
|
|
656
656
|
try {
|
|
657
|
-
const inlineConfig = await
|
|
657
|
+
const inlineConfig = await _chunkDXJWPFLIjs.mergeViteConfigs.call(void 0,
|
|
658
658
|
options,
|
|
659
659
|
viteConfig,
|
|
660
660
|
{
|
|
661
661
|
root: options.userRoot,
|
|
662
662
|
plugins: [
|
|
663
|
-
await
|
|
663
|
+
await _chunkDXJWPFLIjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
|
|
664
664
|
{
|
|
665
665
|
name: "resolve-config",
|
|
666
666
|
configResolved(_config) {
|
|
@@ -681,7 +681,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
681
681
|
} else {
|
|
682
682
|
console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
|
|
683
683
|
await _vite.build.call(void 0,
|
|
684
|
-
await
|
|
684
|
+
await _chunkDXJWPFLIjs.mergeViteConfigs.call(void 0,
|
|
685
685
|
options,
|
|
686
686
|
inlineConfig,
|
|
687
687
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkDXJWPFLIjs = require('./chunk-DXJWPFLI.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -2496,7 +2496,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2496
2496
|
const pluginOptions = rawConfig.slidev || {};
|
|
2497
2497
|
_process2.default.env.EDITOR = _process2.default.env.EDITOR || "code";
|
|
2498
2498
|
const server = await _vite.createServer.call(void 0,
|
|
2499
|
-
await
|
|
2499
|
+
await _chunkDXJWPFLIjs.mergeViteConfigs.call(void 0,
|
|
2500
2500
|
options,
|
|
2501
2501
|
viteConfig,
|
|
2502
2502
|
{
|
|
@@ -2506,7 +2506,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2506
2506
|
]
|
|
2507
2507
|
},
|
|
2508
2508
|
plugins: [
|
|
2509
|
-
await
|
|
2509
|
+
await _chunkDXJWPFLIjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
|
|
2510
2510
|
]
|
|
2511
2511
|
},
|
|
2512
2512
|
"serve"
|
|
@@ -2519,12 +2519,12 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2519
2519
|
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
2520
2520
|
|
|
2521
2521
|
// package.json
|
|
2522
|
-
var version = "0.43.0-beta.
|
|
2522
|
+
var version = "0.43.0-beta.5";
|
|
2523
2523
|
|
|
2524
2524
|
// node/themes.ts
|
|
2525
2525
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
2526
2526
|
|
|
2527
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.21.
|
|
2527
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.21.8/node_modules/@antfu/ni/dist/shared/ni.82314ed6.mjs
|
|
2528
2528
|
var _fs2 = require('fs'); var _fs3 = _interopRequireDefault(_fs2);
|
|
2529
2529
|
|
|
2530
2530
|
|
|
@@ -3064,7 +3064,7 @@ async function getConfig() {
|
|
|
3064
3064
|
let packageManager = "";
|
|
3065
3065
|
if (result)
|
|
3066
3066
|
packageManager = _nullishCoalesce(JSON.parse(_fs3.default.readFileSync(result, "utf8")).packageManager, () => ( ""));
|
|
3067
|
-
const [, agent, version3] = packageManager.match(new RegExp(`^(${Object.values(LOCKS).join("|")})@(d).*?$`)) || [];
|
|
3067
|
+
const [, agent, version3] = packageManager.match(new RegExp(`^(${Object.values(LOCKS).join("|")})@(\\d).*?$`)) || [];
|
|
3068
3068
|
if (agent)
|
|
3069
3069
|
config = Object.assign({}, defaultConfig, { defaultAgent: agent === "yarn" && Number.parseInt(version3) > 1 ? "yarn@berry" : agent });
|
|
3070
3070
|
else if (!_fs3.default.existsSync(rcPath))
|
|
@@ -7523,7 +7523,7 @@ function init(open, close) {
|
|
|
7523
7523
|
return txt === void 0 ? chain([open], [blk]) : $.enabled ? run$1([blk], txt + "") : txt + "";
|
|
7524
7524
|
};
|
|
7525
7525
|
}
|
|
7526
|
-
var version2 = "0.21.
|
|
7526
|
+
var version2 = "0.21.8";
|
|
7527
7527
|
var DEBUG_SIGN = "?";
|
|
7528
7528
|
async function getCliCommand(fn, args, options = {}, cwd = _nullishCoalesce(options.cwd, () => ( _process2.default.cwd()))) {
|
|
7529
7529
|
const isGlobal = args.includes("-g");
|
|
@@ -7550,6 +7550,29 @@ async function run(fn, args, options = {}) {
|
|
|
7550
7550
|
const debug2 = args.includes(DEBUG_SIGN);
|
|
7551
7551
|
if (debug2)
|
|
7552
7552
|
remove(args, DEBUG_SIGN);
|
|
7553
|
+
let cwd = _nullishCoalesce(options.cwd, () => ( _process2.default.cwd()));
|
|
7554
|
+
if (args[0] === "-C") {
|
|
7555
|
+
cwd = _path.resolve.call(void 0, cwd, args[1]);
|
|
7556
|
+
args.splice(0, 2);
|
|
7557
|
+
}
|
|
7558
|
+
if (args.length === 1 && _optionalChain([args, 'access', _4 => _4[0], 'optionalAccess', _5 => _5.toLowerCase, 'call', _6 => _6()]) === "-v") {
|
|
7559
|
+
const getV = (a, o) => execaCommand(`${a} -v`, o).then((e) => e.stdout).then((e) => e.startsWith("v") ? e : `v${e}`);
|
|
7560
|
+
const globalAgentPromise = getGlobalAgent();
|
|
7561
|
+
const globalAgentVersionPromise = globalAgentPromise.then(getV);
|
|
7562
|
+
const agentPromise = detect({ ...options, cwd }).then((a) => a || "");
|
|
7563
|
+
const agentVersionPromise = agentPromise.then((a) => a && getV(a, { cwd }));
|
|
7564
|
+
const nodeVersionPromise = getV("node", { cwd });
|
|
7565
|
+
console.log(`@antfu/ni ${$.cyan(`v${version2}`)}`);
|
|
7566
|
+
console.log(`node ${$.green(await nodeVersionPromise)}`);
|
|
7567
|
+
const [agent, agentVersion] = await Promise.all([agentPromise, agentVersionPromise]);
|
|
7568
|
+
if (agent)
|
|
7569
|
+
console.log(`${agent.padEnd(10)} ${$.blue(agentVersion)}`);
|
|
7570
|
+
else
|
|
7571
|
+
console.log("agent no lock file");
|
|
7572
|
+
const [globalAgent, globalAgentVersion] = await Promise.all([globalAgentPromise, globalAgentVersionPromise]);
|
|
7573
|
+
console.log(`${`${globalAgent} -g`.padEnd(10)} ${$.blue(globalAgentVersion)}`);
|
|
7574
|
+
return;
|
|
7575
|
+
}
|
|
7553
7576
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v")) {
|
|
7554
7577
|
console.log(`@antfu/ni v${version2}`);
|
|
7555
7578
|
return;
|
|
@@ -7568,11 +7591,6 @@ async function run(fn, args, options = {}) {
|
|
|
7568
7591
|
console.log($.yellow("\ncheck https://github.com/antfu/ni for more documentation."));
|
|
7569
7592
|
return;
|
|
7570
7593
|
}
|
|
7571
|
-
let cwd = _nullishCoalesce(options.cwd, () => ( _process2.default.cwd()));
|
|
7572
|
-
if (args[0] === "-C") {
|
|
7573
|
-
cwd = _path.resolve.call(void 0, cwd, args[1]);
|
|
7574
|
-
args.splice(0, 2);
|
|
7575
|
-
}
|
|
7576
7594
|
let command = await getCliCommand(fn, args, options, cwd);
|
|
7577
7595
|
if (!command)
|
|
7578
7596
|
return;
|
|
@@ -7586,7 +7604,7 @@ async function run(fn, args, options = {}) {
|
|
|
7586
7604
|
await execaCommand(command, { stdio: "inherit", encoding: "utf-8", cwd });
|
|
7587
7605
|
}
|
|
7588
7606
|
|
|
7589
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.21.
|
|
7607
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.21.8/node_modules/@antfu/ni/dist/index.mjs
|
|
7590
7608
|
|
|
7591
7609
|
|
|
7592
7610
|
|
|
@@ -7624,14 +7642,14 @@ async function getPackageJson(root) {
|
|
|
7624
7642
|
async function getAddons(userRoot, config2) {
|
|
7625
7643
|
const { slidev = {} } = await getPackageJson(userRoot);
|
|
7626
7644
|
const configAddons = Array.isArray(config2.addons) ? config2.addons : [];
|
|
7627
|
-
const addons = configAddons.concat(Array.isArray(_optionalChain([slidev, 'optionalAccess',
|
|
7645
|
+
const addons = configAddons.concat(Array.isArray(_optionalChain([slidev, 'optionalAccess', _7 => _7.addons])) ? slidev.addons : []);
|
|
7628
7646
|
return (await getRecursivePlugins(addons.map(resolvePluginName), 3)).filter(Boolean);
|
|
7629
7647
|
}
|
|
7630
7648
|
async function getRecursivePlugins(addons, depth) {
|
|
7631
7649
|
const addonsArray = await Promise.all(addons.map(async (addon) => {
|
|
7632
7650
|
const { slidev = {}, engines = {} } = await getPackageJson(addon);
|
|
7633
7651
|
checkEngine(addon, engines);
|
|
7634
|
-
let addons2 = Array.isArray(_optionalChain([slidev, 'optionalAccess',
|
|
7652
|
+
let addons2 = Array.isArray(_optionalChain([slidev, 'optionalAccess', _8 => _8.addons])) ? slidev.addons : [];
|
|
7635
7653
|
if (addons2.length > 0 && depth)
|
|
7636
7654
|
addons2 = await getRecursivePlugins(addons2.map(resolvePluginName), depth - 1);
|
|
7637
7655
|
addons2.push(addon);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IMVZEGBY.mjs";
|
|
5
5
|
import {
|
|
6
6
|
packageExists,
|
|
7
7
|
resolveImportPath
|
|
@@ -2519,12 +2519,12 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2519
2519
|
import * as parser from "@slidev/parser/fs";
|
|
2520
2520
|
|
|
2521
2521
|
// package.json
|
|
2522
|
-
var version = "0.43.0-beta.
|
|
2522
|
+
var version = "0.43.0-beta.5";
|
|
2523
2523
|
|
|
2524
2524
|
// node/themes.ts
|
|
2525
2525
|
import prompts2 from "prompts";
|
|
2526
2526
|
|
|
2527
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.21.
|
|
2527
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.21.8/node_modules/@antfu/ni/dist/shared/ni.82314ed6.mjs
|
|
2528
2528
|
import fs$1, { promises, createWriteStream, createReadStream, existsSync } from "node:fs";
|
|
2529
2529
|
import path$3, { join as join$1, dirname, resolve } from "node:path";
|
|
2530
2530
|
import process$2 from "node:process";
|
|
@@ -3064,7 +3064,7 @@ async function getConfig() {
|
|
|
3064
3064
|
let packageManager = "";
|
|
3065
3065
|
if (result)
|
|
3066
3066
|
packageManager = JSON.parse(fs$1.readFileSync(result, "utf8")).packageManager ?? "";
|
|
3067
|
-
const [, agent, version3] = packageManager.match(new RegExp(`^(${Object.values(LOCKS).join("|")})@(d).*?$`)) || [];
|
|
3067
|
+
const [, agent, version3] = packageManager.match(new RegExp(`^(${Object.values(LOCKS).join("|")})@(\\d).*?$`)) || [];
|
|
3068
3068
|
if (agent)
|
|
3069
3069
|
config = Object.assign({}, defaultConfig, { defaultAgent: agent === "yarn" && Number.parseInt(version3) > 1 ? "yarn@berry" : agent });
|
|
3070
3070
|
else if (!fs$1.existsSync(rcPath))
|
|
@@ -7523,7 +7523,7 @@ function init(open, close) {
|
|
|
7523
7523
|
return txt === void 0 ? chain([open], [blk]) : $.enabled ? run$1([blk], txt + "") : txt + "";
|
|
7524
7524
|
};
|
|
7525
7525
|
}
|
|
7526
|
-
var version2 = "0.21.
|
|
7526
|
+
var version2 = "0.21.8";
|
|
7527
7527
|
var DEBUG_SIGN = "?";
|
|
7528
7528
|
async function getCliCommand(fn, args, options = {}, cwd = options.cwd ?? process$2.cwd()) {
|
|
7529
7529
|
const isGlobal = args.includes("-g");
|
|
@@ -7550,6 +7550,29 @@ async function run(fn, args, options = {}) {
|
|
|
7550
7550
|
const debug2 = args.includes(DEBUG_SIGN);
|
|
7551
7551
|
if (debug2)
|
|
7552
7552
|
remove(args, DEBUG_SIGN);
|
|
7553
|
+
let cwd = options.cwd ?? process$2.cwd();
|
|
7554
|
+
if (args[0] === "-C") {
|
|
7555
|
+
cwd = resolve(cwd, args[1]);
|
|
7556
|
+
args.splice(0, 2);
|
|
7557
|
+
}
|
|
7558
|
+
if (args.length === 1 && args[0]?.toLowerCase() === "-v") {
|
|
7559
|
+
const getV = (a, o) => execaCommand(`${a} -v`, o).then((e) => e.stdout).then((e) => e.startsWith("v") ? e : `v${e}`);
|
|
7560
|
+
const globalAgentPromise = getGlobalAgent();
|
|
7561
|
+
const globalAgentVersionPromise = globalAgentPromise.then(getV);
|
|
7562
|
+
const agentPromise = detect({ ...options, cwd }).then((a) => a || "");
|
|
7563
|
+
const agentVersionPromise = agentPromise.then((a) => a && getV(a, { cwd }));
|
|
7564
|
+
const nodeVersionPromise = getV("node", { cwd });
|
|
7565
|
+
console.log(`@antfu/ni ${$.cyan(`v${version2}`)}`);
|
|
7566
|
+
console.log(`node ${$.green(await nodeVersionPromise)}`);
|
|
7567
|
+
const [agent, agentVersion] = await Promise.all([agentPromise, agentVersionPromise]);
|
|
7568
|
+
if (agent)
|
|
7569
|
+
console.log(`${agent.padEnd(10)} ${$.blue(agentVersion)}`);
|
|
7570
|
+
else
|
|
7571
|
+
console.log("agent no lock file");
|
|
7572
|
+
const [globalAgent, globalAgentVersion] = await Promise.all([globalAgentPromise, globalAgentVersionPromise]);
|
|
7573
|
+
console.log(`${`${globalAgent} -g`.padEnd(10)} ${$.blue(globalAgentVersion)}`);
|
|
7574
|
+
return;
|
|
7575
|
+
}
|
|
7553
7576
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v")) {
|
|
7554
7577
|
console.log(`@antfu/ni v${version2}`);
|
|
7555
7578
|
return;
|
|
@@ -7568,11 +7591,6 @@ async function run(fn, args, options = {}) {
|
|
|
7568
7591
|
console.log($.yellow("\ncheck https://github.com/antfu/ni for more documentation."));
|
|
7569
7592
|
return;
|
|
7570
7593
|
}
|
|
7571
|
-
let cwd = options.cwd ?? process$2.cwd();
|
|
7572
|
-
if (args[0] === "-C") {
|
|
7573
|
-
cwd = resolve(cwd, args[1]);
|
|
7574
|
-
args.splice(0, 2);
|
|
7575
|
-
}
|
|
7576
7594
|
let command = await getCliCommand(fn, args, options, cwd);
|
|
7577
7595
|
if (!command)
|
|
7578
7596
|
return;
|