@slidev/cli 0.40.3 → 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.
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunk6NWTPU4Jjs = require('./chunk-6NWTPU4J.js');
5
+ var _chunkFT5Y6KDWjs = require('./chunk-FT5Y6KDW.js');
6
6
  require('./chunk-GE7W2DBE.js');
7
7
 
8
8
  // node/build.ts
@@ -646,16 +646,16 @@ async function build(options, viteConfig = {}, args) {
646
646
  let originalIndexHTML;
647
647
  if (_fsextra2.default.existsSync(indexPath))
648
648
  originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
649
- await _fsextra2.default.writeFile(indexPath, await _chunk6NWTPU4Jjs.getIndexHtml.call(void 0, options), "utf-8");
649
+ await _fsextra2.default.writeFile(indexPath, await _chunkFT5Y6KDWjs.getIndexHtml.call(void 0, options), "utf-8");
650
650
  let config = void 0;
651
651
  try {
652
- const inlineConfig = await _chunk6NWTPU4Jjs.mergeViteConfigs.call(void 0,
652
+ const inlineConfig = await _chunkFT5Y6KDWjs.mergeViteConfigs.call(void 0,
653
653
  options,
654
654
  viteConfig,
655
655
  {
656
656
  root: options.userRoot,
657
657
  plugins: [
658
- await _chunk6NWTPU4Jjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
658
+ await _chunkFT5Y6KDWjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
659
659
  {
660
660
  name: "resolve-config",
661
661
  configResolved(_config) {
@@ -676,7 +676,7 @@ async function build(options, viteConfig = {}, args) {
676
676
  } else {
677
677
  console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
678
678
  await _vite.build.call(void 0,
679
- await _chunk6NWTPU4Jjs.mergeViteConfigs.call(void 0,
679
+ await _chunkFT5Y6KDWjs.mergeViteConfigs.call(void 0,
680
680
  options,
681
681
  inlineConfig,
682
682
  {
@@ -717,7 +717,7 @@ async function build(options, viteConfig = {}, args) {
717
717
  await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
718
718
  `, "utf-8");
719
719
  if ([true, "true", "auto"].includes(options.data.config.download)) {
720
- const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-DLPDCYMZ.js"));
720
+ const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-INNI35CW.js"));
721
721
  const port = 12445;
722
722
  const app = _connect2.default.call(void 0, );
723
723
  const server = _http2.default.createServer(app);
@@ -2,7 +2,7 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-JA6SMOG4.mjs";
5
+ } from "./chunk-46GOGODM.mjs";
6
6
  import "./chunk-CTG3GV2W.mjs";
7
7
 
8
8
  // node/build.ts
@@ -717,7 +717,7 @@ async function build(options, viteConfig = {}, args) {
717
717
  await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
718
718
  `, "utf-8");
719
719
  if ([true, "true", "auto"].includes(options.data.config.download)) {
720
- const { exportSlides, getExportOptions } = await import("./export-J6WWCAPJ.mjs");
720
+ const { exportSlides, getExportOptions } = await import("./export-N3YCMXVO.mjs");
721
721
  const port = 12445;
722
722
  const app = connect();
723
723
  const server = http.createServer(app);
@@ -269,10 +269,10 @@ var dependencies = {
269
269
  "@antfu/utils": "^0.7.2",
270
270
  "@slidev/parser": "workspace:*",
271
271
  "@slidev/types": "workspace:*",
272
- "@unocss/reset": "^0.49.4",
273
- "@vueuse/core": "^9.12.0",
274
- "@vueuse/head": "^1.0.25",
275
- "@vueuse/math": "^9.12.0",
272
+ "@unocss/reset": "^0.50.6",
273
+ "@vueuse/core": "^9.13.0",
274
+ "@vueuse/head": "^1.1.23",
275
+ "@vueuse/math": "^9.13.0",
276
276
  "@vueuse/motion": "^2.0.0-beta.27",
277
277
  codemirror: "^5.65.5",
278
278
  defu: "^6.1.2",
@@ -281,13 +281,13 @@ var dependencies = {
281
281
  "js-base64": "^3.7.5",
282
282
  "js-yaml": "^4.1.0",
283
283
  katex: "^0.16.4",
284
- mermaid: "^9.3.0",
284
+ mermaid: "^9.4.3",
285
285
  "monaco-editor": "^0.33.0",
286
286
  nanoid: "^4.0.1",
287
- prettier: "^2.8.4",
287
+ prettier: "^2.8.6",
288
288
  recordrtc: "^5.6.2",
289
289
  resolve: "^1.22.1",
290
- unocss: "^0.49.4",
290
+ unocss: "^0.50.6",
291
291
  "vite-plugin-windicss": "^1.8.10",
292
292
  vue: "^3.2.47",
293
293
  "vue-router": "^4.1.6",
@@ -406,11 +406,11 @@ function createConfigPlugin(options) {
406
406
  ...isInstalledGlobally ? [dirname4(resolveGlobalImportPath("@slidev/client/package.json")), dirname4(resolveGlobalImportPath("katex/package.json"))] : []
407
407
  ])
408
408
  }
409
- }
409
+ },
410
+ publicDir: join4(options.userRoot, "public")
410
411
  };
411
412
  if (isInstalledGlobally) {
412
413
  injection.cacheDir = join4(options.cliRoot, "node_modules/.vite");
413
- injection.publicDir = join4(options.userRoot, "public");
414
414
  injection.root = options.cliRoot;
415
415
  injection.resolve.alias.vue = `${resolveImportPath("vue/dist/vue.esm-browser.js", true)}`;
416
416
  }
@@ -527,6 +527,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
527
527
  var _a, _b, _c;
528
528
  if (!data.entries.some((i) => slash2(i) === ctx.file))
529
529
  return;
530
+ await ctx.read();
530
531
  const newData = await parser.load(entry, data.themeMeta);
531
532
  const moduleIds = /* @__PURE__ */ new Set();
532
533
  if (data.slides.length !== newData.slides.length) {
@@ -1401,6 +1402,13 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1401
1402
  });
1402
1403
  }
1403
1404
  function transformMarkdownMonaco(md2) {
1405
+ md2 = md2.replace(/^```(\w+?)\s*{monaco-diff}\s*?({.*?})?\s*?\n([\s\S]+?)^~~~\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code, diff) => {
1406
+ lang = lang.trim();
1407
+ options = options.trim() || "{}";
1408
+ const encoded = base64.encode(code, true);
1409
+ const encodedDiff = base64.encode(diff, true);
1410
+ return `<Monaco :code="'${encoded}'" :diff="'${encodedDiff}'" lang="${lang}" v-bind="${options}" />`;
1411
+ });
1404
1412
  md2 = md2.replace(/^```(\w+?)\s*{monaco}\s*?({.*?})?\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code) => {
1405
1413
  lang = lang.trim();
1406
1414
  options = options.trim() || "{}";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
3
  mergeViteConfigs
4
- } from "./chunk-JA6SMOG4.mjs";
4
+ } from "./chunk-46GOGODM.mjs";
5
5
  import {
6
6
  __commonJS,
7
7
  __privateAdd,
@@ -2406,7 +2406,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
2406
2406
  import * as parser from "@slidev/parser/fs";
2407
2407
 
2408
2408
  // package.json
2409
- var version = "0.40.3";
2409
+ var version = "0.40.4";
2410
2410
 
2411
2411
  // node/themes.ts
2412
2412
  import prompts2 from "prompts";
@@ -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 }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunk6NWTPU4Jjs = require('./chunk-6NWTPU4J.js');
4
+ var _chunkFT5Y6KDWjs = require('./chunk-FT5Y6KDW.js');
5
5
 
6
6
 
7
7
 
@@ -2383,7 +2383,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
2383
2383
  const pluginOptions = rawConfig.slidev || {};
2384
2384
  process.env.EDITOR = process.env.EDITOR || "code";
2385
2385
  const server = await _vite.createServer.call(void 0,
2386
- await _chunk6NWTPU4Jjs.mergeViteConfigs.call(void 0,
2386
+ await _chunkFT5Y6KDWjs.mergeViteConfigs.call(void 0,
2387
2387
  options,
2388
2388
  viteConfig,
2389
2389
  {
@@ -2393,7 +2393,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
2393
2393
  ]
2394
2394
  },
2395
2395
  plugins: [
2396
- await _chunk6NWTPU4Jjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
2396
+ await _chunkFT5Y6KDWjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
2397
2397
  ]
2398
2398
  },
2399
2399
  "serve"
@@ -2406,7 +2406,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
2406
2406
  var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
2407
2407
 
2408
2408
  // package.json
2409
- var version = "0.40.3";
2409
+ var version = "0.40.4";
2410
2410
 
2411
2411
  // node/themes.ts
2412
2412
  var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
@@ -269,10 +269,10 @@ var dependencies = {
269
269
  "@antfu/utils": "^0.7.2",
270
270
  "@slidev/parser": "workspace:*",
271
271
  "@slidev/types": "workspace:*",
272
- "@unocss/reset": "^0.49.4",
273
- "@vueuse/core": "^9.12.0",
274
- "@vueuse/head": "^1.0.25",
275
- "@vueuse/math": "^9.12.0",
272
+ "@unocss/reset": "^0.50.6",
273
+ "@vueuse/core": "^9.13.0",
274
+ "@vueuse/head": "^1.1.23",
275
+ "@vueuse/math": "^9.13.0",
276
276
  "@vueuse/motion": "^2.0.0-beta.27",
277
277
  codemirror: "^5.65.5",
278
278
  defu: "^6.1.2",
@@ -281,13 +281,13 @@ var dependencies = {
281
281
  "js-base64": "^3.7.5",
282
282
  "js-yaml": "^4.1.0",
283
283
  katex: "^0.16.4",
284
- mermaid: "^9.3.0",
284
+ mermaid: "^9.4.3",
285
285
  "monaco-editor": "^0.33.0",
286
286
  nanoid: "^4.0.1",
287
- prettier: "^2.8.4",
287
+ prettier: "^2.8.6",
288
288
  recordrtc: "^5.6.2",
289
289
  resolve: "^1.22.1",
290
- unocss: "^0.49.4",
290
+ unocss: "^0.50.6",
291
291
  "vite-plugin-windicss": "^1.8.10",
292
292
  vue: "^3.2.47",
293
293
  "vue-router": "^4.1.6",
@@ -406,11 +406,11 @@ function createConfigPlugin(options) {
406
406
  ..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
407
407
  ])
408
408
  }
409
- }
409
+ },
410
+ publicDir: _path.join.call(void 0, options.userRoot, "public")
410
411
  };
411
412
  if (_isinstalledglobally2.default) {
412
413
  injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
413
- injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
414
414
  injection.root = options.cliRoot;
415
415
  injection.resolve.alias.vue = `${_chunkGE7W2DBEjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
416
416
  }
@@ -527,6 +527,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
527
527
  var _a, _b, _c;
528
528
  if (!data.entries.some((i) => _utils.slash.call(void 0, i) === ctx.file))
529
529
  return;
530
+ await ctx.read();
530
531
  const newData = await parser.load(entry, data.themeMeta);
531
532
  const moduleIds = /* @__PURE__ */ new Set();
532
533
  if (data.slides.length !== newData.slides.length) {
@@ -1401,6 +1402,13 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1401
1402
  });
1402
1403
  }
1403
1404
  function transformMarkdownMonaco(md2) {
1405
+ md2 = md2.replace(/^```(\w+?)\s*{monaco-diff}\s*?({.*?})?\s*?\n([\s\S]+?)^~~~\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code, diff) => {
1406
+ lang = lang.trim();
1407
+ options = options.trim() || "{}";
1408
+ const encoded = base64.encode(code, true);
1409
+ const encodedDiff = base64.encode(diff, true);
1410
+ return `<Monaco :code="'${encoded}'" :diff="'${encodedDiff}'" lang="${lang}" v-bind="${options}" />`;
1411
+ });
1404
1412
  md2 = md2.replace(/^```(\w+?)\s*{monaco}\s*?({.*?})?\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code) => {
1405
1413
  lang = lang.trim();
1406
1414
  options = options.trim() || "{}";
package/dist/cli.js CHANGED
@@ -9,17 +9,17 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkZ62L2OLLjs = require('./chunk-Z62L2OLL.js');
12
+ var _chunkCKLR5LMVjs = require('./chunk-CKLR5LMV.js');
13
13
 
14
14
 
15
15
 
16
- var _chunk6NWTPU4Jjs = require('./chunk-6NWTPU4J.js');
16
+ var _chunkFT5Y6KDWjs = require('./chunk-FT5Y6KDW.js');
17
17
 
18
18
 
19
19
  var _chunkGE7W2DBEjs = require('./chunk-GE7W2DBE.js');
20
20
 
21
21
  // node/cli.ts
22
- var import_fast_deep_equal = _chunkGE7W2DBEjs.__toESM.call(void 0, _chunk6NWTPU4Jjs.require_fast_deep_equal.call(void 0, ));
22
+ var import_fast_deep_equal = _chunkGE7W2DBEjs.__toESM.call(void 0, _chunkFT5Y6KDWjs.require_fast_deep_equal.call(void 0, ));
23
23
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
24
24
  var _os = require('os'); var _os2 = _interopRequireDefault(_os);
25
25
  var _child_process = require('child_process');
@@ -45,15 +45,15 @@ _fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) =>
45
45
  const roots = (
46
46
  /* uniq */
47
47
  [
48
- _chunkZ62L2OLLjs.getUserRoot.call(void 0, {}).userRoot,
49
- ..._chunkZ62L2OLLjs.getAddonRoots.call(void 0, addons, ""),
50
- _chunkZ62L2OLLjs.getClientRoot.call(void 0, )
48
+ _chunkCKLR5LMVjs.getUserRoot.call(void 0, {}).userRoot,
49
+ ..._chunkCKLR5LMVjs.getAddonRoots.call(void 0, addons, ""),
50
+ _chunkCKLR5LMVjs.getClientRoot.call(void 0, )
51
51
  ]
52
52
  );
53
53
  const mergeArrays = (a, b) => a.concat(b);
54
- return await _chunk6NWTPU4Jjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
54
+ return await _chunkFT5Y6KDWjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
55
55
  });
56
- var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkZ62L2OLLjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
56
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkCKLR5LMVjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
57
57
  cli.command(
58
58
  "* [entry]",
59
59
  "Start a local server for Slidev",
@@ -109,9 +109,9 @@ cli.command(
109
109
  async function initServer() {
110
110
  if (server)
111
111
  await server.close();
112
- const options = await _chunkZ62L2OLLjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
112
+ const options = await _chunkCKLR5LMVjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
113
113
  port = userPort || await findFreePort(3030);
114
- server = await _chunkZ62L2OLLjs.createServer.call(void 0,
114
+ server = await _chunkCKLR5LMVjs.createServer.call(void 0,
115
115
  options,
116
116
  {
117
117
  server: {
@@ -125,7 +125,7 @@ cli.command(
125
125
  },
126
126
  {
127
127
  onDataReload(newData, data) {
128
- if (!theme && _chunkZ62L2OLLjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkZ62L2OLLjs.resolveThemeName.call(void 0, data.config.theme)) {
128
+ if (!theme && _chunkCKLR5LMVjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkCKLR5LMVjs.resolveThemeName.call(void 0, data.config.theme)) {
129
129
  console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
130
130
  initServer();
131
131
  } else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
@@ -218,7 +218,7 @@ ${_kolorist.dim.call(void 0, " QR Code for remote control: ")}
218
218
  }
219
219
  );
220
220
  cli.command(
221
- "build [entry]",
221
+ "build [entry..]",
222
222
  "Build hostable SPA",
223
223
  (args) => exportOptions(commonOptions(args)).option("watch", {
224
224
  alias: "w",
@@ -243,28 +243,32 @@ cli.command(
243
243
  }).strict().help(),
244
244
  async (args) => {
245
245
  const { entry, theme, watch, base, download, out, inspect } = args;
246
- const { build } = await Promise.resolve().then(() => require("./build-XITW5QXZ.js"));
247
- const options = await _chunkZ62L2OLLjs.resolveOptions.call(void 0, { entry, theme, inspect }, "build");
248
- if (download && !options.data.config.download)
249
- options.data.config.download = download;
250
- printInfo(options);
251
- await build(options, {
252
- base,
253
- build: {
254
- watch: watch ? {} : void 0,
255
- outDir: out
256
- }
257
- }, args);
246
+ const { build } = await Promise.resolve().then(() => require("./build-HVQ7GG2W.js"));
247
+ for (const entryFile of entry) {
248
+ const options = await _chunkCKLR5LMVjs.resolveOptions.call(void 0, { 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 : _path2.default.join(out, _path2.default.basename(entryFile, ".md"))
257
+ }
258
+ }, { ...args, entry: entryFile });
259
+ }
258
260
  }
259
261
  );
260
262
  cli.command(
261
- "format [entry]",
263
+ "format [entry..]",
262
264
  "Format the markdown file",
263
265
  (args) => commonOptions(args).strict().help(),
264
266
  async ({ entry }) => {
265
- const data = await _chunkZ62L2OLLjs.parser.load(entry);
266
- _chunkZ62L2OLLjs.parser.prettify(data);
267
- await _chunkZ62L2OLLjs.parser.save(data);
267
+ for (const entryFile of entry) {
268
+ const data = await _chunkCKLR5LMVjs.parser.load(entryFile);
269
+ _chunkCKLR5LMVjs.parser.prettify(data);
270
+ await _chunkCKLR5LMVjs.parser.save(data);
271
+ }
268
272
  }
269
273
  );
270
274
  cli.command(
@@ -279,17 +283,17 @@ cli.command(
279
283
  default: "theme"
280
284
  }),
281
285
  async ({ entry, dir, theme: themeInput }) => {
282
- const data = await _chunkZ62L2OLLjs.parser.load(entry);
283
- const theme = _chunkZ62L2OLLjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
286
+ const data = await _chunkCKLR5LMVjs.parser.load(entry);
287
+ const theme = _chunkCKLR5LMVjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
284
288
  if (theme === "none") {
285
289
  console.error('Cannot eject theme "none"');
286
290
  process.exit(1);
287
291
  }
288
- if (_chunkZ62L2OLLjs.isPath.call(void 0, theme)) {
292
+ if (_chunkCKLR5LMVjs.isPath.call(void 0, theme)) {
289
293
  console.error("Theme is already ejected");
290
294
  process.exit(1);
291
295
  }
292
- const roots = _chunkZ62L2OLLjs.getThemeRoots.call(void 0, theme, entry);
296
+ const roots = _chunkCKLR5LMVjs.getThemeRoots.call(void 0, theme, entry);
293
297
  if (!roots.length) {
294
298
  console.error(`Could not find theme "${theme}"`);
295
299
  process.exit(1);
@@ -301,7 +305,7 @@ cli.command(
301
305
  const dirPath = `./${dir}`;
302
306
  data.slides[0].frontmatter.theme = dirPath;
303
307
  data.slides[0].raw = null;
304
- await _chunkZ62L2OLLjs.parser.save(data);
308
+ await _chunkCKLR5LMVjs.parser.save(data);
305
309
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
306
310
  }
307
311
  );
@@ -312,37 +316,39 @@ cli.command(
312
316
  }
313
317
  );
314
318
  cli.command(
315
- "export [entry]",
319
+ "export [entry..]",
316
320
  "Export slides to PDF",
317
321
  (args) => exportOptions(commonOptions(args)).strict().help(),
318
322
  async (args) => {
319
323
  const { entry, theme } = args;
320
324
  process.env.NODE_ENV = "production";
321
- const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-DLPDCYMZ.js"));
325
+ const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-INNI35CW.js"));
322
326
  const port = await findFreePort(12445);
323
- const options = await _chunkZ62L2OLLjs.resolveOptions.call(void 0, { entry, theme }, "export");
324
- const server = await _chunkZ62L2OLLjs.createServer.call(void 0,
325
- options,
326
- {
327
- server: { port },
328
- clearScreen: false
329
- }
330
- );
331
- await server.listen(port);
332
- printInfo(options);
333
- _chunkZ62L2OLLjs.parser.filterDisabled(options.data);
334
- const output = await exportSlides({
335
- port,
336
- ...getExportOptions(args, options)
337
- });
338
- console.log(`${_kolorist.green.call(void 0, " \u2713 ")}${_kolorist.dim.call(void 0, "exported to ")}./${output}
327
+ for (const entryFile of entry) {
328
+ const options = await _chunkCKLR5LMVjs.resolveOptions.call(void 0, { entry: entryFile, theme }, "export");
329
+ const server = await _chunkCKLR5LMVjs.createServer.call(void 0,
330
+ options,
331
+ {
332
+ server: { port },
333
+ clearScreen: false
334
+ }
335
+ );
336
+ await server.listen(port);
337
+ printInfo(options);
338
+ _chunkCKLR5LMVjs.parser.filterDisabled(options.data);
339
+ const result = await exportSlides({
340
+ port,
341
+ ...getExportOptions({ ...args, entry: entryFile }, options)
342
+ });
343
+ console.log(`${_kolorist.green.call(void 0, " \u2713 ")}${_kolorist.dim.call(void 0, "exported to ")}./${result}
339
344
  `);
340
- server.close();
345
+ server.close();
346
+ }
341
347
  process.exit(0);
342
348
  }
343
349
  );
344
350
  cli.command(
345
- "export-notes [entry]",
351
+ "export-notes [entry..]",
346
352
  "Export slide notes to PDF",
347
353
  (args) => args.positional("entry", {
348
354
  default: "slides.md",
@@ -362,29 +368,29 @@ cli.command(
362
368
  timeout
363
369
  }) => {
364
370
  process.env.NODE_ENV = "production";
365
- const { exportNotes } = await Promise.resolve().then(() => require("./export-DLPDCYMZ.js"));
371
+ const { exportNotes } = await Promise.resolve().then(() => require("./export-INNI35CW.js"));
366
372
  const port = await findFreePort(12445);
367
- const options = await _chunkZ62L2OLLjs.resolveOptions.call(void 0, { entry }, "export");
368
- if (!output)
369
- output = options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entry, ".md")}-export-notes`;
370
- const server = await _chunkZ62L2OLLjs.createServer.call(void 0,
371
- options,
372
- {
373
- server: { port },
374
- clearScreen: false
375
- }
376
- );
377
- await server.listen(port);
378
- printInfo(options);
379
- _chunkZ62L2OLLjs.parser.filterDisabled(options.data);
380
- output = await exportNotes({
381
- port,
382
- output,
383
- timeout
384
- });
385
- console.log(`${_kolorist.green.call(void 0, " \u2713 ")}${_kolorist.dim.call(void 0, "exported to ")}./${output}
373
+ for (const entryFile of entry) {
374
+ const options = await _chunkCKLR5LMVjs.resolveOptions.call(void 0, { entry: entryFile }, "export");
375
+ const server = await _chunkCKLR5LMVjs.createServer.call(void 0,
376
+ options,
377
+ {
378
+ server: { port },
379
+ clearScreen: false
380
+ }
381
+ );
382
+ await server.listen(port);
383
+ printInfo(options);
384
+ _chunkCKLR5LMVjs.parser.filterDisabled(options.data);
385
+ const result = await exportNotes({
386
+ port,
387
+ output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entryFile, ".md")}-export-notes`),
388
+ timeout
389
+ });
390
+ console.log(`${_kolorist.green.call(void 0, " \u2713 ")}${_kolorist.dim.call(void 0, "exported to ")}./${result}
386
391
  `);
387
- server.close();
392
+ server.close();
393
+ }
388
394
  process.exit(0);
389
395
  }
390
396
  );
@@ -436,7 +442,7 @@ function printInfo(options, port, remote, tunnelUrl) {
436
442
  console.log();
437
443
  console.log();
438
444
  console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
439
- console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkZ62L2OLLjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
445
+ console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkCKLR5LMVjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
440
446
  console.log();
441
447
  console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
442
448
  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-N5CUSDFJ.mjs";
12
+ } from "./chunk-4FABOYKQ.mjs";
13
13
  import {
14
14
  loadSetups,
15
15
  require_fast_deep_equal
16
- } from "./chunk-JA6SMOG4.mjs";
16
+ } from "./chunk-46GOGODM.mjs";
17
17
  import {
18
18
  __toESM
19
19
  } from "./chunk-CTG3GV2W.mjs";
@@ -218,7 +218,7 @@ ${dim(" QR Code for remote control: ")}
218
218
  }
219
219
  );
220
220
  cli.command(
221
- "build [entry]",
221
+ "build [entry..]",
222
222
  "Build hostable SPA",
223
223
  (args) => exportOptions(commonOptions(args)).option("watch", {
224
224
  alias: "w",
@@ -243,28 +243,32 @@ cli.command(
243
243
  }).strict().help(),
244
244
  async (args) => {
245
245
  const { entry, theme, watch, base, download, out, inspect } = args;
246
- const { build } = await import("./build-5AAIMY5U.mjs");
247
- const options = await resolveOptions({ entry, theme, inspect }, "build");
248
- if (download && !options.data.config.download)
249
- options.data.config.download = download;
250
- printInfo(options);
251
- await build(options, {
252
- base,
253
- build: {
254
- watch: watch ? {} : void 0,
255
- outDir: out
256
- }
257
- }, args);
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
+ }
258
260
  }
259
261
  );
260
262
  cli.command(
261
- "format [entry]",
263
+ "format [entry..]",
262
264
  "Format the markdown file",
263
265
  (args) => commonOptions(args).strict().help(),
264
266
  async ({ entry }) => {
265
- const data = await parser.load(entry);
266
- parser.prettify(data);
267
- await parser.save(data);
267
+ for (const entryFile of entry) {
268
+ const data = await parser.load(entryFile);
269
+ parser.prettify(data);
270
+ await parser.save(data);
271
+ }
268
272
  }
269
273
  );
270
274
  cli.command(
@@ -312,37 +316,39 @@ cli.command(
312
316
  }
313
317
  );
314
318
  cli.command(
315
- "export [entry]",
319
+ "export [entry..]",
316
320
  "Export slides to PDF",
317
321
  (args) => exportOptions(commonOptions(args)).strict().help(),
318
322
  async (args) => {
319
323
  const { entry, theme } = args;
320
324
  process.env.NODE_ENV = "production";
321
- const { exportSlides, getExportOptions } = await import("./export-J6WWCAPJ.mjs");
325
+ const { exportSlides, getExportOptions } = await import("./export-N3YCMXVO.mjs");
322
326
  const port = await findFreePort(12445);
323
- const options = await resolveOptions({ entry, theme }, "export");
324
- const server = await createServer(
325
- options,
326
- {
327
- server: { port },
328
- clearScreen: false
329
- }
330
- );
331
- await server.listen(port);
332
- printInfo(options);
333
- parser.filterDisabled(options.data);
334
- const output = await exportSlides({
335
- port,
336
- ...getExportOptions(args, options)
337
- });
338
- console.log(`${green(" \u2713 ")}${dim("exported to ")}./${output}
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}
339
344
  `);
340
- server.close();
345
+ server.close();
346
+ }
341
347
  process.exit(0);
342
348
  }
343
349
  );
344
350
  cli.command(
345
- "export-notes [entry]",
351
+ "export-notes [entry..]",
346
352
  "Export slide notes to PDF",
347
353
  (args) => args.positional("entry", {
348
354
  default: "slides.md",
@@ -362,29 +368,29 @@ cli.command(
362
368
  timeout
363
369
  }) => {
364
370
  process.env.NODE_ENV = "production";
365
- const { exportNotes } = await import("./export-J6WWCAPJ.mjs");
371
+ const { exportNotes } = await import("./export-N3YCMXVO.mjs");
366
372
  const port = await findFreePort(12445);
367
- const options = await resolveOptions({ entry }, "export");
368
- if (!output)
369
- output = options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${path.basename(entry, ".md")}-export-notes`;
370
- const server = await createServer(
371
- options,
372
- {
373
- server: { port },
374
- clearScreen: false
375
- }
376
- );
377
- await server.listen(port);
378
- printInfo(options);
379
- parser.filterDisabled(options.data);
380
- output = await exportNotes({
381
- port,
382
- output,
383
- timeout
384
- });
385
- 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}
386
391
  `);
387
- server.close();
392
+ server.close();
393
+ }
388
394
  process.exit(0);
389
395
  }
390
396
  );
@@ -76,7 +76,7 @@ async function exportNotes({
76
76
  timeout = 3e4
77
77
  }) {
78
78
  if (!_chunkGE7W2DBEjs.packageExists.call(void 0, "playwright-chromium"))
79
- throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D 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();
@@ -122,7 +122,7 @@ async function exportSlides({
122
122
  perSlide = false
123
123
  }) {
124
124
  if (!_chunkGE7W2DBEjs.packageExists.call(void 0, "playwright-chromium"))
125
- throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D 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({
@@ -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 installed it via `npm i -D 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 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 installed it via `npm i -D 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 = parseRangeString(total, range);
127
127
  const { chromium } = await import("playwright-chromium");
128
128
  const browser = await chromium.launch({
package/dist/index.js CHANGED
@@ -9,11 +9,11 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkZ62L2OLLjs = require('./chunk-Z62L2OLL.js');
12
+ var _chunkCKLR5LMVjs = require('./chunk-CKLR5LMV.js');
13
13
 
14
14
 
15
15
 
16
- var _chunk6NWTPU4Jjs = require('./chunk-6NWTPU4J.js');
16
+ var _chunkFT5Y6KDWjs = require('./chunk-FT5Y6KDW.js');
17
17
  require('./chunk-GE7W2DBE.js');
18
18
 
19
19
 
@@ -28,4 +28,4 @@ require('./chunk-GE7W2DBE.js');
28
28
 
29
29
 
30
30
 
31
- exports.ViteSlidevPlugin = _chunk6NWTPU4Jjs.ViteSlidevPlugin; exports.createServer = _chunkZ62L2OLLjs.createServer; exports.createWindiCSSPlugin = _chunk6NWTPU4Jjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkZ62L2OLLjs.getAddonRoots; exports.getCLIRoot = _chunkZ62L2OLLjs.getCLIRoot; exports.getClientRoot = _chunkZ62L2OLLjs.getClientRoot; exports.getRoot = _chunkZ62L2OLLjs.getRoot; exports.getThemeRoots = _chunkZ62L2OLLjs.getThemeRoots; exports.getUserRoot = _chunkZ62L2OLLjs.getUserRoot; exports.isPath = _chunkZ62L2OLLjs.isPath; exports.parser = _chunkZ62L2OLLjs.parser; exports.resolveOptions = _chunkZ62L2OLLjs.resolveOptions;
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,11 +9,11 @@ import {
9
9
  isPath,
10
10
  parser,
11
11
  resolveOptions
12
- } from "./chunk-N5CUSDFJ.mjs";
12
+ } from "./chunk-4FABOYKQ.mjs";
13
13
  import {
14
14
  ViteSlidevPlugin,
15
15
  createWindiCSSPlugin
16
- } from "./chunk-JA6SMOG4.mjs";
16
+ } from "./chunk-46GOGODM.mjs";
17
17
  import "./chunk-CTG3GV2W.mjs";
18
18
  export {
19
19
  ViteSlidevPlugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.40.3",
3
+ "version": "0.40.4",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -44,23 +44,23 @@
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.15",
48
- "@iconify-json/ph": "^1.1.4",
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.0.0",
51
- "@vitejs/plugin-vue-jsx": "^3.0.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.11.2",
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.0",
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.17.0",
63
+ "jiti": "^1.18.2",
64
64
  "js-base64": "^3.7.5",
65
65
  "katex": "^0.16.4",
66
66
  "kolorist": "^1.7.0",
@@ -70,10 +70,10 @@
70
70
  "markdown-it-link-attributes": "^4.0.1",
71
71
  "monaco-editor": "^0.33.0",
72
72
  "nanoid": "^4.0.1",
73
- "open": "^8.4.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.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",
@@ -81,21 +81,21 @@
81
81
  "resolve-from": "^5.0.0",
82
82
  "resolve-global": "^1.0.0",
83
83
  "shiki": "^0.14.1",
84
- "unocss": "^0.49.4",
85
- "unplugin-icons": "^0.15.2",
86
- "unplugin-vue-components": "^0.23.0",
87
- "vite": "^4.1.1",
88
- "vite-plugin-inspect": "^0.7.15",
89
- "vite-plugin-remote-assets": "^0.3.0",
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
90
  "vite-plugin-vue-markdown": "^0.22.4",
91
- "vite-plugin-vue-server-ref": "^0.3.0",
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.6.2",
96
- "@slidev/client": "0.40.3",
97
- "@slidev/parser": "0.40.3",
98
- "@slidev/types": "0.40.3"
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",