@slidev/cli 0.41.0 → 0.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2452,7 +2452,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2452
2452
|
import * as parser from "@slidev/parser/fs";
|
|
2453
2453
|
|
|
2454
2454
|
// package.json
|
|
2455
|
-
var version = "0.41.
|
|
2455
|
+
var version = "0.41.1";
|
|
2456
2456
|
|
|
2457
2457
|
// node/themes.ts
|
|
2458
2458
|
import prompts2 from "prompts";
|
|
@@ -2452,7 +2452,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2452
2452
|
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
2453
2453
|
|
|
2454
2454
|
// package.json
|
|
2455
|
-
var version = "0.41.
|
|
2455
|
+
var version = "0.41.1";
|
|
2456
2456
|
|
|
2457
2457
|
// node/themes.ts
|
|
2458
2458
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkOM6HSZVYjs = require('./chunk-OM6HSZVY.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -45,15 +45,15 @@ _fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) =>
|
|
|
45
45
|
const roots = (
|
|
46
46
|
/* uniq */
|
|
47
47
|
[
|
|
48
|
-
|
|
49
|
-
...
|
|
50
|
-
|
|
48
|
+
_chunkOM6HSZVYjs.getUserRoot.call(void 0, {}).userRoot,
|
|
49
|
+
..._chunkOM6HSZVYjs.getAddonRoots.call(void 0, addons, ""),
|
|
50
|
+
_chunkOM6HSZVYjs.getClientRoot.call(void 0, )
|
|
51
51
|
]
|
|
52
52
|
);
|
|
53
53
|
const mergeArrays = (a, b) => a.concat(b);
|
|
54
54
|
return await _chunkUJUM4LW4js.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
|
|
55
55
|
});
|
|
56
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
56
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkOM6HSZVYjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
57
57
|
cli.command(
|
|
58
58
|
"* [entry]",
|
|
59
59
|
"Start a local server for Slidev",
|
|
@@ -109,9 +109,9 @@ cli.command(
|
|
|
109
109
|
async function initServer() {
|
|
110
110
|
if (server)
|
|
111
111
|
await server.close();
|
|
112
|
-
const options = await
|
|
112
|
+
const options = await _chunkOM6HSZVYjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
113
113
|
port = userPort || await findFreePort(3030);
|
|
114
|
-
server = await
|
|
114
|
+
server = await _chunkOM6HSZVYjs.createServer.call(void 0,
|
|
115
115
|
options,
|
|
116
116
|
{
|
|
117
117
|
server: {
|
|
@@ -125,7 +125,7 @@ cli.command(
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
onDataReload(newData, data) {
|
|
128
|
-
if (!theme &&
|
|
128
|
+
if (!theme && _chunkOM6HSZVYjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkOM6HSZVYjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
129
129
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
130
130
|
initServer();
|
|
131
131
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -245,7 +245,7 @@ cli.command(
|
|
|
245
245
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
246
246
|
const { build } = await Promise.resolve().then(() => require("./build-3GLTTQXV.js"));
|
|
247
247
|
for (const entryFile of entry) {
|
|
248
|
-
const options = await
|
|
248
|
+
const options = await _chunkOM6HSZVYjs.resolveOptions.call(void 0, { entry: entryFile, theme, inspect }, "build");
|
|
249
249
|
if (download && !options.data.config.download)
|
|
250
250
|
options.data.config.download = download;
|
|
251
251
|
printInfo(options);
|
|
@@ -265,9 +265,9 @@ cli.command(
|
|
|
265
265
|
(args) => commonOptions(args).strict().help(),
|
|
266
266
|
async ({ entry }) => {
|
|
267
267
|
for (const entryFile of entry) {
|
|
268
|
-
const data = await
|
|
269
|
-
|
|
270
|
-
await
|
|
268
|
+
const data = await _chunkOM6HSZVYjs.parser.load(entryFile);
|
|
269
|
+
_chunkOM6HSZVYjs.parser.prettify(data);
|
|
270
|
+
await _chunkOM6HSZVYjs.parser.save(data);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
);
|
|
@@ -283,17 +283,17 @@ cli.command(
|
|
|
283
283
|
default: "theme"
|
|
284
284
|
}),
|
|
285
285
|
async ({ entry, dir, theme: themeInput }) => {
|
|
286
|
-
const data = await
|
|
287
|
-
const theme =
|
|
286
|
+
const data = await _chunkOM6HSZVYjs.parser.load(entry);
|
|
287
|
+
const theme = _chunkOM6HSZVYjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
288
288
|
if (theme === "none") {
|
|
289
289
|
console.error('Cannot eject theme "none"');
|
|
290
290
|
process.exit(1);
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
292
|
+
if (_chunkOM6HSZVYjs.isPath.call(void 0, theme)) {
|
|
293
293
|
console.error("Theme is already ejected");
|
|
294
294
|
process.exit(1);
|
|
295
295
|
}
|
|
296
|
-
const roots =
|
|
296
|
+
const roots = _chunkOM6HSZVYjs.getThemeRoots.call(void 0, theme, entry);
|
|
297
297
|
if (!roots.length) {
|
|
298
298
|
console.error(`Could not find theme "${theme}"`);
|
|
299
299
|
process.exit(1);
|
|
@@ -305,7 +305,7 @@ cli.command(
|
|
|
305
305
|
const dirPath = `./${dir}`;
|
|
306
306
|
data.slides[0].frontmatter.theme = dirPath;
|
|
307
307
|
data.slides[0].raw = null;
|
|
308
|
-
await
|
|
308
|
+
await _chunkOM6HSZVYjs.parser.save(data);
|
|
309
309
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
310
310
|
}
|
|
311
311
|
);
|
|
@@ -325,8 +325,8 @@ cli.command(
|
|
|
325
325
|
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-GTPZJWVE.js"));
|
|
326
326
|
const port = await findFreePort(12445);
|
|
327
327
|
for (const entryFile of entry) {
|
|
328
|
-
const options = await
|
|
329
|
-
const server = await
|
|
328
|
+
const options = await _chunkOM6HSZVYjs.resolveOptions.call(void 0, { entry: entryFile, theme }, "export");
|
|
329
|
+
const server = await _chunkOM6HSZVYjs.createServer.call(void 0,
|
|
330
330
|
options,
|
|
331
331
|
{
|
|
332
332
|
server: { port },
|
|
@@ -335,7 +335,7 @@ cli.command(
|
|
|
335
335
|
);
|
|
336
336
|
await server.listen(port);
|
|
337
337
|
printInfo(options);
|
|
338
|
-
|
|
338
|
+
_chunkOM6HSZVYjs.parser.filterDisabled(options.data);
|
|
339
339
|
const result = await exportSlides({
|
|
340
340
|
port,
|
|
341
341
|
...getExportOptions({ ...args, entry: entryFile }, options)
|
|
@@ -371,8 +371,8 @@ cli.command(
|
|
|
371
371
|
const { exportNotes } = await Promise.resolve().then(() => require("./export-GTPZJWVE.js"));
|
|
372
372
|
const port = await findFreePort(12445);
|
|
373
373
|
for (const entryFile of entry) {
|
|
374
|
-
const options = await
|
|
375
|
-
const server = await
|
|
374
|
+
const options = await _chunkOM6HSZVYjs.resolveOptions.call(void 0, { entry: entryFile }, "export");
|
|
375
|
+
const server = await _chunkOM6HSZVYjs.createServer.call(void 0,
|
|
376
376
|
options,
|
|
377
377
|
{
|
|
378
378
|
server: { port },
|
|
@@ -381,7 +381,7 @@ cli.command(
|
|
|
381
381
|
);
|
|
382
382
|
await server.listen(port);
|
|
383
383
|
printInfo(options);
|
|
384
|
-
|
|
384
|
+
_chunkOM6HSZVYjs.parser.filterDisabled(options.data);
|
|
385
385
|
const result = await exportNotes({
|
|
386
386
|
port,
|
|
387
387
|
output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entryFile, ".md")}-export-notes`),
|
|
@@ -442,7 +442,7 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
442
442
|
console.log();
|
|
443
443
|
console.log();
|
|
444
444
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
445
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
445
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkOM6HSZVYjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
446
446
|
console.log();
|
|
447
447
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
448
448
|
console.log(_kolorist.dim.call(void 0, " entry ") + _kolorist.dim.call(void 0, _path2.default.dirname(options.entry) + _path2.default.sep) + _path2.default.basename(options.entry));
|
package/dist/cli.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkOM6HSZVYjs = require('./chunk-OM6HSZVY.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -28,4 +28,4 @@ require('./chunk-GE7W2DBE.js');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
exports.ViteSlidevPlugin = _chunkUJUM4LW4js.ViteSlidevPlugin; exports.createServer =
|
|
31
|
+
exports.ViteSlidevPlugin = _chunkUJUM4LW4js.ViteSlidevPlugin; exports.createServer = _chunkOM6HSZVYjs.createServer; exports.createWindiCSSPlugin = _chunkUJUM4LW4js.createWindiCSSPlugin; exports.getAddonRoots = _chunkOM6HSZVYjs.getAddonRoots; exports.getCLIRoot = _chunkOM6HSZVYjs.getCLIRoot; exports.getClientRoot = _chunkOM6HSZVYjs.getClientRoot; exports.getRoot = _chunkOM6HSZVYjs.getRoot; exports.getThemeRoots = _chunkOM6HSZVYjs.getThemeRoots; exports.getUserRoot = _chunkOM6HSZVYjs.getUserRoot; exports.isPath = _chunkOM6HSZVYjs.isPath; exports.parser = _chunkOM6HSZVYjs.parser; exports.resolveOptions = _chunkOM6HSZVYjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.1",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -94,9 +94,9 @@
|
|
|
94
94
|
"vue": "^3.3.2",
|
|
95
95
|
"windicss": "^3.5.6",
|
|
96
96
|
"yargs": "^17.7.2",
|
|
97
|
-
"@slidev/client": "0.41.
|
|
98
|
-
"@slidev/parser": "0.41.
|
|
99
|
-
"@slidev/types": "0.41.
|
|
97
|
+
"@slidev/client": "0.41.1",
|
|
98
|
+
"@slidev/parser": "0.41.1",
|
|
99
|
+
"@slidev/types": "0.41.1"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@types/plantuml-encoder": "^1.4.0",
|