@slidev/cli 0.40.5 → 0.40.6
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-QEAAPDMG.mjs → build-ABEUVCF3.mjs} +1 -1
- package/dist/{build-HVQ7GG2W.js → build-LXXDJIKQ.js} +5 -5
- package/dist/{chunk-46GOGODM.mjs → chunk-IBT35HXF.mjs} +4 -3
- package/dist/{chunk-FT5Y6KDW.js → chunk-IZ3FTOWY.js} +4 -3
- package/dist/{chunk-UBIR7TUM.mjs → chunk-MKAMV2EC.mjs} +154 -88
- package/dist/{chunk-ANS7HJRQ.js → chunk-RQPNLNE7.js} +125 -58
- package/dist/cli.js +28 -28
- package/dist/cli.mjs +3 -3
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +7 -7
|
@@ -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(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkIZ3FTOWYjs = require('./chunk-IZ3FTOWY.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -2383,7 +2383,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2383
2383
|
const pluginOptions = rawConfig.slidev || {};
|
|
2384
2384
|
process.env.EDITOR = process.env.EDITOR || "code";
|
|
2385
2385
|
const server = await _vite.createServer.call(void 0,
|
|
2386
|
-
await
|
|
2386
|
+
await _chunkIZ3FTOWYjs.mergeViteConfigs.call(void 0,
|
|
2387
2387
|
options,
|
|
2388
2388
|
viteConfig,
|
|
2389
2389
|
{
|
|
@@ -2393,7 +2393,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2393
2393
|
]
|
|
2394
2394
|
},
|
|
2395
2395
|
plugins: [
|
|
2396
|
-
await
|
|
2396
|
+
await _chunkIZ3FTOWYjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
|
|
2397
2397
|
]
|
|
2398
2398
|
},
|
|
2399
2399
|
"serve"
|
|
@@ -2406,29 +2406,30 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2406
2406
|
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
2407
2407
|
|
|
2408
2408
|
// package.json
|
|
2409
|
-
var version = "0.40.
|
|
2409
|
+
var version = "0.40.6";
|
|
2410
2410
|
|
|
2411
2411
|
// node/themes.ts
|
|
2412
2412
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
2413
2413
|
|
|
2414
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.
|
|
2414
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.21.2/node_modules/@antfu/ni/dist/shared/ni.ff5047d2.mjs
|
|
2415
2415
|
|
|
2416
2416
|
var _readline = require('readline'); var _readline2 = _interopRequireDefault(_readline);
|
|
2417
2417
|
var _events = require('events'); var _events2 = _interopRequireDefault(_events);
|
|
2418
2418
|
var _buffer = require('buffer'); var _buffer2 = _interopRequireDefault(_buffer);
|
|
2419
|
-
|
|
2420
2419
|
var _child_process = require('child_process'); var _child_process2 = _interopRequireDefault(_child_process);
|
|
2421
2420
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
2422
2421
|
|
|
2422
|
+
|
|
2423
2423
|
var _fs2 = require('fs'); var _fs3 = _interopRequireDefault(_fs2);
|
|
2424
2424
|
var _url = require('url'); var _url2 = _interopRequireDefault(_url);
|
|
2425
2425
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
2426
|
-
|
|
2427
2426
|
var _assert = require('assert'); var _assert2 = _interopRequireDefault(_assert);
|
|
2428
2427
|
|
|
2428
|
+
|
|
2429
2429
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
2430
2430
|
var _util = require('util'); var _util2 = _interopRequireDefault(_util);
|
|
2431
2431
|
|
|
2432
|
+
|
|
2432
2433
|
var _tty = require('tty'); var _tty2 = _interopRequireDefault(_tty);
|
|
2433
2434
|
var npmRun = (agent) => (args) => {
|
|
2434
2435
|
if (args.length > 1)
|
|
@@ -3496,19 +3497,17 @@ onetime.callCount = (function_) => {
|
|
|
3496
3497
|
}
|
|
3497
3498
|
return calledFunctions.get(function_);
|
|
3498
3499
|
};
|
|
3499
|
-
var getRealtimeSignals =
|
|
3500
|
+
var getRealtimeSignals = () => {
|
|
3500
3501
|
const length = SIGRTMAX - SIGRTMIN + 1;
|
|
3501
3502
|
return Array.from({ length }, getRealtimeSignal);
|
|
3502
3503
|
};
|
|
3503
|
-
var getRealtimeSignal =
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
};
|
|
3511
|
-
};
|
|
3504
|
+
var getRealtimeSignal = (value, index) => ({
|
|
3505
|
+
name: `SIGRT${index + 1}`,
|
|
3506
|
+
number: SIGRTMIN + index,
|
|
3507
|
+
action: "terminate",
|
|
3508
|
+
description: "Application-specific signal (realtime)",
|
|
3509
|
+
standard: "posix"
|
|
3510
|
+
});
|
|
3512
3511
|
var SIGRTMIN = 34;
|
|
3513
3512
|
var SIGRTMAX = 64;
|
|
3514
3513
|
var SIGNALS = [
|
|
@@ -3782,19 +3781,19 @@ var SIGNALS = [
|
|
|
3782
3781
|
standard: "other"
|
|
3783
3782
|
}
|
|
3784
3783
|
];
|
|
3785
|
-
var getSignals =
|
|
3784
|
+
var getSignals = () => {
|
|
3786
3785
|
const realtimeSignals = getRealtimeSignals();
|
|
3787
3786
|
const signals = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
|
|
3788
3787
|
return signals;
|
|
3789
3788
|
};
|
|
3790
|
-
var normalizeSignal =
|
|
3789
|
+
var normalizeSignal = ({
|
|
3791
3790
|
name,
|
|
3792
3791
|
number: defaultNumber,
|
|
3793
3792
|
description,
|
|
3794
3793
|
action: action2,
|
|
3795
3794
|
forced = false,
|
|
3796
3795
|
standard
|
|
3797
|
-
}) {
|
|
3796
|
+
}) => {
|
|
3798
3797
|
const {
|
|
3799
3798
|
signals: { [name]: constantSignal }
|
|
3800
3799
|
} = _os.constants;
|
|
@@ -3802,24 +3801,27 @@ var normalizeSignal = function({
|
|
|
3802
3801
|
const number2 = supported ? constantSignal : defaultNumber;
|
|
3803
3802
|
return { name, number: number2, description, supported, action: action2, forced, standard };
|
|
3804
3803
|
};
|
|
3805
|
-
var getSignalsByName =
|
|
3804
|
+
var getSignalsByName = () => {
|
|
3806
3805
|
const signals = getSignals();
|
|
3807
|
-
return signals.
|
|
3808
|
-
};
|
|
3809
|
-
var getSignalByName = function(signalByNameMemo, { name, number: number2, description, supported, action: action2, forced, standard }) {
|
|
3810
|
-
return {
|
|
3811
|
-
...signalByNameMemo,
|
|
3812
|
-
[name]: { name, number: number2, description, supported, action: action2, forced, standard }
|
|
3813
|
-
};
|
|
3806
|
+
return Object.fromEntries(signals.map(getSignalByName));
|
|
3814
3807
|
};
|
|
3808
|
+
var getSignalByName = ({
|
|
3809
|
+
name,
|
|
3810
|
+
number: number2,
|
|
3811
|
+
description,
|
|
3812
|
+
supported,
|
|
3813
|
+
action: action2,
|
|
3814
|
+
forced,
|
|
3815
|
+
standard
|
|
3816
|
+
}) => [name, { name, number: number2, description, supported, action: action2, forced, standard }];
|
|
3815
3817
|
var signalsByName = getSignalsByName();
|
|
3816
|
-
var getSignalsByNumber =
|
|
3818
|
+
var getSignalsByNumber = () => {
|
|
3817
3819
|
const signals = getSignals();
|
|
3818
3820
|
const length = SIGRTMAX + 1;
|
|
3819
3821
|
const signalsA = Array.from({ length }, (value, number2) => getSignalByNumber(number2, signals));
|
|
3820
3822
|
return Object.assign({}, ...signalsA);
|
|
3821
3823
|
};
|
|
3822
|
-
var getSignalByNumber =
|
|
3824
|
+
var getSignalByNumber = (number2, signals) => {
|
|
3823
3825
|
const signal = findSignalByNumber(number2, signals);
|
|
3824
3826
|
if (signal === void 0) {
|
|
3825
3827
|
return {};
|
|
@@ -3837,7 +3839,7 @@ var getSignalByNumber = function(number2, signals) {
|
|
|
3837
3839
|
}
|
|
3838
3840
|
};
|
|
3839
3841
|
};
|
|
3840
|
-
var findSignalByNumber =
|
|
3842
|
+
var findSignalByNumber = (number2, signals) => {
|
|
3841
3843
|
const signal = signals.find(({ name }) => _os.constants.signals[name] === number2);
|
|
3842
3844
|
if (signal !== void 0) {
|
|
3843
3845
|
return signal;
|
|
@@ -4219,6 +4221,39 @@ var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
|
|
|
4219
4221
|
function isStream(stream2) {
|
|
4220
4222
|
return stream2 !== null && typeof stream2 === "object" && typeof stream2.pipe === "function";
|
|
4221
4223
|
}
|
|
4224
|
+
function isWritableStream(stream2) {
|
|
4225
|
+
return isStream(stream2) && stream2.writable !== false && typeof stream2._write === "function" && typeof stream2._writableState === "object";
|
|
4226
|
+
}
|
|
4227
|
+
var isExecaChildProcess = (target) => target instanceof _child_process.ChildProcess && typeof target.then === "function";
|
|
4228
|
+
var pipeToTarget = (spawned, streamName, target) => {
|
|
4229
|
+
if (typeof target === "string") {
|
|
4230
|
+
spawned[streamName].pipe(_fs2.createWriteStream.call(void 0, target));
|
|
4231
|
+
return spawned;
|
|
4232
|
+
}
|
|
4233
|
+
if (isWritableStream(target)) {
|
|
4234
|
+
spawned[streamName].pipe(target);
|
|
4235
|
+
return spawned;
|
|
4236
|
+
}
|
|
4237
|
+
if (!isExecaChildProcess(target)) {
|
|
4238
|
+
throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
|
|
4239
|
+
}
|
|
4240
|
+
if (!isWritableStream(target.stdin)) {
|
|
4241
|
+
throw new TypeError("The target child process's stdin must be available.");
|
|
4242
|
+
}
|
|
4243
|
+
spawned[streamName].pipe(target.stdin);
|
|
4244
|
+
return target;
|
|
4245
|
+
};
|
|
4246
|
+
var addPipeMethods = (spawned) => {
|
|
4247
|
+
if (spawned.stdout !== null) {
|
|
4248
|
+
spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
|
|
4249
|
+
}
|
|
4250
|
+
if (spawned.stderr !== null) {
|
|
4251
|
+
spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
|
|
4252
|
+
}
|
|
4253
|
+
if (spawned.all !== void 0) {
|
|
4254
|
+
spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
|
|
4255
|
+
}
|
|
4256
|
+
};
|
|
4222
4257
|
var getStreamExports = {};
|
|
4223
4258
|
var getStream$1 = {
|
|
4224
4259
|
get exports() {
|
|
@@ -4347,8 +4382,21 @@ var mergeStream = function() {
|
|
|
4347
4382
|
}
|
|
4348
4383
|
}
|
|
4349
4384
|
};
|
|
4350
|
-
var
|
|
4351
|
-
if (input
|
|
4385
|
+
var validateInputOptions = (input) => {
|
|
4386
|
+
if (input !== void 0) {
|
|
4387
|
+
throw new TypeError("The `input` and `inputFile` options cannot be both set.");
|
|
4388
|
+
}
|
|
4389
|
+
};
|
|
4390
|
+
var getInput = ({ input, inputFile }) => {
|
|
4391
|
+
if (typeof inputFile !== "string") {
|
|
4392
|
+
return input;
|
|
4393
|
+
}
|
|
4394
|
+
validateInputOptions(input);
|
|
4395
|
+
return _fs2.createReadStream.call(void 0, inputFile);
|
|
4396
|
+
};
|
|
4397
|
+
var handleInput = (spawned, options) => {
|
|
4398
|
+
const input = getInput(options);
|
|
4399
|
+
if (input === void 0) {
|
|
4352
4400
|
return;
|
|
4353
4401
|
}
|
|
4354
4402
|
if (isStream(input)) {
|
|
@@ -4371,7 +4419,7 @@ var makeAllStream = (spawned, { all }) => {
|
|
|
4371
4419
|
return mixed;
|
|
4372
4420
|
};
|
|
4373
4421
|
var getBufferedData = async (stream2, streamPromise) => {
|
|
4374
|
-
if (!stream2) {
|
|
4422
|
+
if (!stream2 || streamPromise === void 0) {
|
|
4375
4423
|
return;
|
|
4376
4424
|
}
|
|
4377
4425
|
stream2.destroy();
|
|
@@ -4416,7 +4464,6 @@ var mergePromise = (spawned, promise) => {
|
|
|
4416
4464
|
const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
4417
4465
|
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
4418
4466
|
}
|
|
4419
|
-
return spawned;
|
|
4420
4467
|
};
|
|
4421
4468
|
var getSpawnedPromise = (spawned) => new Promise((resolve3, reject) => {
|
|
4422
4469
|
spawned.on("exit", (exitCode, signal) => {
|
|
@@ -4460,6 +4507,19 @@ var parseCommand = (command) => {
|
|
|
4460
4507
|
}
|
|
4461
4508
|
return tokens;
|
|
4462
4509
|
};
|
|
4510
|
+
var verboseDefault = _util.debuglog.call(void 0, "execa").enabled;
|
|
4511
|
+
var padField = (field, padding) => String(field).padStart(padding, "0");
|
|
4512
|
+
var getTimestamp = () => {
|
|
4513
|
+
const date2 = /* @__PURE__ */ new Date();
|
|
4514
|
+
return `${padField(date2.getHours(), 2)}:${padField(date2.getMinutes(), 2)}:${padField(date2.getSeconds(), 2)}.${padField(date2.getMilliseconds(), 3)}`;
|
|
4515
|
+
};
|
|
4516
|
+
var logCommand = (escapedCommand, { verbose }) => {
|
|
4517
|
+
if (!verbose) {
|
|
4518
|
+
return;
|
|
4519
|
+
}
|
|
4520
|
+
_process2.default.stderr.write(`[${getTimestamp()}] ${escapedCommand}
|
|
4521
|
+
`);
|
|
4522
|
+
};
|
|
4463
4523
|
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
|
4464
4524
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
4465
4525
|
const env2 = extendEnv ? { ..._process2.default.env, ...envOption } : envOption;
|
|
@@ -4486,6 +4546,7 @@ var handleArguments = (file, args, options = {}) => {
|
|
|
4486
4546
|
cleanup: true,
|
|
4487
4547
|
all: false,
|
|
4488
4548
|
windowsHide: true,
|
|
4549
|
+
verbose: verboseDefault,
|
|
4489
4550
|
...options
|
|
4490
4551
|
};
|
|
4491
4552
|
options.env = getEnv(options);
|
|
@@ -4508,6 +4569,7 @@ function execa(file, args, options) {
|
|
|
4508
4569
|
const parsed = handleArguments(file, args, options);
|
|
4509
4570
|
const command = joinCommand(file, args);
|
|
4510
4571
|
const escapedCommand = getEscapedCommand(file, args);
|
|
4572
|
+
logCommand(escapedCommand, parsed.options);
|
|
4511
4573
|
validateTimeout(parsed.options);
|
|
4512
4574
|
let spawned;
|
|
4513
4575
|
try {
|
|
@@ -4526,7 +4588,8 @@ function execa(file, args, options) {
|
|
|
4526
4588
|
isCanceled: false,
|
|
4527
4589
|
killed: false
|
|
4528
4590
|
}));
|
|
4529
|
-
|
|
4591
|
+
mergePromise(dummySpawned, errorPromise);
|
|
4592
|
+
return dummySpawned;
|
|
4530
4593
|
}
|
|
4531
4594
|
const spawnedPromise = getSpawnedPromise(spawned);
|
|
4532
4595
|
const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
|
|
@@ -4551,7 +4614,7 @@ function execa(file, args, options) {
|
|
|
4551
4614
|
escapedCommand,
|
|
4552
4615
|
parsed,
|
|
4553
4616
|
timedOut,
|
|
4554
|
-
isCanceled:
|
|
4617
|
+
isCanceled: parsed.options.signal ? parsed.options.signal.aborted : false,
|
|
4555
4618
|
killed: spawned.killed
|
|
4556
4619
|
});
|
|
4557
4620
|
if (!parsed.options.reject) {
|
|
@@ -4573,9 +4636,11 @@ function execa(file, args, options) {
|
|
|
4573
4636
|
};
|
|
4574
4637
|
};
|
|
4575
4638
|
const handlePromiseOnce = onetime(handlePromise);
|
|
4576
|
-
handleInput(spawned, parsed.options
|
|
4639
|
+
handleInput(spawned, parsed.options);
|
|
4577
4640
|
spawned.all = makeAllStream(spawned, parsed.options);
|
|
4578
|
-
|
|
4641
|
+
addPipeMethods(spawned);
|
|
4642
|
+
mergePromise(spawned, handlePromiseOnce);
|
|
4643
|
+
return spawned;
|
|
4579
4644
|
}
|
|
4580
4645
|
function execaCommand(command, options) {
|
|
4581
4646
|
const [file, ...args] = parseCommand(command);
|
|
@@ -10036,6 +10101,7 @@ var whichSync = (cmd, opt = {}) => {
|
|
|
10036
10101
|
};
|
|
10037
10102
|
var lib = which;
|
|
10038
10103
|
which.sync = whichSync;
|
|
10104
|
+
var CLI_TEMP_DIR = _path.join.call(void 0, _os2.default.tmpdir(), "antfu-ni");
|
|
10039
10105
|
function remove(arr, v) {
|
|
10040
10106
|
const index = arr.indexOf(v);
|
|
10041
10107
|
if (index >= 0)
|
|
@@ -10043,25 +10109,19 @@ function remove(arr, v) {
|
|
|
10043
10109
|
return arr;
|
|
10044
10110
|
}
|
|
10045
10111
|
function exclude(arr, v) {
|
|
10046
|
-
return
|
|
10112
|
+
return arr.slice().filter((item) => item !== v);
|
|
10047
10113
|
}
|
|
10048
10114
|
function cmdExists(cmd) {
|
|
10049
|
-
|
|
10050
|
-
_child_process.execSync.call(void 0,
|
|
10051
|
-
_os2.default.platform() === "win32" ? `cmd /c "(help ${cmd} > nul || exit 0) && where ${cmd} > nul 2> nul"` : `command -v ${cmd}`
|
|
10052
|
-
);
|
|
10053
|
-
return true;
|
|
10054
|
-
} catch (e5) {
|
|
10055
|
-
return false;
|
|
10056
|
-
}
|
|
10115
|
+
return lib.sync(cmd, { nothrow: true }) !== null;
|
|
10057
10116
|
}
|
|
10058
10117
|
function getVoltaPrefix() {
|
|
10059
10118
|
const VOLTA_PREFIX = "volta run";
|
|
10060
|
-
const hasVoltaCommand =
|
|
10119
|
+
const hasVoltaCommand = cmdExists("volta");
|
|
10061
10120
|
return hasVoltaCommand ? VOLTA_PREFIX : "";
|
|
10062
10121
|
}
|
|
10063
10122
|
async function detect({ autoInstall, cwd } = {}) {
|
|
10064
10123
|
let agent = null;
|
|
10124
|
+
let version3 = null;
|
|
10065
10125
|
const lockPath = await findUp(Object.keys(LOCKS), { cwd });
|
|
10066
10126
|
let packageJsonPath;
|
|
10067
10127
|
if (lockPath)
|
|
@@ -10072,17 +10132,18 @@ async function detect({ autoInstall, cwd } = {}) {
|
|
|
10072
10132
|
try {
|
|
10073
10133
|
const pkg = JSON.parse(_fs3.default.readFileSync(packageJsonPath, "utf8"));
|
|
10074
10134
|
if (typeof pkg.packageManager === "string") {
|
|
10075
|
-
const [name,
|
|
10076
|
-
|
|
10135
|
+
const [name, ver] = pkg.packageManager.split("@");
|
|
10136
|
+
version3 = ver;
|
|
10137
|
+
if (name === "yarn" && parseInt(ver) > 1)
|
|
10077
10138
|
agent = "yarn@berry";
|
|
10078
|
-
else if (name === "pnpm" && parseInt(
|
|
10139
|
+
else if (name === "pnpm" && parseInt(ver) < 7)
|
|
10079
10140
|
agent = "pnpm@6";
|
|
10080
10141
|
else if (name in AGENTS)
|
|
10081
10142
|
agent = name;
|
|
10082
10143
|
else
|
|
10083
10144
|
console.warn("[ni] Unknown packageManager:", pkg.packageManager);
|
|
10084
10145
|
}
|
|
10085
|
-
} catch (
|
|
10146
|
+
} catch (e5) {
|
|
10086
10147
|
}
|
|
10087
10148
|
}
|
|
10088
10149
|
if (!agent && lockPath)
|
|
@@ -10102,10 +10163,15 @@ async function detect({ autoInstall, cwd } = {}) {
|
|
|
10102
10163
|
if (!tryInstall)
|
|
10103
10164
|
process.exit(1);
|
|
10104
10165
|
}
|
|
10105
|
-
await execaCommand(`npm i -g ${agent}`, { stdio: "inherit", cwd });
|
|
10166
|
+
await execaCommand(`npm i -g ${agent}${version3 ? `@${version3}` : ""}`, { stdio: "inherit", cwd });
|
|
10106
10167
|
}
|
|
10107
10168
|
return agent;
|
|
10108
10169
|
}
|
|
10170
|
+
var UnsupportedCommand = class extends Error {
|
|
10171
|
+
constructor({ agent, command }) {
|
|
10172
|
+
super(`Command "${command}" is not support by agent "${agent}"`);
|
|
10173
|
+
}
|
|
10174
|
+
};
|
|
10109
10175
|
function getCommand(agent, command, args = []) {
|
|
10110
10176
|
if (!(agent in AGENTS))
|
|
10111
10177
|
throw new Error(`Unsupported agent "${agent}"`);
|
|
@@ -10113,7 +10179,7 @@ function getCommand(agent, command, args = []) {
|
|
|
10113
10179
|
if (typeof c === "function")
|
|
10114
10180
|
return c(args);
|
|
10115
10181
|
if (!c)
|
|
10116
|
-
throw new
|
|
10182
|
+
throw new UnsupportedCommand({ agent, command });
|
|
10117
10183
|
return c.replace("{0}", args.join(" ")).trim();
|
|
10118
10184
|
}
|
|
10119
10185
|
var parseNi = (agent, args, ctx) => {
|
|
@@ -10228,7 +10294,7 @@ function init(open, close) {
|
|
|
10228
10294
|
return txt === void 0 ? chain([open], [blk]) : $.enabled ? run$1([blk], txt + "") : txt + "";
|
|
10229
10295
|
};
|
|
10230
10296
|
}
|
|
10231
|
-
var version2 = "0.
|
|
10297
|
+
var version2 = "0.21.2";
|
|
10232
10298
|
var DEBUG_SIGN = "?";
|
|
10233
10299
|
async function run(fn, args, options = {}) {
|
|
10234
10300
|
const debug2 = args.includes(DEBUG_SIGN);
|
|
@@ -10246,7 +10312,7 @@ async function run(fn, args, options = {}) {
|
|
|
10246
10312
|
`));
|
|
10247
10313
|
console.log(`ni ${dash} install`);
|
|
10248
10314
|
console.log(`nr ${dash} run`);
|
|
10249
|
-
console.log(`
|
|
10315
|
+
console.log(`nlx ${dash} execute`);
|
|
10250
10316
|
console.log(`nu ${dash} upgrade`);
|
|
10251
10317
|
console.log(`nun ${dash} uninstall`);
|
|
10252
10318
|
console.log(`nci ${dash} clean install`);
|
|
@@ -10290,7 +10356,8 @@ async function run(fn, args, options = {}) {
|
|
|
10290
10356
|
await execaCommand(command, { stdio: "inherit", encoding: "utf-8", cwd });
|
|
10291
10357
|
}
|
|
10292
10358
|
|
|
10293
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.
|
|
10359
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.21.2/node_modules/@antfu/ni/dist/index.mjs
|
|
10360
|
+
|
|
10294
10361
|
|
|
10295
10362
|
|
|
10296
10363
|
|
package/dist/cli.js
CHANGED
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkRQPNLNE7js = require('./chunk-RQPNLNE7.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkIZ3FTOWYjs = require('./chunk-IZ3FTOWY.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _chunkGE7W2DBEjs = require('./chunk-GE7W2DBE.js');
|
|
20
20
|
|
|
21
21
|
// node/cli.ts
|
|
22
|
-
var import_fast_deep_equal = _chunkGE7W2DBEjs.__toESM.call(void 0,
|
|
22
|
+
var import_fast_deep_equal = _chunkGE7W2DBEjs.__toESM.call(void 0, _chunkIZ3FTOWYjs.require_fast_deep_equal.call(void 0, ));
|
|
23
23
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
24
24
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
25
25
|
var _child_process = require('child_process');
|
|
@@ -45,15 +45,15 @@ _fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) =>
|
|
|
45
45
|
const roots = (
|
|
46
46
|
/* uniq */
|
|
47
47
|
[
|
|
48
|
-
|
|
49
|
-
...
|
|
50
|
-
|
|
48
|
+
_chunkRQPNLNE7js.getUserRoot.call(void 0, {}).userRoot,
|
|
49
|
+
..._chunkRQPNLNE7js.getAddonRoots.call(void 0, addons, ""),
|
|
50
|
+
_chunkRQPNLNE7js.getClientRoot.call(void 0, )
|
|
51
51
|
]
|
|
52
52
|
);
|
|
53
53
|
const mergeArrays = (a, b) => a.concat(b);
|
|
54
|
-
return await
|
|
54
|
+
return await _chunkIZ3FTOWYjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
|
|
55
55
|
});
|
|
56
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
56
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkRQPNLNE7js.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
57
57
|
cli.command(
|
|
58
58
|
"* [entry]",
|
|
59
59
|
"Start a local server for Slidev",
|
|
@@ -109,9 +109,9 @@ cli.command(
|
|
|
109
109
|
async function initServer() {
|
|
110
110
|
if (server)
|
|
111
111
|
await server.close();
|
|
112
|
-
const options = await
|
|
112
|
+
const options = await _chunkRQPNLNE7js.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
113
113
|
port = userPort || await findFreePort(3030);
|
|
114
|
-
server = await
|
|
114
|
+
server = await _chunkRQPNLNE7js.createServer.call(void 0,
|
|
115
115
|
options,
|
|
116
116
|
{
|
|
117
117
|
server: {
|
|
@@ -125,7 +125,7 @@ cli.command(
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
onDataReload(newData, data) {
|
|
128
|
-
if (!theme &&
|
|
128
|
+
if (!theme && _chunkRQPNLNE7js.resolveThemeName.call(void 0, newData.config.theme) !== _chunkRQPNLNE7js.resolveThemeName.call(void 0, data.config.theme)) {
|
|
129
129
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
130
130
|
initServer();
|
|
131
131
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -243,9 +243,9 @@ cli.command(
|
|
|
243
243
|
}).strict().help(),
|
|
244
244
|
async (args) => {
|
|
245
245
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
246
|
-
const { build } = await Promise.resolve().then(() => require("./build-
|
|
246
|
+
const { build } = await Promise.resolve().then(() => require("./build-LXXDJIKQ.js"));
|
|
247
247
|
for (const entryFile of entry) {
|
|
248
|
-
const options = await
|
|
248
|
+
const options = await _chunkRQPNLNE7js.resolveOptions.call(void 0, { entry: entryFile, theme, inspect }, "build");
|
|
249
249
|
if (download && !options.data.config.download)
|
|
250
250
|
options.data.config.download = download;
|
|
251
251
|
printInfo(options);
|
|
@@ -265,9 +265,9 @@ cli.command(
|
|
|
265
265
|
(args) => commonOptions(args).strict().help(),
|
|
266
266
|
async ({ entry }) => {
|
|
267
267
|
for (const entryFile of entry) {
|
|
268
|
-
const data = await
|
|
269
|
-
|
|
270
|
-
await
|
|
268
|
+
const data = await _chunkRQPNLNE7js.parser.load(entryFile);
|
|
269
|
+
_chunkRQPNLNE7js.parser.prettify(data);
|
|
270
|
+
await _chunkRQPNLNE7js.parser.save(data);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
);
|
|
@@ -283,17 +283,17 @@ cli.command(
|
|
|
283
283
|
default: "theme"
|
|
284
284
|
}),
|
|
285
285
|
async ({ entry, dir, theme: themeInput }) => {
|
|
286
|
-
const data = await
|
|
287
|
-
const theme =
|
|
286
|
+
const data = await _chunkRQPNLNE7js.parser.load(entry);
|
|
287
|
+
const theme = _chunkRQPNLNE7js.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
288
288
|
if (theme === "none") {
|
|
289
289
|
console.error('Cannot eject theme "none"');
|
|
290
290
|
process.exit(1);
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (_chunkRQPNLNE7js.isPath.call(void 0, theme)) {
|
|
293
293
|
console.error("Theme is already ejected");
|
|
294
294
|
process.exit(1);
|
|
295
295
|
}
|
|
296
|
-
const roots =
|
|
296
|
+
const roots = _chunkRQPNLNE7js.getThemeRoots.call(void 0, theme, entry);
|
|
297
297
|
if (!roots.length) {
|
|
298
298
|
console.error(`Could not find theme "${theme}"`);
|
|
299
299
|
process.exit(1);
|
|
@@ -305,7 +305,7 @@ cli.command(
|
|
|
305
305
|
const dirPath = `./${dir}`;
|
|
306
306
|
data.slides[0].frontmatter.theme = dirPath;
|
|
307
307
|
data.slides[0].raw = null;
|
|
308
|
-
await
|
|
308
|
+
await _chunkRQPNLNE7js.parser.save(data);
|
|
309
309
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
310
310
|
}
|
|
311
311
|
);
|
|
@@ -325,8 +325,8 @@ cli.command(
|
|
|
325
325
|
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-INNI35CW.js"));
|
|
326
326
|
const port = await findFreePort(12445);
|
|
327
327
|
for (const entryFile of entry) {
|
|
328
|
-
const options = await
|
|
329
|
-
const server = await
|
|
328
|
+
const options = await _chunkRQPNLNE7js.resolveOptions.call(void 0, { entry: entryFile, theme }, "export");
|
|
329
|
+
const server = await _chunkRQPNLNE7js.createServer.call(void 0,
|
|
330
330
|
options,
|
|
331
331
|
{
|
|
332
332
|
server: { port },
|
|
@@ -335,7 +335,7 @@ cli.command(
|
|
|
335
335
|
);
|
|
336
336
|
await server.listen(port);
|
|
337
337
|
printInfo(options);
|
|
338
|
-
|
|
338
|
+
_chunkRQPNLNE7js.parser.filterDisabled(options.data);
|
|
339
339
|
const result = await exportSlides({
|
|
340
340
|
port,
|
|
341
341
|
...getExportOptions({ ...args, entry: entryFile }, options)
|
|
@@ -371,8 +371,8 @@ cli.command(
|
|
|
371
371
|
const { exportNotes } = await Promise.resolve().then(() => require("./export-INNI35CW.js"));
|
|
372
372
|
const port = await findFreePort(12445);
|
|
373
373
|
for (const entryFile of entry) {
|
|
374
|
-
const options = await
|
|
375
|
-
const server = await
|
|
374
|
+
const options = await _chunkRQPNLNE7js.resolveOptions.call(void 0, { entry: entryFile }, "export");
|
|
375
|
+
const server = await _chunkRQPNLNE7js.createServer.call(void 0,
|
|
376
376
|
options,
|
|
377
377
|
{
|
|
378
378
|
server: { port },
|
|
@@ -381,7 +381,7 @@ cli.command(
|
|
|
381
381
|
);
|
|
382
382
|
await server.listen(port);
|
|
383
383
|
printInfo(options);
|
|
384
|
-
|
|
384
|
+
_chunkRQPNLNE7js.parser.filterDisabled(options.data);
|
|
385
385
|
const result = await exportNotes({
|
|
386
386
|
port,
|
|
387
387
|
output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entryFile, ".md")}-export-notes`),
|
|
@@ -442,7 +442,7 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
442
442
|
console.log();
|
|
443
443
|
console.log();
|
|
444
444
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
445
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
445
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkRQPNLNE7js.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
446
446
|
console.log();
|
|
447
447
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
448
448
|
console.log(_kolorist.dim.call(void 0, " entry ") + _kolorist.dim.call(void 0, _path2.default.dirname(options.entry) + _path2.default.sep) + _path2.default.basename(options.entry));
|
package/dist/cli.mjs
CHANGED
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
resolveOptions,
|
|
10
10
|
resolveThemeName,
|
|
11
11
|
version
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MKAMV2EC.mjs";
|
|
13
13
|
import {
|
|
14
14
|
loadSetups,
|
|
15
15
|
require_fast_deep_equal
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IBT35HXF.mjs";
|
|
17
17
|
import {
|
|
18
18
|
__toESM
|
|
19
19
|
} from "./chunk-CTG3GV2W.mjs";
|
|
@@ -243,7 +243,7 @@ cli.command(
|
|
|
243
243
|
}).strict().help(),
|
|
244
244
|
async (args) => {
|
|
245
245
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
246
|
-
const { build } = await import("./build-
|
|
246
|
+
const { build } = await import("./build-ABEUVCF3.mjs");
|
|
247
247
|
for (const entryFile of entry) {
|
|
248
248
|
const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
|
|
249
249
|
if (download && !options.data.config.download)
|
package/dist/index.js
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkRQPNLNE7js = require('./chunk-RQPNLNE7.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkIZ3FTOWYjs = require('./chunk-IZ3FTOWY.js');
|
|
17
17
|
require('./chunk-GE7W2DBE.js');
|
|
18
18
|
|
|
19
19
|
|
|
@@ -28,4 +28,4 @@ require('./chunk-GE7W2DBE.js');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
exports.ViteSlidevPlugin =
|
|
31
|
+
exports.ViteSlidevPlugin = _chunkIZ3FTOWYjs.ViteSlidevPlugin; exports.createServer = _chunkRQPNLNE7js.createServer; exports.createWindiCSSPlugin = _chunkIZ3FTOWYjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkRQPNLNE7js.getAddonRoots; exports.getCLIRoot = _chunkRQPNLNE7js.getCLIRoot; exports.getClientRoot = _chunkRQPNLNE7js.getClientRoot; exports.getRoot = _chunkRQPNLNE7js.getRoot; exports.getThemeRoots = _chunkRQPNLNE7js.getThemeRoots; exports.getUserRoot = _chunkRQPNLNE7js.getUserRoot; exports.isPath = _chunkRQPNLNE7js.isPath; exports.parser = _chunkRQPNLNE7js.parser; exports.resolveOptions = _chunkRQPNLNE7js.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
isPath,
|
|
10
10
|
parser,
|
|
11
11
|
resolveOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MKAMV2EC.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ViteSlidevPlugin,
|
|
15
15
|
createWindiCSSPlugin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IBT35HXF.mjs";
|
|
17
17
|
import "./chunk-CTG3GV2W.mjs";
|
|
18
18
|
export {
|
|
19
19
|
ViteSlidevPlugin,
|