@slidev/cli 0.43.0-beta.0 → 0.43.0-beta.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.
|
@@ -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.0-beta.
|
|
2522
|
+
var version = "0.43.0-beta.1";
|
|
2523
2523
|
|
|
2524
2524
|
// node/themes.ts
|
|
2525
2525
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
@@ -7640,7 +7640,7 @@ async function getRecursivePlugins(addons, depth) {
|
|
|
7640
7640
|
return addonsArray.flat();
|
|
7641
7641
|
}
|
|
7642
7642
|
async function checkEngine(name, engines) {
|
|
7643
|
-
if (engines.slidev && !(0, import_semver.satisfies)(version, engines.slidev))
|
|
7643
|
+
if (engines.slidev && !(0, import_semver.satisfies)(version, engines.slidev, { includePrerelease: true }))
|
|
7644
7644
|
throw new Error(`[slidev] addon "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
7645
7645
|
}
|
|
7646
7646
|
function resolvePluginName(name) {
|
|
@@ -7756,7 +7756,7 @@ async function getThemeMeta(name, path2) {
|
|
|
7756
7756
|
return {};
|
|
7757
7757
|
if (path2) {
|
|
7758
7758
|
const { slidev = {}, engines = {} } = await _fsextra2.default.readJSON(path2);
|
|
7759
|
-
if (engines.slidev && !(0, import_semver2.satisfies)(version, engines.slidev))
|
|
7759
|
+
if (engines.slidev && !(0, import_semver2.satisfies)(version, engines.slidev, { includePrerelease: true }))
|
|
7760
7760
|
throw new Error(`[slidev] theme "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
7761
7761
|
return slidev;
|
|
7762
7762
|
}
|
|
@@ -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.0-beta.
|
|
2522
|
+
var version = "0.43.0-beta.1";
|
|
2523
2523
|
|
|
2524
2524
|
// node/themes.ts
|
|
2525
2525
|
import prompts2 from "prompts";
|
|
@@ -7630,7 +7630,7 @@ async function getRecursivePlugins(addons, depth) {
|
|
|
7630
7630
|
return addonsArray.flat();
|
|
7631
7631
|
}
|
|
7632
7632
|
async function checkEngine(name, engines) {
|
|
7633
|
-
if (engines.slidev && !(0, import_semver.satisfies)(version, engines.slidev))
|
|
7633
|
+
if (engines.slidev && !(0, import_semver.satisfies)(version, engines.slidev, { includePrerelease: true }))
|
|
7634
7634
|
throw new Error(`[slidev] addon "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
7635
7635
|
}
|
|
7636
7636
|
function resolvePluginName(name) {
|
|
@@ -7746,7 +7746,7 @@ async function getThemeMeta(name, path2) {
|
|
|
7746
7746
|
return {};
|
|
7747
7747
|
if (path2) {
|
|
7748
7748
|
const { slidev = {}, engines = {} } = await fs3.readJSON(path2);
|
|
7749
|
-
if (engines.slidev && !(0, import_semver2.satisfies)(version, engines.slidev))
|
|
7749
|
+
if (engines.slidev && !(0, import_semver2.satisfies)(version, engines.slidev, { includePrerelease: true }))
|
|
7750
7750
|
throw new Error(`[slidev] theme "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
7751
7751
|
return slidev;
|
|
7752
7752
|
}
|
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkCJW2UL6Kjs = require('./chunk-CJW2UL6K.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkROTHRPSWjs = require('./chunk-ROTHRPSW.js');
|
|
@@ -50,15 +50,15 @@ _fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) =>
|
|
|
50
50
|
const roots = (
|
|
51
51
|
/* uniq */
|
|
52
52
|
[
|
|
53
|
-
|
|
54
|
-
...
|
|
55
|
-
|
|
53
|
+
_chunkCJW2UL6Kjs.getUserRoot.call(void 0, {}).userRoot,
|
|
54
|
+
..._chunkCJW2UL6Kjs.getAddonRoots.call(void 0, addons, ""),
|
|
55
|
+
_chunkCJW2UL6Kjs.getClientRoot.call(void 0, )
|
|
56
56
|
]
|
|
57
57
|
);
|
|
58
58
|
const mergeArrays = (a, b) => a.concat(b);
|
|
59
59
|
return await _chunkKKGXM3XLjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
|
|
60
60
|
});
|
|
61
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
61
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkCJW2UL6Kjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
62
62
|
cli.command(
|
|
63
63
|
"* [entry]",
|
|
64
64
|
"Start a local server for Slidev",
|
|
@@ -114,9 +114,9 @@ cli.command(
|
|
|
114
114
|
async function initServer() {
|
|
115
115
|
if (server)
|
|
116
116
|
await server.close();
|
|
117
|
-
const options = await
|
|
117
|
+
const options = await _chunkCJW2UL6Kjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
118
118
|
port = userPort || await findFreePort(3030);
|
|
119
|
-
server = await
|
|
119
|
+
server = await _chunkCJW2UL6Kjs.createServer.call(void 0,
|
|
120
120
|
options,
|
|
121
121
|
{
|
|
122
122
|
server: {
|
|
@@ -130,7 +130,7 @@ cli.command(
|
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
132
|
onDataReload(newData, data) {
|
|
133
|
-
if (!theme &&
|
|
133
|
+
if (!theme && _chunkCJW2UL6Kjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkCJW2UL6Kjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
134
134
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
135
135
|
initServer();
|
|
136
136
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -261,7 +261,7 @@ cli.command(
|
|
|
261
261
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
262
262
|
const { build } = await Promise.resolve().then(() => require("./build-J2XECXHU.js"));
|
|
263
263
|
for (const entryFile of entry) {
|
|
264
|
-
const options = await
|
|
264
|
+
const options = await _chunkCJW2UL6Kjs.resolveOptions.call(void 0, { entry: entryFile, theme, inspect }, "build");
|
|
265
265
|
if (download && !options.data.config.download)
|
|
266
266
|
options.data.config.download = download;
|
|
267
267
|
printInfo(options);
|
|
@@ -281,9 +281,9 @@ cli.command(
|
|
|
281
281
|
(args) => commonOptions(args).strict().help(),
|
|
282
282
|
async ({ entry }) => {
|
|
283
283
|
for (const entryFile of entry) {
|
|
284
|
-
const data = await
|
|
285
|
-
|
|
286
|
-
await
|
|
284
|
+
const data = await _chunkCJW2UL6Kjs.parser.load(entryFile);
|
|
285
|
+
_chunkCJW2UL6Kjs.parser.prettify(data);
|
|
286
|
+
await _chunkCJW2UL6Kjs.parser.save(data);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
);
|
|
@@ -299,17 +299,17 @@ cli.command(
|
|
|
299
299
|
default: "theme"
|
|
300
300
|
}),
|
|
301
301
|
async ({ entry, dir, theme: themeInput }) => {
|
|
302
|
-
const data = await
|
|
303
|
-
const theme =
|
|
302
|
+
const data = await _chunkCJW2UL6Kjs.parser.load(entry);
|
|
303
|
+
const theme = _chunkCJW2UL6Kjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
304
304
|
if (theme === "none") {
|
|
305
305
|
console.error('Cannot eject theme "none"');
|
|
306
306
|
_process2.default.exit(1);
|
|
307
307
|
}
|
|
308
|
-
if (
|
|
308
|
+
if (_chunkCJW2UL6Kjs.isPath.call(void 0, theme)) {
|
|
309
309
|
console.error("Theme is already ejected");
|
|
310
310
|
_process2.default.exit(1);
|
|
311
311
|
}
|
|
312
|
-
const roots =
|
|
312
|
+
const roots = _chunkCJW2UL6Kjs.getThemeRoots.call(void 0, theme, entry);
|
|
313
313
|
if (!roots.length) {
|
|
314
314
|
console.error(`Could not find theme "${theme}"`);
|
|
315
315
|
_process2.default.exit(1);
|
|
@@ -321,7 +321,7 @@ cli.command(
|
|
|
321
321
|
const dirPath = `./${dir}`;
|
|
322
322
|
data.slides[0].frontmatter.theme = dirPath;
|
|
323
323
|
data.slides[0].raw = null;
|
|
324
|
-
await
|
|
324
|
+
await _chunkCJW2UL6Kjs.parser.save(data);
|
|
325
325
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
326
326
|
}
|
|
327
327
|
);
|
|
@@ -341,8 +341,8 @@ cli.command(
|
|
|
341
341
|
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-MCALG7XD.js"));
|
|
342
342
|
const port = await findFreePort(12445);
|
|
343
343
|
for (const entryFile of entry) {
|
|
344
|
-
const options = await
|
|
345
|
-
const server = await
|
|
344
|
+
const options = await _chunkCJW2UL6Kjs.resolveOptions.call(void 0, { entry: entryFile, theme }, "export");
|
|
345
|
+
const server = await _chunkCJW2UL6Kjs.createServer.call(void 0,
|
|
346
346
|
options,
|
|
347
347
|
{
|
|
348
348
|
server: { port },
|
|
@@ -351,7 +351,7 @@ cli.command(
|
|
|
351
351
|
);
|
|
352
352
|
await server.listen(port);
|
|
353
353
|
printInfo(options);
|
|
354
|
-
|
|
354
|
+
_chunkCJW2UL6Kjs.parser.filterDisabled(options.data);
|
|
355
355
|
const result = await exportSlides({
|
|
356
356
|
port,
|
|
357
357
|
...getExportOptions({ ...args, entry: entryFile }, options)
|
|
@@ -387,8 +387,8 @@ cli.command(
|
|
|
387
387
|
const { exportNotes } = await Promise.resolve().then(() => require("./export-MCALG7XD.js"));
|
|
388
388
|
const port = await findFreePort(12445);
|
|
389
389
|
for (const entryFile of entry) {
|
|
390
|
-
const options = await
|
|
391
|
-
const server = await
|
|
390
|
+
const options = await _chunkCJW2UL6Kjs.resolveOptions.call(void 0, { entry: entryFile }, "export");
|
|
391
|
+
const server = await _chunkCJW2UL6Kjs.createServer.call(void 0,
|
|
392
392
|
options,
|
|
393
393
|
{
|
|
394
394
|
server: { port },
|
|
@@ -397,7 +397,7 @@ cli.command(
|
|
|
397
397
|
);
|
|
398
398
|
await server.listen(port);
|
|
399
399
|
printInfo(options);
|
|
400
|
-
|
|
400
|
+
_chunkCJW2UL6Kjs.parser.filterDisabled(options.data);
|
|
401
401
|
const result = await exportNotes({
|
|
402
402
|
port,
|
|
403
403
|
output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entryFile, ".md")}-export-notes`),
|
|
@@ -458,7 +458,7 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
458
458
|
console.log();
|
|
459
459
|
console.log();
|
|
460
460
|
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${
|
|
461
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkCJW2UL6Kjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
462
462
|
console.log();
|
|
463
463
|
_parser.verifyConfig.call(void 0, options.data.config, options.data.themeMeta, (v) => console.warn(_kolorist.yellow.call(void 0, ` ! ${v}`)));
|
|
464
464
|
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
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkCJW2UL6Kjs = require('./chunk-CJW2UL6K.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkJ7PXWEZ7js = require('./chunk-J7PXWEZ7.js');
|
|
@@ -32,4 +32,4 @@ require('./chunk-YUG22S6W.js');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
exports.ViteSlidevPlugin = _chunkROTHRPSWjs.ViteSlidevPlugin; exports.createServer =
|
|
35
|
+
exports.ViteSlidevPlugin = _chunkROTHRPSWjs.ViteSlidevPlugin; exports.createServer = _chunkCJW2UL6Kjs.createServer; exports.createWindiCSSPlugin = _chunkJ7PXWEZ7js.createWindiCSSPlugin; exports.getAddonRoots = _chunkCJW2UL6Kjs.getAddonRoots; exports.getCLIRoot = _chunkCJW2UL6Kjs.getCLIRoot; exports.getClientRoot = _chunkCJW2UL6Kjs.getClientRoot; exports.getRoot = _chunkCJW2UL6Kjs.getRoot; exports.getThemeRoots = _chunkCJW2UL6Kjs.getThemeRoots; exports.getUserRoot = _chunkCJW2UL6Kjs.getUserRoot; exports.isPath = _chunkCJW2UL6Kjs.isPath; exports.parser = _chunkCJW2UL6Kjs.parser; exports.resolveOptions = _chunkCJW2UL6Kjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
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.1",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -96,9 +96,9 @@
|
|
|
96
96
|
"vue": "^3.3.4",
|
|
97
97
|
"windicss": "^3.5.6",
|
|
98
98
|
"yargs": "^17.7.2",
|
|
99
|
-
"@slidev/client": "0.43.0-beta.
|
|
100
|
-
"@slidev/parser": "0.43.0-beta.
|
|
101
|
-
"@slidev/types": "0.43.0-beta.
|
|
99
|
+
"@slidev/client": "0.43.0-beta.1",
|
|
100
|
+
"@slidev/parser": "0.43.0-beta.1",
|
|
101
|
+
"@slidev/types": "0.43.0-beta.1"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
104
|
"@types/plantuml-encoder": "^1.4.0",
|