@slidev/cli 0.38.1 → 0.38.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.
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkBQ7BP5DLjs = require('./chunk-BQ7BP5DL.js');
5
+ var _chunkW2IZ2OEVjs = require('./chunk-W2IZ2OEV.js');
6
6
 
7
7
 
8
8
 
@@ -655,16 +655,16 @@ async function build(options, viteConfig = {}) {
655
655
  let originalIndexHTML;
656
656
  if (_fsextra2.default.existsSync(indexPath))
657
657
  originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
658
- await _fsextra2.default.writeFile(indexPath, await _chunkBQ7BP5DLjs.getIndexHtml.call(void 0, options), "utf-8");
658
+ await _fsextra2.default.writeFile(indexPath, await _chunkW2IZ2OEVjs.getIndexHtml.call(void 0, options), "utf-8");
659
659
  let config = void 0;
660
660
  try {
661
- const inlineConfig = await _chunkBQ7BP5DLjs.mergeViteConfigs.call(void 0,
661
+ const inlineConfig = await _chunkW2IZ2OEVjs.mergeViteConfigs.call(void 0,
662
662
  options,
663
663
  viteConfig,
664
664
  {
665
665
  root: options.userRoot,
666
666
  plugins: [
667
- await _chunkBQ7BP5DLjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
667
+ await _chunkW2IZ2OEVjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
668
668
  {
669
669
  name: "resolve-config",
670
670
  configResolved(_config) {
@@ -685,7 +685,7 @@ async function build(options, viteConfig = {}) {
685
685
  } else {
686
686
  console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
687
687
  await _vite.build.call(void 0,
688
- await _chunkBQ7BP5DLjs.mergeViteConfigs.call(void 0,
688
+ await _chunkW2IZ2OEVjs.mergeViteConfigs.call(void 0,
689
689
  options,
690
690
  inlineConfig,
691
691
  {
@@ -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-6GLH5C55.js")));
728
+ const { exportSlides } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-OIZT2CQS.js")));
729
729
  const port = 12445;
730
730
  const app = _connect2.default.call(void 0, );
731
731
  const server = _http2.default.createServer(app);
@@ -2,7 +2,7 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-HLY2TTS3.mjs";
5
+ } from "./chunk-CWYLQZTY.mjs";
6
6
  import {
7
7
  __require,
8
8
  __toESM,
@@ -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-ERXKQVMC.mjs")));
728
+ const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-JGJTLG7B.mjs")));
729
729
  const port = 12445;
730
730
  const app = connect();
731
731
  const server = http.createServer(app);
@@ -277,9 +277,9 @@ var dependencies = {
277
277
  "@slidev/parser": "workspace:*",
278
278
  "@slidev/types": "workspace:*",
279
279
  "@unocss/reset": "^0.47.6",
280
- "@vueuse/core": "^9.6.0",
280
+ "@vueuse/core": "^9.7.0",
281
281
  "@vueuse/head": "^1.0.22",
282
- "@vueuse/math": "^9.6.0",
282
+ "@vueuse/math": "^9.7.0",
283
283
  "@vueuse/motion": "^2.0.0-beta.26",
284
284
  codemirror: "^5.65.5",
285
285
  defu: "^6.1.1",
@@ -288,14 +288,14 @@ var dependencies = {
288
288
  "js-base64": "^3.7.3",
289
289
  "js-yaml": "^4.1.0",
290
290
  katex: "^0.16.4",
291
- mermaid: "^9.2.2",
291
+ mermaid: "^9.3.0",
292
292
  "monaco-editor": "^0.33.0",
293
293
  nanoid: "^4.0.0",
294
294
  prettier: "^2.8.1",
295
295
  recordrtc: "^5.6.2",
296
296
  resolve: "^1.22.1",
297
297
  unocss: "^0.47.6",
298
- "vite-plugin-windicss": "^1.8.9",
298
+ "vite-plugin-windicss": "^1.8.10",
299
299
  vue: "^3.2.45",
300
300
  "vue-router": "^4.1.6",
301
301
  "vue-starport": "^0.3.0",
@@ -276,9 +276,9 @@ var dependencies = {
276
276
  "@slidev/parser": "workspace:*",
277
277
  "@slidev/types": "workspace:*",
278
278
  "@unocss/reset": "^0.47.6",
279
- "@vueuse/core": "^9.6.0",
279
+ "@vueuse/core": "^9.7.0",
280
280
  "@vueuse/head": "^1.0.22",
281
- "@vueuse/math": "^9.6.0",
281
+ "@vueuse/math": "^9.7.0",
282
282
  "@vueuse/motion": "^2.0.0-beta.26",
283
283
  codemirror: "^5.65.5",
284
284
  defu: "^6.1.1",
@@ -287,14 +287,14 @@ var dependencies = {
287
287
  "js-base64": "^3.7.3",
288
288
  "js-yaml": "^4.1.0",
289
289
  katex: "^0.16.4",
290
- mermaid: "^9.2.2",
290
+ mermaid: "^9.3.0",
291
291
  "monaco-editor": "^0.33.0",
292
292
  nanoid: "^4.0.0",
293
293
  prettier: "^2.8.1",
294
294
  recordrtc: "^5.6.2",
295
295
  resolve: "^1.22.1",
296
296
  unocss: "^0.47.6",
297
- "vite-plugin-windicss": "^1.8.9",
297
+ "vite-plugin-windicss": "^1.8.10",
298
298
  vue: "^3.2.45",
299
299
  "vue-router": "^4.1.6",
300
300
  "vue-starport": "^0.3.0",
@@ -1,7 +1,7 @@
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 }; }
2
2
 
3
3
 
4
- var _chunkBQ7BP5DLjs = require('./chunk-BQ7BP5DL.js');
4
+ var _chunkW2IZ2OEVjs = require('./chunk-W2IZ2OEV.js');
5
5
 
6
6
 
7
7
 
@@ -2426,7 +2426,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
2426
2426
  const pluginOptions = rawConfig.slidev || {};
2427
2427
  process.env.EDITOR = process.env.EDITOR || "code";
2428
2428
  const server = await _vite.createServer.call(void 0,
2429
- await _chunkBQ7BP5DLjs.mergeViteConfigs.call(void 0,
2429
+ await _chunkW2IZ2OEVjs.mergeViteConfigs.call(void 0,
2430
2430
  options,
2431
2431
  viteConfig,
2432
2432
  {
@@ -2436,7 +2436,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
2436
2436
  ]
2437
2437
  },
2438
2438
  plugins: [
2439
- await _chunkBQ7BP5DLjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
2439
+ await _chunkW2IZ2OEVjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
2440
2440
  ]
2441
2441
  },
2442
2442
  "serve"
@@ -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.1";
2453
+ var version = "0.38.2";
2454
2454
 
2455
2455
  // node/themes.ts
2456
2456
  _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
3
  mergeViteConfigs
4
- } from "./chunk-HLY2TTS3.mjs";
4
+ } from "./chunk-CWYLQZTY.mjs";
5
5
  import {
6
6
  __commonJS,
7
7
  __dirname,
@@ -2451,7 +2451,7 @@ init_esm_shims();
2451
2451
  import * as parser from "@slidev/parser/fs";
2452
2452
 
2453
2453
  // package.json
2454
- var version = "0.38.1";
2454
+ var version = "0.38.2";
2455
2455
 
2456
2456
  // node/themes.ts
2457
2457
  init_esm_shims();
package/dist/cli.js CHANGED
@@ -9,11 +9,11 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkGJNTJKIAjs = require('./chunk-GJNTJKIA.js');
12
+ var _chunkWASFPW47js = require('./chunk-WASFPW47.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkBQ7BP5DLjs = require('./chunk-BQ7BP5DL.js');
16
+ var _chunkW2IZ2OEVjs = require('./chunk-W2IZ2OEV.js');
17
17
 
18
18
 
19
19
 
@@ -22,7 +22,7 @@ var _chunkOVFYMGU6js = require('./chunk-OVFYMGU6.js');
22
22
 
23
23
  // node/cli.ts
24
24
  _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
25
- var import_fast_deep_equal = _chunkOVFYMGU6js.__toESM.call(void 0, _chunkBQ7BP5DLjs.require_fast_deep_equal.call(void 0, ));
25
+ var import_fast_deep_equal = _chunkOVFYMGU6js.__toESM.call(void 0, _chunkW2IZ2OEVjs.require_fast_deep_equal.call(void 0, ));
26
26
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
27
27
  var _net = require('net'); var _net2 = _interopRequireDefault(_net);
28
28
  var _os = require('os'); var _os2 = _interopRequireDefault(_os);
@@ -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
- _chunkGJNTJKIAjs.getUserRoot.call(void 0, {}).userRoot,
51
- ..._chunkGJNTJKIAjs.getAddonRoots.call(void 0, addons, ""),
52
- _chunkGJNTJKIAjs.getClientRoot.call(void 0, )
50
+ _chunkWASFPW47js.getUserRoot.call(void 0, {}).userRoot,
51
+ ..._chunkWASFPW47js.getAddonRoots.call(void 0, addons, ""),
52
+ _chunkWASFPW47js.getClientRoot.call(void 0, )
53
53
  ];
54
54
  const mergeArrays = (a, b) => a.concat(b);
55
- return await _chunkBQ7BP5DLjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
55
+ return await _chunkW2IZ2OEVjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
56
56
  });
57
- var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkGJNTJKIAjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
57
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkWASFPW47js.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 _chunkGJNTJKIAjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
108
+ const options = await _chunkWASFPW47js.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
109
109
  port = userPort || await findFreePort(3030);
110
- server = await _chunkGJNTJKIAjs.createServer.call(void 0,
110
+ server = await _chunkWASFPW47js.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 && _chunkGJNTJKIAjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkGJNTJKIAjs.resolveThemeName.call(void 0, data.config.theme)) {
124
+ if (!theme && _chunkWASFPW47js.resolveThemeName.call(void 0, newData.config.theme) !== _chunkWASFPW47js.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-ZXAFCRGR.js")));
211
- const options = await _chunkGJNTJKIAjs.resolveOptions.call(void 0, { entry, theme, inspect }, "build");
210
+ const { build } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./build-3EAJCMHL.js")));
211
+ const options = await _chunkWASFPW47js.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 _chunkGJNTJKIAjs.parser.load(entry);
230
- _chunkGJNTJKIAjs.parser.prettify(data);
231
- await _chunkGJNTJKIAjs.parser.save(data);
229
+ const data = await _chunkWASFPW47js.parser.load(entry);
230
+ _chunkWASFPW47js.parser.prettify(data);
231
+ await _chunkWASFPW47js.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 _chunkGJNTJKIAjs.parser.load(entry);
247
- const theme = _chunkGJNTJKIAjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
246
+ const data = await _chunkWASFPW47js.parser.load(entry);
247
+ const theme = _chunkWASFPW47js.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 (_chunkGJNTJKIAjs.isPath.call(void 0, theme)) {
252
+ if (_chunkWASFPW47js.isPath.call(void 0, theme)) {
253
253
  console.error("Theme is already ejected");
254
254
  process.exit(1);
255
255
  }
256
- const roots = _chunkGJNTJKIAjs.getThemeRoots.call(void 0, theme, entry);
256
+ const roots = _chunkWASFPW47js.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 _chunkGJNTJKIAjs.parser.save(data);
268
+ await _chunkWASFPW47js.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-6GLH5C55.js")));
326
+ const { exportSlides } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-OIZT2CQS.js")));
327
327
  const port = await findFreePort(12445);
328
- const options = await _chunkGJNTJKIAjs.resolveOptions.call(void 0, { entry, theme }, "build");
328
+ const options = await _chunkWASFPW47js.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 _chunkGJNTJKIAjs.createServer.call(void 0,
330
+ const server = await _chunkWASFPW47js.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
- _chunkGJNTJKIAjs.parser.filterDisabled(options.data);
339
+ _chunkWASFPW47js.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({
@@ -371,18 +371,23 @@ cli.command(
371
371
  }).option("output", {
372
372
  type: "string",
373
373
  describe: "path to the output"
374
+ }).option("timeout", {
375
+ default: 3e4,
376
+ type: "number",
377
+ describe: "timeout for rendering the print page"
374
378
  }).strict().help(),
375
379
  async ({
376
380
  entry,
377
- output
381
+ output,
382
+ timeout
378
383
  }) => {
379
384
  process.env.NODE_ENV = "production";
380
- const { exportNotes } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-6GLH5C55.js")));
385
+ const { exportNotes } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-OIZT2CQS.js")));
381
386
  const port = await findFreePort(12445);
382
- const options = await _chunkGJNTJKIAjs.resolveOptions.call(void 0, { entry }, "build");
387
+ const options = await _chunkWASFPW47js.resolveOptions.call(void 0, { entry }, "build");
383
388
  if (!output)
384
389
  output = options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entry, ".md")}-export-notes`;
385
- const server = await _chunkGJNTJKIAjs.createServer.call(void 0,
390
+ const server = await _chunkWASFPW47js.createServer.call(void 0,
386
391
  options,
387
392
  {
388
393
  server: { port },
@@ -391,10 +396,11 @@ cli.command(
391
396
  );
392
397
  await server.listen(port);
393
398
  printInfo(options);
394
- _chunkGJNTJKIAjs.parser.filterDisabled(options.data);
399
+ _chunkWASFPW47js.parser.filterDisabled(options.data);
395
400
  output = await exportNotes({
396
401
  port,
397
- output
402
+ output,
403
+ timeout
398
404
  });
399
405
  console.log(`${_kolorist.green.call(void 0, " \u2713 ")}${_kolorist.dim.call(void 0, "exported to ")}./${output}
400
406
  `);
@@ -418,7 +424,7 @@ function printInfo(options, port, remote) {
418
424
  console.log();
419
425
  console.log();
420
426
  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${_chunkGJNTJKIAjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
427
+ console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkWASFPW47js.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
422
428
  console.log();
423
429
  console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
424
430
  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,11 +9,11 @@ import {
9
9
  resolveOptions,
10
10
  resolveThemeName,
11
11
  version
12
- } from "./chunk-JNKN7NBO.mjs";
12
+ } from "./chunk-ZM2W3WD5.mjs";
13
13
  import {
14
14
  loadSetups,
15
15
  require_fast_deep_equal
16
- } from "./chunk-HLY2TTS3.mjs";
16
+ } from "./chunk-CWYLQZTY.mjs";
17
17
  import {
18
18
  __dirname,
19
19
  __require,
@@ -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-2FE54GJC.mjs")));
211
+ const { build } = await Promise.resolve().then(() => __toESM(__require("./build-ZVJV76M5.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-ERXKQVMC.mjs")));
327
+ const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-JGJTLG7B.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`;
@@ -372,13 +372,18 @@ cli.command(
372
372
  }).option("output", {
373
373
  type: "string",
374
374
  describe: "path to the output"
375
+ }).option("timeout", {
376
+ default: 3e4,
377
+ type: "number",
378
+ describe: "timeout for rendering the print page"
375
379
  }).strict().help(),
376
380
  async ({
377
381
  entry,
378
- output
382
+ output,
383
+ timeout
379
384
  }) => {
380
385
  process.env.NODE_ENV = "production";
381
- const { exportNotes } = await Promise.resolve().then(() => __toESM(__require("./export-ERXKQVMC.mjs")));
386
+ const { exportNotes } = await Promise.resolve().then(() => __toESM(__require("./export-JGJTLG7B.mjs")));
382
387
  const port = await findFreePort(12445);
383
388
  const options = await resolveOptions({ entry }, "build");
384
389
  if (!output)
@@ -395,7 +400,8 @@ cli.command(
395
400
  parser.filterDisabled(options.data);
396
401
  output = await exportNotes({
397
402
  port,
398
- output
403
+ output,
404
+ timeout
399
405
  });
400
406
  console.log(`${green(" \u2713 ")}${dim("exported to ")}./${output}
401
407
  `);
@@ -74,7 +74,8 @@ function createSlidevProgress(indeterminate = false) {
74
74
  async function exportNotes({
75
75
  port = 18724,
76
76
  base = "/",
77
- output = "notes"
77
+ output = "notes",
78
+ timeout = 3e4
78
79
  }) {
79
80
  if (!packageExists("playwright-chromium"))
80
81
  throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D playwright-chromium`");
@@ -86,7 +87,7 @@ async function exportNotes({
86
87
  progress.start(1);
87
88
  if (!output.endsWith(".pdf"))
88
89
  output = `${output}.pdf`;
89
- await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil: "networkidle" });
90
+ await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil: "networkidle", timeout });
90
91
  await page.waitForLoadState("networkidle");
91
92
  await page.emulateMedia({ media: "screen" });
92
93
  await page.pdf({
@@ -74,7 +74,8 @@ function createSlidevProgress(indeterminate = false) {
74
74
  async function exportNotes({
75
75
  port = 18724,
76
76
  base = "/",
77
- output = "notes"
77
+ output = "notes",
78
+ timeout = 3e4
78
79
  }) {
79
80
  if (!_chunkOVFYMGU6js.packageExists.call(void 0, "playwright-chromium"))
80
81
  throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D playwright-chromium`");
@@ -86,7 +87,7 @@ async function exportNotes({
86
87
  progress.start(1);
87
88
  if (!output.endsWith(".pdf"))
88
89
  output = `${output}.pdf`;
89
- await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil: "networkidle" });
90
+ await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil: "networkidle", timeout });
90
91
  await page.waitForLoadState("networkidle");
91
92
  await page.emulateMedia({ media: "screen" });
92
93
  await page.pdf({
package/dist/index.js CHANGED
@@ -9,11 +9,11 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkGJNTJKIAjs = require('./chunk-GJNTJKIA.js');
12
+ var _chunkWASFPW47js = require('./chunk-WASFPW47.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkBQ7BP5DLjs = require('./chunk-BQ7BP5DL.js');
16
+ var _chunkW2IZ2OEVjs = require('./chunk-W2IZ2OEV.js');
17
17
 
18
18
 
19
19
  var _chunkOVFYMGU6js = require('./chunk-OVFYMGU6.js');
@@ -36,4 +36,4 @@ _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
36
36
 
37
37
 
38
38
 
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;
39
+ exports.ViteSlidevPlugin = _chunkW2IZ2OEVjs.ViteSlidevPlugin; exports.createServer = _chunkWASFPW47js.createServer; exports.createWindiCSSPlugin = _chunkW2IZ2OEVjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkWASFPW47js.getAddonRoots; exports.getCLIRoot = _chunkWASFPW47js.getCLIRoot; exports.getClientRoot = _chunkWASFPW47js.getClientRoot; exports.getRoot = _chunkWASFPW47js.getRoot; exports.getThemeRoots = _chunkWASFPW47js.getThemeRoots; exports.getUserRoot = _chunkWASFPW47js.getUserRoot; exports.isPath = _chunkWASFPW47js.isPath; exports.parser = _chunkWASFPW47js.parser; exports.resolveOptions = _chunkWASFPW47js.resolveOptions;
package/dist/index.mjs CHANGED
@@ -9,11 +9,11 @@ import {
9
9
  isPath,
10
10
  parser,
11
11
  resolveOptions
12
- } from "./chunk-JNKN7NBO.mjs";
12
+ } from "./chunk-ZM2W3WD5.mjs";
13
13
  import {
14
14
  ViteSlidevPlugin,
15
15
  createWindiCSSPlugin
16
- } from "./chunk-HLY2TTS3.mjs";
16
+ } from "./chunk-CWYLQZTY.mjs";
17
17
  import {
18
18
  init_esm_shims
19
19
  } from "./chunk-T5WFA52O.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.38.1",
3
+ "version": "0.38.2",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -75,22 +75,22 @@
75
75
  "resolve": "^1.22.1",
76
76
  "resolve-from": "^5.0.0",
77
77
  "resolve-global": "^1.0.0",
78
- "shiki": "^0.11.1",
78
+ "shiki": "^0.12.1",
79
79
  "unocss": "^0.47.6",
80
80
  "unplugin-icons": "^0.14.15",
81
81
  "unplugin-vue-components": "^0.22.12",
82
- "vite": "^4.0.1",
83
- "vite-plugin-inspect": "^0.7.10",
82
+ "vite": "^4.0.2",
83
+ "vite-plugin-inspect": "^0.7.11",
84
84
  "vite-plugin-remote-assets": "^0.3.0",
85
85
  "vite-plugin-vue-markdown": "^0.22.1",
86
86
  "vite-plugin-vue-server-ref": "^0.3.0",
87
- "vite-plugin-windicss": "^1.8.9",
87
+ "vite-plugin-windicss": "^1.8.10",
88
88
  "vue": "^3.2.45",
89
89
  "windicss": "^3.5.6",
90
90
  "yargs": "^17.6.2",
91
- "@slidev/client": "0.38.1",
92
- "@slidev/parser": "0.38.1",
93
- "@slidev/types": "0.38.1"
91
+ "@slidev/client": "0.38.2",
92
+ "@slidev/parser": "0.38.2",
93
+ "@slidev/types": "0.38.2"
94
94
  },
95
95
  "devDependencies": {
96
96
  "@types/plantuml-encoder": "^1.4.0",