@slidev/cli 0.34.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/dist/build-AZXVYLTZ.mjs +743 -0
- package/dist/build-ONMHHPBT.js +743 -0
- package/dist/chunk-BQ63PXSA.mjs +1633 -0
- package/dist/chunk-FD6XUAB4.js +1632 -0
- package/dist/{chunk-IWKTUAXD.mjs → chunk-GVA336JI.mjs} +0 -32
- package/dist/{chunk-5GSPMDNU.js → chunk-PNKOKFFZ.js} +166 -166
- package/dist/{chunk-SO7T6GEW.js → chunk-SQLX75IO.js} +1 -37
- package/dist/{chunk-QE663OGO.mjs → chunk-VO7LIZVO.mjs} +35 -35
- package/dist/cli.js +24 -24
- package/dist/cli.mjs +5 -5
- package/dist/{export-Z44PM4CT.mjs → export-5OVMZQWE.mjs} +1 -1
- package/dist/{export-URR4VZNO.js → export-TH7MNEXN.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +6 -7
- package/dist/build-GQNLL4B2.js +0 -113
- package/dist/build-Y3ZVSXFT.mjs +0 -113
- package/dist/chunk-FROLEDLC.js +0 -10916
- package/dist/chunk-OGKTSZVU.mjs +0 -10917
|
@@ -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
|
};
|
|
@@ -85,11 +56,8 @@ var __privateWrapper = (obj, member, setter, getter) => {
|
|
|
85
56
|
};
|
|
86
57
|
|
|
87
58
|
// ../../node_modules/.pnpm/tsup@5.12.9_typescript@4.7.4/node_modules/tsup/assets/cjs_shims.js
|
|
88
|
-
var getImportMetaUrl, importMetaUrl;
|
|
89
59
|
var init_cjs_shims = __esm({
|
|
90
60
|
"../../node_modules/.pnpm/tsup@5.12.9_typescript@4.7.4/node_modules/tsup/assets/cjs_shims.js"() {
|
|
91
|
-
getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
92
|
-
importMetaUrl = exports.importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
93
61
|
}
|
|
94
62
|
});
|
|
95
63
|
|
|
@@ -171,8 +139,4 @@ function packageExists(name) {
|
|
|
171
139
|
|
|
172
140
|
|
|
173
141
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
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.importMetaUrl = importMetaUrl; 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,7 +2399,7 @@ init_esm_shims();
|
|
|
2402
2399
|
import * as parser from "@slidev/parser/fs";
|
|
2403
2400
|
|
|
2404
2401
|
// package.json
|
|
2405
|
-
var version = "0.34.
|
|
2402
|
+
var version = "0.34.1";
|
|
2406
2403
|
|
|
2407
2404
|
// node/themes.ts
|
|
2408
2405
|
init_esm_shims();
|
|
@@ -2479,17 +2476,19 @@ 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 = {
|
|
@@ -3109,7 +3108,7 @@ async function findUpMultiple(name, options = {}) {
|
|
|
3109
3108
|
};
|
|
3110
3109
|
const matches = [];
|
|
3111
3110
|
while (true) {
|
|
3112
|
-
const foundPath = await runMatcher(
|
|
3111
|
+
const foundPath = await runMatcher({ ...options, cwd: directory });
|
|
3113
3112
|
if (foundPath === findUpStop) {
|
|
3114
3113
|
break;
|
|
3115
3114
|
}
|
|
@@ -3124,7 +3123,7 @@ async function findUpMultiple(name, options = {}) {
|
|
|
3124
3123
|
return matches;
|
|
3125
3124
|
}
|
|
3126
3125
|
async function findUp(name, options = {}) {
|
|
3127
|
-
const matches = await findUpMultiple(name,
|
|
3126
|
+
const matches = await findUpMultiple(name, { ...options, limit: 1 });
|
|
3128
3127
|
return matches[0];
|
|
3129
3128
|
}
|
|
3130
3129
|
var customRcPath = process.env.NI_CONFIG_FILE;
|
|
@@ -3416,9 +3415,8 @@ function npmRunPath(options = {}) {
|
|
|
3416
3415
|
result.push(path$3.resolve(cwdString, execPath, ".."));
|
|
3417
3416
|
return [...result, path_].join(path$3.delimiter);
|
|
3418
3417
|
}
|
|
3419
|
-
function npmRunPathEnv(
|
|
3420
|
-
|
|
3421
|
-
env2 = __spreadValues({}, env2);
|
|
3418
|
+
function npmRunPathEnv({ env: env2 = process$2.env, ...options } = {}) {
|
|
3419
|
+
env2 = { ...env2 };
|
|
3422
3420
|
const path2 = pathKey({ env: env2 });
|
|
3423
3421
|
options.path = env2[path2];
|
|
3424
3422
|
env2[path2] = npmRunPath(options);
|
|
@@ -3456,7 +3454,7 @@ var changeToString = (to, from, name) => {
|
|
|
3456
3454
|
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
3457
3455
|
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
3458
3456
|
Object.defineProperty(newToString, "name", toStringName);
|
|
3459
|
-
Object.defineProperty(to, "toString",
|
|
3457
|
+
Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
|
|
3460
3458
|
};
|
|
3461
3459
|
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
3462
3460
|
const { name } = to;
|
|
@@ -3806,9 +3804,10 @@ var getSignalsByName = function() {
|
|
|
3806
3804
|
return signals.reduce(getSignalByName, {});
|
|
3807
3805
|
};
|
|
3808
3806
|
var getSignalByName = function(signalByNameMemo, { name, number: number2, description, supported, action: action2, forced, standard }) {
|
|
3809
|
-
return
|
|
3807
|
+
return {
|
|
3808
|
+
...signalByNameMemo,
|
|
3810
3809
|
[name]: { name, number: number2, description, supported, action: action2, forced, standard }
|
|
3811
|
-
}
|
|
3810
|
+
};
|
|
3812
3811
|
};
|
|
3813
3812
|
var signalsByName = getSignalsByName();
|
|
3814
3813
|
var getSignalsByNumber = function() {
|
|
@@ -4179,7 +4178,7 @@ function isStream(stream2) {
|
|
|
4179
4178
|
var getStream$2 = { exports: {} };
|
|
4180
4179
|
var { PassThrough: PassThroughStream } = require$$0$3;
|
|
4181
4180
|
var bufferStream$1 = (options) => {
|
|
4182
|
-
options =
|
|
4181
|
+
options = { ...options };
|
|
4183
4182
|
const { array } = options;
|
|
4184
4183
|
let { encoding } = options;
|
|
4185
4184
|
const isBuffer = encoding === "buffer";
|
|
@@ -4230,9 +4229,10 @@ async function getStream(inputStream, options) {
|
|
|
4230
4229
|
if (!inputStream) {
|
|
4231
4230
|
throw new Error("Expected a stream");
|
|
4232
4231
|
}
|
|
4233
|
-
options =
|
|
4234
|
-
maxBuffer: Infinity
|
|
4235
|
-
|
|
4232
|
+
options = {
|
|
4233
|
+
maxBuffer: Infinity,
|
|
4234
|
+
...options
|
|
4235
|
+
};
|
|
4236
4236
|
const { maxBuffer } = options;
|
|
4237
4237
|
const stream2 = bufferStream(options);
|
|
4238
4238
|
await new Promise((resolve3, reject) => {
|
|
@@ -4259,8 +4259,8 @@ async function getStream(inputStream, options) {
|
|
|
4259
4259
|
return stream2.getBufferedValue();
|
|
4260
4260
|
}
|
|
4261
4261
|
getStream$2.exports = getStream;
|
|
4262
|
-
getStream$2.exports.buffer = (stream2, options) => getStream(stream2,
|
|
4263
|
-
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 });
|
|
4264
4264
|
getStream$2.exports.MaxBufferError = MaxBufferError;
|
|
4265
4265
|
var getStream$1 = getStream$2.exports;
|
|
4266
4266
|
var { PassThrough } = require$$0$3;
|
|
@@ -4363,7 +4363,7 @@ var descriptors = ["then", "catch", "finally"].map((property) => [
|
|
|
4363
4363
|
var mergePromise = (spawned, promise) => {
|
|
4364
4364
|
for (const [property, descriptor] of descriptors) {
|
|
4365
4365
|
const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
4366
|
-
Reflect.defineProperty(spawned, property,
|
|
4366
|
+
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
4367
4367
|
}
|
|
4368
4368
|
return spawned;
|
|
4369
4369
|
};
|
|
@@ -4411,7 +4411,7 @@ var parseCommand = (command) => {
|
|
|
4411
4411
|
};
|
|
4412
4412
|
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
|
4413
4413
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
4414
|
-
const env2 = extendEnv ?
|
|
4414
|
+
const env2 = extendEnv ? { ...process$2.env, ...envOption } : envOption;
|
|
4415
4415
|
if (preferLocal) {
|
|
4416
4416
|
return npmRunPathEnv({ env: env2, cwd: localDir, execPath });
|
|
4417
4417
|
}
|
|
@@ -4422,7 +4422,7 @@ var handleArguments = (file, args, options = {}) => {
|
|
|
4422
4422
|
file = parsed.command;
|
|
4423
4423
|
args = parsed.args;
|
|
4424
4424
|
options = parsed.options;
|
|
4425
|
-
options =
|
|
4425
|
+
options = {
|
|
4426
4426
|
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
4427
4427
|
buffer: true,
|
|
4428
4428
|
stripFinalNewline: true,
|
|
@@ -4434,8 +4434,9 @@ var handleArguments = (file, args, options = {}) => {
|
|
|
4434
4434
|
reject: true,
|
|
4435
4435
|
cleanup: true,
|
|
4436
4436
|
all: false,
|
|
4437
|
-
windowsHide: true
|
|
4438
|
-
|
|
4437
|
+
windowsHide: true,
|
|
4438
|
+
...options
|
|
4439
|
+
};
|
|
4439
4440
|
options.env = getEnv(options);
|
|
4440
4441
|
options.stdio = normalizeStdio(options);
|
|
4441
4442
|
if (process$2.platform === "win32" && path$3.basename(file, ".exe") === "cmd") {
|
|
@@ -4814,8 +4815,7 @@ var supportsHyperlinks = {
|
|
|
4814
4815
|
stdout: supportsHyperlink(process.stdout),
|
|
4815
4816
|
stderr: supportsHyperlink(process.stderr)
|
|
4816
4817
|
};
|
|
4817
|
-
function terminalLink(text2, url2,
|
|
4818
|
-
var _b = _a, { target = "stdout" } = _b, options = __objRest(_b, ["target"]);
|
|
4818
|
+
function terminalLink(text2, url2, { target = "stdout", ...options } = {}) {
|
|
4819
4819
|
if (!supportsHyperlinks[target]) {
|
|
4820
4820
|
if (options.fallback === false) {
|
|
4821
4821
|
return text2;
|
|
@@ -4825,7 +4825,7 @@ function terminalLink(text2, url2, _a = {}) {
|
|
|
4825
4825
|
return ansiEscapes.link(text2, url2);
|
|
4826
4826
|
}
|
|
4827
4827
|
terminalLink.isSupported = supportsHyperlinks.stdout;
|
|
4828
|
-
terminalLink.stderr = (text2, url2, options = {}) => terminalLink(text2, url2,
|
|
4828
|
+
terminalLink.stderr = (text2, url2, options = {}) => terminalLink(text2, url2, { target: "stderr", ...options });
|
|
4829
4829
|
terminalLink.stderr.isSupported = supportsHyperlinks.stderr;
|
|
4830
4830
|
var prompts$4 = {};
|
|
4831
4831
|
var { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env;
|
|
@@ -9336,7 +9336,7 @@ async function prompt(questions = [], { onSubmit = noop, onCancel = noop } = {})
|
|
|
9336
9336
|
for (question of questions) {
|
|
9337
9337
|
({ name, type } = question);
|
|
9338
9338
|
if (typeof type === "function") {
|
|
9339
|
-
type = await type(answer,
|
|
9339
|
+
type = await type(answer, { ...answers }, question);
|
|
9340
9340
|
question["type"] = type;
|
|
9341
9341
|
}
|
|
9342
9342
|
if (!type)
|
|
@@ -9345,7 +9345,7 @@ async function prompt(questions = [], { onSubmit = noop, onCancel = noop } = {})
|
|
|
9345
9345
|
if (passOn.includes(key))
|
|
9346
9346
|
continue;
|
|
9347
9347
|
let value = question[key];
|
|
9348
|
-
question[key] = typeof value === "function" ? await value(answer,
|
|
9348
|
+
question[key] = typeof value === "function" ? await value(answer, { ...answers }, lastPrompt) : value;
|
|
9349
9349
|
}
|
|
9350
9350
|
lastPrompt = question;
|
|
9351
9351
|
if (typeof question.message !== "string") {
|
|
@@ -9461,7 +9461,7 @@ async function run(fn, args, options = {}) {
|
|
|
9461
9461
|
if (isGlobal) {
|
|
9462
9462
|
command = await fn(await getGlobalAgent(), args);
|
|
9463
9463
|
} else {
|
|
9464
|
-
let agent = await detect(
|
|
9464
|
+
let agent = await detect({ ...options, cwd }) || await getDefaultAgent();
|
|
9465
9465
|
if (agent === "prompt") {
|
|
9466
9466
|
agent = (await prompts({
|
|
9467
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);
|
|
@@ -38,7 +38,7 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
38
38
|
"fonts",
|
|
39
39
|
"css"
|
|
40
40
|
];
|
|
41
|
-
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");
|
|
42
42
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
43
43
|
alias: "p",
|
|
44
44
|
type: "number",
|
|
@@ -81,9 +81,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
81
81
|
async function initServer() {
|
|
82
82
|
if (server)
|
|
83
83
|
await server.close();
|
|
84
|
-
const options = await
|
|
84
|
+
const options = await _chunkPNKOKFFZjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
|
|
85
85
|
port = userPort || await findFreePort(3030);
|
|
86
|
-
server = await
|
|
86
|
+
server = await _chunkPNKOKFFZjs.createServer.call(void 0, options, {
|
|
87
87
|
server: {
|
|
88
88
|
port,
|
|
89
89
|
strictPort: true,
|
|
@@ -94,7 +94,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
94
94
|
logLevel: log
|
|
95
95
|
}, {
|
|
96
96
|
onDataReload(newData, data) {
|
|
97
|
-
if (!theme &&
|
|
97
|
+
if (!theme && _chunkPNKOKFFZjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkPNKOKFFZjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
98
98
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
99
99
|
initServer();
|
|
100
100
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -170,8 +170,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
170
170
|
type: "boolean",
|
|
171
171
|
describe: "allow download as PDF"
|
|
172
172
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
173
|
-
const { build } = await Promise.resolve().then(() =>
|
|
174
|
-
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");
|
|
175
175
|
if (download && !options.data.config.download)
|
|
176
176
|
options.data.config.download = download;
|
|
177
177
|
printInfo(options);
|
|
@@ -184,26 +184,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
184
184
|
});
|
|
185
185
|
});
|
|
186
186
|
cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
|
|
187
|
-
const data = await
|
|
188
|
-
|
|
189
|
-
await
|
|
187
|
+
const data = await _chunkPNKOKFFZjs.parser.load(entry);
|
|
188
|
+
_chunkPNKOKFFZjs.parser.prettify(data);
|
|
189
|
+
await _chunkPNKOKFFZjs.parser.save(data);
|
|
190
190
|
});
|
|
191
191
|
cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
192
192
|
return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
|
|
193
193
|
type: "string",
|
|
194
194
|
default: "theme"
|
|
195
195
|
}), async ({ entry, dir, theme: themeInput }) => {
|
|
196
|
-
const data = await
|
|
197
|
-
const theme =
|
|
196
|
+
const data = await _chunkPNKOKFFZjs.parser.load(entry);
|
|
197
|
+
const theme = _chunkPNKOKFFZjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
198
198
|
if (theme === "none") {
|
|
199
199
|
console.error('Can not eject theme "none"');
|
|
200
200
|
process.exit(1);
|
|
201
201
|
}
|
|
202
|
-
if (
|
|
202
|
+
if (_chunkPNKOKFFZjs.isPath.call(void 0, theme)) {
|
|
203
203
|
console.error("Theme is already ejected");
|
|
204
204
|
process.exit(1);
|
|
205
205
|
}
|
|
206
|
-
const roots =
|
|
206
|
+
const roots = _chunkPNKOKFFZjs.getThemeRoots.call(void 0, theme, entry);
|
|
207
207
|
if (!roots.length) {
|
|
208
208
|
console.error(`Does not found theme "${theme}"`);
|
|
209
209
|
process.exit(1);
|
|
@@ -215,7 +215,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
215
215
|
const dirPath = `./${dir}`;
|
|
216
216
|
data.slides[0].frontmatter.theme = dirPath;
|
|
217
217
|
data.slides[0].raw = null;
|
|
218
|
-
await
|
|
218
|
+
await _chunkPNKOKFFZjs.parser.save(data);
|
|
219
219
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
220
220
|
});
|
|
221
221
|
}, () => {
|
|
@@ -257,17 +257,17 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
257
257
|
"with-clicks": withClicks
|
|
258
258
|
}) => {
|
|
259
259
|
process.env.NODE_ENV = "production";
|
|
260
|
-
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")));
|
|
261
261
|
const port = await findFreePort(12445);
|
|
262
|
-
const options = await
|
|
262
|
+
const options = await _chunkPNKOKFFZjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
263
263
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
264
|
-
const server = await
|
|
264
|
+
const server = await _chunkPNKOKFFZjs.createServer.call(void 0, options, {
|
|
265
265
|
server: { port },
|
|
266
266
|
clearScreen: false
|
|
267
267
|
});
|
|
268
268
|
await server.listen(port);
|
|
269
269
|
printInfo(options);
|
|
270
|
-
|
|
270
|
+
_chunkPNKOKFFZjs.parser.filterDisabled(options.data);
|
|
271
271
|
const width = options.data.config.canvasWidth;
|
|
272
272
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
273
273
|
output = await exportSlides({
|
|
@@ -305,7 +305,7 @@ function printInfo(options, port, remote) {
|
|
|
305
305
|
console.log();
|
|
306
306
|
console.log();
|
|
307
307
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
308
|
-
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)") : ""}`);
|
|
309
309
|
console.log();
|
|
310
310
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
311
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));
|
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();
|
|
@@ -171,7 +171,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
171
171
|
type: "boolean",
|
|
172
172
|
describe: "allow download as PDF"
|
|
173
173
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
174
|
-
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-
|
|
174
|
+
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-AZXVYLTZ.mjs")));
|
|
175
175
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
176
176
|
if (download && !options.data.config.download)
|
|
177
177
|
options.data.config.download = download;
|
|
@@ -258,7 +258,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
258
258
|
"with-clicks": withClicks
|
|
259
259
|
}) => {
|
|
260
260
|
process.env.NODE_ENV = "production";
|
|
261
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
261
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-5OVMZQWE.mjs")));
|
|
262
262
|
const port = await findFreePort(12445);
|
|
263
263
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
264
264
|
output = output || options.data.config.exportFilename || `${path.basename(entry, ".md")}-export`;
|
|
@@ -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.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 @@ _chunkSO7T6GEWjs.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();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.1",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,10 +45,9 @@
|
|
|
45
45
|
"@antfu/utils": "^0.5.2",
|
|
46
46
|
"@iconify-json/carbon": "^1.1.6",
|
|
47
47
|
"@iconify-json/ph": "^1.1.2",
|
|
48
|
-
"@slidev/client": "0.34.
|
|
49
|
-
"@slidev/parser": "0.34.
|
|
50
|
-
"@slidev/types": "0.34.
|
|
51
|
-
"@unocss/reset": "^0.42.0",
|
|
48
|
+
"@slidev/client": "0.34.1",
|
|
49
|
+
"@slidev/parser": "0.34.1",
|
|
50
|
+
"@slidev/types": "0.34.1",
|
|
52
51
|
"@vitejs/plugin-vue": "^2.3.3",
|
|
53
52
|
"@vue/compiler-sfc": "^3.2.37",
|
|
54
53
|
"cli-progress": "^3.11.2",
|
|
@@ -78,6 +77,7 @@
|
|
|
78
77
|
"resolve-from": "^5.0.0",
|
|
79
78
|
"resolve-global": "^1.0.0",
|
|
80
79
|
"shiki": "^0.10.1",
|
|
80
|
+
"unocss": "^0.42.0",
|
|
81
81
|
"unplugin-icons": "^0.14.6",
|
|
82
82
|
"unplugin-vue-components": "^0.20.1",
|
|
83
83
|
"vite": "^2.9.13",
|
|
@@ -93,8 +93,7 @@
|
|
|
93
93
|
"@types/plantuml-encoder": "^1.4.0",
|
|
94
94
|
"fast-deep-equal": "^3.1.3",
|
|
95
95
|
"semver": "^7.3.7",
|
|
96
|
-
"sirv": "^2.0.2"
|
|
97
|
-
"unocss": "^0.42.0"
|
|
96
|
+
"sirv": "^2.0.2"
|
|
98
97
|
},
|
|
99
98
|
"scripts": {
|
|
100
99
|
"build": "rimraf dist && tsup node/index.ts node/cli.ts --dts --format cjs,esm --splitting --external @slidev/client/package.json",
|