@slidev/cli 0.33.0 → 0.34.1
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-P4Q57V2J.mjs → build-AZXVYLTZ.mjs} +4 -5
- package/dist/{build-JMQRM5SA.js → build-ONMHHPBT.js} +13 -14
- package/dist/{chunk-C7GPMAIX.mjs → chunk-BQ63PXSA.mjs} +121 -60
- package/dist/{chunk-UNBXPUSG.js → chunk-FD6XUAB4.js} +162 -101
- package/dist/{chunk-ZWCVPYOA.mjs → chunk-GVA336JI.mjs} +2 -34
- package/dist/{chunk-JQEMHC65.js → chunk-PNKOKFFZ.js} +172 -171
- package/dist/{chunk-FFZLS6QK.js → chunk-SQLX75IO.js} +3 -35
- package/dist/{chunk-ORQ3SHUX.mjs → chunk-VO7LIZVO.mjs} +40 -39
- package/dist/cli.js +28 -25
- package/dist/cli.mjs +9 -6
- package/dist/{export-5R6FV775.mjs → export-5OVMZQWE.mjs} +1 -1
- package/dist/{export-LOKLMK66.js → export-TH7MNEXN.js} +4 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +21 -19
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
7
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
25
8
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
26
9
|
}) : x)(function(x) {
|
|
@@ -28,18 +11,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
28
11
|
return require.apply(this, arguments);
|
|
29
12
|
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
30
13
|
});
|
|
31
|
-
var __objRest = (source, exclude) => {
|
|
32
|
-
var target = {};
|
|
33
|
-
for (var prop in source)
|
|
34
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
35
|
-
target[prop] = source[prop];
|
|
36
|
-
if (source != null && __getOwnPropSymbols)
|
|
37
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
38
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
39
|
-
target[prop] = source[prop];
|
|
40
|
-
}
|
|
41
|
-
return target;
|
|
42
|
-
};
|
|
43
14
|
var __esm = (fn, res) => function __init() {
|
|
44
15
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
45
16
|
};
|
|
@@ -84,9 +55,9 @@ var __privateWrapper = (obj, member, setter, getter) => {
|
|
|
84
55
|
};
|
|
85
56
|
};
|
|
86
57
|
|
|
87
|
-
// ../../node_modules/.pnpm/tsup@5.12.9_typescript@4.7.
|
|
58
|
+
// ../../node_modules/.pnpm/tsup@5.12.9_typescript@4.7.4/node_modules/tsup/assets/cjs_shims.js
|
|
88
59
|
var init_cjs_shims = __esm({
|
|
89
|
-
"../../node_modules/.pnpm/tsup@5.12.9_typescript@4.7.
|
|
60
|
+
"../../node_modules/.pnpm/tsup@5.12.9_typescript@4.7.4/node_modules/tsup/assets/cjs_shims.js"() {
|
|
90
61
|
}
|
|
91
62
|
});
|
|
92
63
|
|
|
@@ -168,7 +139,4 @@ function packageExists(name) {
|
|
|
168
139
|
|
|
169
140
|
|
|
170
141
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require; exports.__objRest = __objRest; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateWrapper = __privateWrapper; exports.init_cjs_shims = init_cjs_shims; exports.toAtFS = toAtFS; exports.resolveImportPath = resolveImportPath; exports.resolveGlobalImportPath = resolveGlobalImportPath; exports.stringifyMarkdownTokens = stringifyMarkdownTokens; exports.generateGoogleFontsUrl = generateGoogleFontsUrl; exports.packageExists = packageExists;
|
|
142
|
+
exports.__require = __require; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateWrapper = __privateWrapper; exports.init_cjs_shims = init_cjs_shims; exports.toAtFS = toAtFS; exports.resolveImportPath = resolveImportPath; exports.resolveGlobalImportPath = resolveGlobalImportPath; exports.stringifyMarkdownTokens = stringifyMarkdownTokens; exports.generateGoogleFontsUrl = generateGoogleFontsUrl; exports.packageExists = packageExists;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BQ63PXSA.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.1";
|
|
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",
|
package/dist/cli.js
CHANGED
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkPNKOKFFZjs = require('./chunk-PNKOKFFZ.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkFD6XUAB4js = require('./chunk-FD6XUAB4.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkSQLX75IOjs = require('./chunk-SQLX75IO.js');
|
|
18
18
|
|
|
19
19
|
// node/cli.ts
|
|
20
|
-
|
|
21
|
-
var import_fast_deep_equal =
|
|
20
|
+
_chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
21
|
+
var import_fast_deep_equal = _chunkSQLX75IOjs.__toESM.call(void 0, _chunkFD6XUAB4js.require_fast_deep_equal.call(void 0, ));
|
|
22
22
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
23
23
|
var _net = require('net'); var _net2 = _interopRequireDefault(_net);
|
|
24
24
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
@@ -30,13 +30,15 @@ var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);
|
|
|
30
30
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
31
31
|
var _kolorist = require('kolorist');
|
|
32
32
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
33
|
+
var _parser = require('@slidev/parser');
|
|
33
34
|
var CONFIG_RESTART_FIELDS = [
|
|
34
35
|
"highlighter",
|
|
35
36
|
"monaco",
|
|
36
37
|
"routerMode",
|
|
37
|
-
"fonts"
|
|
38
|
+
"fonts",
|
|
39
|
+
"css"
|
|
38
40
|
];
|
|
39
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
41
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkPNKOKFFZjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
40
42
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
41
43
|
alias: "p",
|
|
42
44
|
type: "number",
|
|
@@ -79,9 +81,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
79
81
|
async function initServer() {
|
|
80
82
|
if (server)
|
|
81
83
|
await server.close();
|
|
82
|
-
const options = await
|
|
84
|
+
const options = await _chunkPNKOKFFZjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
|
|
83
85
|
port = userPort || await findFreePort(3030);
|
|
84
|
-
server = await
|
|
86
|
+
server = await _chunkPNKOKFFZjs.createServer.call(void 0, options, {
|
|
85
87
|
server: {
|
|
86
88
|
port,
|
|
87
89
|
strictPort: true,
|
|
@@ -92,7 +94,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
92
94
|
logLevel: log
|
|
93
95
|
}, {
|
|
94
96
|
onDataReload(newData, data) {
|
|
95
|
-
if (!theme &&
|
|
97
|
+
if (!theme && _chunkPNKOKFFZjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkPNKOKFFZjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
96
98
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
97
99
|
initServer();
|
|
98
100
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -168,8 +170,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
168
170
|
type: "boolean",
|
|
169
171
|
describe: "allow download as PDF"
|
|
170
172
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
171
|
-
const { build } = await Promise.resolve().then(() =>
|
|
172
|
-
const options = await
|
|
173
|
+
const { build } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./build-ONMHHPBT.js")));
|
|
174
|
+
const options = await _chunkPNKOKFFZjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
173
175
|
if (download && !options.data.config.download)
|
|
174
176
|
options.data.config.download = download;
|
|
175
177
|
printInfo(options);
|
|
@@ -182,26 +184,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
182
184
|
});
|
|
183
185
|
});
|
|
184
186
|
cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
|
|
185
|
-
const data = await
|
|
186
|
-
|
|
187
|
-
await
|
|
187
|
+
const data = await _chunkPNKOKFFZjs.parser.load(entry);
|
|
188
|
+
_chunkPNKOKFFZjs.parser.prettify(data);
|
|
189
|
+
await _chunkPNKOKFFZjs.parser.save(data);
|
|
188
190
|
});
|
|
189
191
|
cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
190
192
|
return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
|
|
191
193
|
type: "string",
|
|
192
194
|
default: "theme"
|
|
193
195
|
}), async ({ entry, dir, theme: themeInput }) => {
|
|
194
|
-
const data = await
|
|
195
|
-
const theme =
|
|
196
|
+
const data = await _chunkPNKOKFFZjs.parser.load(entry);
|
|
197
|
+
const theme = _chunkPNKOKFFZjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
196
198
|
if (theme === "none") {
|
|
197
199
|
console.error('Can not eject theme "none"');
|
|
198
200
|
process.exit(1);
|
|
199
201
|
}
|
|
200
|
-
if (
|
|
202
|
+
if (_chunkPNKOKFFZjs.isPath.call(void 0, theme)) {
|
|
201
203
|
console.error("Theme is already ejected");
|
|
202
204
|
process.exit(1);
|
|
203
205
|
}
|
|
204
|
-
const roots =
|
|
206
|
+
const roots = _chunkPNKOKFFZjs.getThemeRoots.call(void 0, theme, entry);
|
|
205
207
|
if (!roots.length) {
|
|
206
208
|
console.error(`Does not found theme "${theme}"`);
|
|
207
209
|
process.exit(1);
|
|
@@ -213,7 +215,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
213
215
|
const dirPath = `./${dir}`;
|
|
214
216
|
data.slides[0].frontmatter.theme = dirPath;
|
|
215
217
|
data.slides[0].raw = null;
|
|
216
|
-
await
|
|
218
|
+
await _chunkPNKOKFFZjs.parser.save(data);
|
|
217
219
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
218
220
|
});
|
|
219
221
|
}, () => {
|
|
@@ -255,17 +257,17 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
255
257
|
"with-clicks": withClicks
|
|
256
258
|
}) => {
|
|
257
259
|
process.env.NODE_ENV = "production";
|
|
258
|
-
const { exportSlides } = await Promise.resolve().then(() =>
|
|
260
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./export-TH7MNEXN.js")));
|
|
259
261
|
const port = await findFreePort(12445);
|
|
260
|
-
const options = await
|
|
262
|
+
const options = await _chunkPNKOKFFZjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
261
263
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
262
|
-
const server = await
|
|
264
|
+
const server = await _chunkPNKOKFFZjs.createServer.call(void 0, options, {
|
|
263
265
|
server: { port },
|
|
264
266
|
clearScreen: false
|
|
265
267
|
});
|
|
266
268
|
await server.listen(port);
|
|
267
269
|
printInfo(options);
|
|
268
|
-
|
|
270
|
+
_chunkPNKOKFFZjs.parser.filterDisabled(options.data);
|
|
269
271
|
const width = options.data.config.canvasWidth;
|
|
270
272
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
271
273
|
output = await exportSlides({
|
|
@@ -303,7 +305,7 @@ function printInfo(options, port, remote) {
|
|
|
303
305
|
console.log();
|
|
304
306
|
console.log();
|
|
305
307
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
306
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
308
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkPNKOKFFZjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
307
309
|
console.log();
|
|
308
310
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
309
311
|
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));
|
|
@@ -326,6 +328,7 @@ function printInfo(options, port, remote) {
|
|
|
326
328
|
console.log(`${_kolorist.dim.call(void 0, " shortcuts ")} > ${_kolorist.underline.call(void 0, "r")}${_kolorist.dim.call(void 0, "estart | ")}${_kolorist.underline.call(void 0, "o")}${_kolorist.dim.call(void 0, "pen | ")}${_kolorist.underline.call(void 0, "e")}${_kolorist.dim.call(void 0, "dit")}`);
|
|
327
329
|
}
|
|
328
330
|
console.log();
|
|
331
|
+
_parser.verifyConfig.call(void 0, options.data.config, options.data.themeMeta, (v) => console.warn(_kolorist.yellow.call(void 0, ` ! ${v}`)));
|
|
329
332
|
console.log();
|
|
330
333
|
}
|
|
331
334
|
function isPortFree(port) {
|
package/dist/cli.mjs
CHANGED
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
resolveOptions,
|
|
7
7
|
resolveThemeName,
|
|
8
8
|
version
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VO7LIZVO.mjs";
|
|
10
10
|
import {
|
|
11
11
|
require_fast_deep_equal
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BQ63PXSA.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__dirname,
|
|
15
15
|
__require,
|
|
16
16
|
__toESM,
|
|
17
17
|
init_esm_shims
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GVA336JI.mjs";
|
|
19
19
|
|
|
20
20
|
// node/cli.ts
|
|
21
21
|
init_esm_shims();
|
|
@@ -31,11 +31,13 @@ import yargs from "yargs";
|
|
|
31
31
|
import prompts from "prompts";
|
|
32
32
|
import { blue, bold, cyan, dim, gray, green, underline, yellow } from "kolorist";
|
|
33
33
|
import isInstalledGlobally from "is-installed-globally";
|
|
34
|
+
import { verifyConfig } from "@slidev/parser";
|
|
34
35
|
var CONFIG_RESTART_FIELDS = [
|
|
35
36
|
"highlighter",
|
|
36
37
|
"monaco",
|
|
37
38
|
"routerMode",
|
|
38
|
-
"fonts"
|
|
39
|
+
"fonts",
|
|
40
|
+
"css"
|
|
39
41
|
];
|
|
40
42
|
var cli = yargs.scriptName("slidev").usage("$0 [args]").version(version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
41
43
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
@@ -169,7 +171,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
169
171
|
type: "boolean",
|
|
170
172
|
describe: "allow download as PDF"
|
|
171
173
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
172
|
-
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-
|
|
174
|
+
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-AZXVYLTZ.mjs")));
|
|
173
175
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
174
176
|
if (download && !options.data.config.download)
|
|
175
177
|
options.data.config.download = download;
|
|
@@ -256,7 +258,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
256
258
|
"with-clicks": withClicks
|
|
257
259
|
}) => {
|
|
258
260
|
process.env.NODE_ENV = "production";
|
|
259
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
261
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-5OVMZQWE.mjs")));
|
|
260
262
|
const port = await findFreePort(12445);
|
|
261
263
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
262
264
|
output = output || options.data.config.exportFilename || `${path.basename(entry, ".md")}-export`;
|
|
@@ -327,6 +329,7 @@ function printInfo(options, port, remote) {
|
|
|
327
329
|
console.log(`${dim(" shortcuts ")} > ${underline("r")}${dim("estart | ")}${underline("o")}${dim("pen | ")}${underline("e")}${dim("dit")}`);
|
|
328
330
|
}
|
|
329
331
|
console.log();
|
|
332
|
+
verifyConfig(options.data.config, options.data.themeMeta, (v) => console.warn(yellow(` ! ${v}`)));
|
|
330
333
|
console.log();
|
|
331
334
|
}
|
|
332
335
|
function isPortFree(port) {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkSQLX75IOjs = require('./chunk-SQLX75IO.js');
|
|
7
7
|
|
|
8
8
|
// node/export.ts
|
|
9
|
-
|
|
9
|
+
_chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
10
10
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
11
11
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
12
12
|
var _kolorist = require('kolorist');
|
|
@@ -60,10 +60,10 @@ async function exportSlides({
|
|
|
60
60
|
height = 1080,
|
|
61
61
|
withClicks = false
|
|
62
62
|
}) {
|
|
63
|
-
if (!
|
|
63
|
+
if (!_chunkSQLX75IOjs.packageExists.call(void 0, "playwright-chromium"))
|
|
64
64
|
throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D playwright-chromium`");
|
|
65
65
|
const pages = _core.parseRangeString.call(void 0, total, range);
|
|
66
|
-
const { chromium } = await Promise.resolve().then(() =>
|
|
66
|
+
const { chromium } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "playwright-chromium")));
|
|
67
67
|
const browser = await chromium.launch();
|
|
68
68
|
const context = await browser.newContext({
|
|
69
69
|
viewport: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Vue from '@vitejs/plugin-vue';
|
|
2
2
|
import Icons from 'unplugin-icons/vite';
|
|
3
3
|
import Components from 'unplugin-vue-components/vite';
|
|
4
|
-
import Markdown from 'vite-plugin-
|
|
4
|
+
import Markdown from 'vite-plugin-vue-markdown';
|
|
5
5
|
import WindiCSS from 'vite-plugin-windicss';
|
|
6
|
+
import { VitePluginConfig } from 'unocss/vite';
|
|
6
7
|
import RemoteAssets from 'vite-plugin-remote-assets';
|
|
7
8
|
import ServerRef from 'vite-plugin-vue-server-ref';
|
|
8
9
|
import { ArgumentsType } from '@antfu/utils';
|
|
@@ -55,6 +56,7 @@ interface SlidevPluginOptions extends SlidevEntryOptions {
|
|
|
55
56
|
icons?: ArgumentsType<typeof Icons>[0];
|
|
56
57
|
remoteAssets?: ArgumentsType<typeof RemoteAssets>[0];
|
|
57
58
|
serverRef?: ArgumentsType<typeof ServerRef>[0];
|
|
59
|
+
unocss?: VitePluginConfig;
|
|
58
60
|
}
|
|
59
61
|
interface SlidevServerOptions {
|
|
60
62
|
onDataReload?: (newData: SlidevMarkdown, data: SlidevMarkdown) => void;
|
package/dist/index.js
CHANGED
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkPNKOKFFZjs = require('./chunk-PNKOKFFZ.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkFD6XUAB4js = require('./chunk-FD6XUAB4.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkSQLX75IOjs = require('./chunk-SQLX75IO.js');
|
|
20
20
|
|
|
21
21
|
// node/index.ts
|
|
22
|
-
|
|
22
|
+
_chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
23
23
|
|
|
24
24
|
// node/declare.ts
|
|
25
|
-
|
|
25
|
+
_chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -36,4 +36,4 @@ _chunkFFZLS6QKjs.init_cjs_shims.call(void 0, );
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
exports.ViteSlidevPlugin =
|
|
39
|
+
exports.ViteSlidevPlugin = _chunkFD6XUAB4js.ViteSlidevPlugin; exports.createServer = _chunkPNKOKFFZjs.createServer; exports.createWindiCSSPlugin = _chunkFD6XUAB4js.createWindiCSSPlugin; exports.getAddonRoots = _chunkPNKOKFFZjs.getAddonRoots; exports.getCLIRoot = _chunkPNKOKFFZjs.getCLIRoot; exports.getClientRoot = _chunkPNKOKFFZjs.getClientRoot; exports.getRoot = _chunkPNKOKFFZjs.getRoot; exports.getThemeRoots = _chunkPNKOKFFZjs.getThemeRoots; exports.getUserRoot = _chunkPNKOKFFZjs.getUserRoot; exports.isPath = _chunkPNKOKFFZjs.isPath; exports.parser = _chunkPNKOKFFZjs.parser; exports.resolveOptions = _chunkPNKOKFFZjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
isPath,
|
|
10
10
|
parser,
|
|
11
11
|
resolveOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VO7LIZVO.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ViteSlidevPlugin,
|
|
15
15
|
createWindiCSSPlugin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BQ63PXSA.mjs";
|
|
17
17
|
import {
|
|
18
18
|
init_esm_shims
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-GVA336JI.mjs";
|
|
20
20
|
|
|
21
21
|
// node/index.ts
|
|
22
22
|
init_esm_shims();
|