@slidev/cli 0.38.2 → 0.38.4
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-3EAJCMHL.js → build-ATIWLFVV.js} +5 -5
- package/dist/{build-ZVJV76M5.mjs → build-XB553JUF.mjs} +1 -1
- package/dist/{chunk-WASFPW47.js → chunk-CUQDKJBB.js} +4 -4
- package/dist/{chunk-ZM2W3WD5.mjs → chunk-LAZ5PNFJ.mjs} +2 -2
- package/dist/{chunk-CWYLQZTY.mjs → chunk-NTTNCVJU.mjs} +21 -12
- package/dist/{chunk-W2IZ2OEV.js → chunk-TXDYSJOB.js} +21 -12
- package/dist/cli.js +28 -28
- package/dist/cli.mjs +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +12 -12
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkTXDYSJOBjs = require('./chunk-TXDYSJOB.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -655,16 +655,16 @@ async function build(options, viteConfig = {}) {
|
|
|
655
655
|
let originalIndexHTML;
|
|
656
656
|
if (_fsextra2.default.existsSync(indexPath))
|
|
657
657
|
originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
|
|
658
|
-
await _fsextra2.default.writeFile(indexPath, await
|
|
658
|
+
await _fsextra2.default.writeFile(indexPath, await _chunkTXDYSJOBjs.getIndexHtml.call(void 0, options), "utf-8");
|
|
659
659
|
let config = void 0;
|
|
660
660
|
try {
|
|
661
|
-
const inlineConfig = await
|
|
661
|
+
const inlineConfig = await _chunkTXDYSJOBjs.mergeViteConfigs.call(void 0,
|
|
662
662
|
options,
|
|
663
663
|
viteConfig,
|
|
664
664
|
{
|
|
665
665
|
root: options.userRoot,
|
|
666
666
|
plugins: [
|
|
667
|
-
await
|
|
667
|
+
await _chunkTXDYSJOBjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
|
|
668
668
|
{
|
|
669
669
|
name: "resolve-config",
|
|
670
670
|
configResolved(_config) {
|
|
@@ -685,7 +685,7 @@ async function build(options, viteConfig = {}) {
|
|
|
685
685
|
} else {
|
|
686
686
|
console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
|
|
687
687
|
await _vite.build.call(void 0,
|
|
688
|
-
await
|
|
688
|
+
await _chunkTXDYSJOBjs.mergeViteConfigs.call(void 0,
|
|
689
689
|
options,
|
|
690
690
|
inlineConfig,
|
|
691
691
|
{
|
|
@@ -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 }; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkTXDYSJOBjs = require('./chunk-TXDYSJOB.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -2426,7 +2426,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2426
2426
|
const pluginOptions = rawConfig.slidev || {};
|
|
2427
2427
|
process.env.EDITOR = process.env.EDITOR || "code";
|
|
2428
2428
|
const server = await _vite.createServer.call(void 0,
|
|
2429
|
-
await
|
|
2429
|
+
await _chunkTXDYSJOBjs.mergeViteConfigs.call(void 0,
|
|
2430
2430
|
options,
|
|
2431
2431
|
viteConfig,
|
|
2432
2432
|
{
|
|
@@ -2436,7 +2436,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2436
2436
|
]
|
|
2437
2437
|
},
|
|
2438
2438
|
plugins: [
|
|
2439
|
-
await
|
|
2439
|
+
await _chunkTXDYSJOBjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
|
|
2440
2440
|
]
|
|
2441
2441
|
},
|
|
2442
2442
|
"serve"
|
|
@@ -2450,7 +2450,7 @@ _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
|
|
2450
2450
|
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
2451
2451
|
|
|
2452
2452
|
// package.json
|
|
2453
|
-
var version = "0.38.
|
|
2453
|
+
var version = "0.38.4";
|
|
2454
2454
|
|
|
2455
2455
|
// node/themes.ts
|
|
2456
2456
|
_chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NTTNCVJU.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__dirname,
|
|
@@ -2451,7 +2451,7 @@ init_esm_shims();
|
|
|
2451
2451
|
import * as parser from "@slidev/parser/fs";
|
|
2452
2452
|
|
|
2453
2453
|
// package.json
|
|
2454
|
-
var version = "0.38.
|
|
2454
|
+
var version = "0.38.4";
|
|
2455
2455
|
|
|
2456
2456
|
// node/themes.ts
|
|
2457
2457
|
init_esm_shims();
|
|
@@ -234,7 +234,7 @@ async function loadDrawings(options) {
|
|
|
234
234
|
suppressErrors: true
|
|
235
235
|
});
|
|
236
236
|
const obj = {};
|
|
237
|
-
Promise.all(files.map(async (path) => {
|
|
237
|
+
await Promise.all(files.map(async (path) => {
|
|
238
238
|
const num = +basename(path, ".svg");
|
|
239
239
|
if (Number.isNaN(num))
|
|
240
240
|
return;
|
|
@@ -276,25 +276,25 @@ var dependencies = {
|
|
|
276
276
|
"@antfu/utils": "^0.7.2",
|
|
277
277
|
"@slidev/parser": "workspace:*",
|
|
278
278
|
"@slidev/types": "workspace:*",
|
|
279
|
-
"@unocss/reset": "^0.
|
|
280
|
-
"@vueuse/core": "^9.
|
|
279
|
+
"@unocss/reset": "^0.48.4",
|
|
280
|
+
"@vueuse/core": "^9.11.0",
|
|
281
281
|
"@vueuse/head": "^1.0.22",
|
|
282
|
-
"@vueuse/math": "^9.
|
|
282
|
+
"@vueuse/math": "^9.11.0",
|
|
283
283
|
"@vueuse/motion": "^2.0.0-beta.26",
|
|
284
284
|
codemirror: "^5.65.5",
|
|
285
285
|
defu: "^6.1.1",
|
|
286
286
|
drauu: "^0.3.2",
|
|
287
287
|
"file-saver": "^2.0.5",
|
|
288
|
-
"js-base64": "^3.7.
|
|
288
|
+
"js-base64": "^3.7.4",
|
|
289
289
|
"js-yaml": "^4.1.0",
|
|
290
290
|
katex: "^0.16.4",
|
|
291
291
|
mermaid: "^9.3.0",
|
|
292
292
|
"monaco-editor": "^0.33.0",
|
|
293
293
|
nanoid: "^4.0.0",
|
|
294
|
-
prettier: "^2.8.
|
|
294
|
+
prettier: "^2.8.3",
|
|
295
295
|
recordrtc: "^5.6.2",
|
|
296
296
|
resolve: "^1.22.1",
|
|
297
|
-
unocss: "^0.
|
|
297
|
+
unocss: "^0.48.4",
|
|
298
298
|
"vite-plugin-windicss": "^1.8.10",
|
|
299
299
|
vue: "^3.2.45",
|
|
300
300
|
"vue-router": "^4.1.6",
|
|
@@ -434,12 +434,14 @@ function createConfigPlugin(options) {
|
|
|
434
434
|
}
|
|
435
435
|
function getDefine(options) {
|
|
436
436
|
return {
|
|
437
|
+
__DEV__: options.mode === "dev" ? "true" : "false",
|
|
437
438
|
__SLIDEV_CLIENT_ROOT__: JSON.stringify(toAtFS(options.clientRoot)),
|
|
438
439
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
439
440
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
440
441
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
441
442
|
__SLIDEV_FEATURE_RECORD__: JSON.stringify(options.data.config.record === true || options.data.config.record === options.mode),
|
|
442
|
-
|
|
443
|
+
__SLIDEV_FEATURE_PRESENTER__: JSON.stringify(options.data.config.presenter === true || options.data.config.presenter === options.mode),
|
|
444
|
+
__USE_SERVER__: options.mode !== "build" ? "true" : "false"
|
|
443
445
|
};
|
|
444
446
|
}
|
|
445
447
|
|
|
@@ -620,7 +622,11 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
620
622
|
if (id === "/@slidev/titles.md") {
|
|
621
623
|
return {
|
|
622
624
|
code: data.slides.map(({ title }, i) => {
|
|
623
|
-
return `<template ${i === 0 ? "v-if" : "v-else-if"}="+no === ${i + 1}"
|
|
625
|
+
return `<template ${i === 0 ? "v-if" : "v-else-if"}="+no === ${i + 1}">
|
|
626
|
+
|
|
627
|
+
${title}
|
|
628
|
+
|
|
629
|
+
</template>`;
|
|
624
630
|
}).join(""),
|
|
625
631
|
map: { mappings: "" }
|
|
626
632
|
};
|
|
@@ -1290,6 +1296,9 @@ function getThemeName(theme) {
|
|
|
1290
1296
|
return theme;
|
|
1291
1297
|
return theme.name;
|
|
1292
1298
|
}
|
|
1299
|
+
function isShikiDarkModeThemes(theme) {
|
|
1300
|
+
return typeof theme === "object" && ("dark" in theme || "light" in theme);
|
|
1301
|
+
}
|
|
1293
1302
|
function resolveShikiOptions(options) {
|
|
1294
1303
|
const themes = [];
|
|
1295
1304
|
let darkModeThemes;
|
|
@@ -1298,7 +1307,7 @@ function resolveShikiOptions(options) {
|
|
|
1298
1307
|
} else if (typeof options.theme === "string") {
|
|
1299
1308
|
themes.push(options.theme);
|
|
1300
1309
|
} else {
|
|
1301
|
-
if (
|
|
1310
|
+
if (isShikiDarkModeThemes(options.theme)) {
|
|
1302
1311
|
darkModeThemes = options.theme;
|
|
1303
1312
|
themes.push(options.theme.dark);
|
|
1304
1313
|
themes.push(options.theme.light);
|
|
@@ -1324,8 +1333,8 @@ var MarkdownItShiki = (markdownit, options = {}) => {
|
|
|
1324
1333
|
markdownit.options.highlight = (code, lang) => {
|
|
1325
1334
|
if (darkModeThemes) {
|
|
1326
1335
|
const trimmed = trimEndNewLine(code);
|
|
1327
|
-
const dark = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.dark }).replace('<pre class="shiki
|
|
1328
|
-
const light = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.light }).replace('<pre class="shiki
|
|
1336
|
+
const dark = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.dark }).replace('<pre class="shiki', '<pre class="slidev-code shiki shiki-dark');
|
|
1337
|
+
const light = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.light }).replace('<pre class="shiki', '<pre class="slidev-code shiki shiki-light');
|
|
1329
1338
|
return escapeVueInCode(`<pre class="shiki-container">${dark}${light}</pre>`);
|
|
1330
1339
|
} else {
|
|
1331
1340
|
return escapeVueInCode(
|
|
@@ -233,7 +233,7 @@ async function loadDrawings(options) {
|
|
|
233
233
|
suppressErrors: true
|
|
234
234
|
});
|
|
235
235
|
const obj = {};
|
|
236
|
-
Promise.all(files.map(async (path) => {
|
|
236
|
+
await Promise.all(files.map(async (path) => {
|
|
237
237
|
const num = +_path.basename.call(void 0, path, ".svg");
|
|
238
238
|
if (Number.isNaN(num))
|
|
239
239
|
return;
|
|
@@ -275,25 +275,25 @@ var dependencies = {
|
|
|
275
275
|
"@antfu/utils": "^0.7.2",
|
|
276
276
|
"@slidev/parser": "workspace:*",
|
|
277
277
|
"@slidev/types": "workspace:*",
|
|
278
|
-
"@unocss/reset": "^0.
|
|
279
|
-
"@vueuse/core": "^9.
|
|
278
|
+
"@unocss/reset": "^0.48.4",
|
|
279
|
+
"@vueuse/core": "^9.11.0",
|
|
280
280
|
"@vueuse/head": "^1.0.22",
|
|
281
|
-
"@vueuse/math": "^9.
|
|
281
|
+
"@vueuse/math": "^9.11.0",
|
|
282
282
|
"@vueuse/motion": "^2.0.0-beta.26",
|
|
283
283
|
codemirror: "^5.65.5",
|
|
284
284
|
defu: "^6.1.1",
|
|
285
285
|
drauu: "^0.3.2",
|
|
286
286
|
"file-saver": "^2.0.5",
|
|
287
|
-
"js-base64": "^3.7.
|
|
287
|
+
"js-base64": "^3.7.4",
|
|
288
288
|
"js-yaml": "^4.1.0",
|
|
289
289
|
katex: "^0.16.4",
|
|
290
290
|
mermaid: "^9.3.0",
|
|
291
291
|
"monaco-editor": "^0.33.0",
|
|
292
292
|
nanoid: "^4.0.0",
|
|
293
|
-
prettier: "^2.8.
|
|
293
|
+
prettier: "^2.8.3",
|
|
294
294
|
recordrtc: "^5.6.2",
|
|
295
295
|
resolve: "^1.22.1",
|
|
296
|
-
unocss: "^0.
|
|
296
|
+
unocss: "^0.48.4",
|
|
297
297
|
"vite-plugin-windicss": "^1.8.10",
|
|
298
298
|
vue: "^3.2.45",
|
|
299
299
|
"vue-router": "^4.1.6",
|
|
@@ -433,12 +433,14 @@ function createConfigPlugin(options) {
|
|
|
433
433
|
}
|
|
434
434
|
function getDefine(options) {
|
|
435
435
|
return {
|
|
436
|
+
__DEV__: options.mode === "dev" ? "true" : "false",
|
|
436
437
|
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkOVFYMGU6js.toAtFS.call(void 0, options.clientRoot)),
|
|
437
438
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
438
439
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
439
440
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
440
441
|
__SLIDEV_FEATURE_RECORD__: JSON.stringify(options.data.config.record === true || options.data.config.record === options.mode),
|
|
441
|
-
|
|
442
|
+
__SLIDEV_FEATURE_PRESENTER__: JSON.stringify(options.data.config.presenter === true || options.data.config.presenter === options.mode),
|
|
443
|
+
__USE_SERVER__: options.mode !== "build" ? "true" : "false"
|
|
442
444
|
};
|
|
443
445
|
}
|
|
444
446
|
|
|
@@ -619,7 +621,11 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
619
621
|
if (id === "/@slidev/titles.md") {
|
|
620
622
|
return {
|
|
621
623
|
code: data.slides.map(({ title }, i) => {
|
|
622
|
-
return `<template ${i === 0 ? "v-if" : "v-else-if"}="+no === ${i + 1}"
|
|
624
|
+
return `<template ${i === 0 ? "v-if" : "v-else-if"}="+no === ${i + 1}">
|
|
625
|
+
|
|
626
|
+
${title}
|
|
627
|
+
|
|
628
|
+
</template>`;
|
|
623
629
|
}).join(""),
|
|
624
630
|
map: { mappings: "" }
|
|
625
631
|
};
|
|
@@ -1289,6 +1295,9 @@ function getThemeName(theme) {
|
|
|
1289
1295
|
return theme;
|
|
1290
1296
|
return theme.name;
|
|
1291
1297
|
}
|
|
1298
|
+
function isShikiDarkModeThemes(theme) {
|
|
1299
|
+
return typeof theme === "object" && ("dark" in theme || "light" in theme);
|
|
1300
|
+
}
|
|
1292
1301
|
function resolveShikiOptions(options) {
|
|
1293
1302
|
const themes = [];
|
|
1294
1303
|
let darkModeThemes;
|
|
@@ -1297,7 +1306,7 @@ function resolveShikiOptions(options) {
|
|
|
1297
1306
|
} else if (typeof options.theme === "string") {
|
|
1298
1307
|
themes.push(options.theme);
|
|
1299
1308
|
} else {
|
|
1300
|
-
if (
|
|
1309
|
+
if (isShikiDarkModeThemes(options.theme)) {
|
|
1301
1310
|
darkModeThemes = options.theme;
|
|
1302
1311
|
themes.push(options.theme.dark);
|
|
1303
1312
|
themes.push(options.theme.light);
|
|
@@ -1323,8 +1332,8 @@ var MarkdownItShiki = (markdownit, options = {}) => {
|
|
|
1323
1332
|
markdownit.options.highlight = (code, lang) => {
|
|
1324
1333
|
if (darkModeThemes) {
|
|
1325
1334
|
const trimmed = trimEndNewLine(code);
|
|
1326
|
-
const dark = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.dark }).replace('<pre class="shiki
|
|
1327
|
-
const light = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.light }).replace('<pre class="shiki
|
|
1335
|
+
const dark = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.dark }).replace('<pre class="shiki', '<pre class="slidev-code shiki shiki-dark');
|
|
1336
|
+
const light = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.light }).replace('<pre class="shiki', '<pre class="slidev-code shiki shiki-light');
|
|
1328
1337
|
return escapeVueInCode(`<pre class="shiki-container">${dark}${light}</pre>`);
|
|
1329
1338
|
} else {
|
|
1330
1339
|
return escapeVueInCode(
|
package/dist/cli.js
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkCUQDKJBBjs = require('./chunk-CUQDKJBB.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkTXDYSJOBjs = require('./chunk-TXDYSJOB.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -22,7 +22,7 @@ var _chunkOVFYMGU6js = require('./chunk-OVFYMGU6.js');
|
|
|
22
22
|
|
|
23
23
|
// node/cli.ts
|
|
24
24
|
_chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
|
25
|
-
var import_fast_deep_equal = _chunkOVFYMGU6js.__toESM.call(void 0,
|
|
25
|
+
var import_fast_deep_equal = _chunkOVFYMGU6js.__toESM.call(void 0, _chunkTXDYSJOBjs.require_fast_deep_equal.call(void 0, ));
|
|
26
26
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
27
27
|
var _net = require('net'); var _net2 = _interopRequireDefault(_net);
|
|
28
28
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
@@ -47,14 +47,14 @@ _fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) =>
|
|
|
47
47
|
var _a;
|
|
48
48
|
const addons = (_a = headmatter == null ? void 0 : headmatter.addons) != null ? _a : [];
|
|
49
49
|
const roots = [
|
|
50
|
-
|
|
51
|
-
...
|
|
52
|
-
|
|
50
|
+
_chunkCUQDKJBBjs.getUserRoot.call(void 0, {}).userRoot,
|
|
51
|
+
..._chunkCUQDKJBBjs.getAddonRoots.call(void 0, addons, ""),
|
|
52
|
+
_chunkCUQDKJBBjs.getClientRoot.call(void 0, )
|
|
53
53
|
];
|
|
54
54
|
const mergeArrays = (a, b) => a.concat(b);
|
|
55
|
-
return await
|
|
55
|
+
return await _chunkTXDYSJOBjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
|
|
56
56
|
});
|
|
57
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
57
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkCUQDKJBBjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
58
58
|
cli.command(
|
|
59
59
|
"* [entry]",
|
|
60
60
|
"Start a local server for Slidev",
|
|
@@ -105,9 +105,9 @@ cli.command(
|
|
|
105
105
|
async function initServer() {
|
|
106
106
|
if (server)
|
|
107
107
|
await server.close();
|
|
108
|
-
const options = await
|
|
108
|
+
const options = await _chunkCUQDKJBBjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
109
109
|
port = userPort || await findFreePort(3030);
|
|
110
|
-
server = await
|
|
110
|
+
server = await _chunkCUQDKJBBjs.createServer.call(void 0,
|
|
111
111
|
options,
|
|
112
112
|
{
|
|
113
113
|
server: {
|
|
@@ -121,7 +121,7 @@ cli.command(
|
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
onDataReload(newData, data) {
|
|
124
|
-
if (!theme &&
|
|
124
|
+
if (!theme && _chunkCUQDKJBBjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkCUQDKJBBjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
125
125
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
126
126
|
initServer();
|
|
127
127
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -207,8 +207,8 @@ cli.command(
|
|
|
207
207
|
describe: "enable the inspect plugin for debugging"
|
|
208
208
|
}).strict().help(),
|
|
209
209
|
async ({ entry, theme, watch, base, download, out, inspect }) => {
|
|
210
|
-
const { build } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./build-
|
|
211
|
-
const options = await
|
|
210
|
+
const { build } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./build-ATIWLFVV.js")));
|
|
211
|
+
const options = await _chunkCUQDKJBBjs.resolveOptions.call(void 0, { entry, theme, inspect }, "build");
|
|
212
212
|
if (download && !options.data.config.download)
|
|
213
213
|
options.data.config.download = download;
|
|
214
214
|
printInfo(options);
|
|
@@ -226,9 +226,9 @@ cli.command(
|
|
|
226
226
|
"Format the markdown file",
|
|
227
227
|
(args) => commonOptions(args).strict().help(),
|
|
228
228
|
async ({ entry }) => {
|
|
229
|
-
const data = await
|
|
230
|
-
|
|
231
|
-
await
|
|
229
|
+
const data = await _chunkCUQDKJBBjs.parser.load(entry);
|
|
230
|
+
_chunkCUQDKJBBjs.parser.prettify(data);
|
|
231
|
+
await _chunkCUQDKJBBjs.parser.save(data);
|
|
232
232
|
}
|
|
233
233
|
);
|
|
234
234
|
cli.command(
|
|
@@ -243,17 +243,17 @@ cli.command(
|
|
|
243
243
|
default: "theme"
|
|
244
244
|
}),
|
|
245
245
|
async ({ entry, dir, theme: themeInput }) => {
|
|
246
|
-
const data = await
|
|
247
|
-
const theme =
|
|
246
|
+
const data = await _chunkCUQDKJBBjs.parser.load(entry);
|
|
247
|
+
const theme = _chunkCUQDKJBBjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
248
248
|
if (theme === "none") {
|
|
249
249
|
console.error('Cannot eject theme "none"');
|
|
250
250
|
process.exit(1);
|
|
251
251
|
}
|
|
252
|
-
if (
|
|
252
|
+
if (_chunkCUQDKJBBjs.isPath.call(void 0, theme)) {
|
|
253
253
|
console.error("Theme is already ejected");
|
|
254
254
|
process.exit(1);
|
|
255
255
|
}
|
|
256
|
-
const roots =
|
|
256
|
+
const roots = _chunkCUQDKJBBjs.getThemeRoots.call(void 0, theme, entry);
|
|
257
257
|
if (!roots.length) {
|
|
258
258
|
console.error(`Could not find theme "${theme}"`);
|
|
259
259
|
process.exit(1);
|
|
@@ -265,7 +265,7 @@ cli.command(
|
|
|
265
265
|
const dirPath = `./${dir}`;
|
|
266
266
|
data.slides[0].frontmatter.theme = dirPath;
|
|
267
267
|
data.slides[0].raw = null;
|
|
268
|
-
await
|
|
268
|
+
await _chunkCUQDKJBBjs.parser.save(data);
|
|
269
269
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
270
270
|
}
|
|
271
271
|
);
|
|
@@ -325,9 +325,9 @@ cli.command(
|
|
|
325
325
|
process.env.NODE_ENV = "production";
|
|
326
326
|
const { exportSlides } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-OIZT2CQS.js")));
|
|
327
327
|
const port = await findFreePort(12445);
|
|
328
|
-
const options = await
|
|
328
|
+
const options = await _chunkCUQDKJBBjs.resolveOptions.call(void 0, { entry, theme }, "export");
|
|
329
329
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
330
|
-
const server = await
|
|
330
|
+
const server = await _chunkCUQDKJBBjs.createServer.call(void 0,
|
|
331
331
|
options,
|
|
332
332
|
{
|
|
333
333
|
server: { port },
|
|
@@ -336,7 +336,7 @@ cli.command(
|
|
|
336
336
|
);
|
|
337
337
|
await server.listen(port);
|
|
338
338
|
printInfo(options);
|
|
339
|
-
|
|
339
|
+
_chunkCUQDKJBBjs.parser.filterDisabled(options.data);
|
|
340
340
|
const width = options.data.config.canvasWidth;
|
|
341
341
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
342
342
|
output = await exportSlides({
|
|
@@ -384,10 +384,10 @@ cli.command(
|
|
|
384
384
|
process.env.NODE_ENV = "production";
|
|
385
385
|
const { exportNotes } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-OIZT2CQS.js")));
|
|
386
386
|
const port = await findFreePort(12445);
|
|
387
|
-
const options = await
|
|
387
|
+
const options = await _chunkCUQDKJBBjs.resolveOptions.call(void 0, { entry }, "export");
|
|
388
388
|
if (!output)
|
|
389
389
|
output = options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entry, ".md")}-export-notes`;
|
|
390
|
-
const server = await
|
|
390
|
+
const server = await _chunkCUQDKJBBjs.createServer.call(void 0,
|
|
391
391
|
options,
|
|
392
392
|
{
|
|
393
393
|
server: { port },
|
|
@@ -396,7 +396,7 @@ cli.command(
|
|
|
396
396
|
);
|
|
397
397
|
await server.listen(port);
|
|
398
398
|
printInfo(options);
|
|
399
|
-
|
|
399
|
+
_chunkCUQDKJBBjs.parser.filterDisabled(options.data);
|
|
400
400
|
output = await exportNotes({
|
|
401
401
|
port,
|
|
402
402
|
output,
|
|
@@ -424,7 +424,7 @@ function printInfo(options, port, remote) {
|
|
|
424
424
|
console.log();
|
|
425
425
|
console.log();
|
|
426
426
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
427
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
427
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkCUQDKJBBjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
428
428
|
console.log();
|
|
429
429
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
430
430
|
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-LAZ5PNFJ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
loadSetups,
|
|
15
15
|
require_fast_deep_equal
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NTTNCVJU.mjs";
|
|
17
17
|
import {
|
|
18
18
|
__dirname,
|
|
19
19
|
__require,
|
|
@@ -208,7 +208,7 @@ cli.command(
|
|
|
208
208
|
describe: "enable the inspect plugin for debugging"
|
|
209
209
|
}).strict().help(),
|
|
210
210
|
async ({ entry, theme, watch, base, download, out, inspect }) => {
|
|
211
|
-
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-
|
|
211
|
+
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-XB553JUF.mjs")));
|
|
212
212
|
const options = await resolveOptions({ entry, theme, inspect }, "build");
|
|
213
213
|
if (download && !options.data.config.download)
|
|
214
214
|
options.data.config.download = download;
|
|
@@ -326,7 +326,7 @@ cli.command(
|
|
|
326
326
|
process.env.NODE_ENV = "production";
|
|
327
327
|
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-JGJTLG7B.mjs")));
|
|
328
328
|
const port = await findFreePort(12445);
|
|
329
|
-
const options = await resolveOptions({ entry, theme }, "
|
|
329
|
+
const options = await resolveOptions({ entry, theme }, "export");
|
|
330
330
|
output = output || options.data.config.exportFilename || `${path.basename(entry, ".md")}-export`;
|
|
331
331
|
const server = await createServer(
|
|
332
332
|
options,
|
|
@@ -385,7 +385,7 @@ cli.command(
|
|
|
385
385
|
process.env.NODE_ENV = "production";
|
|
386
386
|
const { exportNotes } = await Promise.resolve().then(() => __toESM(__require("./export-JGJTLG7B.mjs")));
|
|
387
387
|
const port = await findFreePort(12445);
|
|
388
|
-
const options = await resolveOptions({ entry }, "
|
|
388
|
+
const options = await resolveOptions({ entry }, "export");
|
|
389
389
|
if (!output)
|
|
390
390
|
output = options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${path.basename(entry, ".md")}-export-notes`;
|
|
391
391
|
const server = await createServer(
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkCUQDKJBBjs = require('./chunk-CUQDKJBB.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkTXDYSJOBjs = require('./chunk-TXDYSJOB.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _chunkOVFYMGU6js = require('./chunk-OVFYMGU6.js');
|
|
@@ -36,4 +36,4 @@ _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
exports.ViteSlidevPlugin =
|
|
39
|
+
exports.ViteSlidevPlugin = _chunkTXDYSJOBjs.ViteSlidevPlugin; exports.createServer = _chunkCUQDKJBBjs.createServer; exports.createWindiCSSPlugin = _chunkTXDYSJOBjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkCUQDKJBBjs.getAddonRoots; exports.getCLIRoot = _chunkCUQDKJBBjs.getCLIRoot; exports.getClientRoot = _chunkCUQDKJBBjs.getClientRoot; exports.getRoot = _chunkCUQDKJBBjs.getRoot; exports.getThemeRoots = _chunkCUQDKJBBjs.getThemeRoots; exports.getUserRoot = _chunkCUQDKJBBjs.getUserRoot; exports.isPath = _chunkCUQDKJBBjs.isPath; exports.parser = _chunkCUQDKJBBjs.parser; exports.resolveOptions = _chunkCUQDKJBBjs.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-LAZ5PNFJ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ViteSlidevPlugin,
|
|
15
15
|
createWindiCSSPlugin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NTTNCVJU.mjs";
|
|
17
17
|
import {
|
|
18
18
|
init_esm_shims
|
|
19
19
|
} from "./chunk-T5WFA52O.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.4",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@antfu/utils": "^0.7.2",
|
|
46
46
|
"@hedgedoc/markdown-it-task-lists": "^2.0.1",
|
|
47
|
-
"@iconify-json/carbon": "^1.1.
|
|
47
|
+
"@iconify-json/carbon": "^1.1.13",
|
|
48
48
|
"@iconify-json/ph": "^1.1.3",
|
|
49
49
|
"@lillallol/outline-pdf": "^4.0.0",
|
|
50
50
|
"@vitejs/plugin-vue": "^4.0.0",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"global-dirs": "^3.0.1",
|
|
58
58
|
"import-from": "^4.0.0",
|
|
59
59
|
"is-installed-globally": "^0.4.0",
|
|
60
|
-
"jiti": "^1.16.
|
|
61
|
-
"js-base64": "^3.7.
|
|
60
|
+
"jiti": "^1.16.2",
|
|
61
|
+
"js-base64": "^3.7.4",
|
|
62
62
|
"katex": "^0.16.4",
|
|
63
63
|
"kolorist": "^1.6.0",
|
|
64
64
|
"markdown-it": "^13.0.1",
|
|
@@ -76,21 +76,21 @@
|
|
|
76
76
|
"resolve-from": "^5.0.0",
|
|
77
77
|
"resolve-global": "^1.0.0",
|
|
78
78
|
"shiki": "^0.12.1",
|
|
79
|
-
"unocss": "^0.
|
|
80
|
-
"unplugin-icons": "^0.
|
|
79
|
+
"unocss": "^0.48.4",
|
|
80
|
+
"unplugin-icons": "^0.15.1",
|
|
81
81
|
"unplugin-vue-components": "^0.22.12",
|
|
82
|
-
"vite": "^4.0.
|
|
83
|
-
"vite-plugin-inspect": "^0.7.
|
|
82
|
+
"vite": "^4.0.4",
|
|
83
|
+
"vite-plugin-inspect": "^0.7.14",
|
|
84
84
|
"vite-plugin-remote-assets": "^0.3.0",
|
|
85
|
-
"vite-plugin-vue-markdown": "^0.22.
|
|
85
|
+
"vite-plugin-vue-markdown": "^0.22.2",
|
|
86
86
|
"vite-plugin-vue-server-ref": "^0.3.0",
|
|
87
87
|
"vite-plugin-windicss": "^1.8.10",
|
|
88
88
|
"vue": "^3.2.45",
|
|
89
89
|
"windicss": "^3.5.6",
|
|
90
90
|
"yargs": "^17.6.2",
|
|
91
|
-
"@slidev/client": "0.38.
|
|
92
|
-
"@slidev/parser": "0.38.
|
|
93
|
-
"@slidev/types": "0.38.
|
|
91
|
+
"@slidev/client": "0.38.4",
|
|
92
|
+
"@slidev/parser": "0.38.4",
|
|
93
|
+
"@slidev/types": "0.38.4"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@types/plantuml-encoder": "^1.4.0",
|