@slidev/cli 0.40.1 → 0.40.2
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.
|
@@ -2400,7 +2400,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2400
2400
|
import * as parser from "@slidev/parser/fs";
|
|
2401
2401
|
|
|
2402
2402
|
// package.json
|
|
2403
|
-
var version = "0.40.
|
|
2403
|
+
var version = "0.40.2";
|
|
2404
2404
|
|
|
2405
2405
|
// node/themes.ts
|
|
2406
2406
|
import prompts2 from "prompts";
|
|
@@ -2400,7 +2400,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2400
2400
|
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
2401
2401
|
|
|
2402
2402
|
// package.json
|
|
2403
|
-
var version = "0.40.
|
|
2403
|
+
var version = "0.40.2";
|
|
2404
2404
|
|
|
2405
2405
|
// node/themes.ts
|
|
2406
2406
|
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 _chunkRRNUXVEAjs = require('./chunk-RRNUXVEA.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -43,14 +43,14 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
43
43
|
_fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) => {
|
|
44
44
|
const addons = _nullishCoalesce((headmatter == null ? void 0 : headmatter.addons), () => ( []));
|
|
45
45
|
const roots = [
|
|
46
|
-
|
|
47
|
-
...
|
|
48
|
-
|
|
46
|
+
_chunkRRNUXVEAjs.getUserRoot.call(void 0, {}).userRoot,
|
|
47
|
+
..._chunkRRNUXVEAjs.getAddonRoots.call(void 0, addons, ""),
|
|
48
|
+
_chunkRRNUXVEAjs.getClientRoot.call(void 0, )
|
|
49
49
|
];
|
|
50
50
|
const mergeArrays = (a, b) => a.concat(b);
|
|
51
51
|
return await _chunkQU6XIJOBjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
|
|
52
52
|
});
|
|
53
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
53
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkRRNUXVEAjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
54
54
|
cli.command(
|
|
55
55
|
"* [entry]",
|
|
56
56
|
"Start a local server for Slidev",
|
|
@@ -106,9 +106,9 @@ cli.command(
|
|
|
106
106
|
async function initServer() {
|
|
107
107
|
if (server)
|
|
108
108
|
await server.close();
|
|
109
|
-
const options = await
|
|
109
|
+
const options = await _chunkRRNUXVEAjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
110
110
|
port = userPort || await findFreePort(3030);
|
|
111
|
-
server = await
|
|
111
|
+
server = await _chunkRRNUXVEAjs.createServer.call(void 0,
|
|
112
112
|
options,
|
|
113
113
|
{
|
|
114
114
|
server: {
|
|
@@ -122,7 +122,7 @@ cli.command(
|
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
onDataReload(newData, data) {
|
|
125
|
-
if (!theme &&
|
|
125
|
+
if (!theme && _chunkRRNUXVEAjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkRRNUXVEAjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
126
126
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
127
127
|
initServer();
|
|
128
128
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -241,7 +241,7 @@ cli.command(
|
|
|
241
241
|
async (args) => {
|
|
242
242
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
243
243
|
const { build } = await Promise.resolve().then(() => require("./build-L4S5TZG4.js"));
|
|
244
|
-
const options = await
|
|
244
|
+
const options = await _chunkRRNUXVEAjs.resolveOptions.call(void 0, { entry, theme, inspect }, "build");
|
|
245
245
|
if (download && !options.data.config.download)
|
|
246
246
|
options.data.config.download = download;
|
|
247
247
|
printInfo(options);
|
|
@@ -259,9 +259,9 @@ cli.command(
|
|
|
259
259
|
"Format the markdown file",
|
|
260
260
|
(args) => commonOptions(args).strict().help(),
|
|
261
261
|
async ({ entry }) => {
|
|
262
|
-
const data = await
|
|
263
|
-
|
|
264
|
-
await
|
|
262
|
+
const data = await _chunkRRNUXVEAjs.parser.load(entry);
|
|
263
|
+
_chunkRRNUXVEAjs.parser.prettify(data);
|
|
264
|
+
await _chunkRRNUXVEAjs.parser.save(data);
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
267
|
cli.command(
|
|
@@ -276,17 +276,17 @@ cli.command(
|
|
|
276
276
|
default: "theme"
|
|
277
277
|
}),
|
|
278
278
|
async ({ entry, dir, theme: themeInput }) => {
|
|
279
|
-
const data = await
|
|
280
|
-
const theme =
|
|
279
|
+
const data = await _chunkRRNUXVEAjs.parser.load(entry);
|
|
280
|
+
const theme = _chunkRRNUXVEAjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
281
281
|
if (theme === "none") {
|
|
282
282
|
console.error('Cannot eject theme "none"');
|
|
283
283
|
process.exit(1);
|
|
284
284
|
}
|
|
285
|
-
if (
|
|
285
|
+
if (_chunkRRNUXVEAjs.isPath.call(void 0, theme)) {
|
|
286
286
|
console.error("Theme is already ejected");
|
|
287
287
|
process.exit(1);
|
|
288
288
|
}
|
|
289
|
-
const roots =
|
|
289
|
+
const roots = _chunkRRNUXVEAjs.getThemeRoots.call(void 0, theme, entry);
|
|
290
290
|
if (!roots.length) {
|
|
291
291
|
console.error(`Could not find theme "${theme}"`);
|
|
292
292
|
process.exit(1);
|
|
@@ -298,7 +298,7 @@ cli.command(
|
|
|
298
298
|
const dirPath = `./${dir}`;
|
|
299
299
|
data.slides[0].frontmatter.theme = dirPath;
|
|
300
300
|
data.slides[0].raw = null;
|
|
301
|
-
await
|
|
301
|
+
await _chunkRRNUXVEAjs.parser.save(data);
|
|
302
302
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
303
303
|
}
|
|
304
304
|
);
|
|
@@ -317,8 +317,8 @@ cli.command(
|
|
|
317
317
|
process.env.NODE_ENV = "production";
|
|
318
318
|
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-BRPXINGP.js"));
|
|
319
319
|
const port = await findFreePort(12445);
|
|
320
|
-
const options = await
|
|
321
|
-
const server = await
|
|
320
|
+
const options = await _chunkRRNUXVEAjs.resolveOptions.call(void 0, { entry, theme }, "export");
|
|
321
|
+
const server = await _chunkRRNUXVEAjs.createServer.call(void 0,
|
|
322
322
|
options,
|
|
323
323
|
{
|
|
324
324
|
server: { port },
|
|
@@ -327,7 +327,7 @@ cli.command(
|
|
|
327
327
|
);
|
|
328
328
|
await server.listen(port);
|
|
329
329
|
printInfo(options);
|
|
330
|
-
|
|
330
|
+
_chunkRRNUXVEAjs.parser.filterDisabled(options.data);
|
|
331
331
|
const output = await exportSlides({
|
|
332
332
|
port,
|
|
333
333
|
...getExportOptions(args, options)
|
|
@@ -361,10 +361,10 @@ cli.command(
|
|
|
361
361
|
process.env.NODE_ENV = "production";
|
|
362
362
|
const { exportNotes } = await Promise.resolve().then(() => require("./export-BRPXINGP.js"));
|
|
363
363
|
const port = await findFreePort(12445);
|
|
364
|
-
const options = await
|
|
364
|
+
const options = await _chunkRRNUXVEAjs.resolveOptions.call(void 0, { entry }, "export");
|
|
365
365
|
if (!output)
|
|
366
366
|
output = options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entry, ".md")}-export-notes`;
|
|
367
|
-
const server = await
|
|
367
|
+
const server = await _chunkRRNUXVEAjs.createServer.call(void 0,
|
|
368
368
|
options,
|
|
369
369
|
{
|
|
370
370
|
server: { port },
|
|
@@ -373,7 +373,7 @@ cli.command(
|
|
|
373
373
|
);
|
|
374
374
|
await server.listen(port);
|
|
375
375
|
printInfo(options);
|
|
376
|
-
|
|
376
|
+
_chunkRRNUXVEAjs.parser.filterDisabled(options.data);
|
|
377
377
|
output = await exportNotes({
|
|
378
378
|
port,
|
|
379
379
|
output,
|
|
@@ -433,7 +433,7 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
433
433
|
console.log();
|
|
434
434
|
console.log();
|
|
435
435
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
436
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
436
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkRRNUXVEAjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
437
437
|
console.log();
|
|
438
438
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
439
439
|
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 _chunkRRNUXVEAjs = require('./chunk-RRNUXVEA.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -28,4 +28,4 @@ require('./chunk-UJ5GHVII.js');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
exports.ViteSlidevPlugin = _chunkQU6XIJOBjs.ViteSlidevPlugin; exports.createServer =
|
|
31
|
+
exports.ViteSlidevPlugin = _chunkQU6XIJOBjs.ViteSlidevPlugin; exports.createServer = _chunkRRNUXVEAjs.createServer; exports.createWindiCSSPlugin = _chunkQU6XIJOBjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkRRNUXVEAjs.getAddonRoots; exports.getCLIRoot = _chunkRRNUXVEAjs.getCLIRoot; exports.getClientRoot = _chunkRRNUXVEAjs.getClientRoot; exports.getRoot = _chunkRRNUXVEAjs.getRoot; exports.getThemeRoots = _chunkRRNUXVEAjs.getThemeRoots; exports.getUserRoot = _chunkRRNUXVEAjs.getUserRoot; exports.isPath = _chunkRRNUXVEAjs.isPath; exports.parser = _chunkRRNUXVEAjs.parser; exports.resolveOptions = _chunkRRNUXVEAjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.2",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -93,9 +93,9 @@
|
|
|
93
93
|
"vue": "^3.2.47",
|
|
94
94
|
"windicss": "^3.5.6",
|
|
95
95
|
"yargs": "^17.6.2",
|
|
96
|
-
"@slidev/client": "0.40.
|
|
97
|
-
"@slidev/parser": "0.40.
|
|
98
|
-
"@slidev/types": "0.40.
|
|
96
|
+
"@slidev/client": "0.40.2",
|
|
97
|
+
"@slidev/parser": "0.40.2",
|
|
98
|
+
"@slidev/types": "0.40.2"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@types/plantuml-encoder": "^1.4.0",
|