@slidev/cli 0.32.4 → 0.34.0
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/README.md +2 -3
- package/dist/build-GQNLL4B2.js +113 -0
- package/dist/build-Y3ZVSXFT.mjs +113 -0
- package/dist/{chunk-ERHEJGU7.js → chunk-5GSPMDNU.js} +162 -160
- package/dist/chunk-FROLEDLC.js +10916 -0
- package/dist/{chunk-ZWCVPYOA.mjs → chunk-IWKTUAXD.mjs} +2 -2
- package/dist/chunk-OGKTSZVU.mjs +10917 -0
- package/dist/{chunk-STSGOSM4.mjs → chunk-QE663OGO.mjs} +13 -11
- package/dist/{chunk-FFZLS6QK.js → chunk-SO7T6GEW.js} +7 -3
- package/dist/cli.js +29 -26
- package/dist/cli.mjs +10 -7
- package/dist/{export-LOKLMK66.js → export-URR4VZNO.js} +4 -4
- package/dist/{export-5R6FV775.mjs → export-Z44PM4CT.mjs} +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +23 -20
- package/dist/build-O7J6JH7N.mjs +0 -742
- package/dist/build-SKQZLTIO.js +0 -742
- package/dist/chunk-CNNMHD67.mjs +0 -1556
- package/dist/chunk-KFVTOCED.js +0 -1555
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ViteSlidevPlugin
|
|
3
|
-
|
|
2
|
+
ViteSlidevPlugin,
|
|
3
|
+
mergeViteConfigs
|
|
4
|
+
} from "./chunk-OGKTSZVU.mjs";
|
|
4
5
|
import {
|
|
5
6
|
__commonJS,
|
|
6
7
|
__dirname,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
init_esm_shims,
|
|
16
17
|
packageExists,
|
|
17
18
|
resolveImportPath
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IWKTUAXD.mjs";
|
|
19
20
|
|
|
20
21
|
// ../../node_modules/.pnpm/semver@7.3.7/node_modules/semver/internal/constants.js
|
|
21
22
|
var require_constants = __commonJS({
|
|
@@ -2378,12 +2379,12 @@ var require_semver2 = __commonJS({
|
|
|
2378
2379
|
// node/server.ts
|
|
2379
2380
|
init_esm_shims();
|
|
2380
2381
|
import { join } from "path";
|
|
2381
|
-
import { createServer as createViteServer,
|
|
2382
|
+
import { createServer as createViteServer, resolveConfig } from "vite";
|
|
2382
2383
|
async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
2383
2384
|
const rawConfig = await resolveConfig({}, "serve");
|
|
2384
2385
|
const pluginOptions = rawConfig.slidev || {};
|
|
2385
2386
|
process.env.EDITOR = process.env.EDITOR || "code";
|
|
2386
|
-
const server = await createViteServer(
|
|
2387
|
+
const server = await createViteServer(await mergeViteConfigs(options, viteConfig, {
|
|
2387
2388
|
optimizeDeps: {
|
|
2388
2389
|
entries: [
|
|
2389
2390
|
join(options.clientRoot, "main.ts")
|
|
@@ -2392,7 +2393,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2392
2393
|
plugins: [
|
|
2393
2394
|
await ViteSlidevPlugin(options, pluginOptions, serverOptions)
|
|
2394
2395
|
]
|
|
2395
|
-
}));
|
|
2396
|
+
}, "serve"));
|
|
2396
2397
|
return server;
|
|
2397
2398
|
}
|
|
2398
2399
|
|
|
@@ -2401,16 +2402,16 @@ init_esm_shims();
|
|
|
2401
2402
|
import * as parser from "@slidev/parser/fs";
|
|
2402
2403
|
|
|
2403
2404
|
// package.json
|
|
2404
|
-
var version = "0.
|
|
2405
|
+
var version = "0.34.0";
|
|
2405
2406
|
|
|
2406
2407
|
// node/themes.ts
|
|
2407
2408
|
init_esm_shims();
|
|
2408
2409
|
import prompts2 from "prompts";
|
|
2409
2410
|
|
|
2410
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.16.
|
|
2411
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.16.3/node_modules/@antfu/ni/dist/index.mjs
|
|
2411
2412
|
init_esm_shims();
|
|
2412
2413
|
|
|
2413
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.16.
|
|
2414
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.16.3/node_modules/@antfu/ni/dist/chunks/runner.mjs
|
|
2414
2415
|
init_esm_shims();
|
|
2415
2416
|
import require$$0, { resolve } from "path";
|
|
2416
2417
|
import require$$0$5 from "readline";
|
|
@@ -2430,7 +2431,7 @@ import require$$0$3 from "stream";
|
|
|
2430
2431
|
import require$$2$1 from "util";
|
|
2431
2432
|
import { promises } from "fs";
|
|
2432
2433
|
import require$$1 from "tty";
|
|
2433
|
-
var version2 = "0.16.
|
|
2434
|
+
var version2 = "0.16.3";
|
|
2434
2435
|
var npmRun = (agent) => (args) => {
|
|
2435
2436
|
if (args.length > 1)
|
|
2436
2437
|
return `${agent} run ${args[0]} -- ${args.slice(1).join(" ")}`;
|
|
@@ -2494,7 +2495,8 @@ var agents = Object.keys(AGENTS);
|
|
|
2494
2495
|
var LOCKS = {
|
|
2495
2496
|
"pnpm-lock.yaml": "pnpm",
|
|
2496
2497
|
"yarn.lock": "yarn",
|
|
2497
|
-
"package-lock.json": "npm"
|
|
2498
|
+
"package-lock.json": "npm",
|
|
2499
|
+
"npm-shrinkwrap.json": "npm"
|
|
2498
2500
|
};
|
|
2499
2501
|
var INSTALL_PAGE = {
|
|
2500
2502
|
"pnpm": "https://pnpm.js.org/en/installation",
|
|
@@ -84,9 +84,12 @@ var __privateWrapper = (obj, member, setter, getter) => {
|
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
// ../../node_modules/.pnpm/tsup@5.12.9_typescript@4.7.
|
|
87
|
+
// ../../node_modules/.pnpm/tsup@5.12.9_typescript@4.7.4/node_modules/tsup/assets/cjs_shims.js
|
|
88
|
+
var getImportMetaUrl, importMetaUrl;
|
|
88
89
|
var init_cjs_shims = __esm({
|
|
89
|
-
"../../node_modules/.pnpm/tsup@5.12.9_typescript@4.7.
|
|
90
|
+
"../../node_modules/.pnpm/tsup@5.12.9_typescript@4.7.4/node_modules/tsup/assets/cjs_shims.js"() {
|
|
91
|
+
getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
92
|
+
importMetaUrl = exports.importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
90
93
|
}
|
|
91
94
|
});
|
|
92
95
|
|
|
@@ -171,4 +174,5 @@ function packageExists(name) {
|
|
|
171
174
|
|
|
172
175
|
|
|
173
176
|
|
|
174
|
-
|
|
177
|
+
|
|
178
|
+
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require; exports.__objRest = __objRest; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateWrapper = __privateWrapper; exports.importMetaUrl = importMetaUrl; exports.init_cjs_shims = init_cjs_shims; exports.toAtFS = toAtFS; exports.resolveImportPath = resolveImportPath; exports.resolveGlobalImportPath = resolveGlobalImportPath; exports.stringifyMarkdownTokens = stringifyMarkdownTokens; exports.generateGoogleFontsUrl = generateGoogleFontsUrl; exports.packageExists = packageExists;
|
package/dist/cli.js
CHANGED
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk5GSPMDNUjs = require('./chunk-5GSPMDNU.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkFROLEDLCjs = require('./chunk-FROLEDLC.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkSO7T6GEWjs = require('./chunk-SO7T6GEW.js');
|
|
18
18
|
|
|
19
19
|
// node/cli.ts
|
|
20
|
-
|
|
21
|
-
var import_fast_deep_equal =
|
|
20
|
+
_chunkSO7T6GEWjs.init_cjs_shims.call(void 0, );
|
|
21
|
+
var import_fast_deep_equal = _chunkSO7T6GEWjs.__toESM.call(void 0, _chunkFROLEDLCjs.require_fast_deep_equal.call(void 0, ));
|
|
22
22
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
23
23
|
var _net = require('net'); var _net2 = _interopRequireDefault(_net);
|
|
24
24
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
@@ -30,13 +30,15 @@ var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);
|
|
|
30
30
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
31
31
|
var _kolorist = require('kolorist');
|
|
32
32
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
33
|
+
var _parser = require('@slidev/parser');
|
|
33
34
|
var CONFIG_RESTART_FIELDS = [
|
|
34
35
|
"highlighter",
|
|
35
36
|
"monaco",
|
|
36
37
|
"routerMode",
|
|
37
|
-
"fonts"
|
|
38
|
+
"fonts",
|
|
39
|
+
"css"
|
|
38
40
|
];
|
|
39
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
41
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunk5GSPMDNUjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
40
42
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
41
43
|
alias: "p",
|
|
42
44
|
type: "number",
|
|
@@ -79,9 +81,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
79
81
|
async function initServer() {
|
|
80
82
|
if (server)
|
|
81
83
|
await server.close();
|
|
82
|
-
const options = await
|
|
84
|
+
const options = await _chunk5GSPMDNUjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
|
|
83
85
|
port = userPort || await findFreePort(3030);
|
|
84
|
-
server = await
|
|
86
|
+
server = await _chunk5GSPMDNUjs.createServer.call(void 0, options, {
|
|
85
87
|
server: {
|
|
86
88
|
port,
|
|
87
89
|
strictPort: true,
|
|
@@ -92,7 +94,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
92
94
|
logLevel: log
|
|
93
95
|
}, {
|
|
94
96
|
onDataReload(newData, data) {
|
|
95
|
-
if (!theme &&
|
|
97
|
+
if (!theme && _chunk5GSPMDNUjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunk5GSPMDNUjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
96
98
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
97
99
|
initServer();
|
|
98
100
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -168,8 +170,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
168
170
|
type: "boolean",
|
|
169
171
|
describe: "allow download as PDF"
|
|
170
172
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
171
|
-
const { build } = await Promise.resolve().then(() =>
|
|
172
|
-
const options = await
|
|
173
|
+
const { build } = await Promise.resolve().then(() => _chunkSO7T6GEWjs.__toESM.call(void 0, _chunkSO7T6GEWjs.__require.call(void 0, "./build-GQNLL4B2.js")));
|
|
174
|
+
const options = await _chunk5GSPMDNUjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
173
175
|
if (download && !options.data.config.download)
|
|
174
176
|
options.data.config.download = download;
|
|
175
177
|
printInfo(options);
|
|
@@ -182,26 +184,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
182
184
|
});
|
|
183
185
|
});
|
|
184
186
|
cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
|
|
185
|
-
const data = await
|
|
186
|
-
|
|
187
|
-
await
|
|
187
|
+
const data = await _chunk5GSPMDNUjs.parser.load(entry);
|
|
188
|
+
_chunk5GSPMDNUjs.parser.prettify(data);
|
|
189
|
+
await _chunk5GSPMDNUjs.parser.save(data);
|
|
188
190
|
});
|
|
189
191
|
cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
190
192
|
return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
|
|
191
193
|
type: "string",
|
|
192
194
|
default: "theme"
|
|
193
195
|
}), async ({ entry, dir, theme: themeInput }) => {
|
|
194
|
-
const data = await
|
|
195
|
-
const theme =
|
|
196
|
+
const data = await _chunk5GSPMDNUjs.parser.load(entry);
|
|
197
|
+
const theme = _chunk5GSPMDNUjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
196
198
|
if (theme === "none") {
|
|
197
199
|
console.error('Can not eject theme "none"');
|
|
198
200
|
process.exit(1);
|
|
199
201
|
}
|
|
200
|
-
if (
|
|
202
|
+
if (_chunk5GSPMDNUjs.isPath.call(void 0, theme)) {
|
|
201
203
|
console.error("Theme is already ejected");
|
|
202
204
|
process.exit(1);
|
|
203
205
|
}
|
|
204
|
-
const roots =
|
|
206
|
+
const roots = _chunk5GSPMDNUjs.getThemeRoots.call(void 0, theme, entry);
|
|
205
207
|
if (!roots.length) {
|
|
206
208
|
console.error(`Does not found theme "${theme}"`);
|
|
207
209
|
process.exit(1);
|
|
@@ -213,7 +215,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
213
215
|
const dirPath = `./${dir}`;
|
|
214
216
|
data.slides[0].frontmatter.theme = dirPath;
|
|
215
217
|
data.slides[0].raw = null;
|
|
216
|
-
await
|
|
218
|
+
await _chunk5GSPMDNUjs.parser.save(data);
|
|
217
219
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
218
220
|
});
|
|
219
221
|
}, () => {
|
|
@@ -255,17 +257,17 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
255
257
|
"with-clicks": withClicks
|
|
256
258
|
}) => {
|
|
257
259
|
process.env.NODE_ENV = "production";
|
|
258
|
-
const { exportSlides } = await Promise.resolve().then(() =>
|
|
260
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkSO7T6GEWjs.__toESM.call(void 0, _chunkSO7T6GEWjs.__require.call(void 0, "./export-URR4VZNO.js")));
|
|
259
261
|
const port = await findFreePort(12445);
|
|
260
|
-
const options = await
|
|
262
|
+
const options = await _chunk5GSPMDNUjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
261
263
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
262
|
-
const server = await
|
|
264
|
+
const server = await _chunk5GSPMDNUjs.createServer.call(void 0, options, {
|
|
263
265
|
server: { port },
|
|
264
266
|
clearScreen: false
|
|
265
267
|
});
|
|
266
268
|
await server.listen(port);
|
|
267
269
|
printInfo(options);
|
|
268
|
-
|
|
270
|
+
_chunk5GSPMDNUjs.parser.filterDisabled(options.data);
|
|
269
271
|
const width = options.data.config.canvasWidth;
|
|
270
272
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
271
273
|
output = await exportSlides({
|
|
@@ -303,7 +305,7 @@ function printInfo(options, port, remote) {
|
|
|
303
305
|
console.log();
|
|
304
306
|
console.log();
|
|
305
307
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
306
|
-
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${_chunk5GSPMDNUjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
307
309
|
console.log();
|
|
308
310
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
309
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));
|
|
@@ -316,7 +318,7 @@ function printInfo(options, port, remote) {
|
|
|
316
318
|
console.log(`${_kolorist.dim.call(void 0, " private slide show ")} > ${_kolorist.cyan.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}/${query}`)}`);
|
|
317
319
|
console.log(`${_kolorist.dim.call(void 0, " presenter mode ")} > ${_kolorist.blue.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}${presenterPath}`)}`);
|
|
318
320
|
if (remote !== void 0) {
|
|
319
|
-
Object.values(_os2.default.networkInterfaces()).forEach((v) => (v || []).filter((details) => details.family === "
|
|
321
|
+
Object.values(_os2.default.networkInterfaces()).forEach((v) => (v || []).filter((details) => String(details.family).slice(-1) === "4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
|
|
320
322
|
console.log(`${_kolorist.dim.call(void 0, " remote control ")} > ${_kolorist.blue.call(void 0, `http://${address}:${port}${presenterPath}`)}`);
|
|
321
323
|
}));
|
|
322
324
|
} else {
|
|
@@ -326,6 +328,7 @@ function printInfo(options, port, remote) {
|
|
|
326
328
|
console.log(`${_kolorist.dim.call(void 0, " shortcuts ")} > ${_kolorist.underline.call(void 0, "r")}${_kolorist.dim.call(void 0, "estart | ")}${_kolorist.underline.call(void 0, "o")}${_kolorist.dim.call(void 0, "pen | ")}${_kolorist.underline.call(void 0, "e")}${_kolorist.dim.call(void 0, "dit")}`);
|
|
327
329
|
}
|
|
328
330
|
console.log();
|
|
331
|
+
_parser.verifyConfig.call(void 0, options.data.config, options.data.themeMeta, (v) => console.warn(_kolorist.yellow.call(void 0, ` ! ${v}`)));
|
|
329
332
|
console.log();
|
|
330
333
|
}
|
|
331
334
|
function isPortFree(port) {
|
package/dist/cli.mjs
CHANGED
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
resolveOptions,
|
|
7
7
|
resolveThemeName,
|
|
8
8
|
version
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QE663OGO.mjs";
|
|
10
10
|
import {
|
|
11
11
|
require_fast_deep_equal
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OGKTSZVU.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__dirname,
|
|
15
15
|
__require,
|
|
16
16
|
__toESM,
|
|
17
17
|
init_esm_shims
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IWKTUAXD.mjs";
|
|
19
19
|
|
|
20
20
|
// node/cli.ts
|
|
21
21
|
init_esm_shims();
|
|
@@ -31,11 +31,13 @@ import yargs from "yargs";
|
|
|
31
31
|
import prompts from "prompts";
|
|
32
32
|
import { blue, bold, cyan, dim, gray, green, underline, yellow } from "kolorist";
|
|
33
33
|
import isInstalledGlobally from "is-installed-globally";
|
|
34
|
+
import { verifyConfig } from "@slidev/parser";
|
|
34
35
|
var CONFIG_RESTART_FIELDS = [
|
|
35
36
|
"highlighter",
|
|
36
37
|
"monaco",
|
|
37
38
|
"routerMode",
|
|
38
|
-
"fonts"
|
|
39
|
+
"fonts",
|
|
40
|
+
"css"
|
|
39
41
|
];
|
|
40
42
|
var cli = yargs.scriptName("slidev").usage("$0 [args]").version(version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
41
43
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
@@ -169,7 +171,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
169
171
|
type: "boolean",
|
|
170
172
|
describe: "allow download as PDF"
|
|
171
173
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
172
|
-
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-
|
|
174
|
+
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-Y3ZVSXFT.mjs")));
|
|
173
175
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
174
176
|
if (download && !options.data.config.download)
|
|
175
177
|
options.data.config.download = download;
|
|
@@ -256,7 +258,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
256
258
|
"with-clicks": withClicks
|
|
257
259
|
}) => {
|
|
258
260
|
process.env.NODE_ENV = "production";
|
|
259
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
261
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-Z44PM4CT.mjs")));
|
|
260
262
|
const port = await findFreePort(12445);
|
|
261
263
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
262
264
|
output = output || options.data.config.exportFilename || `${path.basename(entry, ".md")}-export`;
|
|
@@ -317,7 +319,7 @@ function printInfo(options, port, remote) {
|
|
|
317
319
|
console.log(`${dim(" private slide show ")} > ${cyan(`http://localhost:${bold(port)}/${query}`)}`);
|
|
318
320
|
console.log(`${dim(" presenter mode ")} > ${blue(`http://localhost:${bold(port)}${presenterPath}`)}`);
|
|
319
321
|
if (remote !== void 0) {
|
|
320
|
-
Object.values(os.networkInterfaces()).forEach((v) => (v || []).filter((details) => details.family === "
|
|
322
|
+
Object.values(os.networkInterfaces()).forEach((v) => (v || []).filter((details) => String(details.family).slice(-1) === "4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
|
|
321
323
|
console.log(`${dim(" remote control ")} > ${blue(`http://${address}:${port}${presenterPath}`)}`);
|
|
322
324
|
}));
|
|
323
325
|
} else {
|
|
@@ -327,6 +329,7 @@ function printInfo(options, port, remote) {
|
|
|
327
329
|
console.log(`${dim(" shortcuts ")} > ${underline("r")}${dim("estart | ")}${underline("o")}${dim("pen | ")}${underline("e")}${dim("dit")}`);
|
|
328
330
|
}
|
|
329
331
|
console.log();
|
|
332
|
+
verifyConfig(options.data.config, options.data.themeMeta, (v) => console.warn(yellow(` ! ${v}`)));
|
|
330
333
|
console.log();
|
|
331
334
|
}
|
|
332
335
|
function isPortFree(port) {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkSO7T6GEWjs = require('./chunk-SO7T6GEW.js');
|
|
7
7
|
|
|
8
8
|
// node/export.ts
|
|
9
|
-
|
|
9
|
+
_chunkSO7T6GEWjs.init_cjs_shims.call(void 0, );
|
|
10
10
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
11
11
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
12
12
|
var _kolorist = require('kolorist');
|
|
@@ -60,10 +60,10 @@ async function exportSlides({
|
|
|
60
60
|
height = 1080,
|
|
61
61
|
withClicks = false
|
|
62
62
|
}) {
|
|
63
|
-
if (!
|
|
63
|
+
if (!_chunkSO7T6GEWjs.packageExists.call(void 0, "playwright-chromium"))
|
|
64
64
|
throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D playwright-chromium`");
|
|
65
65
|
const pages = _core.parseRangeString.call(void 0, total, range);
|
|
66
|
-
const { chromium } = await Promise.resolve().then(() =>
|
|
66
|
+
const { chromium } = await Promise.resolve().then(() => _chunkSO7T6GEWjs.__toESM.call(void 0, _chunkSO7T6GEWjs.__require.call(void 0, "playwright-chromium")));
|
|
67
67
|
const browser = await chromium.launch();
|
|
68
68
|
const context = await browser.newContext({
|
|
69
69
|
viewport: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Vue from '@vitejs/plugin-vue';
|
|
2
2
|
import Icons from 'unplugin-icons/vite';
|
|
3
3
|
import Components from 'unplugin-vue-components/vite';
|
|
4
|
-
import Markdown from 'vite-plugin-
|
|
4
|
+
import Markdown from 'vite-plugin-vue-markdown';
|
|
5
5
|
import WindiCSS from 'vite-plugin-windicss';
|
|
6
|
+
import { VitePluginConfig } from 'unocss/vite';
|
|
6
7
|
import RemoteAssets from 'vite-plugin-remote-assets';
|
|
7
8
|
import ServerRef from 'vite-plugin-vue-server-ref';
|
|
8
9
|
import { ArgumentsType } from '@antfu/utils';
|
|
@@ -55,6 +56,7 @@ interface SlidevPluginOptions extends SlidevEntryOptions {
|
|
|
55
56
|
icons?: ArgumentsType<typeof Icons>[0];
|
|
56
57
|
remoteAssets?: ArgumentsType<typeof RemoteAssets>[0];
|
|
57
58
|
serverRef?: ArgumentsType<typeof ServerRef>[0];
|
|
59
|
+
unocss?: VitePluginConfig;
|
|
58
60
|
}
|
|
59
61
|
interface SlidevServerOptions {
|
|
60
62
|
onDataReload?: (newData: SlidevMarkdown, data: SlidevMarkdown) => void;
|
package/dist/index.js
CHANGED
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk5GSPMDNUjs = require('./chunk-5GSPMDNU.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkFROLEDLCjs = require('./chunk-FROLEDLC.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkSO7T6GEWjs = require('./chunk-SO7T6GEW.js');
|
|
20
20
|
|
|
21
21
|
// node/index.ts
|
|
22
|
-
|
|
22
|
+
_chunkSO7T6GEWjs.init_cjs_shims.call(void 0, );
|
|
23
23
|
|
|
24
24
|
// node/declare.ts
|
|
25
|
-
|
|
25
|
+
_chunkSO7T6GEWjs.init_cjs_shims.call(void 0, );
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -36,4 +36,4 @@ _chunkFFZLS6QKjs.init_cjs_shims.call(void 0, );
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
exports.ViteSlidevPlugin =
|
|
39
|
+
exports.ViteSlidevPlugin = _chunkFROLEDLCjs.ViteSlidevPlugin; exports.createServer = _chunk5GSPMDNUjs.createServer; exports.createWindiCSSPlugin = _chunkFROLEDLCjs.createWindiCSSPlugin; exports.getAddonRoots = _chunk5GSPMDNUjs.getAddonRoots; exports.getCLIRoot = _chunk5GSPMDNUjs.getCLIRoot; exports.getClientRoot = _chunk5GSPMDNUjs.getClientRoot; exports.getRoot = _chunk5GSPMDNUjs.getRoot; exports.getThemeRoots = _chunk5GSPMDNUjs.getThemeRoots; exports.getUserRoot = _chunk5GSPMDNUjs.getUserRoot; exports.isPath = _chunk5GSPMDNUjs.isPath; exports.parser = _chunk5GSPMDNUjs.parser; exports.resolveOptions = _chunk5GSPMDNUjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
isPath,
|
|
10
10
|
parser,
|
|
11
11
|
resolveOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QE663OGO.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ViteSlidevPlugin,
|
|
15
15
|
createWindiCSSPlugin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OGKTSZVU.mjs";
|
|
17
17
|
import {
|
|
18
18
|
init_esm_shims
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IWKTUAXD.mjs";
|
|
20
20
|
|
|
21
21
|
// node/index.ts
|
|
22
22
|
init_esm_shims();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,14 +43,15 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@antfu/utils": "^0.5.2",
|
|
46
|
-
"@iconify-json/carbon": "^1.1.
|
|
47
|
-
"@iconify-json/ph": "^1.1.
|
|
48
|
-
"@slidev/client": "0.
|
|
49
|
-
"@slidev/parser": "0.
|
|
50
|
-
"@slidev/types": "0.
|
|
46
|
+
"@iconify-json/carbon": "^1.1.6",
|
|
47
|
+
"@iconify-json/ph": "^1.1.2",
|
|
48
|
+
"@slidev/client": "0.34.0",
|
|
49
|
+
"@slidev/parser": "0.34.0",
|
|
50
|
+
"@slidev/types": "0.34.0",
|
|
51
|
+
"@unocss/reset": "^0.42.0",
|
|
51
52
|
"@vitejs/plugin-vue": "^2.3.3",
|
|
52
|
-
"@vue/compiler-sfc": "^3.2.
|
|
53
|
-
"cli-progress": "^3.11.
|
|
53
|
+
"@vue/compiler-sfc": "^3.2.37",
|
|
54
|
+
"cli-progress": "^3.11.2",
|
|
54
55
|
"codemirror": "^5.65.5",
|
|
55
56
|
"connect": "^3.7.0",
|
|
56
57
|
"debug": "^4.3.4",
|
|
@@ -59,39 +60,41 @@
|
|
|
59
60
|
"global-dirs": "^3.0.0",
|
|
60
61
|
"import-from": "^4.0.0",
|
|
61
62
|
"is-installed-globally": "^0.4.0",
|
|
62
|
-
"jiti": "^1.
|
|
63
|
+
"jiti": "^1.14.0",
|
|
63
64
|
"js-base64": "^3.7.2",
|
|
64
|
-
"katex": "^0.
|
|
65
|
+
"katex": "^0.16.0",
|
|
65
66
|
"kolorist": "^1.5.1",
|
|
66
67
|
"markdown-it": "^13.0.1",
|
|
67
68
|
"markdown-it-footnote": "^3.0.3",
|
|
68
69
|
"markdown-it-link-attributes": "^4.0.0",
|
|
69
70
|
"monaco-editor": "^0.33.0",
|
|
70
|
-
"nanoid": "^
|
|
71
|
+
"nanoid": "^4.0.0",
|
|
71
72
|
"open": "^8.4.0",
|
|
72
73
|
"plantuml-encoder": "^1.4.0",
|
|
74
|
+
"postcss-nested": "^5.0.6",
|
|
73
75
|
"prismjs": "^1.28.0",
|
|
74
76
|
"prompts": "^2.4.2",
|
|
75
|
-
"resolve": "^1.22.
|
|
77
|
+
"resolve": "^1.22.1",
|
|
76
78
|
"resolve-from": "^5.0.0",
|
|
77
79
|
"resolve-global": "^1.0.0",
|
|
78
80
|
"shiki": "^0.10.1",
|
|
79
|
-
"unplugin-icons": "^0.14.
|
|
80
|
-
"unplugin-vue-components": "^0.
|
|
81
|
-
"vite": "^2.9.
|
|
82
|
-
"vite-plugin-md": "^0.14.0",
|
|
81
|
+
"unplugin-icons": "^0.14.6",
|
|
82
|
+
"unplugin-vue-components": "^0.20.1",
|
|
83
|
+
"vite": "^2.9.13",
|
|
83
84
|
"vite-plugin-remote-assets": "^0.2.2",
|
|
85
|
+
"vite-plugin-vue-markdown": "^0.20.1",
|
|
84
86
|
"vite-plugin-vue-server-ref": "^0.2.4",
|
|
85
|
-
"vite-plugin-windicss": "^1.8.
|
|
86
|
-
"vue": "^3.2.
|
|
87
|
-
"windicss": "^3.5.
|
|
87
|
+
"vite-plugin-windicss": "^1.8.6",
|
|
88
|
+
"vue": "^3.2.37",
|
|
89
|
+
"windicss": "^3.5.5",
|
|
88
90
|
"yargs": "^17.5.1"
|
|
89
91
|
},
|
|
90
92
|
"devDependencies": {
|
|
91
93
|
"@types/plantuml-encoder": "^1.4.0",
|
|
92
94
|
"fast-deep-equal": "^3.1.3",
|
|
93
95
|
"semver": "^7.3.7",
|
|
94
|
-
"sirv": "^2.0.2"
|
|
96
|
+
"sirv": "^2.0.2",
|
|
97
|
+
"unocss": "^0.42.0"
|
|
95
98
|
},
|
|
96
99
|
"scripts": {
|
|
97
100
|
"build": "rimraf dist && tsup node/index.ts node/cli.ts --dts --format cjs,esm --splitting --external @slidev/client/package.json",
|