@slidev/cli 0.43.3 → 0.43.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{build-CYEFDYEC.mjs → build-6664TIC5.mjs} +2 -2
- package/dist/{build-3FWGWRLN.js → build-JUYH5PKW.js} +6 -6
- package/dist/{chunk-JDHANZ37.mjs → chunk-43ON36K4.mjs} +2 -2
- package/dist/{chunk-JFREA44O.mjs → chunk-4NQOFFBR.mjs} +10 -9
- package/dist/{chunk-HO75FTDI.mjs → chunk-HIYCK5KO.mjs} +1 -1
- package/dist/{chunk-EFLHY5RE.js → chunk-MUDR5O2R.js} +4 -4
- package/dist/{chunk-J7PXWEZ7.js → chunk-T7LIARZ4.js} +2 -2
- package/dist/{chunk-KKGXM3XL.js → chunk-UWTQKD35.js} +2 -2
- package/dist/{chunk-G5GBN6R3.mjs → chunk-UYSFRITU.mjs} +2 -2
- package/dist/{chunk-SEZW5DVB.js → chunk-VIMRLOY5.js} +12 -11
- package/dist/cli.js +29 -29
- package/dist/cli.mjs +5 -5
- package/dist/index.js +5 -5
- package/dist/index.mjs +4 -4
- package/dist/{unocss-2DU67QXG.js → unocss-E5M4APXD.js} +2 -2
- package/dist/{unocss-2UOAV4VT.mjs → unocss-EBBZWMQM.mjs} +2 -2
- package/dist/windicss-JD27KSJD.js +9 -0
- package/dist/{windicss-UVXCUIV4.mjs → windicss-UANMMLDV.mjs} +2 -2
- package/package.json +6 -6
- package/dist/windicss-FNELZNWD.js +0 -9
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkVIMRLOY5js = require('./chunk-VIMRLOY5.js');
|
|
6
|
+
require('./chunk-UWTQKD35.js');
|
|
7
7
|
require('./chunk-JQHGZJGJ.js');
|
|
8
8
|
require('./chunk-YUG22S6W.js');
|
|
9
9
|
|
|
@@ -651,16 +651,16 @@ async function build(options, viteConfig = {}, args) {
|
|
|
651
651
|
let originalIndexHTML;
|
|
652
652
|
if (_fsextra2.default.existsSync(indexPath))
|
|
653
653
|
originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
|
|
654
|
-
await _fsextra2.default.writeFile(indexPath, await
|
|
654
|
+
await _fsextra2.default.writeFile(indexPath, await _chunkVIMRLOY5js.getIndexHtml.call(void 0, options), "utf-8");
|
|
655
655
|
let config = void 0;
|
|
656
656
|
try {
|
|
657
|
-
const inlineConfig = await
|
|
657
|
+
const inlineConfig = await _chunkVIMRLOY5js.mergeViteConfigs.call(void 0,
|
|
658
658
|
options,
|
|
659
659
|
viteConfig,
|
|
660
660
|
{
|
|
661
661
|
root: options.userRoot,
|
|
662
662
|
plugins: [
|
|
663
|
-
await
|
|
663
|
+
await _chunkVIMRLOY5js.ViteSlidevPlugin.call(void 0, options, pluginOptions),
|
|
664
664
|
{
|
|
665
665
|
name: "resolve-config",
|
|
666
666
|
configResolved(_config) {
|
|
@@ -681,7 +681,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
681
681
|
} else {
|
|
682
682
|
console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
|
|
683
683
|
await _vite.build.call(void 0,
|
|
684
|
-
await
|
|
684
|
+
await _chunkVIMRLOY5js.mergeViteConfigs.call(void 0,
|
|
685
685
|
options,
|
|
686
686
|
inlineConfig,
|
|
687
687
|
{
|
|
@@ -15,7 +15,7 @@ function deepMerge(a, b, rootPath = "") {
|
|
|
15
15
|
});
|
|
16
16
|
return a;
|
|
17
17
|
}
|
|
18
|
-
async function loadSetups(roots, name, arg, initial, merge = true
|
|
18
|
+
async function loadSetups(roots, name, arg, initial, merge = true) {
|
|
19
19
|
let returns = initial;
|
|
20
20
|
for (const root of roots) {
|
|
21
21
|
const path = resolve(root, "setup", name);
|
|
@@ -23,7 +23,7 @@ async function loadSetups(roots, name, arg, initial, merge = true, accumulate) {
|
|
|
23
23
|
const { default: setup } = jiti(__filename)(path);
|
|
24
24
|
const result = await setup(arg);
|
|
25
25
|
if (result !== null) {
|
|
26
|
-
returns = merge ?
|
|
26
|
+
returns = typeof merge === "function" ? merge(returns, result) : merge ? deepMerge(returns, result) : result;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadSetups
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-43ON36K4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
generateGoogleFontsUrl,
|
|
6
6
|
resolveGlobalImportPath,
|
|
@@ -188,7 +188,7 @@ var dependencies = {
|
|
|
188
188
|
"@slidev/types": "workspace:*",
|
|
189
189
|
"@unocss/reset": "^0.55.7",
|
|
190
190
|
"@vueuse/core": "^10.4.1",
|
|
191
|
-
"@vueuse/head": "^
|
|
191
|
+
"@vueuse/head": "^2.0.0",
|
|
192
192
|
"@vueuse/math": "^10.4.1",
|
|
193
193
|
"@vueuse/motion": "^2.0.0",
|
|
194
194
|
codemirror: "^5.65.5",
|
|
@@ -201,10 +201,10 @@ var dependencies = {
|
|
|
201
201
|
katex: "^0.16.8",
|
|
202
202
|
mermaid: "^10.4.0",
|
|
203
203
|
"monaco-editor": "^0.37.1",
|
|
204
|
-
nanoid: "^
|
|
204
|
+
nanoid: "^5.0.1",
|
|
205
205
|
prettier: "^3.0.3",
|
|
206
206
|
recordrtc: "^5.6.2",
|
|
207
|
-
resolve: "^1.22.
|
|
207
|
+
resolve: "^1.22.6",
|
|
208
208
|
unocss: "^0.55.7",
|
|
209
209
|
"vite-plugin-windicss": "^1.9.1",
|
|
210
210
|
vue: "^3.3.4",
|
|
@@ -382,14 +382,14 @@ var vueContextImports = [
|
|
|
382
382
|
injectionSlidevContext as _injectionSlidevContext,
|
|
383
383
|
injectionClicks as _injectionClicks,
|
|
384
384
|
injectionCurrentPage as _injectionCurrentPage,
|
|
385
|
-
|
|
385
|
+
injectionRenderContext as _injectionRenderContext,
|
|
386
386
|
injectionFrontmatter as _injectionFrontmatter,
|
|
387
387
|
} from "@slidev/client/constants.ts"`.replace(/\n\s+/g, "\n"),
|
|
388
388
|
"const $slidev = _vueInject(_injectionSlidevContext)",
|
|
389
389
|
'const $nav = _vueToRef($slidev, "nav")',
|
|
390
390
|
"const $clicks = _vueInject(_injectionClicks)",
|
|
391
391
|
"const $page = _vueInject(_injectionCurrentPage)",
|
|
392
|
-
"const $renderContext = _vueInject(
|
|
392
|
+
"const $renderContext = _vueInject(_injectionRenderContext)"
|
|
393
393
|
];
|
|
394
394
|
function getBodyJson(req) {
|
|
395
395
|
return new Promise((resolve3, reject) => {
|
|
@@ -560,6 +560,7 @@ ${title}
|
|
|
560
560
|
} else if (type === "frontmatter") {
|
|
561
561
|
return {
|
|
562
562
|
code: [
|
|
563
|
+
"// @unocss-include",
|
|
563
564
|
'import { reactive, computed } from "vue"',
|
|
564
565
|
`export const frontmatter = reactive(${JSON.stringify(slide.frontmatter)})`,
|
|
565
566
|
`export const meta = reactive({
|
|
@@ -680,8 +681,8 @@ Unknown layout "${bold(layoutName)}".${yellow(" Available layouts are:")}`) + Ob
|
|
|
680
681
|
"_vueProvide(_injectionFrontmatter, frontmatter)",
|
|
681
682
|
// update frontmatter in router
|
|
682
683
|
";(() => {",
|
|
683
|
-
" const route = $slidev.nav.rawRoutes.find(i => i.path === String($page))",
|
|
684
|
-
" if (route
|
|
684
|
+
" const route = $slidev.nav.rawRoutes.find(i => i.path === String($page.value))",
|
|
685
|
+
" if (route?.meta?.slide?.frontmatter) {",
|
|
685
686
|
" Object.keys(route.meta.slide.frontmatter).forEach(key => {",
|
|
686
687
|
" if (!(key in $frontmatter)) delete route.meta.slide.frontmatter[key]",
|
|
687
688
|
" })",
|
|
@@ -1689,7 +1690,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1689
1690
|
dev: true,
|
|
1690
1691
|
build: true
|
|
1691
1692
|
})) : null,
|
|
1692
|
-
config.css === "none" ? null : config.css === "windicss" ? import("./windicss-
|
|
1693
|
+
config.css === "none" ? null : config.css === "windicss" ? import("./windicss-UANMMLDV.mjs").then((r) => r.createWindiCSSPlugin(options, pluginOptions)) : import("./unocss-EBBZWMQM.mjs").then((r) => r.createUnocssPlugin(options, pluginOptions))
|
|
1693
1694
|
];
|
|
1694
1695
|
return (await Promise.all(plugins)).flat().filter(notNullish2);
|
|
1695
1696
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkVIMRLOY5js = require('./chunk-VIMRLOY5.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -2496,7 +2496,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2496
2496
|
const pluginOptions = rawConfig.slidev || {};
|
|
2497
2497
|
_process2.default.env.EDITOR = _process2.default.env.EDITOR || "code";
|
|
2498
2498
|
const server = await _vite.createServer.call(void 0,
|
|
2499
|
-
await
|
|
2499
|
+
await _chunkVIMRLOY5js.mergeViteConfigs.call(void 0,
|
|
2500
2500
|
options,
|
|
2501
2501
|
viteConfig,
|
|
2502
2502
|
{
|
|
@@ -2506,7 +2506,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2506
2506
|
]
|
|
2507
2507
|
},
|
|
2508
2508
|
plugins: [
|
|
2509
|
-
await
|
|
2509
|
+
await _chunkVIMRLOY5js.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
|
|
2510
2510
|
]
|
|
2511
2511
|
},
|
|
2512
2512
|
"serve"
|
|
@@ -2519,7 +2519,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2519
2519
|
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
2520
2520
|
|
|
2521
2521
|
// package.json
|
|
2522
|
-
var version = "0.43.
|
|
2522
|
+
var version = "0.43.5";
|
|
2523
2523
|
|
|
2524
2524
|
// node/themes.ts
|
|
2525
2525
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUWTQKD35js = require('./chunk-UWTQKD35.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkJQHGZJGJjs = require('./chunk-JQHGZJGJ.js');
|
|
@@ -23,7 +23,7 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
|
|
|
23
23
|
let config = _jiti2.default.call(void 0, __filename)(configFile);
|
|
24
24
|
if (config.default)
|
|
25
25
|
config = config.default;
|
|
26
|
-
config = await
|
|
26
|
+
config = await _chunkUWTQKD35js.loadSetups.call(void 0, roots, "windicss.ts", {}, config, true);
|
|
27
27
|
return WindiCSS(
|
|
28
28
|
{
|
|
29
29
|
configFiles: [configFile],
|
|
@@ -15,7 +15,7 @@ function deepMerge(a, b, rootPath = "") {
|
|
|
15
15
|
});
|
|
16
16
|
return a;
|
|
17
17
|
}
|
|
18
|
-
async function loadSetups(roots, name, arg, initial, merge = true
|
|
18
|
+
async function loadSetups(roots, name, arg, initial, merge = true) {
|
|
19
19
|
let returns = initial;
|
|
20
20
|
for (const root of roots) {
|
|
21
21
|
const path = _path.resolve.call(void 0, root, "setup", name);
|
|
@@ -23,7 +23,7 @@ async function loadSetups(roots, name, arg, initial, merge = true, accumulate) {
|
|
|
23
23
|
const { default: setup } = _jiti2.default.call(void 0, __filename)(path);
|
|
24
24
|
const result = await setup(arg);
|
|
25
25
|
if (result !== null) {
|
|
26
|
-
returns = merge ?
|
|
26
|
+
returns = typeof merge === "function" ? merge(returns, result) : merge ? deepMerge(returns, result) : result;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4NQOFFBR.mjs";
|
|
5
5
|
import {
|
|
6
6
|
packageExists,
|
|
7
7
|
resolveImportPath
|
|
@@ -2519,7 +2519,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2519
2519
|
import * as parser from "@slidev/parser/fs";
|
|
2520
2520
|
|
|
2521
2521
|
// package.json
|
|
2522
|
-
var version = "0.43.
|
|
2522
|
+
var version = "0.43.5";
|
|
2523
2523
|
|
|
2524
2524
|
// node/themes.ts
|
|
2525
2525
|
import prompts2 from "prompts";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUWTQKD35js = require('./chunk-UWTQKD35.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -188,7 +188,7 @@ var dependencies = {
|
|
|
188
188
|
"@slidev/types": "workspace:*",
|
|
189
189
|
"@unocss/reset": "^0.55.7",
|
|
190
190
|
"@vueuse/core": "^10.4.1",
|
|
191
|
-
"@vueuse/head": "^
|
|
191
|
+
"@vueuse/head": "^2.0.0",
|
|
192
192
|
"@vueuse/math": "^10.4.1",
|
|
193
193
|
"@vueuse/motion": "^2.0.0",
|
|
194
194
|
codemirror: "^5.65.5",
|
|
@@ -201,10 +201,10 @@ var dependencies = {
|
|
|
201
201
|
katex: "^0.16.8",
|
|
202
202
|
mermaid: "^10.4.0",
|
|
203
203
|
"monaco-editor": "^0.37.1",
|
|
204
|
-
nanoid: "^
|
|
204
|
+
nanoid: "^5.0.1",
|
|
205
205
|
prettier: "^3.0.3",
|
|
206
206
|
recordrtc: "^5.6.2",
|
|
207
|
-
resolve: "^1.22.
|
|
207
|
+
resolve: "^1.22.6",
|
|
208
208
|
unocss: "^0.55.7",
|
|
209
209
|
"vite-plugin-windicss": "^1.9.1",
|
|
210
210
|
vue: "^3.3.4",
|
|
@@ -382,14 +382,14 @@ var vueContextImports = [
|
|
|
382
382
|
injectionSlidevContext as _injectionSlidevContext,
|
|
383
383
|
injectionClicks as _injectionClicks,
|
|
384
384
|
injectionCurrentPage as _injectionCurrentPage,
|
|
385
|
-
|
|
385
|
+
injectionRenderContext as _injectionRenderContext,
|
|
386
386
|
injectionFrontmatter as _injectionFrontmatter,
|
|
387
387
|
} from "@slidev/client/constants.ts"`.replace(/\n\s+/g, "\n"),
|
|
388
388
|
"const $slidev = _vueInject(_injectionSlidevContext)",
|
|
389
389
|
'const $nav = _vueToRef($slidev, "nav")',
|
|
390
390
|
"const $clicks = _vueInject(_injectionClicks)",
|
|
391
391
|
"const $page = _vueInject(_injectionCurrentPage)",
|
|
392
|
-
"const $renderContext = _vueInject(
|
|
392
|
+
"const $renderContext = _vueInject(_injectionRenderContext)"
|
|
393
393
|
];
|
|
394
394
|
function getBodyJson(req) {
|
|
395
395
|
return new Promise((resolve3, reject) => {
|
|
@@ -560,6 +560,7 @@ ${title}
|
|
|
560
560
|
} else if (type === "frontmatter") {
|
|
561
561
|
return {
|
|
562
562
|
code: [
|
|
563
|
+
"// @unocss-include",
|
|
563
564
|
'import { reactive, computed } from "vue"',
|
|
564
565
|
`export const frontmatter = reactive(${JSON.stringify(slide.frontmatter)})`,
|
|
565
566
|
`export const meta = reactive({
|
|
@@ -680,8 +681,8 @@ Unknown layout "${_kolorist.bold.call(void 0, layoutName)}".${_kolorist.yellow.c
|
|
|
680
681
|
"_vueProvide(_injectionFrontmatter, frontmatter)",
|
|
681
682
|
// update frontmatter in router
|
|
682
683
|
";(() => {",
|
|
683
|
-
" const route = $slidev.nav.rawRoutes.find(i => i.path === String($page))",
|
|
684
|
-
" if (route
|
|
684
|
+
" const route = $slidev.nav.rawRoutes.find(i => i.path === String($page.value))",
|
|
685
|
+
" if (route?.meta?.slide?.frontmatter) {",
|
|
685
686
|
" Object.keys(route.meta.slide.frontmatter).forEach(key => {",
|
|
686
687
|
" if (!(key in $frontmatter)) delete route.meta.slide.frontmatter[key]",
|
|
687
688
|
" })",
|
|
@@ -1353,7 +1354,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1353
1354
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1354
1355
|
if (config.highlighter === "shiki") {
|
|
1355
1356
|
const Shiki = await Promise.resolve().then(() => require("shiki"));
|
|
1356
|
-
const shikiOptions = await
|
|
1357
|
+
const shikiOptions = await _chunkUWTQKD35js.loadSetups.call(void 0, roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1357
1358
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1358
1359
|
shikiOptions.highlighter = await Shiki.getHighlighter({ themes, langs });
|
|
1359
1360
|
setups.push((md2) => md2.use(markdown_it_shiki_default, shikiOptions));
|
|
@@ -1362,7 +1363,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1362
1363
|
}
|
|
1363
1364
|
if (config.mdc)
|
|
1364
1365
|
setups.push((md2) => md2.use(_markdownitmdc2.default));
|
|
1365
|
-
const KatexOptions = await
|
|
1366
|
+
const KatexOptions = await _chunkUWTQKD35js.loadSetups.call(void 0, roots, "katex.ts", {}, { strict: false }, false);
|
|
1366
1367
|
return _vite8.default.call(void 0, {
|
|
1367
1368
|
include: [/\.md$/],
|
|
1368
1369
|
wrapperClasses: "",
|
|
@@ -1689,7 +1690,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1689
1690
|
dev: true,
|
|
1690
1691
|
build: true
|
|
1691
1692
|
})) : null,
|
|
1692
|
-
config.css === "none" ? null : config.css === "windicss" ? Promise.resolve().then(() => require("./windicss-
|
|
1693
|
+
config.css === "none" ? null : config.css === "windicss" ? Promise.resolve().then(() => require("./windicss-JD27KSJD.js")).then((r) => r.createWindiCSSPlugin(options, pluginOptions)) : Promise.resolve().then(() => require("./unocss-E5M4APXD.js")).then((r) => r.createUnocssPlugin(options, pluginOptions))
|
|
1693
1694
|
];
|
|
1694
1695
|
return (await Promise.all(plugins)).flat().filter(_utils.notNullish);
|
|
1695
1696
|
}
|
package/dist/cli.js
CHANGED
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkMUDR5O2Rjs = require('./chunk-MUDR5O2R.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkVIMRLOY5js = require('./chunk-VIMRLOY5.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkUWTQKD35js = require('./chunk-UWTQKD35.js');
|
|
19
19
|
require('./chunk-JQHGZJGJ.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkYUG22S6Wjs = require('./chunk-YUG22S6W.js');
|
|
23
23
|
|
|
24
24
|
// node/cli.ts
|
|
25
|
-
var import_fast_deep_equal = _chunkYUG22S6Wjs.__toESM.call(void 0,
|
|
25
|
+
var import_fast_deep_equal = _chunkYUG22S6Wjs.__toESM.call(void 0, _chunkVIMRLOY5js.require_fast_deep_equal.call(void 0, ));
|
|
26
26
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
27
27
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
28
28
|
var _child_process = require('child_process');
|
|
@@ -51,15 +51,15 @@ _fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) =>
|
|
|
51
51
|
const roots = (
|
|
52
52
|
/* uniq */
|
|
53
53
|
[
|
|
54
|
-
|
|
55
|
-
...
|
|
56
|
-
|
|
54
|
+
_chunkMUDR5O2Rjs.getUserRoot.call(void 0, {}).userRoot,
|
|
55
|
+
..._chunkMUDR5O2Rjs.getAddonRoots.call(void 0, addons, ""),
|
|
56
|
+
_chunkMUDR5O2Rjs.getClientRoot.call(void 0, )
|
|
57
57
|
]
|
|
58
58
|
);
|
|
59
59
|
const mergeArrays = (a, b) => a.concat(b);
|
|
60
|
-
return await
|
|
60
|
+
return await _chunkUWTQKD35js.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], mergeArrays);
|
|
61
61
|
});
|
|
62
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
62
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkMUDR5O2Rjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
63
63
|
cli.command(
|
|
64
64
|
"* [entry]",
|
|
65
65
|
"Start a local server for Slidev",
|
|
@@ -115,9 +115,9 @@ cli.command(
|
|
|
115
115
|
async function initServer() {
|
|
116
116
|
if (server)
|
|
117
117
|
await server.close();
|
|
118
|
-
const options = await
|
|
118
|
+
const options = await _chunkMUDR5O2Rjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
119
119
|
port = userPort || await findFreePort(3030);
|
|
120
|
-
server = await
|
|
120
|
+
server = await _chunkMUDR5O2Rjs.createServer.call(void 0,
|
|
121
121
|
options,
|
|
122
122
|
{
|
|
123
123
|
server: {
|
|
@@ -131,7 +131,7 @@ cli.command(
|
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
onDataReload(newData, data) {
|
|
134
|
-
if (!theme &&
|
|
134
|
+
if (!theme && _chunkMUDR5O2Rjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkMUDR5O2Rjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
135
135
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
136
136
|
initServer();
|
|
137
137
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -260,9 +260,9 @@ cli.command(
|
|
|
260
260
|
}).strict().help(),
|
|
261
261
|
async (args) => {
|
|
262
262
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
263
|
-
const { build } = await Promise.resolve().then(() => require("./build-
|
|
263
|
+
const { build } = await Promise.resolve().then(() => require("./build-JUYH5PKW.js"));
|
|
264
264
|
for (const entryFile of entry) {
|
|
265
|
-
const options = await
|
|
265
|
+
const options = await _chunkMUDR5O2Rjs.resolveOptions.call(void 0, { entry: entryFile, theme, inspect }, "build");
|
|
266
266
|
if (download && !options.data.config.download)
|
|
267
267
|
options.data.config.download = download;
|
|
268
268
|
printInfo(options);
|
|
@@ -282,9 +282,9 @@ cli.command(
|
|
|
282
282
|
(args) => commonOptions(args).strict().help(),
|
|
283
283
|
async ({ entry }) => {
|
|
284
284
|
for (const entryFile of entry) {
|
|
285
|
-
const data = await
|
|
286
|
-
|
|
287
|
-
await
|
|
285
|
+
const data = await _chunkMUDR5O2Rjs.parser.load(entryFile);
|
|
286
|
+
_chunkMUDR5O2Rjs.parser.prettify(data);
|
|
287
|
+
await _chunkMUDR5O2Rjs.parser.save(data);
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
);
|
|
@@ -300,17 +300,17 @@ cli.command(
|
|
|
300
300
|
default: "theme"
|
|
301
301
|
}),
|
|
302
302
|
async ({ entry, dir, theme: themeInput }) => {
|
|
303
|
-
const data = await
|
|
304
|
-
const theme =
|
|
303
|
+
const data = await _chunkMUDR5O2Rjs.parser.load(entry);
|
|
304
|
+
const theme = _chunkMUDR5O2Rjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
305
305
|
if (theme === "none") {
|
|
306
306
|
console.error('Cannot eject theme "none"');
|
|
307
307
|
_process2.default.exit(1);
|
|
308
308
|
}
|
|
309
|
-
if (
|
|
309
|
+
if (_chunkMUDR5O2Rjs.isPath.call(void 0, theme)) {
|
|
310
310
|
console.error("Theme is already ejected");
|
|
311
311
|
_process2.default.exit(1);
|
|
312
312
|
}
|
|
313
|
-
const roots =
|
|
313
|
+
const roots = _chunkMUDR5O2Rjs.getThemeRoots.call(void 0, theme, entry);
|
|
314
314
|
if (!roots.length) {
|
|
315
315
|
console.error(`Could not find theme "${theme}"`);
|
|
316
316
|
_process2.default.exit(1);
|
|
@@ -322,7 +322,7 @@ cli.command(
|
|
|
322
322
|
const dirPath = `./${dir}`;
|
|
323
323
|
data.slides[0].frontmatter.theme = dirPath;
|
|
324
324
|
data.slides[0].raw = null;
|
|
325
|
-
await
|
|
325
|
+
await _chunkMUDR5O2Rjs.parser.save(data);
|
|
326
326
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
327
327
|
}
|
|
328
328
|
);
|
|
@@ -342,8 +342,8 @@ cli.command(
|
|
|
342
342
|
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-MCALG7XD.js"));
|
|
343
343
|
const port = await findFreePort(12445);
|
|
344
344
|
for (const entryFile of entry) {
|
|
345
|
-
const options = await
|
|
346
|
-
const server = await
|
|
345
|
+
const options = await _chunkMUDR5O2Rjs.resolveOptions.call(void 0, { entry: entryFile, theme }, "export");
|
|
346
|
+
const server = await _chunkMUDR5O2Rjs.createServer.call(void 0,
|
|
347
347
|
options,
|
|
348
348
|
{
|
|
349
349
|
server: { port },
|
|
@@ -352,7 +352,7 @@ cli.command(
|
|
|
352
352
|
);
|
|
353
353
|
await server.listen(port);
|
|
354
354
|
printInfo(options);
|
|
355
|
-
|
|
355
|
+
_chunkMUDR5O2Rjs.parser.filterDisabled(options.data);
|
|
356
356
|
const result = await exportSlides({
|
|
357
357
|
port,
|
|
358
358
|
...getExportOptions({ ...args, entry: entryFile }, options)
|
|
@@ -388,8 +388,8 @@ cli.command(
|
|
|
388
388
|
const { exportNotes } = await Promise.resolve().then(() => require("./export-MCALG7XD.js"));
|
|
389
389
|
const port = await findFreePort(12445);
|
|
390
390
|
for (const entryFile of entry) {
|
|
391
|
-
const options = await
|
|
392
|
-
const server = await
|
|
391
|
+
const options = await _chunkMUDR5O2Rjs.resolveOptions.call(void 0, { entry: entryFile }, "export");
|
|
392
|
+
const server = await _chunkMUDR5O2Rjs.createServer.call(void 0,
|
|
393
393
|
options,
|
|
394
394
|
{
|
|
395
395
|
server: { port },
|
|
@@ -398,7 +398,7 @@ cli.command(
|
|
|
398
398
|
);
|
|
399
399
|
await server.listen(port);
|
|
400
400
|
printInfo(options);
|
|
401
|
-
|
|
401
|
+
_chunkMUDR5O2Rjs.parser.filterDisabled(options.data);
|
|
402
402
|
const result = await exportNotes({
|
|
403
403
|
port,
|
|
404
404
|
output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entryFile, ".md")}-export-notes`),
|
|
@@ -459,7 +459,7 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
459
459
|
console.log();
|
|
460
460
|
console.log();
|
|
461
461
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
462
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
462
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkMUDR5O2Rjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
463
463
|
console.log();
|
|
464
464
|
_parser.verifyConfig.call(void 0, options.data.config, options.data.themeMeta, (v) => console.warn(_kolorist.yellow.call(void 0, ` ! ${v}`)));
|
|
465
465
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
package/dist/cli.mjs
CHANGED
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
resolveOptions,
|
|
10
10
|
resolveThemeName,
|
|
11
11
|
version
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UYSFRITU.mjs";
|
|
13
13
|
import {
|
|
14
14
|
require_fast_deep_equal
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4NQOFFBR.mjs";
|
|
16
16
|
import {
|
|
17
17
|
loadSetups
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-43ON36K4.mjs";
|
|
19
19
|
import "./chunk-ZEKM4EGL.mjs";
|
|
20
20
|
import {
|
|
21
21
|
__toESM
|
|
@@ -57,7 +57,7 @@ injectPreparserExtensionLoader(async (headmatter, filepath) => {
|
|
|
57
57
|
]
|
|
58
58
|
);
|
|
59
59
|
const mergeArrays = (a, b) => a.concat(b);
|
|
60
|
-
return await loadSetups(roots, "preparser.ts", { filepath, headmatter }, [],
|
|
60
|
+
return await loadSetups(roots, "preparser.ts", { filepath, headmatter }, [], mergeArrays);
|
|
61
61
|
});
|
|
62
62
|
var cli = yargs.scriptName("slidev").usage("$0 [args]").version(version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
63
63
|
cli.command(
|
|
@@ -260,7 +260,7 @@ cli.command(
|
|
|
260
260
|
}).strict().help(),
|
|
261
261
|
async (args) => {
|
|
262
262
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
263
|
-
const { build } = await import("./build-
|
|
263
|
+
const { build } = await import("./build-6664TIC5.mjs");
|
|
264
264
|
for (const entryFile of entry) {
|
|
265
265
|
const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
|
|
266
266
|
if (download && !options.data.config.download)
|
package/dist/index.js
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkMUDR5O2Rjs = require('./chunk-MUDR5O2R.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkT7LIARZ4js = require('./chunk-T7LIARZ4.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
19
|
-
require('./chunk-
|
|
18
|
+
var _chunkVIMRLOY5js = require('./chunk-VIMRLOY5.js');
|
|
19
|
+
require('./chunk-UWTQKD35.js');
|
|
20
20
|
require('./chunk-JQHGZJGJ.js');
|
|
21
21
|
require('./chunk-YUG22S6W.js');
|
|
22
22
|
|
|
@@ -32,4 +32,4 @@ require('./chunk-YUG22S6W.js');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
exports.ViteSlidevPlugin =
|
|
35
|
+
exports.ViteSlidevPlugin = _chunkVIMRLOY5js.ViteSlidevPlugin; exports.createServer = _chunkMUDR5O2Rjs.createServer; exports.createWindiCSSPlugin = _chunkT7LIARZ4js.createWindiCSSPlugin; exports.getAddonRoots = _chunkMUDR5O2Rjs.getAddonRoots; exports.getCLIRoot = _chunkMUDR5O2Rjs.getCLIRoot; exports.getClientRoot = _chunkMUDR5O2Rjs.getClientRoot; exports.getRoot = _chunkMUDR5O2Rjs.getRoot; exports.getThemeRoots = _chunkMUDR5O2Rjs.getThemeRoots; exports.getUserRoot = _chunkMUDR5O2Rjs.getUserRoot; exports.isPath = _chunkMUDR5O2Rjs.isPath; exports.parser = _chunkMUDR5O2Rjs.parser; exports.resolveOptions = _chunkMUDR5O2Rjs.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-UYSFRITU.mjs";
|
|
13
13
|
import {
|
|
14
14
|
createWindiCSSPlugin
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HIYCK5KO.mjs";
|
|
16
16
|
import {
|
|
17
17
|
ViteSlidevPlugin
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-4NQOFFBR.mjs";
|
|
19
|
+
import "./chunk-43ON36K4.mjs";
|
|
20
20
|
import "./chunk-ZEKM4EGL.mjs";
|
|
21
21
|
import "./chunk-QHOBBTS4.mjs";
|
|
22
22
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUWTQKD35js = require('./chunk-UWTQKD35.js');
|
|
4
4
|
require('./chunk-YUG22S6W.js');
|
|
5
5
|
|
|
6
6
|
// node/plugins/unocss.ts
|
|
@@ -28,7 +28,7 @@ async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, u
|
|
|
28
28
|
}).filter(Boolean);
|
|
29
29
|
configs.reverse();
|
|
30
30
|
let config = _unocss.mergeConfigs.call(void 0, [...configs, unoOptions]);
|
|
31
|
-
config = await
|
|
31
|
+
config = await _chunkUWTQKD35js.loadSetups.call(void 0, roots, "unocss.ts", {}, config, (a, b) => _unocss.mergeConfigs.call(void 0, [a, b]));
|
|
32
32
|
config.theme ||= {};
|
|
33
33
|
config.theme.fontFamily ||= {};
|
|
34
34
|
config.theme.fontFamily.sans ||= data.config.fonts.sans.join(",");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadSetups
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-43ON36K4.mjs";
|
|
4
4
|
import "./chunk-QHOBBTS4.mjs";
|
|
5
5
|
|
|
6
6
|
// node/plugins/unocss.ts
|
|
@@ -28,7 +28,7 @@ async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, u
|
|
|
28
28
|
}).filter(Boolean);
|
|
29
29
|
configs.reverse();
|
|
30
30
|
let config = mergeConfigs([...configs, unoOptions]);
|
|
31
|
-
config = await loadSetups(roots, "unocss.ts", {}, config,
|
|
31
|
+
config = await loadSetups(roots, "unocss.ts", {}, config, (a, b) => mergeConfigs([a, b]));
|
|
32
32
|
config.theme ||= {};
|
|
33
33
|
config.theme.fontFamily ||= {};
|
|
34
34
|
config.theme.fontFamily.sans ||= data.config.fonts.sans.join(",");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkT7LIARZ4js = require('./chunk-T7LIARZ4.js');
|
|
4
|
+
require('./chunk-UWTQKD35.js');
|
|
5
|
+
require('./chunk-JQHGZJGJ.js');
|
|
6
|
+
require('./chunk-YUG22S6W.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.createWindiCSSPlugin = _chunkT7LIARZ4js.createWindiCSSPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.5",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -74,14 +74,14 @@
|
|
|
74
74
|
"markdown-it-link-attributes": "^4.0.1",
|
|
75
75
|
"markdown-it-mdc": "^0.1.4",
|
|
76
76
|
"monaco-editor": "^0.37.1",
|
|
77
|
-
"nanoid": "^
|
|
77
|
+
"nanoid": "^5.0.1",
|
|
78
78
|
"open": "^8.4.1",
|
|
79
79
|
"pdf-lib": "^1.17.1",
|
|
80
80
|
"plantuml-encoder": "^1.4.0",
|
|
81
81
|
"postcss-nested": "^6.0.1",
|
|
82
82
|
"prismjs": "^1.29.0",
|
|
83
83
|
"prompts": "^2.4.2",
|
|
84
|
-
"resolve": "^1.22.
|
|
84
|
+
"resolve": "^1.22.6",
|
|
85
85
|
"resolve-from": "^5.0.0",
|
|
86
86
|
"resolve-global": "^1.0.0",
|
|
87
87
|
"shiki": "npm:shikiji-compat@^0.6.8",
|
|
@@ -99,9 +99,9 @@
|
|
|
99
99
|
"vue": "^3.3.4",
|
|
100
100
|
"windicss": "^3.5.6",
|
|
101
101
|
"yargs": "^17.7.2",
|
|
102
|
-
"@slidev/client": "0.43.
|
|
103
|
-
"@slidev/parser": "0.43.
|
|
104
|
-
"@slidev/types": "0.43.
|
|
102
|
+
"@slidev/client": "0.43.5",
|
|
103
|
+
"@slidev/parser": "0.43.5",
|
|
104
|
+
"@slidev/types": "0.43.5"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
107
|
"@types/plantuml-encoder": "^1.4.0",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkJ7PXWEZ7js = require('./chunk-J7PXWEZ7.js');
|
|
4
|
-
require('./chunk-KKGXM3XL.js');
|
|
5
|
-
require('./chunk-JQHGZJGJ.js');
|
|
6
|
-
require('./chunk-YUG22S6W.js');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.createWindiCSSPlugin = _chunkJ7PXWEZ7js.createWindiCSSPlugin;
|