@slidev/cli 0.35.1 → 0.35.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.
|
@@ -2398,7 +2398,7 @@ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
|
2398
2398
|
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
2399
2399
|
|
|
2400
2400
|
// package.json
|
|
2401
|
-
var version = "0.35.
|
|
2401
|
+
var version = "0.35.2";
|
|
2402
2402
|
|
|
2403
2403
|
// node/themes.ts
|
|
2404
2404
|
_chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkOIH6DIQ4js = require('./chunk-OIH6DIQ4.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkGH4JJSLKjs = require('./chunk-GH4JJSLK.js');
|
|
@@ -38,7 +38,7 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
38
38
|
"fonts",
|
|
39
39
|
"css"
|
|
40
40
|
];
|
|
41
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
41
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkOIH6DIQ4js.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
42
42
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
43
43
|
alias: "p",
|
|
44
44
|
type: "number",
|
|
@@ -81,9 +81,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
81
81
|
async function initServer() {
|
|
82
82
|
if (server)
|
|
83
83
|
await server.close();
|
|
84
|
-
const options = await
|
|
84
|
+
const options = await _chunkOIH6DIQ4js.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
|
|
85
85
|
port = userPort || await findFreePort(3030);
|
|
86
|
-
server = await
|
|
86
|
+
server = await _chunkOIH6DIQ4js.createServer.call(void 0, options, {
|
|
87
87
|
server: {
|
|
88
88
|
port,
|
|
89
89
|
strictPort: true,
|
|
@@ -94,7 +94,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
94
94
|
logLevel: log
|
|
95
95
|
}, {
|
|
96
96
|
onDataReload(newData, data) {
|
|
97
|
-
if (!theme &&
|
|
97
|
+
if (!theme && _chunkOIH6DIQ4js.resolveThemeName.call(void 0, newData.config.theme) !== _chunkOIH6DIQ4js.resolveThemeName.call(void 0, data.config.theme)) {
|
|
98
98
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
99
99
|
initServer();
|
|
100
100
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -171,7 +171,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
171
171
|
describe: "allow download as PDF"
|
|
172
172
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
173
173
|
const { build } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./build-Z26FNYJ3.js")));
|
|
174
|
-
const options = await
|
|
174
|
+
const options = await _chunkOIH6DIQ4js.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
175
175
|
if (download && !options.data.config.download)
|
|
176
176
|
options.data.config.download = download;
|
|
177
177
|
printInfo(options);
|
|
@@ -184,26 +184,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
184
184
|
});
|
|
185
185
|
});
|
|
186
186
|
cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
|
|
187
|
-
const data = await
|
|
188
|
-
|
|
189
|
-
await
|
|
187
|
+
const data = await _chunkOIH6DIQ4js.parser.load(entry);
|
|
188
|
+
_chunkOIH6DIQ4js.parser.prettify(data);
|
|
189
|
+
await _chunkOIH6DIQ4js.parser.save(data);
|
|
190
190
|
});
|
|
191
191
|
cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
192
192
|
return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
|
|
193
193
|
type: "string",
|
|
194
194
|
default: "theme"
|
|
195
195
|
}), async ({ entry, dir, theme: themeInput }) => {
|
|
196
|
-
const data = await
|
|
197
|
-
const theme =
|
|
196
|
+
const data = await _chunkOIH6DIQ4js.parser.load(entry);
|
|
197
|
+
const theme = _chunkOIH6DIQ4js.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
198
198
|
if (theme === "none") {
|
|
199
199
|
console.error('Can not eject theme "none"');
|
|
200
200
|
process.exit(1);
|
|
201
201
|
}
|
|
202
|
-
if (
|
|
202
|
+
if (_chunkOIH6DIQ4js.isPath.call(void 0, theme)) {
|
|
203
203
|
console.error("Theme is already ejected");
|
|
204
204
|
process.exit(1);
|
|
205
205
|
}
|
|
206
|
-
const roots =
|
|
206
|
+
const roots = _chunkOIH6DIQ4js.getThemeRoots.call(void 0, theme, entry);
|
|
207
207
|
if (!roots.length) {
|
|
208
208
|
console.error(`Does not found theme "${theme}"`);
|
|
209
209
|
process.exit(1);
|
|
@@ -215,7 +215,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
215
215
|
const dirPath = `./${dir}`;
|
|
216
216
|
data.slides[0].frontmatter.theme = dirPath;
|
|
217
217
|
data.slides[0].raw = null;
|
|
218
|
-
await
|
|
218
|
+
await _chunkOIH6DIQ4js.parser.save(data);
|
|
219
219
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
220
220
|
});
|
|
221
221
|
}, () => {
|
|
@@ -259,15 +259,15 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
259
259
|
process.env.NODE_ENV = "production";
|
|
260
260
|
const { exportSlides } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./export-TH7MNEXN.js")));
|
|
261
261
|
const port = await findFreePort(12445);
|
|
262
|
-
const options = await
|
|
262
|
+
const options = await _chunkOIH6DIQ4js.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
263
263
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
264
|
-
const server = await
|
|
264
|
+
const server = await _chunkOIH6DIQ4js.createServer.call(void 0, options, {
|
|
265
265
|
server: { port },
|
|
266
266
|
clearScreen: false
|
|
267
267
|
});
|
|
268
268
|
await server.listen(port);
|
|
269
269
|
printInfo(options);
|
|
270
|
-
|
|
270
|
+
_chunkOIH6DIQ4js.parser.filterDisabled(options.data);
|
|
271
271
|
const width = options.data.config.canvasWidth;
|
|
272
272
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
273
273
|
output = await exportSlides({
|
|
@@ -305,7 +305,7 @@ function printInfo(options, port, remote) {
|
|
|
305
305
|
console.log();
|
|
306
306
|
console.log();
|
|
307
307
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
308
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
308
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkOIH6DIQ4js.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
309
309
|
console.log();
|
|
310
310
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
311
311
|
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 _chunkOIH6DIQ4js = require('./chunk-OIH6DIQ4.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -36,4 +36,4 @@ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
exports.ViteSlidevPlugin = _chunkGH4JJSLKjs.ViteSlidevPlugin; exports.createServer =
|
|
39
|
+
exports.ViteSlidevPlugin = _chunkGH4JJSLKjs.ViteSlidevPlugin; exports.createServer = _chunkOIH6DIQ4js.createServer; exports.createWindiCSSPlugin = _chunkGH4JJSLKjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkOIH6DIQ4js.getAddonRoots; exports.getCLIRoot = _chunkOIH6DIQ4js.getCLIRoot; exports.getClientRoot = _chunkOIH6DIQ4js.getClientRoot; exports.getRoot = _chunkOIH6DIQ4js.getRoot; exports.getThemeRoots = _chunkOIH6DIQ4js.getThemeRoots; exports.getUserRoot = _chunkOIH6DIQ4js.getUserRoot; exports.isPath = _chunkOIH6DIQ4js.isPath; exports.parser = _chunkOIH6DIQ4js.parser; exports.resolveOptions = _chunkOIH6DIQ4js.resolveOptions;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.2",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@hedgedoc/markdown-it-task-lists": "^1.0.5",
|
|
47
47
|
"@iconify-json/carbon": "^1.1.7",
|
|
48
48
|
"@iconify-json/ph": "^1.1.2",
|
|
49
|
-
"@slidev/client": "0.35.
|
|
50
|
-
"@slidev/parser": "0.35.
|
|
51
|
-
"@slidev/types": "0.35.
|
|
49
|
+
"@slidev/client": "0.35.2",
|
|
50
|
+
"@slidev/parser": "0.35.2",
|
|
51
|
+
"@slidev/types": "0.35.2",
|
|
52
52
|
"@vitejs/plugin-vue": "^3.0.1",
|
|
53
53
|
"@vue/compiler-sfc": "^3.2.37",
|
|
54
54
|
"cli-progress": "^3.11.2",
|