@slidev/cli 0.43.0-beta.3 → 0.43.0-beta.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-BMJKCMWK.js → build-2HVDTXMU.js} +5 -5
- package/dist/{build-4JRH4QXK.mjs → build-UUIAUK3H.mjs} +1 -1
- package/dist/{chunk-O2663AU4.js → chunk-2BMKFV7C.js} +33 -15
- package/dist/{chunk-SWZ5SM6V.mjs → chunk-BAK2YZDZ.mjs} +28 -10
- package/dist/chunk-DXJWPFLI.js +1640 -0
- package/dist/chunk-IMVZEGBY.mjs +1640 -0
- package/dist/cli.js +29 -28
- package/dist/cli.mjs +5 -4
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +9 -9
- package/dist/chunk-WAD6PHVC.mjs +0 -4842
- package/dist/chunk-XPOF53GO.js +0 -4842
package/dist/cli.js
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk2BMKFV7Cjs = require('./chunk-2BMKFV7C.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkDXJWPFLIjs = require('./chunk-DXJWPFLI.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkKKGXM3XLjs = require('./chunk-KKGXM3XL.js');
|
|
@@ -22,7 +22,7 @@ require('./chunk-JQHGZJGJ.js');
|
|
|
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, _chunkDXJWPFLIjs.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');
|
|
@@ -43,22 +43,23 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
43
43
|
"routerMode",
|
|
44
44
|
"fonts",
|
|
45
45
|
"css",
|
|
46
|
-
"mdc"
|
|
46
|
+
"mdc",
|
|
47
|
+
"editor"
|
|
47
48
|
];
|
|
48
49
|
_fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) => {
|
|
49
50
|
const addons = _nullishCoalesce(_optionalChain([headmatter, 'optionalAccess', _ => _.addons]), () => ( []));
|
|
50
51
|
const roots = (
|
|
51
52
|
/* uniq */
|
|
52
53
|
[
|
|
53
|
-
|
|
54
|
-
...
|
|
55
|
-
|
|
54
|
+
_chunk2BMKFV7Cjs.getUserRoot.call(void 0, {}).userRoot,
|
|
55
|
+
..._chunk2BMKFV7Cjs.getAddonRoots.call(void 0, addons, ""),
|
|
56
|
+
_chunk2BMKFV7Cjs.getClientRoot.call(void 0, )
|
|
56
57
|
]
|
|
57
58
|
);
|
|
58
59
|
const mergeArrays = (a, b) => a.concat(b);
|
|
59
60
|
return await _chunkKKGXM3XLjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
|
|
60
61
|
});
|
|
61
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
62
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunk2BMKFV7Cjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
62
63
|
cli.command(
|
|
63
64
|
"* [entry]",
|
|
64
65
|
"Start a local server for Slidev",
|
|
@@ -114,9 +115,9 @@ cli.command(
|
|
|
114
115
|
async function initServer() {
|
|
115
116
|
if (server)
|
|
116
117
|
await server.close();
|
|
117
|
-
const options = await
|
|
118
|
+
const options = await _chunk2BMKFV7Cjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
118
119
|
port = userPort || await findFreePort(3030);
|
|
119
|
-
server = await
|
|
120
|
+
server = await _chunk2BMKFV7Cjs.createServer.call(void 0,
|
|
120
121
|
options,
|
|
121
122
|
{
|
|
122
123
|
server: {
|
|
@@ -130,7 +131,7 @@ cli.command(
|
|
|
130
131
|
},
|
|
131
132
|
{
|
|
132
133
|
onDataReload(newData, data) {
|
|
133
|
-
if (!theme &&
|
|
134
|
+
if (!theme && _chunk2BMKFV7Cjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunk2BMKFV7Cjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
134
135
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
135
136
|
initServer();
|
|
136
137
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -259,9 +260,9 @@ cli.command(
|
|
|
259
260
|
}).strict().help(),
|
|
260
261
|
async (args) => {
|
|
261
262
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
262
|
-
const { build } = await Promise.resolve().then(() => require("./build-
|
|
263
|
+
const { build } = await Promise.resolve().then(() => require("./build-2HVDTXMU.js"));
|
|
263
264
|
for (const entryFile of entry) {
|
|
264
|
-
const options = await
|
|
265
|
+
const options = await _chunk2BMKFV7Cjs.resolveOptions.call(void 0, { entry: entryFile, theme, inspect }, "build");
|
|
265
266
|
if (download && !options.data.config.download)
|
|
266
267
|
options.data.config.download = download;
|
|
267
268
|
printInfo(options);
|
|
@@ -281,9 +282,9 @@ cli.command(
|
|
|
281
282
|
(args) => commonOptions(args).strict().help(),
|
|
282
283
|
async ({ entry }) => {
|
|
283
284
|
for (const entryFile of entry) {
|
|
284
|
-
const data = await
|
|
285
|
-
|
|
286
|
-
await
|
|
285
|
+
const data = await _chunk2BMKFV7Cjs.parser.load(entryFile);
|
|
286
|
+
_chunk2BMKFV7Cjs.parser.prettify(data);
|
|
287
|
+
await _chunk2BMKFV7Cjs.parser.save(data);
|
|
287
288
|
}
|
|
288
289
|
}
|
|
289
290
|
);
|
|
@@ -299,17 +300,17 @@ cli.command(
|
|
|
299
300
|
default: "theme"
|
|
300
301
|
}),
|
|
301
302
|
async ({ entry, dir, theme: themeInput }) => {
|
|
302
|
-
const data = await
|
|
303
|
-
const theme =
|
|
303
|
+
const data = await _chunk2BMKFV7Cjs.parser.load(entry);
|
|
304
|
+
const theme = _chunk2BMKFV7Cjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
304
305
|
if (theme === "none") {
|
|
305
306
|
console.error('Cannot eject theme "none"');
|
|
306
307
|
_process2.default.exit(1);
|
|
307
308
|
}
|
|
308
|
-
if (
|
|
309
|
+
if (_chunk2BMKFV7Cjs.isPath.call(void 0, theme)) {
|
|
309
310
|
console.error("Theme is already ejected");
|
|
310
311
|
_process2.default.exit(1);
|
|
311
312
|
}
|
|
312
|
-
const roots =
|
|
313
|
+
const roots = _chunk2BMKFV7Cjs.getThemeRoots.call(void 0, theme, entry);
|
|
313
314
|
if (!roots.length) {
|
|
314
315
|
console.error(`Could not find theme "${theme}"`);
|
|
315
316
|
_process2.default.exit(1);
|
|
@@ -321,7 +322,7 @@ cli.command(
|
|
|
321
322
|
const dirPath = `./${dir}`;
|
|
322
323
|
data.slides[0].frontmatter.theme = dirPath;
|
|
323
324
|
data.slides[0].raw = null;
|
|
324
|
-
await
|
|
325
|
+
await _chunk2BMKFV7Cjs.parser.save(data);
|
|
325
326
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
326
327
|
}
|
|
327
328
|
);
|
|
@@ -341,8 +342,8 @@ cli.command(
|
|
|
341
342
|
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-MCALG7XD.js"));
|
|
342
343
|
const port = await findFreePort(12445);
|
|
343
344
|
for (const entryFile of entry) {
|
|
344
|
-
const options = await
|
|
345
|
-
const server = await
|
|
345
|
+
const options = await _chunk2BMKFV7Cjs.resolveOptions.call(void 0, { entry: entryFile, theme }, "export");
|
|
346
|
+
const server = await _chunk2BMKFV7Cjs.createServer.call(void 0,
|
|
346
347
|
options,
|
|
347
348
|
{
|
|
348
349
|
server: { port },
|
|
@@ -351,7 +352,7 @@ cli.command(
|
|
|
351
352
|
);
|
|
352
353
|
await server.listen(port);
|
|
353
354
|
printInfo(options);
|
|
354
|
-
|
|
355
|
+
_chunk2BMKFV7Cjs.parser.filterDisabled(options.data);
|
|
355
356
|
const result = await exportSlides({
|
|
356
357
|
port,
|
|
357
358
|
...getExportOptions({ ...args, entry: entryFile }, options)
|
|
@@ -387,8 +388,8 @@ cli.command(
|
|
|
387
388
|
const { exportNotes } = await Promise.resolve().then(() => require("./export-MCALG7XD.js"));
|
|
388
389
|
const port = await findFreePort(12445);
|
|
389
390
|
for (const entryFile of entry) {
|
|
390
|
-
const options = await
|
|
391
|
-
const server = await
|
|
391
|
+
const options = await _chunk2BMKFV7Cjs.resolveOptions.call(void 0, { entry: entryFile }, "export");
|
|
392
|
+
const server = await _chunk2BMKFV7Cjs.createServer.call(void 0,
|
|
392
393
|
options,
|
|
393
394
|
{
|
|
394
395
|
server: { port },
|
|
@@ -397,7 +398,7 @@ cli.command(
|
|
|
397
398
|
);
|
|
398
399
|
await server.listen(port);
|
|
399
400
|
printInfo(options);
|
|
400
|
-
|
|
401
|
+
_chunk2BMKFV7Cjs.parser.filterDisabled(options.data);
|
|
401
402
|
const result = await exportNotes({
|
|
402
403
|
port,
|
|
403
404
|
output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entryFile, ".md")}-export-notes`),
|
|
@@ -458,7 +459,7 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
458
459
|
console.log();
|
|
459
460
|
console.log();
|
|
460
461
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
461
|
-
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${_chunk2BMKFV7Cjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
462
463
|
console.log();
|
|
463
464
|
_parser.verifyConfig.call(void 0, options.data.config, options.data.themeMeta, (v) => console.warn(_kolorist.yellow.call(void 0, ` ! ${v}`)));
|
|
464
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,10 +9,10 @@ import {
|
|
|
9
9
|
resolveOptions,
|
|
10
10
|
resolveThemeName,
|
|
11
11
|
version
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BAK2YZDZ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
require_fast_deep_equal
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IMVZEGBY.mjs";
|
|
16
16
|
import {
|
|
17
17
|
loadSetups
|
|
18
18
|
} from "./chunk-JDHANZ37.mjs";
|
|
@@ -43,7 +43,8 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
43
43
|
"routerMode",
|
|
44
44
|
"fonts",
|
|
45
45
|
"css",
|
|
46
|
-
"mdc"
|
|
46
|
+
"mdc",
|
|
47
|
+
"editor"
|
|
47
48
|
];
|
|
48
49
|
injectPreparserExtensionLoader(async (headmatter, filepath) => {
|
|
49
50
|
const addons = headmatter?.addons ?? [];
|
|
@@ -259,7 +260,7 @@ cli.command(
|
|
|
259
260
|
}).strict().help(),
|
|
260
261
|
async (args) => {
|
|
261
262
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
262
|
-
const { build } = await import("./build-
|
|
263
|
+
const { build } = await import("./build-UUIAUK3H.mjs");
|
|
263
264
|
for (const entryFile of entry) {
|
|
264
265
|
const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
|
|
265
266
|
if (download && !options.data.config.download)
|
package/dist/index.js
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk2BMKFV7Cjs = require('./chunk-2BMKFV7C.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkJ7PXWEZ7js = require('./chunk-J7PXWEZ7.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkDXJWPFLIjs = require('./chunk-DXJWPFLI.js');
|
|
19
19
|
require('./chunk-KKGXM3XL.js');
|
|
20
20
|
require('./chunk-JQHGZJGJ.js');
|
|
21
21
|
require('./chunk-YUG22S6W.js');
|
|
@@ -32,4 +32,4 @@ require('./chunk-YUG22S6W.js');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
exports.ViteSlidevPlugin =
|
|
35
|
+
exports.ViteSlidevPlugin = _chunkDXJWPFLIjs.ViteSlidevPlugin; exports.createServer = _chunk2BMKFV7Cjs.createServer; exports.createWindiCSSPlugin = _chunkJ7PXWEZ7js.createWindiCSSPlugin; exports.getAddonRoots = _chunk2BMKFV7Cjs.getAddonRoots; exports.getCLIRoot = _chunk2BMKFV7Cjs.getCLIRoot; exports.getClientRoot = _chunk2BMKFV7Cjs.getClientRoot; exports.getRoot = _chunk2BMKFV7Cjs.getRoot; exports.getThemeRoots = _chunk2BMKFV7Cjs.getThemeRoots; exports.getUserRoot = _chunk2BMKFV7Cjs.getUserRoot; exports.isPath = _chunk2BMKFV7Cjs.isPath; exports.parser = _chunk2BMKFV7Cjs.parser; exports.resolveOptions = _chunk2BMKFV7Cjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
isPath,
|
|
10
10
|
parser,
|
|
11
11
|
resolveOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BAK2YZDZ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
createWindiCSSPlugin
|
|
15
15
|
} from "./chunk-HO75FTDI.mjs";
|
|
16
16
|
import {
|
|
17
17
|
ViteSlidevPlugin
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IMVZEGBY.mjs";
|
|
19
19
|
import "./chunk-JDHANZ37.mjs";
|
|
20
20
|
import "./chunk-ZEKM4EGL.mjs";
|
|
21
21
|
import "./chunk-QHOBBTS4.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.43.0-beta.
|
|
3
|
+
"version": "0.43.0-beta.5",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@antfu/utils": "^0.7.6",
|
|
46
46
|
"@hedgedoc/markdown-it-plugins": "^2.1.4",
|
|
47
|
-
"@iconify-json/carbon": "^1.1.
|
|
47
|
+
"@iconify-json/carbon": "^1.1.21",
|
|
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.55.
|
|
51
|
+
"@unocss/extractor-mdc": "^0.55.6",
|
|
52
52
|
"@vitejs/plugin-vue": "^4.3.4",
|
|
53
53
|
"@vitejs/plugin-vue-jsx": "^3.0.2",
|
|
54
54
|
"@windicss/config": "^1.9.1",
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
"markdown-it": "^13.0.1",
|
|
72
72
|
"markdown-it-footnote": "^3.0.3",
|
|
73
73
|
"markdown-it-link-attributes": "^4.0.1",
|
|
74
|
+
"markdown-it-mdc": "^0.1.2",
|
|
74
75
|
"monaco-editor": "^0.37.1",
|
|
75
76
|
"nanoid": "^4.0.2",
|
|
76
77
|
"open": "^8.4.1",
|
|
@@ -83,8 +84,8 @@
|
|
|
83
84
|
"resolve-from": "^5.0.0",
|
|
84
85
|
"resolve-global": "^1.0.0",
|
|
85
86
|
"shiki": "npm:shikiji-compat@^0.6.6",
|
|
86
|
-
"unocss": "^0.55.
|
|
87
|
-
"unplugin-icons": "^0.
|
|
87
|
+
"unocss": "^0.55.6",
|
|
88
|
+
"unplugin-icons": "^0.17.0",
|
|
88
89
|
"unplugin-vue-components": "^0.25.2",
|
|
89
90
|
"unplugin-vue-markdown": "^0.24.3",
|
|
90
91
|
"uqr": "^0.1.2",
|
|
@@ -97,15 +98,14 @@
|
|
|
97
98
|
"vue": "^3.3.4",
|
|
98
99
|
"windicss": "^3.5.6",
|
|
99
100
|
"yargs": "^17.7.2",
|
|
100
|
-
"@slidev/client": "0.43.0-beta.
|
|
101
|
-
"@slidev/parser": "0.43.0-beta.
|
|
102
|
-
"@slidev/types": "0.43.0-beta.
|
|
101
|
+
"@slidev/client": "0.43.0-beta.5",
|
|
102
|
+
"@slidev/parser": "0.43.0-beta.5",
|
|
103
|
+
"@slidev/types": "0.43.0-beta.5"
|
|
103
104
|
},
|
|
104
105
|
"devDependencies": {
|
|
105
106
|
"@types/plantuml-encoder": "^1.4.0",
|
|
106
107
|
"fast-deep-equal": "^3.1.3",
|
|
107
108
|
"local-pkg": "^0.4.3",
|
|
108
|
-
"markdown-it-mdc": "^0.0.4",
|
|
109
109
|
"semver": "^7.5.4",
|
|
110
110
|
"sirv": "^2.0.3"
|
|
111
111
|
},
|