@slidev/cli 0.38.0 → 0.38.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.
- package/dist/{build-N6ZUPVQG.mjs → build-2FE54GJC.mjs} +1 -1
- package/dist/{build-GDFRNKG7.js → build-ZXAFCRGR.js} +1 -1
- package/dist/{chunk-NDMEWYLR.js → chunk-GJNTJKIA.js} +1 -1
- package/dist/{chunk-D2NFFVC4.mjs → chunk-JNKN7NBO.mjs} +1 -1
- package/dist/cli.js +27 -27
- package/dist/cli.mjs +4 -4
- package/dist/{export-KLTUGSHH.js → export-6GLH5C55.js} +1 -1
- package/dist/{export-BI2J2JAY.mjs → export-ERXKQVMC.mjs} +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
|
@@ -725,7 +725,7 @@ async function build(options, viteConfig = {}) {
|
|
|
725
725
|
await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
726
726
|
`, "utf-8");
|
|
727
727
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
728
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
728
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-ERXKQVMC.mjs")));
|
|
729
729
|
const port = 12445;
|
|
730
730
|
const app = connect();
|
|
731
731
|
const server = http.createServer(app);
|
|
@@ -725,7 +725,7 @@ async function build(options, viteConfig = {}) {
|
|
|
725
725
|
await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
726
726
|
`, "utf-8");
|
|
727
727
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
728
|
-
const { exportSlides } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-
|
|
728
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-6GLH5C55.js")));
|
|
729
729
|
const port = 12445;
|
|
730
730
|
const app = _connect2.default.call(void 0, );
|
|
731
731
|
const server = _http2.default.createServer(app);
|
|
@@ -2450,7 +2450,7 @@ _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
|
|
2450
2450
|
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
2451
2451
|
|
|
2452
2452
|
// package.json
|
|
2453
|
-
var version = "0.38.
|
|
2453
|
+
var version = "0.38.1";
|
|
2454
2454
|
|
|
2455
2455
|
// node/themes.ts
|
|
2456
2456
|
_chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkGJNTJKIAjs = require('./chunk-GJNTJKIA.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -47,14 +47,14 @@ _fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) =>
|
|
|
47
47
|
var _a;
|
|
48
48
|
const addons = (_a = headmatter == null ? void 0 : headmatter.addons) != null ? _a : [];
|
|
49
49
|
const roots = [
|
|
50
|
-
|
|
51
|
-
...
|
|
52
|
-
|
|
50
|
+
_chunkGJNTJKIAjs.getUserRoot.call(void 0, {}).userRoot,
|
|
51
|
+
..._chunkGJNTJKIAjs.getAddonRoots.call(void 0, addons, ""),
|
|
52
|
+
_chunkGJNTJKIAjs.getClientRoot.call(void 0, )
|
|
53
53
|
];
|
|
54
54
|
const mergeArrays = (a, b) => a.concat(b);
|
|
55
55
|
return await _chunkBQ7BP5DLjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
|
|
56
56
|
});
|
|
57
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
57
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkGJNTJKIAjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
58
58
|
cli.command(
|
|
59
59
|
"* [entry]",
|
|
60
60
|
"Start a local server for Slidev",
|
|
@@ -105,9 +105,9 @@ cli.command(
|
|
|
105
105
|
async function initServer() {
|
|
106
106
|
if (server)
|
|
107
107
|
await server.close();
|
|
108
|
-
const options = await
|
|
108
|
+
const options = await _chunkGJNTJKIAjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
109
109
|
port = userPort || await findFreePort(3030);
|
|
110
|
-
server = await
|
|
110
|
+
server = await _chunkGJNTJKIAjs.createServer.call(void 0,
|
|
111
111
|
options,
|
|
112
112
|
{
|
|
113
113
|
server: {
|
|
@@ -121,7 +121,7 @@ cli.command(
|
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
onDataReload(newData, data) {
|
|
124
|
-
if (!theme &&
|
|
124
|
+
if (!theme && _chunkGJNTJKIAjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkGJNTJKIAjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
125
125
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
126
126
|
initServer();
|
|
127
127
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -207,8 +207,8 @@ cli.command(
|
|
|
207
207
|
describe: "enable the inspect plugin for debugging"
|
|
208
208
|
}).strict().help(),
|
|
209
209
|
async ({ entry, theme, watch, base, download, out, inspect }) => {
|
|
210
|
-
const { build } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./build-
|
|
211
|
-
const options = await
|
|
210
|
+
const { build } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./build-ZXAFCRGR.js")));
|
|
211
|
+
const options = await _chunkGJNTJKIAjs.resolveOptions.call(void 0, { entry, theme, inspect }, "build");
|
|
212
212
|
if (download && !options.data.config.download)
|
|
213
213
|
options.data.config.download = download;
|
|
214
214
|
printInfo(options);
|
|
@@ -226,9 +226,9 @@ cli.command(
|
|
|
226
226
|
"Format the markdown file",
|
|
227
227
|
(args) => commonOptions(args).strict().help(),
|
|
228
228
|
async ({ entry }) => {
|
|
229
|
-
const data = await
|
|
230
|
-
|
|
231
|
-
await
|
|
229
|
+
const data = await _chunkGJNTJKIAjs.parser.load(entry);
|
|
230
|
+
_chunkGJNTJKIAjs.parser.prettify(data);
|
|
231
|
+
await _chunkGJNTJKIAjs.parser.save(data);
|
|
232
232
|
}
|
|
233
233
|
);
|
|
234
234
|
cli.command(
|
|
@@ -243,17 +243,17 @@ cli.command(
|
|
|
243
243
|
default: "theme"
|
|
244
244
|
}),
|
|
245
245
|
async ({ entry, dir, theme: themeInput }) => {
|
|
246
|
-
const data = await
|
|
247
|
-
const theme =
|
|
246
|
+
const data = await _chunkGJNTJKIAjs.parser.load(entry);
|
|
247
|
+
const theme = _chunkGJNTJKIAjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
248
248
|
if (theme === "none") {
|
|
249
249
|
console.error('Cannot eject theme "none"');
|
|
250
250
|
process.exit(1);
|
|
251
251
|
}
|
|
252
|
-
if (
|
|
252
|
+
if (_chunkGJNTJKIAjs.isPath.call(void 0, theme)) {
|
|
253
253
|
console.error("Theme is already ejected");
|
|
254
254
|
process.exit(1);
|
|
255
255
|
}
|
|
256
|
-
const roots =
|
|
256
|
+
const roots = _chunkGJNTJKIAjs.getThemeRoots.call(void 0, theme, entry);
|
|
257
257
|
if (!roots.length) {
|
|
258
258
|
console.error(`Could not find theme "${theme}"`);
|
|
259
259
|
process.exit(1);
|
|
@@ -265,7 +265,7 @@ cli.command(
|
|
|
265
265
|
const dirPath = `./${dir}`;
|
|
266
266
|
data.slides[0].frontmatter.theme = dirPath;
|
|
267
267
|
data.slides[0].raw = null;
|
|
268
|
-
await
|
|
268
|
+
await _chunkGJNTJKIAjs.parser.save(data);
|
|
269
269
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
270
270
|
}
|
|
271
271
|
);
|
|
@@ -323,11 +323,11 @@ cli.command(
|
|
|
323
323
|
"with-toc": withTOC
|
|
324
324
|
}) => {
|
|
325
325
|
process.env.NODE_ENV = "production";
|
|
326
|
-
const { exportSlides } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-
|
|
326
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-6GLH5C55.js")));
|
|
327
327
|
const port = await findFreePort(12445);
|
|
328
|
-
const options = await
|
|
328
|
+
const options = await _chunkGJNTJKIAjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
329
329
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
330
|
-
const server = await
|
|
330
|
+
const server = await _chunkGJNTJKIAjs.createServer.call(void 0,
|
|
331
331
|
options,
|
|
332
332
|
{
|
|
333
333
|
server: { port },
|
|
@@ -336,7 +336,7 @@ cli.command(
|
|
|
336
336
|
);
|
|
337
337
|
await server.listen(port);
|
|
338
338
|
printInfo(options);
|
|
339
|
-
|
|
339
|
+
_chunkGJNTJKIAjs.parser.filterDisabled(options.data);
|
|
340
340
|
const width = options.data.config.canvasWidth;
|
|
341
341
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
342
342
|
output = await exportSlides({
|
|
@@ -377,12 +377,12 @@ cli.command(
|
|
|
377
377
|
output
|
|
378
378
|
}) => {
|
|
379
379
|
process.env.NODE_ENV = "production";
|
|
380
|
-
const { exportNotes } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-
|
|
380
|
+
const { exportNotes } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-6GLH5C55.js")));
|
|
381
381
|
const port = await findFreePort(12445);
|
|
382
|
-
const options = await
|
|
382
|
+
const options = await _chunkGJNTJKIAjs.resolveOptions.call(void 0, { entry }, "build");
|
|
383
383
|
if (!output)
|
|
384
384
|
output = options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entry, ".md")}-export-notes`;
|
|
385
|
-
const server = await
|
|
385
|
+
const server = await _chunkGJNTJKIAjs.createServer.call(void 0,
|
|
386
386
|
options,
|
|
387
387
|
{
|
|
388
388
|
server: { port },
|
|
@@ -391,7 +391,7 @@ cli.command(
|
|
|
391
391
|
);
|
|
392
392
|
await server.listen(port);
|
|
393
393
|
printInfo(options);
|
|
394
|
-
|
|
394
|
+
_chunkGJNTJKIAjs.parser.filterDisabled(options.data);
|
|
395
395
|
output = await exportNotes({
|
|
396
396
|
port,
|
|
397
397
|
output
|
|
@@ -418,7 +418,7 @@ function printInfo(options, port, remote) {
|
|
|
418
418
|
console.log();
|
|
419
419
|
console.log();
|
|
420
420
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
421
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
421
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkGJNTJKIAjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
422
422
|
console.log();
|
|
423
423
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
424
424
|
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
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveOptions,
|
|
10
10
|
resolveThemeName,
|
|
11
11
|
version
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JNKN7NBO.mjs";
|
|
13
13
|
import {
|
|
14
14
|
loadSetups,
|
|
15
15
|
require_fast_deep_equal
|
|
@@ -208,7 +208,7 @@ cli.command(
|
|
|
208
208
|
describe: "enable the inspect plugin for debugging"
|
|
209
209
|
}).strict().help(),
|
|
210
210
|
async ({ entry, theme, watch, base, download, out, inspect }) => {
|
|
211
|
-
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-
|
|
211
|
+
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-2FE54GJC.mjs")));
|
|
212
212
|
const options = await resolveOptions({ entry, theme, inspect }, "build");
|
|
213
213
|
if (download && !options.data.config.download)
|
|
214
214
|
options.data.config.download = download;
|
|
@@ -324,7 +324,7 @@ cli.command(
|
|
|
324
324
|
"with-toc": withTOC
|
|
325
325
|
}) => {
|
|
326
326
|
process.env.NODE_ENV = "production";
|
|
327
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
327
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-ERXKQVMC.mjs")));
|
|
328
328
|
const port = await findFreePort(12445);
|
|
329
329
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
330
330
|
output = output || options.data.config.exportFilename || `${path.basename(entry, ".md")}-export`;
|
|
@@ -378,7 +378,7 @@ cli.command(
|
|
|
378
378
|
output
|
|
379
379
|
}) => {
|
|
380
380
|
process.env.NODE_ENV = "production";
|
|
381
|
-
const { exportNotes } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
381
|
+
const { exportNotes } = await Promise.resolve().then(() => __toESM(__require("./export-ERXKQVMC.mjs")));
|
|
382
382
|
const port = await findFreePort(12445);
|
|
383
383
|
const options = await resolveOptions({ entry }, "build");
|
|
384
384
|
if (!output)
|
|
@@ -138,7 +138,7 @@ async function exportSlides({
|
|
|
138
138
|
const page = await context.newPage();
|
|
139
139
|
const progress = createSlidevProgress(true);
|
|
140
140
|
async function go(no, clicks) {
|
|
141
|
-
const path2 = `${no}?print${withClicks ? "=clicks" : ""}${clicks ? `&clicks=${clicks}` : ""}`;
|
|
141
|
+
const path2 = `${no}?print${withClicks ? "=clicks" : ""}${clicks ? `&clicks=${clicks}` : ""}${range ? `&range=${range}` : ""}`;
|
|
142
142
|
const url = routerMode === "hash" ? `http://localhost:${port}${base}#${path2}` : `http://localhost:${port}${base}${path2}`;
|
|
143
143
|
await page.goto(url, {
|
|
144
144
|
waitUntil: "networkidle",
|
|
@@ -138,7 +138,7 @@ async function exportSlides({
|
|
|
138
138
|
const page = await context.newPage();
|
|
139
139
|
const progress = createSlidevProgress(true);
|
|
140
140
|
async function go(no, clicks) {
|
|
141
|
-
const path2 = `${no}?print${withClicks ? "=clicks" : ""}${clicks ? `&clicks=${clicks}` : ""}`;
|
|
141
|
+
const path2 = `${no}?print${withClicks ? "=clicks" : ""}${clicks ? `&clicks=${clicks}` : ""}${range ? `&range=${range}` : ""}`;
|
|
142
142
|
const url = routerMode === "hash" ? `http://localhost:${port}${base}#${path2}` : `http://localhost:${port}${base}${path2}`;
|
|
143
143
|
await page.goto(url, {
|
|
144
144
|
waitUntil: "networkidle",
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkGJNTJKIAjs = require('./chunk-GJNTJKIA.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -36,4 +36,4 @@ _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
exports.ViteSlidevPlugin = _chunkBQ7BP5DLjs.ViteSlidevPlugin; exports.createServer =
|
|
39
|
+
exports.ViteSlidevPlugin = _chunkBQ7BP5DLjs.ViteSlidevPlugin; exports.createServer = _chunkGJNTJKIAjs.createServer; exports.createWindiCSSPlugin = _chunkBQ7BP5DLjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkGJNTJKIAjs.getAddonRoots; exports.getCLIRoot = _chunkGJNTJKIAjs.getCLIRoot; exports.getClientRoot = _chunkGJNTJKIAjs.getClientRoot; exports.getRoot = _chunkGJNTJKIAjs.getRoot; exports.getThemeRoots = _chunkGJNTJKIAjs.getThemeRoots; exports.getUserRoot = _chunkGJNTJKIAjs.getUserRoot; exports.isPath = _chunkGJNTJKIAjs.isPath; exports.parser = _chunkGJNTJKIAjs.parser; exports.resolveOptions = _chunkGJNTJKIAjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.1",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"vue": "^3.2.45",
|
|
89
89
|
"windicss": "^3.5.6",
|
|
90
90
|
"yargs": "^17.6.2",
|
|
91
|
-
"@slidev/client": "0.38.
|
|
92
|
-
"@slidev/parser": "0.38.
|
|
93
|
-
"@slidev/types": "0.38.
|
|
91
|
+
"@slidev/client": "0.38.1",
|
|
92
|
+
"@slidev/parser": "0.38.1",
|
|
93
|
+
"@slidev/types": "0.38.1"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@types/plantuml-encoder": "^1.4.0",
|