@slidev/cli 0.43.5 → 0.43.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{build-6664TIC5.mjs → build-JG6KO567.mjs} +3 -3
- package/dist/{build-JUYH5PKW.js → build-Q7MBUFVA.js} +7 -7
- package/dist/{chunk-VIMRLOY5.js → chunk-6NXWYZV2.js} +25 -25
- package/dist/{chunk-JQHGZJGJ.js → chunk-CGJOXW6I.js} +1 -3
- package/dist/{chunk-T7LIARZ4.js → chunk-CPRFICJ7.js} +4 -4
- package/dist/{chunk-ZEKM4EGL.mjs → chunk-CPYGYVJ2.mjs} +1 -3
- package/dist/{chunk-UYSFRITU.mjs → chunk-ES74KI3X.mjs} +3 -3
- package/dist/{chunk-MUDR5O2R.js → chunk-OTHLYQGO.js} +14 -14
- package/dist/{chunk-HIYCK5KO.mjs → chunk-PZQGSMNY.mjs} +1 -1
- package/dist/{chunk-4NQOFFBR.mjs → chunk-QPK6JSKJ.mjs} +5 -5
- package/dist/cli.js +34 -36
- package/dist/cli.mjs +10 -12
- package/dist/{export-MCALG7XD.js → export-EYYLD3O6.js} +8 -10
- package/dist/{export-I7B4PU6A.mjs → export-GFE5VFSA.mjs} +6 -8
- package/dist/index.js +5 -5
- package/dist/index.mjs +4 -4
- package/dist/{windicss-UANMMLDV.mjs → windicss-5I6DSVQN.mjs} +2 -2
- package/dist/windicss-G7ISUN5H.js +9 -0
- package/package.json +8 -8
- package/dist/windicss-JD27KSJD.js +0 -9
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml,
|
|
4
4
|
mergeViteConfigs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QPK6JSKJ.mjs";
|
|
6
6
|
import "./chunk-43ON36K4.mjs";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-CPYGYVJ2.mjs";
|
|
8
8
|
import "./chunk-QHOBBTS4.mjs";
|
|
9
9
|
|
|
10
10
|
// node/build.ts
|
|
@@ -722,7 +722,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
722
722
|
await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
723
723
|
`, "utf-8");
|
|
724
724
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
725
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
725
|
+
const { exportSlides, getExportOptions } = await import("./export-GFE5VFSA.mjs");
|
|
726
726
|
const port = 12445;
|
|
727
727
|
const app = connect();
|
|
728
728
|
const server = http.createServer(app);
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk6NXWYZV2js = require('./chunk-6NXWYZV2.js');
|
|
6
6
|
require('./chunk-UWTQKD35.js');
|
|
7
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-CGJOXW6I.js');
|
|
8
8
|
require('./chunk-YUG22S6W.js');
|
|
9
9
|
|
|
10
10
|
// node/build.ts
|
|
@@ -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 _chunk6NXWYZV2js.getIndexHtml.call(void 0, options), "utf-8");
|
|
655
655
|
let config = void 0;
|
|
656
656
|
try {
|
|
657
|
-
const inlineConfig = await
|
|
657
|
+
const inlineConfig = await _chunk6NXWYZV2js.mergeViteConfigs.call(void 0,
|
|
658
658
|
options,
|
|
659
659
|
viteConfig,
|
|
660
660
|
{
|
|
661
661
|
root: options.userRoot,
|
|
662
662
|
plugins: [
|
|
663
|
-
await
|
|
663
|
+
await _chunk6NXWYZV2js.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 _chunk6NXWYZV2js.mergeViteConfigs.call(void 0,
|
|
685
685
|
options,
|
|
686
686
|
inlineConfig,
|
|
687
687
|
{
|
|
@@ -722,7 +722,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
722
722
|
await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
723
723
|
`, "utf-8");
|
|
724
724
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
725
|
-
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-
|
|
725
|
+
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-EYYLD3O6.js"));
|
|
726
726
|
const port = 12445;
|
|
727
727
|
const app = _connect2.default.call(void 0, );
|
|
728
728
|
const server = _http2.default.createServer(app);
|
|
@@ -7,7 +7,7 @@ var _chunkUWTQKD35js = require('./chunk-UWTQKD35.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkCGJOXW6Ijs = require('./chunk-CGJOXW6I.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -88,8 +88,8 @@ ${(_optionalChain([index, 'access', _7 => _7.match, 'call', _8 => _8(/<body>([\s
|
|
|
88
88
|
body += '\n<script async src="https://platform.twitter.com/widgets.js"></script>';
|
|
89
89
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
90
90
|
head += `
|
|
91
|
-
<link rel="stylesheet" href="${
|
|
92
|
-
main = main.replace("__ENTRY__",
|
|
91
|
+
<link rel="stylesheet" href="${_chunkCGJOXW6Ijs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
92
|
+
main = main.replace("__ENTRY__", _chunkCGJOXW6Ijs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
93
93
|
return main;
|
|
94
94
|
}
|
|
95
95
|
async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config, command) {
|
|
@@ -186,7 +186,7 @@ var dependencies = {
|
|
|
186
186
|
"@antfu/utils": "^0.7.6",
|
|
187
187
|
"@slidev/parser": "workspace:*",
|
|
188
188
|
"@slidev/types": "workspace:*",
|
|
189
|
-
"@unocss/reset": "^0.
|
|
189
|
+
"@unocss/reset": "^0.56.4",
|
|
190
190
|
"@vueuse/core": "^10.4.1",
|
|
191
191
|
"@vueuse/head": "^2.0.0",
|
|
192
192
|
"@vueuse/math": "^10.4.1",
|
|
@@ -205,10 +205,10 @@ var dependencies = {
|
|
|
205
205
|
prettier: "^3.0.3",
|
|
206
206
|
recordrtc: "^5.6.2",
|
|
207
207
|
resolve: "^1.22.6",
|
|
208
|
-
unocss: "^0.
|
|
208
|
+
unocss: "^0.56.4",
|
|
209
209
|
"vite-plugin-windicss": "^1.9.1",
|
|
210
210
|
vue: "^3.3.4",
|
|
211
|
-
"vue-router": "^4.2.
|
|
211
|
+
"vue-router": "^4.2.5",
|
|
212
212
|
"vue-starport": "^0.4.0",
|
|
213
213
|
windicss: "^3.5.6"
|
|
214
214
|
};
|
|
@@ -286,7 +286,7 @@ function createConfigPlugin(options) {
|
|
|
286
286
|
define: getDefine(options),
|
|
287
287
|
resolve: {
|
|
288
288
|
alias: {
|
|
289
|
-
"@slidev/client/": `${
|
|
289
|
+
"@slidev/client/": `${_chunkCGJOXW6Ijs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
290
290
|
},
|
|
291
291
|
dedupe: ["vue"]
|
|
292
292
|
},
|
|
@@ -321,7 +321,7 @@ function createConfigPlugin(options) {
|
|
|
321
321
|
allow: _utils.uniq.call(void 0, [
|
|
322
322
|
searchForWorkspaceRoot(options.userRoot),
|
|
323
323
|
searchForWorkspaceRoot(options.cliRoot),
|
|
324
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
324
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkCGJOXW6Ijs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkCGJOXW6Ijs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
325
325
|
])
|
|
326
326
|
}
|
|
327
327
|
},
|
|
@@ -330,7 +330,7 @@ function createConfigPlugin(options) {
|
|
|
330
330
|
if (_isinstalledglobally2.default) {
|
|
331
331
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
332
332
|
injection.root = options.cliRoot;
|
|
333
|
-
injection.resolve.alias.vue = `${
|
|
333
|
+
injection.resolve.alias.vue = `${_chunkCGJOXW6Ijs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
334
334
|
}
|
|
335
335
|
return _vite.mergeConfig.call(void 0, injection, config);
|
|
336
336
|
},
|
|
@@ -352,7 +352,7 @@ function createConfigPlugin(options) {
|
|
|
352
352
|
function getDefine(options) {
|
|
353
353
|
return {
|
|
354
354
|
__DEV__: options.mode === "dev" ? "true" : "false",
|
|
355
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
355
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkCGJOXW6Ijs.toAtFS.call(void 0, options.clientRoot)),
|
|
356
356
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
357
357
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
358
358
|
__SLIDEV_FEATURE_EDITOR__: JSON.stringify(options.mode === "dev" && options.data.config.editor !== false),
|
|
@@ -675,8 +675,8 @@ Unknown layout "${_kolorist.bold.call(void 0, layoutName)}".${_kolorist.yellow.c
|
|
|
675
675
|
delete frontmatter.title;
|
|
676
676
|
const imports = [
|
|
677
677
|
...vueContextImports,
|
|
678
|
-
`import InjectedLayout from "${
|
|
679
|
-
`import frontmatter from "${
|
|
678
|
+
`import InjectedLayout from "${_chunkCGJOXW6Ijs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
679
|
+
`import frontmatter from "${_chunkCGJOXW6Ijs.toAtFS.call(void 0, `${slidePrefix + (pageNo + 1)}.frontmatter`)}"`,
|
|
680
680
|
"const $frontmatter = frontmatter",
|
|
681
681
|
"_vueProvide(_injectionFrontmatter, frontmatter)",
|
|
682
682
|
// update frontmatter in router
|
|
@@ -789,11 +789,11 @@ defineProps<{ no: number | string }>()`);
|
|
|
789
789
|
}
|
|
790
790
|
async function generateUserStyles() {
|
|
791
791
|
const imports = [
|
|
792
|
-
`import "${
|
|
793
|
-
`import "${
|
|
794
|
-
`import "${
|
|
795
|
-
`import "${
|
|
796
|
-
`import "${
|
|
792
|
+
`import "${_chunkCGJOXW6Ijs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
793
|
+
`import "${_chunkCGJOXW6Ijs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
794
|
+
`import "${_chunkCGJOXW6Ijs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`,
|
|
795
|
+
`import "${_chunkCGJOXW6Ijs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/katex.css"))}"`,
|
|
796
|
+
`import "${_chunkCGJOXW6Ijs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/transitions.css"))}"`
|
|
797
797
|
];
|
|
798
798
|
const roots2 = _utils.uniq.call(void 0, [
|
|
799
799
|
...themeRoots,
|
|
@@ -810,13 +810,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
810
810
|
];
|
|
811
811
|
for (const style of styles) {
|
|
812
812
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
813
|
-
imports.push(`import "${
|
|
813
|
+
imports.push(`import "${_chunkCGJOXW6Ijs.toAtFS.call(void 0, style)}"`);
|
|
814
814
|
continue;
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
818
|
if (data.features.katex)
|
|
819
|
-
imports.push(`import "${
|
|
819
|
+
imports.push(`import "${_chunkCGJOXW6Ijs.toAtFS.call(void 0, _chunkCGJOXW6Ijs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
820
820
|
if (data.config.css === "unocss") {
|
|
821
821
|
imports.unshift(
|
|
822
822
|
'import "@unocss/reset/tailwind.css"',
|
|
@@ -844,7 +844,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
844
844
|
const layouts = _utils.objectMap.call(void 0,
|
|
845
845
|
await getLayouts(),
|
|
846
846
|
(k, v) => {
|
|
847
|
-
imports.push(`import __layout_${k} from "${
|
|
847
|
+
imports.push(`import __layout_${k} from "${_chunkCGJOXW6Ijs.toAtFS.call(void 0, v)}"`);
|
|
848
848
|
return [k, `__layout_${k}`];
|
|
849
849
|
}
|
|
850
850
|
);
|
|
@@ -882,7 +882,7 @@ ${redirects.join(",\n")}
|
|
|
882
882
|
const config = { ...data.config, remote };
|
|
883
883
|
if (_utils.isString.call(void 0, config.title)) {
|
|
884
884
|
const tokens = md.parseInline(config.title, {});
|
|
885
|
-
config.title =
|
|
885
|
+
config.title = _chunkCGJOXW6Ijs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
886
886
|
}
|
|
887
887
|
if (_utils.isString.call(void 0, config.info))
|
|
888
888
|
config.info = md.render(config.info);
|
|
@@ -903,7 +903,7 @@ ${redirects.join(",\n")}
|
|
|
903
903
|
];
|
|
904
904
|
}
|
|
905
905
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
906
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
906
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkCGJOXW6Ijs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
907
907
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
908
908
|
return `
|
|
909
909
|
${imports}
|
|
@@ -922,7 +922,7 @@ export default {
|
|
|
922
922
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
923
923
|
];
|
|
924
924
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
925
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
925
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkCGJOXW6Ijs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
926
926
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
927
927
|
return `
|
|
928
928
|
${imports}
|
|
@@ -1003,7 +1003,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
1003
1003
|
setups.forEach((path, idx) => {
|
|
1004
1004
|
if (!_fs.existsSync.call(void 0, path))
|
|
1005
1005
|
return;
|
|
1006
|
-
imports.push(`import __n${idx} from '${
|
|
1006
|
+
imports.push(`import __n${idx} from '${_chunkCGJOXW6Ijs.toAtFS.call(void 0, path)}'`);
|
|
1007
1007
|
let fn = `:AWAIT:__n${idx}`;
|
|
1008
1008
|
if (/\binjection_return\b/g.test(code))
|
|
1009
1009
|
fn = `injection_return = ${fn}`;
|
|
@@ -1690,7 +1690,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1690
1690
|
dev: true,
|
|
1691
1691
|
build: true
|
|
1692
1692
|
})) : null,
|
|
1693
|
-
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-G7ISUN5H.js")).then((r) => r.createWindiCSSPlugin(options, pluginOptions)) : Promise.resolve().then(() => require("./unocss-E5M4APXD.js")).then((r) => r.createUnocssPlugin(options, pluginOptions))
|
|
1694
1694
|
];
|
|
1695
1695
|
return (await Promise.all(plugins)).flat().filter(_utils.notNullish);
|
|
1696
1696
|
}
|
|
@@ -48,9 +48,7 @@ function resolveGlobalImportPath(importName) {
|
|
|
48
48
|
throw new Error(`Failed to resolve global package "${importName}"`);
|
|
49
49
|
}
|
|
50
50
|
function stringifyMarkdownTokens(tokens) {
|
|
51
|
-
return tokens.map(
|
|
52
|
-
(token) => _optionalChain([token, 'access', _ => _.children, 'optionalAccess', _2 => _2.filter, 'call', _3 => _3((t) => ["text", "code_inline"].includes(t.type) && !t.content.match(/^\s*$/)), 'access', _4 => _4.map, 'call', _5 => _5((t) => t.content.trim()), 'access', _6 => _6.join, 'call', _7 => _7(" ")])
|
|
53
|
-
).filter(Boolean).join(" ");
|
|
51
|
+
return tokens.map((token) => _optionalChain([token, 'access', _ => _.children, 'optionalAccess', _2 => _2.filter, 'call', _3 => _3((t) => ["text", "code_inline"].includes(t.type) && !t.content.match(/^\s*$/)), 'access', _4 => _4.map, 'call', _5 => _5((t) => t.content.trim()), 'access', _6 => _6.join, 'call', _7 => _7(" ")])).filter(Boolean).join(" ");
|
|
54
52
|
}
|
|
55
53
|
function generateGoogleFontsUrl(options) {
|
|
56
54
|
const weights = options.weights.flatMap((i) => options.italic ? [`0,${i}`, `1,${i}`] : [`${i}`]).sort().join(";");
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkUWTQKD35js = require('./chunk-UWTQKD35.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCGJOXW6Ijs = require('./chunk-CGJOXW6I.js');
|
|
7
7
|
|
|
8
8
|
// node/plugins/windicss.ts
|
|
9
9
|
var _path = require('path');
|
|
@@ -51,9 +51,9 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
|
|
|
51
51
|
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
52
52
|
});
|
|
53
53
|
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
54
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
55
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
56
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
54
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkCGJOXW6Ijs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
55
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkCGJOXW6Ijs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
56
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkCGJOXW6Ijs.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
57
57
|
},
|
|
58
58
|
...windiOptions
|
|
59
59
|
}
|
|
@@ -48,9 +48,7 @@ function resolveGlobalImportPath(importName) {
|
|
|
48
48
|
throw new Error(`Failed to resolve global package "${importName}"`);
|
|
49
49
|
}
|
|
50
50
|
function stringifyMarkdownTokens(tokens) {
|
|
51
|
-
return tokens.map(
|
|
52
|
-
(token) => token.children?.filter((t) => ["text", "code_inline"].includes(t.type) && !t.content.match(/^\s*$/)).map((t) => t.content.trim()).join(" ")
|
|
53
|
-
).filter(Boolean).join(" ");
|
|
51
|
+
return tokens.map((token) => token.children?.filter((t) => ["text", "code_inline"].includes(t.type) && !t.content.match(/^\s*$/)).map((t) => t.content.trim()).join(" ")).filter(Boolean).join(" ");
|
|
54
52
|
}
|
|
55
53
|
function generateGoogleFontsUrl(options) {
|
|
56
54
|
const weights = options.weights.flatMap((i) => options.italic ? [`0,${i}`, `1,${i}`] : [`${i}`]).sort().join(";");
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QPK6JSKJ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
packageExists,
|
|
7
7
|
resolveImportPath
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CPYGYVJ2.mjs";
|
|
9
9
|
import {
|
|
10
10
|
__commonJS,
|
|
11
11
|
__toESM
|
|
@@ -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.6";
|
|
2523
2523
|
|
|
2524
2524
|
// node/themes.ts
|
|
2525
2525
|
import prompts2 from "prompts";
|
|
@@ -1,11 +1,11 @@
|
|
|
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 _chunk6NXWYZV2js = require('./chunk-6NXWYZV2.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkCGJOXW6Ijs = require('./chunk-CGJOXW6I.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -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 _chunk6NXWYZV2js.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 _chunk6NXWYZV2js.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.6";
|
|
2523
2523
|
|
|
2524
2524
|
// node/themes.ts
|
|
2525
2525
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
@@ -7631,7 +7631,7 @@ var import_semver = _chunkYUG22S6Wjs.__toESM.call(void 0, require_semver2());
|
|
|
7631
7631
|
|
|
7632
7632
|
async function getPackageJson(root) {
|
|
7633
7633
|
try {
|
|
7634
|
-
const file =
|
|
7634
|
+
const file = _chunkCGJOXW6Ijs.resolveImportPath.call(void 0, `${root}/package.json`, true);
|
|
7635
7635
|
if (file && _fsextra2.default.existsSync(file))
|
|
7636
7636
|
return await _fsextra2.default.readJSON(file);
|
|
7637
7637
|
return {};
|
|
@@ -7666,7 +7666,7 @@ function resolvePluginName(name) {
|
|
|
7666
7666
|
return "";
|
|
7667
7667
|
if (isPath(name))
|
|
7668
7668
|
return name;
|
|
7669
|
-
if (
|
|
7669
|
+
if (_chunkCGJOXW6Ijs.packageExists.call(void 0, `slidev-addon-${name}`))
|
|
7670
7670
|
return `slidev-addon-${name}`;
|
|
7671
7671
|
return name;
|
|
7672
7672
|
}
|
|
@@ -7674,7 +7674,7 @@ function resolvePluginName(name) {
|
|
|
7674
7674
|
// node/options.ts
|
|
7675
7675
|
var debug = _debug3.default.call(void 0, "slidev:options");
|
|
7676
7676
|
function getClientRoot() {
|
|
7677
|
-
return _path.dirname.call(void 0,
|
|
7677
|
+
return _path.dirname.call(void 0, _chunkCGJOXW6Ijs.resolveImportPath.call(void 0, "@slidev/client/package.json", true));
|
|
7678
7678
|
}
|
|
7679
7679
|
function getCLIRoot() {
|
|
7680
7680
|
return _path.resolve.call(void 0, __dirname, "..");
|
|
@@ -7695,7 +7695,7 @@ function getAddonRoots(addons, entry) {
|
|
|
7695
7695
|
function getRoot(name, entry) {
|
|
7696
7696
|
if (isPath(name))
|
|
7697
7697
|
return _path.resolve.call(void 0, _path.dirname.call(void 0, entry), name);
|
|
7698
|
-
return _path.dirname.call(void 0,
|
|
7698
|
+
return _path.dirname.call(void 0, _chunkCGJOXW6Ijs.resolveImportPath.call(void 0, `${name}/package.json`, true));
|
|
7699
7699
|
}
|
|
7700
7700
|
function getUserRoot(options) {
|
|
7701
7701
|
const { entry: rawEntry = "slides.md", userRoot = _process2.default.cwd() } = options;
|
|
@@ -7714,7 +7714,7 @@ async function resolveOptions(options, mode2, promptForInstallation = true) {
|
|
|
7714
7714
|
if (await promptForThemeInstallation(theme) === false)
|
|
7715
7715
|
_process2.default.exit(1);
|
|
7716
7716
|
} else {
|
|
7717
|
-
if (!
|
|
7717
|
+
if (!_chunkCGJOXW6Ijs.packageExists.call(void 0, theme)) {
|
|
7718
7718
|
console.error(`Theme "${theme}" not found, have you installed it?`);
|
|
7719
7719
|
_process2.default.exit(1);
|
|
7720
7720
|
}
|
|
@@ -7787,11 +7787,11 @@ function resolveThemeName(name) {
|
|
|
7787
7787
|
return name;
|
|
7788
7788
|
if (isPath(name))
|
|
7789
7789
|
return name;
|
|
7790
|
-
if (
|
|
7790
|
+
if (_chunkCGJOXW6Ijs.packageExists.call(void 0, `@slidev/theme-${name}`))
|
|
7791
7791
|
return `@slidev/theme-${name}`;
|
|
7792
|
-
if (
|
|
7792
|
+
if (_chunkCGJOXW6Ijs.packageExists.call(void 0, `slidev-theme-${name}`))
|
|
7793
7793
|
return `slidev-theme-${name}`;
|
|
7794
|
-
if (
|
|
7794
|
+
if (_chunkCGJOXW6Ijs.packageExists.call(void 0, name))
|
|
7795
7795
|
return name;
|
|
7796
7796
|
if (officialThemes[name] != null)
|
|
7797
7797
|
return officialThemes[name];
|
|
@@ -7803,7 +7803,7 @@ async function promptForThemeInstallation(name) {
|
|
|
7803
7803
|
name = resolveThemeName(name);
|
|
7804
7804
|
if (!name)
|
|
7805
7805
|
return name;
|
|
7806
|
-
if (isPath(name) ||
|
|
7806
|
+
if (isPath(name) || _chunkCGJOXW6Ijs.packageExists.call(void 0, name))
|
|
7807
7807
|
return name;
|
|
7808
7808
|
const { confirm: confirm2 } = await _prompts2.default.call(void 0, {
|
|
7809
7809
|
name: "confirm",
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
resolveImportPath,
|
|
8
8
|
stringifyMarkdownTokens,
|
|
9
9
|
toAtFS
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CPYGYVJ2.mjs";
|
|
11
11
|
import {
|
|
12
12
|
__commonJS,
|
|
13
13
|
__require,
|
|
@@ -186,7 +186,7 @@ var dependencies = {
|
|
|
186
186
|
"@antfu/utils": "^0.7.6",
|
|
187
187
|
"@slidev/parser": "workspace:*",
|
|
188
188
|
"@slidev/types": "workspace:*",
|
|
189
|
-
"@unocss/reset": "^0.
|
|
189
|
+
"@unocss/reset": "^0.56.4",
|
|
190
190
|
"@vueuse/core": "^10.4.1",
|
|
191
191
|
"@vueuse/head": "^2.0.0",
|
|
192
192
|
"@vueuse/math": "^10.4.1",
|
|
@@ -205,10 +205,10 @@ var dependencies = {
|
|
|
205
205
|
prettier: "^3.0.3",
|
|
206
206
|
recordrtc: "^5.6.2",
|
|
207
207
|
resolve: "^1.22.6",
|
|
208
|
-
unocss: "^0.
|
|
208
|
+
unocss: "^0.56.4",
|
|
209
209
|
"vite-plugin-windicss": "^1.9.1",
|
|
210
210
|
vue: "^3.3.4",
|
|
211
|
-
"vue-router": "^4.2.
|
|
211
|
+
"vue-router": "^4.2.5",
|
|
212
212
|
"vue-starport": "^0.4.0",
|
|
213
213
|
windicss: "^3.5.6"
|
|
214
214
|
};
|
|
@@ -1690,7 +1690,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1690
1690
|
dev: true,
|
|
1691
1691
|
build: true
|
|
1692
1692
|
})) : null,
|
|
1693
|
-
config.css === "none" ? null : config.css === "windicss" ? import("./windicss-
|
|
1693
|
+
config.css === "none" ? null : config.css === "windicss" ? import("./windicss-5I6DSVQN.mjs").then((r) => r.createWindiCSSPlugin(options, pluginOptions)) : import("./unocss-EBBZWMQM.mjs").then((r) => r.createUnocssPlugin(options, pluginOptions))
|
|
1694
1694
|
];
|
|
1695
1695
|
return (await Promise.all(plugins)).flat().filter(notNullish2);
|
|
1696
1696
|
}
|
package/dist/cli.js
CHANGED
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkOTHLYQGOjs = require('./chunk-OTHLYQGO.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunk6NXWYZV2js = require('./chunk-6NXWYZV2.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkUWTQKD35js = require('./chunk-UWTQKD35.js');
|
|
19
|
-
require('./chunk-
|
|
19
|
+
require('./chunk-CGJOXW6I.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, _chunk6NXWYZV2js.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
|
+
_chunkOTHLYQGOjs.getUserRoot.call(void 0, {}).userRoot,
|
|
55
|
+
..._chunkOTHLYQGOjs.getAddonRoots.call(void 0, addons, ""),
|
|
56
|
+
_chunkOTHLYQGOjs.getClientRoot.call(void 0, )
|
|
57
57
|
]
|
|
58
58
|
);
|
|
59
59
|
const mergeArrays = (a, b) => a.concat(b);
|
|
60
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(_chunkOTHLYQGOjs.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 _chunkOTHLYQGOjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
119
119
|
port = userPort || await findFreePort(3030);
|
|
120
|
-
server = await
|
|
120
|
+
server = await _chunkOTHLYQGOjs.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 && _chunkOTHLYQGOjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkOTHLYQGOjs.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-Q7MBUFVA.js"));
|
|
264
264
|
for (const entryFile of entry) {
|
|
265
|
-
const options = await
|
|
265
|
+
const options = await _chunkOTHLYQGOjs.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 _chunkOTHLYQGOjs.parser.load(entryFile);
|
|
286
|
+
_chunkOTHLYQGOjs.parser.prettify(data);
|
|
287
|
+
await _chunkOTHLYQGOjs.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 _chunkOTHLYQGOjs.parser.load(entry);
|
|
304
|
+
const theme = _chunkOTHLYQGOjs.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 (_chunkOTHLYQGOjs.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 = _chunkOTHLYQGOjs.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 _chunkOTHLYQGOjs.parser.save(data);
|
|
326
326
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
327
327
|
}
|
|
328
328
|
);
|
|
@@ -339,11 +339,11 @@ cli.command(
|
|
|
339
339
|
async (args) => {
|
|
340
340
|
const { entry, theme } = args;
|
|
341
341
|
_process2.default.env.NODE_ENV = "production";
|
|
342
|
-
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-
|
|
342
|
+
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-EYYLD3O6.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 _chunkOTHLYQGOjs.resolveOptions.call(void 0, { entry: entryFile, theme }, "export");
|
|
346
|
+
const server = await _chunkOTHLYQGOjs.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
|
+
_chunkOTHLYQGOjs.parser.filterDisabled(options.data);
|
|
356
356
|
const result = await exportSlides({
|
|
357
357
|
port,
|
|
358
358
|
...getExportOptions({ ...args, entry: entryFile }, options)
|
|
@@ -385,11 +385,11 @@ cli.command(
|
|
|
385
385
|
timeout
|
|
386
386
|
}) => {
|
|
387
387
|
_process2.default.env.NODE_ENV = "production";
|
|
388
|
-
const { exportNotes } = await Promise.resolve().then(() => require("./export-
|
|
388
|
+
const { exportNotes } = await Promise.resolve().then(() => require("./export-EYYLD3O6.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 _chunkOTHLYQGOjs.resolveOptions.call(void 0, { entry: entryFile }, "export");
|
|
392
|
+
const server = await _chunkOTHLYQGOjs.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
|
+
_chunkOTHLYQGOjs.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${_chunkOTHLYQGOjs.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")));
|
|
@@ -477,12 +477,10 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
477
477
|
console.log(`${_kolorist.dim.call(void 0, " inspector")} > ${_kolorist.yellow.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}/__inspect/`)}`);
|
|
478
478
|
let lastRemoteUrl = "";
|
|
479
479
|
if (remote !== void 0) {
|
|
480
|
-
Object.values(_os2.default.networkInterfaces()).forEach(
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
})
|
|
485
|
-
);
|
|
480
|
+
Object.values(_os2.default.networkInterfaces()).forEach((v) => (v || []).filter((details) => String(details.family).slice(-1) === "4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
|
|
481
|
+
lastRemoteUrl = `http://${address}:${port}${presenterPath}`;
|
|
482
|
+
console.log(`${_kolorist.dim.call(void 0, " remote control ")} > ${_kolorist.blue.call(void 0, lastRemoteUrl)}`);
|
|
483
|
+
}));
|
|
486
484
|
if (tunnelUrl) {
|
|
487
485
|
lastRemoteUrl = `${tunnelUrl}${presenterPath}`;
|
|
488
486
|
console.log(`${_kolorist.dim.call(void 0, " remote via tunnel")} > ${_kolorist.yellow.call(void 0, lastRemoteUrl)}`);
|
package/dist/cli.mjs
CHANGED
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
resolveOptions,
|
|
10
10
|
resolveThemeName,
|
|
11
11
|
version
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ES74KI3X.mjs";
|
|
13
13
|
import {
|
|
14
14
|
require_fast_deep_equal
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QPK6JSKJ.mjs";
|
|
16
16
|
import {
|
|
17
17
|
loadSetups
|
|
18
18
|
} from "./chunk-43ON36K4.mjs";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-CPYGYVJ2.mjs";
|
|
20
20
|
import {
|
|
21
21
|
__toESM
|
|
22
22
|
} from "./chunk-QHOBBTS4.mjs";
|
|
@@ -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-JG6KO567.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)
|
|
@@ -339,7 +339,7 @@ cli.command(
|
|
|
339
339
|
async (args) => {
|
|
340
340
|
const { entry, theme } = args;
|
|
341
341
|
process.env.NODE_ENV = "production";
|
|
342
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
342
|
+
const { exportSlides, getExportOptions } = await import("./export-GFE5VFSA.mjs");
|
|
343
343
|
const port = await findFreePort(12445);
|
|
344
344
|
for (const entryFile of entry) {
|
|
345
345
|
const options = await resolveOptions({ entry: entryFile, theme }, "export");
|
|
@@ -385,7 +385,7 @@ cli.command(
|
|
|
385
385
|
timeout
|
|
386
386
|
}) => {
|
|
387
387
|
process.env.NODE_ENV = "production";
|
|
388
|
-
const { exportNotes } = await import("./export-
|
|
388
|
+
const { exportNotes } = await import("./export-GFE5VFSA.mjs");
|
|
389
389
|
const port = await findFreePort(12445);
|
|
390
390
|
for (const entryFile of entry) {
|
|
391
391
|
const options = await resolveOptions({ entry: entryFile }, "export");
|
|
@@ -477,12 +477,10 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
477
477
|
console.log(`${dim(" inspector")} > ${yellow(`http://localhost:${bold(port)}/__inspect/`)}`);
|
|
478
478
|
let lastRemoteUrl = "";
|
|
479
479
|
if (remote !== void 0) {
|
|
480
|
-
Object.values(os.networkInterfaces()).forEach(
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
})
|
|
485
|
-
);
|
|
480
|
+
Object.values(os.networkInterfaces()).forEach((v) => (v || []).filter((details) => String(details.family).slice(-1) === "4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
|
|
481
|
+
lastRemoteUrl = `http://${address}:${port}${presenterPath}`;
|
|
482
|
+
console.log(`${dim(" remote control ")} > ${blue(lastRemoteUrl)}`);
|
|
483
|
+
}));
|
|
486
484
|
if (tunnelUrl) {
|
|
487
485
|
lastRemoteUrl = `${tunnelUrl}${presenterPath}`;
|
|
488
486
|
console.log(`${dim(" remote via tunnel")} > ${yellow(lastRemoteUrl)}`);
|
|
@@ -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 _chunkCGJOXW6Ijs = require('./chunk-CGJOXW6I.js');
|
|
4
4
|
require('./chunk-YUG22S6W.js');
|
|
5
5
|
|
|
6
6
|
// node/export.ts
|
|
@@ -28,14 +28,12 @@ function addToTree(tree, info, slideIndexes, level = 1) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
function makeOutline(tree) {
|
|
31
|
-
return tree.map(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return childrenOutline.length > 0 ? `${rootOutline}
|
|
31
|
+
return tree.map(({ title, path: path2, level, children }) => {
|
|
32
|
+
const rootOutline = title ? `${path2}|${"-".repeat(level - 1)}|${title}` : null;
|
|
33
|
+
const childrenOutline = makeOutline(children);
|
|
34
|
+
return childrenOutline.length > 0 ? `${rootOutline}
|
|
36
35
|
${childrenOutline}` : rootOutline;
|
|
37
|
-
|
|
38
|
-
).filter((outline) => !!outline).join("\n");
|
|
36
|
+
}).filter((outline) => !!outline).join("\n");
|
|
39
37
|
}
|
|
40
38
|
function createSlidevProgress(indeterminate = false) {
|
|
41
39
|
function getSpinner(n = 0) {
|
|
@@ -76,7 +74,7 @@ async function exportNotes({
|
|
|
76
74
|
output = "notes",
|
|
77
75
|
timeout = 3e4
|
|
78
76
|
}) {
|
|
79
|
-
if (!
|
|
77
|
+
if (!_chunkCGJOXW6Ijs.packageExists.call(void 0, "playwright-chromium"))
|
|
80
78
|
throw new Error("The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`");
|
|
81
79
|
const { chromium } = await Promise.resolve().then(() => require("playwright-chromium"));
|
|
82
80
|
const browser = await chromium.launch();
|
|
@@ -122,7 +120,7 @@ async function exportSlides({
|
|
|
122
120
|
withToc = false,
|
|
123
121
|
perSlide = false
|
|
124
122
|
}) {
|
|
125
|
-
if (!
|
|
123
|
+
if (!_chunkCGJOXW6Ijs.packageExists.call(void 0, "playwright-chromium"))
|
|
126
124
|
throw new Error("The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`");
|
|
127
125
|
const pages = _core.parseRangeString.call(void 0, total, range);
|
|
128
126
|
const { chromium } = await Promise.resolve().then(() => require("playwright-chromium"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
packageExists
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CPYGYVJ2.mjs";
|
|
4
4
|
import "./chunk-QHOBBTS4.mjs";
|
|
5
5
|
|
|
6
6
|
// node/export.ts
|
|
@@ -28,14 +28,12 @@ function addToTree(tree, info, slideIndexes, level = 1) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
function makeOutline(tree) {
|
|
31
|
-
return tree.map(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return childrenOutline.length > 0 ? `${rootOutline}
|
|
31
|
+
return tree.map(({ title, path: path2, level, children }) => {
|
|
32
|
+
const rootOutline = title ? `${path2}|${"-".repeat(level - 1)}|${title}` : null;
|
|
33
|
+
const childrenOutline = makeOutline(children);
|
|
34
|
+
return childrenOutline.length > 0 ? `${rootOutline}
|
|
36
35
|
${childrenOutline}` : rootOutline;
|
|
37
|
-
|
|
38
|
-
).filter((outline) => !!outline).join("\n");
|
|
36
|
+
}).filter((outline) => !!outline).join("\n");
|
|
39
37
|
}
|
|
40
38
|
function createSlidevProgress(indeterminate = false) {
|
|
41
39
|
function getSpinner(n = 0) {
|
package/dist/index.js
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkOTHLYQGOjs = require('./chunk-OTHLYQGO.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkCPRFICJ7js = require('./chunk-CPRFICJ7.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunk6NXWYZV2js = require('./chunk-6NXWYZV2.js');
|
|
19
19
|
require('./chunk-UWTQKD35.js');
|
|
20
|
-
require('./chunk-
|
|
20
|
+
require('./chunk-CGJOXW6I.js');
|
|
21
21
|
require('./chunk-YUG22S6W.js');
|
|
22
22
|
|
|
23
23
|
|
|
@@ -32,4 +32,4 @@ require('./chunk-YUG22S6W.js');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
exports.ViteSlidevPlugin =
|
|
35
|
+
exports.ViteSlidevPlugin = _chunk6NXWYZV2js.ViteSlidevPlugin; exports.createServer = _chunkOTHLYQGOjs.createServer; exports.createWindiCSSPlugin = _chunkCPRFICJ7js.createWindiCSSPlugin; exports.getAddonRoots = _chunkOTHLYQGOjs.getAddonRoots; exports.getCLIRoot = _chunkOTHLYQGOjs.getCLIRoot; exports.getClientRoot = _chunkOTHLYQGOjs.getClientRoot; exports.getRoot = _chunkOTHLYQGOjs.getRoot; exports.getThemeRoots = _chunkOTHLYQGOjs.getThemeRoots; exports.getUserRoot = _chunkOTHLYQGOjs.getUserRoot; exports.isPath = _chunkOTHLYQGOjs.isPath; exports.parser = _chunkOTHLYQGOjs.parser; exports.resolveOptions = _chunkOTHLYQGOjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
isPath,
|
|
10
10
|
parser,
|
|
11
11
|
resolveOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ES74KI3X.mjs";
|
|
13
13
|
import {
|
|
14
14
|
createWindiCSSPlugin
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PZQGSMNY.mjs";
|
|
16
16
|
import {
|
|
17
17
|
ViteSlidevPlugin
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QPK6JSKJ.mjs";
|
|
19
19
|
import "./chunk-43ON36K4.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-CPYGYVJ2.mjs";
|
|
21
21
|
import "./chunk-QHOBBTS4.mjs";
|
|
22
22
|
export {
|
|
23
23
|
ViteSlidevPlugin,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWindiCSSPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PZQGSMNY.mjs";
|
|
4
4
|
import "./chunk-43ON36K4.mjs";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-CPYGYVJ2.mjs";
|
|
6
6
|
import "./chunk-QHOBBTS4.mjs";
|
|
7
7
|
export {
|
|
8
8
|
createWindiCSSPlugin
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkCPRFICJ7js = require('./chunk-CPRFICJ7.js');
|
|
4
|
+
require('./chunk-UWTQKD35.js');
|
|
5
|
+
require('./chunk-CGJOXW6I.js');
|
|
6
|
+
require('./chunk-YUG22S6W.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.createWindiCSSPlugin = _chunkCPRFICJ7js.createWindiCSSPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.6",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@iconify-json/ph": "^1.1.6",
|
|
49
49
|
"@lillallol/outline-pdf": "^4.0.0",
|
|
50
50
|
"@mrdrogdrog/optional": "^1.2.1",
|
|
51
|
-
"@unocss/extractor-mdc": "^0.
|
|
52
|
-
"@unocss/reset": "^0.
|
|
51
|
+
"@unocss/extractor-mdc": "^0.56.4",
|
|
52
|
+
"@unocss/reset": "^0.56.4",
|
|
53
53
|
"@vitejs/plugin-vue": "^4.3.4",
|
|
54
54
|
"@vitejs/plugin-vue-jsx": "^3.0.2",
|
|
55
55
|
"@windicss/config": "^1.9.1",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"katex": "^0.16.8",
|
|
70
70
|
"kolorist": "^1.8.0",
|
|
71
71
|
"localtunnel": "^2.0.2",
|
|
72
|
-
"markdown-it": "^13.0.
|
|
72
|
+
"markdown-it": "^13.0.2",
|
|
73
73
|
"markdown-it-footnote": "^3.0.3",
|
|
74
74
|
"markdown-it-link-attributes": "^4.0.1",
|
|
75
75
|
"markdown-it-mdc": "^0.1.4",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"resolve-from": "^5.0.0",
|
|
86
86
|
"resolve-global": "^1.0.0",
|
|
87
87
|
"shiki": "npm:shikiji-compat@^0.6.8",
|
|
88
|
-
"unocss": "^0.
|
|
88
|
+
"unocss": "^0.56.4",
|
|
89
89
|
"unplugin-icons": "^0.17.0",
|
|
90
90
|
"unplugin-vue-components": "^0.25.2",
|
|
91
91
|
"unplugin-vue-markdown": "^0.24.3",
|
|
@@ -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.6",
|
|
103
|
+
"@slidev/parser": "0.43.6",
|
|
104
|
+
"@slidev/types": "0.43.6"
|
|
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 _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;
|