@slidev/cli 0.40.2 → 0.40.4
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-L4S5TZG4.js → build-HVQ7GG2W.js} +9 -7
- package/dist/{build-BGUF7J7N.mjs → build-QEAAPDMG.mjs} +5 -3
- package/dist/{chunk-ZAT6O5HR.mjs → chunk-46GOGODM.mjs} +37 -21
- package/dist/{chunk-EZ2J7PMK.mjs → chunk-4FABOYKQ.mjs} +63 -15
- package/dist/{chunk-RRNUXVEA.js → chunk-CKLR5LMV.js} +141 -93
- package/dist/{chunk-VLEV37KF.mjs → chunk-CTG3GV2W.mjs} +4 -0
- package/dist/{chunk-QU6XIJOB.js → chunk-FT5Y6KDW.js} +61 -45
- package/dist/{chunk-UJ5GHVII.js → chunk-GE7W2DBE.js} +4 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +87 -78
- package/dist/cli.mjs +75 -66
- package/dist/{export-BRPXINGP.js → export-INNI35CW.js} +6 -5
- package/dist/{export-BAZ4BSV6.mjs → export-N3YCMXVO.mjs} +4 -3
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/package.json +25 -25
package/dist/cli.mjs
CHANGED
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
resolveOptions,
|
|
10
10
|
resolveThemeName,
|
|
11
11
|
version
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4FABOYKQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
loadSetups,
|
|
15
15
|
require_fast_deep_equal
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-46GOGODM.mjs";
|
|
17
17
|
import {
|
|
18
18
|
__toESM
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CTG3GV2W.mjs";
|
|
20
20
|
|
|
21
21
|
// node/cli.ts
|
|
22
22
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal());
|
|
@@ -42,11 +42,14 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
42
42
|
];
|
|
43
43
|
injectPreparserExtensionLoader(async (headmatter, filepath) => {
|
|
44
44
|
const addons = (headmatter == null ? void 0 : headmatter.addons) ?? [];
|
|
45
|
-
const roots =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
const roots = (
|
|
46
|
+
/* uniq */
|
|
47
|
+
[
|
|
48
|
+
getUserRoot({}).userRoot,
|
|
49
|
+
...getAddonRoots(addons, ""),
|
|
50
|
+
getClientRoot()
|
|
51
|
+
]
|
|
52
|
+
);
|
|
50
53
|
const mergeArrays = (a, b) => a.concat(b);
|
|
51
54
|
return await loadSetups(roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
|
|
52
55
|
});
|
|
@@ -215,7 +218,7 @@ ${dim(" QR Code for remote control: ")}
|
|
|
215
218
|
}
|
|
216
219
|
);
|
|
217
220
|
cli.command(
|
|
218
|
-
"build [entry]",
|
|
221
|
+
"build [entry..]",
|
|
219
222
|
"Build hostable SPA",
|
|
220
223
|
(args) => exportOptions(commonOptions(args)).option("watch", {
|
|
221
224
|
alias: "w",
|
|
@@ -240,28 +243,32 @@ cli.command(
|
|
|
240
243
|
}).strict().help(),
|
|
241
244
|
async (args) => {
|
|
242
245
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
243
|
-
const { build } = await import("./build-
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
options.data.config.download
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
246
|
+
const { build } = await import("./build-QEAAPDMG.mjs");
|
|
247
|
+
for (const entryFile of entry) {
|
|
248
|
+
const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
|
|
249
|
+
if (download && !options.data.config.download)
|
|
250
|
+
options.data.config.download = download;
|
|
251
|
+
printInfo(options);
|
|
252
|
+
await build(options, {
|
|
253
|
+
base,
|
|
254
|
+
build: {
|
|
255
|
+
watch: watch ? {} : void 0,
|
|
256
|
+
outDir: entry.length === 1 ? out : path.join(out, path.basename(entryFile, ".md"))
|
|
257
|
+
}
|
|
258
|
+
}, { ...args, entry: entryFile });
|
|
259
|
+
}
|
|
255
260
|
}
|
|
256
261
|
);
|
|
257
262
|
cli.command(
|
|
258
|
-
"format [entry]",
|
|
263
|
+
"format [entry..]",
|
|
259
264
|
"Format the markdown file",
|
|
260
265
|
(args) => commonOptions(args).strict().help(),
|
|
261
266
|
async ({ entry }) => {
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
|
|
267
|
+
for (const entryFile of entry) {
|
|
268
|
+
const data = await parser.load(entryFile);
|
|
269
|
+
parser.prettify(data);
|
|
270
|
+
await parser.save(data);
|
|
271
|
+
}
|
|
265
272
|
}
|
|
266
273
|
);
|
|
267
274
|
cli.command(
|
|
@@ -309,37 +316,39 @@ cli.command(
|
|
|
309
316
|
}
|
|
310
317
|
);
|
|
311
318
|
cli.command(
|
|
312
|
-
"export [entry]",
|
|
319
|
+
"export [entry..]",
|
|
313
320
|
"Export slides to PDF",
|
|
314
321
|
(args) => exportOptions(commonOptions(args)).strict().help(),
|
|
315
322
|
async (args) => {
|
|
316
323
|
const { entry, theme } = args;
|
|
317
324
|
process.env.NODE_ENV = "production";
|
|
318
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
325
|
+
const { exportSlides, getExportOptions } = await import("./export-N3YCMXVO.mjs");
|
|
319
326
|
const port = await findFreePort(12445);
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
327
|
+
for (const entryFile of entry) {
|
|
328
|
+
const options = await resolveOptions({ entry: entryFile, theme }, "export");
|
|
329
|
+
const server = await createServer(
|
|
330
|
+
options,
|
|
331
|
+
{
|
|
332
|
+
server: { port },
|
|
333
|
+
clearScreen: false
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
await server.listen(port);
|
|
337
|
+
printInfo(options);
|
|
338
|
+
parser.filterDisabled(options.data);
|
|
339
|
+
const result = await exportSlides({
|
|
340
|
+
port,
|
|
341
|
+
...getExportOptions({ ...args, entry: entryFile }, options)
|
|
342
|
+
});
|
|
343
|
+
console.log(`${green(" \u2713 ")}${dim("exported to ")}./${result}
|
|
336
344
|
`);
|
|
337
|
-
|
|
345
|
+
server.close();
|
|
346
|
+
}
|
|
338
347
|
process.exit(0);
|
|
339
348
|
}
|
|
340
349
|
);
|
|
341
350
|
cli.command(
|
|
342
|
-
"export-notes [entry]",
|
|
351
|
+
"export-notes [entry..]",
|
|
343
352
|
"Export slide notes to PDF",
|
|
344
353
|
(args) => args.positional("entry", {
|
|
345
354
|
default: "slides.md",
|
|
@@ -359,29 +368,29 @@ cli.command(
|
|
|
359
368
|
timeout
|
|
360
369
|
}) => {
|
|
361
370
|
process.env.NODE_ENV = "production";
|
|
362
|
-
const { exportNotes } = await import("./export-
|
|
371
|
+
const { exportNotes } = await import("./export-N3YCMXVO.mjs");
|
|
363
372
|
const port = await findFreePort(12445);
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
console.log(`${green(" \u2713 ")}${dim("exported to ")}./${output}
|
|
373
|
+
for (const entryFile of entry) {
|
|
374
|
+
const options = await resolveOptions({ entry: entryFile }, "export");
|
|
375
|
+
const server = await createServer(
|
|
376
|
+
options,
|
|
377
|
+
{
|
|
378
|
+
server: { port },
|
|
379
|
+
clearScreen: false
|
|
380
|
+
}
|
|
381
|
+
);
|
|
382
|
+
await server.listen(port);
|
|
383
|
+
printInfo(options);
|
|
384
|
+
parser.filterDisabled(options.data);
|
|
385
|
+
const result = await exportNotes({
|
|
386
|
+
port,
|
|
387
|
+
output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${path.basename(entryFile, ".md")}-export-notes`),
|
|
388
|
+
timeout
|
|
389
|
+
});
|
|
390
|
+
console.log(`${green(" \u2713 ")}${dim("exported to ")}./${result}
|
|
383
391
|
`);
|
|
384
|
-
|
|
392
|
+
server.close();
|
|
393
|
+
}
|
|
385
394
|
process.exit(0);
|
|
386
395
|
}
|
|
387
396
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkGE7W2DBEjs = require('./chunk-GE7W2DBE.js');
|
|
4
4
|
|
|
5
5
|
// node/export.ts
|
|
6
6
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -75,8 +75,8 @@ async function exportNotes({
|
|
|
75
75
|
output = "notes",
|
|
76
76
|
timeout = 3e4
|
|
77
77
|
}) {
|
|
78
|
-
if (!
|
|
79
|
-
throw new Error("The exporting for Slidev is powered by Playwright, please
|
|
78
|
+
if (!_chunkGE7W2DBEjs.packageExists.call(void 0, "playwright-chromium"))
|
|
79
|
+
throw new Error("The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`");
|
|
80
80
|
const { chromium } = await Promise.resolve().then(() => require("playwright-chromium"));
|
|
81
81
|
const browser = await chromium.launch();
|
|
82
82
|
const context = await browser.newContext();
|
|
@@ -121,8 +121,8 @@ async function exportSlides({
|
|
|
121
121
|
withToc = false,
|
|
122
122
|
perSlide = false
|
|
123
123
|
}) {
|
|
124
|
-
if (!
|
|
125
|
-
throw new Error("The exporting for Slidev is powered by Playwright, please
|
|
124
|
+
if (!_chunkGE7W2DBEjs.packageExists.call(void 0, "playwright-chromium"))
|
|
125
|
+
throw new Error("The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`");
|
|
126
126
|
const pages = _core.parseRangeString.call(void 0, total, range);
|
|
127
127
|
const { chromium } = await Promise.resolve().then(() => require("playwright-chromium"));
|
|
128
128
|
const browser = await chromium.launch({
|
|
@@ -131,6 +131,7 @@ async function exportSlides({
|
|
|
131
131
|
const context = await browser.newContext({
|
|
132
132
|
viewport: {
|
|
133
133
|
width,
|
|
134
|
+
// Calculate height for every slides to be in the viewport to trigger the rendering of iframes (twitter, youtube...)
|
|
134
135
|
height: perSlide ? height : height * pages.length
|
|
135
136
|
},
|
|
136
137
|
deviceScaleFactor: 1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
packageExists
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CTG3GV2W.mjs";
|
|
4
4
|
|
|
5
5
|
// node/export.ts
|
|
6
6
|
import path from "path";
|
|
@@ -76,7 +76,7 @@ async function exportNotes({
|
|
|
76
76
|
timeout = 3e4
|
|
77
77
|
}) {
|
|
78
78
|
if (!packageExists("playwright-chromium"))
|
|
79
|
-
throw new Error("The exporting for Slidev is powered by Playwright, please
|
|
79
|
+
throw new Error("The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`");
|
|
80
80
|
const { chromium } = await import("playwright-chromium");
|
|
81
81
|
const browser = await chromium.launch();
|
|
82
82
|
const context = await browser.newContext();
|
|
@@ -122,7 +122,7 @@ async function exportSlides({
|
|
|
122
122
|
perSlide = false
|
|
123
123
|
}) {
|
|
124
124
|
if (!packageExists("playwright-chromium"))
|
|
125
|
-
throw new Error("The exporting for Slidev is powered by Playwright, please
|
|
125
|
+
throw new Error("The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`");
|
|
126
126
|
const pages = parseRangeString(total, range);
|
|
127
127
|
const { chromium } = await import("playwright-chromium");
|
|
128
128
|
const browser = await chromium.launch({
|
|
@@ -131,6 +131,7 @@ async function exportSlides({
|
|
|
131
131
|
const context = await browser.newContext({
|
|
132
132
|
viewport: {
|
|
133
133
|
width,
|
|
134
|
+
// Calculate height for every slides to be in the viewport to trigger the rendering of iframes (twitter, youtube...)
|
|
134
135
|
height: perSlide ? height : height * pages.length
|
|
135
136
|
},
|
|
136
137
|
deviceScaleFactor: 1
|
package/dist/index.js
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkCKLR5LMVjs = require('./chunk-CKLR5LMV.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
require('./chunk-
|
|
16
|
+
var _chunkFT5Y6KDWjs = require('./chunk-FT5Y6KDW.js');
|
|
17
|
+
require('./chunk-GE7W2DBE.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -28,4 +28,4 @@ require('./chunk-UJ5GHVII.js');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
exports.ViteSlidevPlugin =
|
|
31
|
+
exports.ViteSlidevPlugin = _chunkFT5Y6KDWjs.ViteSlidevPlugin; exports.createServer = _chunkCKLR5LMVjs.createServer; exports.createWindiCSSPlugin = _chunkFT5Y6KDWjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkCKLR5LMVjs.getAddonRoots; exports.getCLIRoot = _chunkCKLR5LMVjs.getCLIRoot; exports.getClientRoot = _chunkCKLR5LMVjs.getClientRoot; exports.getRoot = _chunkCKLR5LMVjs.getRoot; exports.getThemeRoots = _chunkCKLR5LMVjs.getThemeRoots; exports.getUserRoot = _chunkCKLR5LMVjs.getUserRoot; exports.isPath = _chunkCKLR5LMVjs.isPath; exports.parser = _chunkCKLR5LMVjs.parser; exports.resolveOptions = _chunkCKLR5LMVjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
isPath,
|
|
10
10
|
parser,
|
|
11
11
|
resolveOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4FABOYKQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ViteSlidevPlugin,
|
|
15
15
|
createWindiCSSPlugin
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-46GOGODM.mjs";
|
|
17
|
+
import "./chunk-CTG3GV2W.mjs";
|
|
18
18
|
export {
|
|
19
19
|
ViteSlidevPlugin,
|
|
20
20
|
createServer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.4",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,24 +44,24 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@antfu/utils": "^0.7.2",
|
|
46
46
|
"@hedgedoc/markdown-it-plugins": "^2.0.0",
|
|
47
|
-
"@iconify-json/carbon": "^1.1.
|
|
48
|
-
"@iconify-json/ph": "^1.1.
|
|
47
|
+
"@iconify-json/carbon": "^1.1.16",
|
|
48
|
+
"@iconify-json/ph": "^1.1.5",
|
|
49
49
|
"@lillallol/outline-pdf": "^4.0.0",
|
|
50
|
-
"@vitejs/plugin-vue": "^4.
|
|
51
|
-
"@vitejs/plugin-vue-jsx": "^3.0.
|
|
50
|
+
"@vitejs/plugin-vue": "^4.1.0",
|
|
51
|
+
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
|
52
52
|
"@windicss/config": "^1.8.10",
|
|
53
|
-
"cli-progress": "^3.
|
|
53
|
+
"cli-progress": "^3.12.0",
|
|
54
54
|
"codemirror": "^5.65.5",
|
|
55
55
|
"connect": "^3.7.0",
|
|
56
56
|
"debug": "^4.3.4",
|
|
57
57
|
"fast-glob": "^3.2.12",
|
|
58
|
-
"fs-extra": "^11.1.
|
|
58
|
+
"fs-extra": "^11.1.1",
|
|
59
59
|
"get-port-please": "^3.0.1",
|
|
60
60
|
"global-dirs": "^3.0.1",
|
|
61
61
|
"import-from": "^4.0.0",
|
|
62
62
|
"is-installed-globally": "^0.4.0",
|
|
63
|
-
"jiti": "^1.
|
|
64
|
-
"js-base64": "^3.7.
|
|
63
|
+
"jiti": "^1.18.2",
|
|
64
|
+
"js-base64": "^3.7.5",
|
|
65
65
|
"katex": "^0.16.4",
|
|
66
66
|
"kolorist": "^1.7.0",
|
|
67
67
|
"localtunnel": "^2.0.2",
|
|
@@ -69,33 +69,33 @@
|
|
|
69
69
|
"markdown-it-footnote": "^3.0.3",
|
|
70
70
|
"markdown-it-link-attributes": "^4.0.1",
|
|
71
71
|
"monaco-editor": "^0.33.0",
|
|
72
|
-
"nanoid": "^4.0.
|
|
73
|
-
"open": "^
|
|
72
|
+
"nanoid": "^4.0.1",
|
|
73
|
+
"open": "^9.0.0",
|
|
74
74
|
"pdf-lib": "^1.17.1",
|
|
75
75
|
"plantuml-encoder": "^1.4.0",
|
|
76
|
-
"postcss-nested": "^6.0.
|
|
76
|
+
"postcss-nested": "^6.0.1",
|
|
77
77
|
"prismjs": "^1.29.0",
|
|
78
78
|
"prompts": "^2.4.2",
|
|
79
79
|
"qrcode-terminal": "^0.12.0",
|
|
80
80
|
"resolve": "^1.22.1",
|
|
81
81
|
"resolve-from": "^5.0.0",
|
|
82
82
|
"resolve-global": "^1.0.0",
|
|
83
|
-
"shiki": "^0.14.
|
|
84
|
-
"unocss": "^0.
|
|
85
|
-
"unplugin-icons": "^0.15.
|
|
86
|
-
"unplugin-vue-components": "^0.
|
|
87
|
-
"vite": "^4.
|
|
88
|
-
"vite-plugin-inspect": "^0.7.
|
|
89
|
-
"vite-plugin-remote-assets": "^0.3.
|
|
90
|
-
"vite-plugin-vue-markdown": "^0.22.
|
|
91
|
-
"vite-plugin-vue-server-ref": "^0.3.
|
|
83
|
+
"shiki": "^0.14.1",
|
|
84
|
+
"unocss": "^0.50.6",
|
|
85
|
+
"unplugin-icons": "^0.15.3",
|
|
86
|
+
"unplugin-vue-components": "^0.24.1",
|
|
87
|
+
"vite": "^4.2.1",
|
|
88
|
+
"vite-plugin-inspect": "^0.7.18",
|
|
89
|
+
"vite-plugin-remote-assets": "^0.3.1",
|
|
90
|
+
"vite-plugin-vue-markdown": "^0.22.4",
|
|
91
|
+
"vite-plugin-vue-server-ref": "^0.3.1",
|
|
92
92
|
"vite-plugin-windicss": "^1.8.10",
|
|
93
93
|
"vue": "^3.2.47",
|
|
94
94
|
"windicss": "^3.5.6",
|
|
95
|
-
"yargs": "^17.
|
|
96
|
-
"@slidev/client": "0.40.
|
|
97
|
-
"@slidev/parser": "0.40.
|
|
98
|
-
"@slidev/types": "0.40.
|
|
95
|
+
"yargs": "^17.7.1",
|
|
96
|
+
"@slidev/client": "0.40.4",
|
|
97
|
+
"@slidev/parser": "0.40.4",
|
|
98
|
+
"@slidev/types": "0.40.4"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@types/plantuml-encoder": "^1.4.0",
|