@slidev/cli 0.34.2 → 0.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-4NHF5SPM.mjs";
5
+ } from "./chunk-X2HQWYH2.mjs";
6
6
  import {
7
7
  __require,
8
8
  __toESM,
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkXIB52LE6js = require('./chunk-XIB52LE6.js');
5
+ var _chunkGH4JJSLKjs = require('./chunk-GH4JJSLK.js');
6
6
 
7
7
 
8
8
 
@@ -655,13 +655,13 @@ 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 _chunkXIB52LE6js.getIndexHtml.call(void 0, options), "utf-8");
658
+ await _fsextra2.default.writeFile(indexPath, await _chunkGH4JJSLKjs.getIndexHtml.call(void 0, options), "utf-8");
659
659
  let config = void 0;
660
660
  try {
661
- const inlineConfig = await _chunkXIB52LE6js.mergeViteConfigs.call(void 0, options, viteConfig, {
661
+ const inlineConfig = await _chunkGH4JJSLKjs.mergeViteConfigs.call(void 0, options, viteConfig, {
662
662
  root: options.userRoot,
663
663
  plugins: [
664
- await _chunkXIB52LE6js.ViteSlidevPlugin.call(void 0, options, pluginOptions),
664
+ await _chunkGH4JJSLKjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
665
665
  {
666
666
  name: "resolve-config",
667
667
  configResolved(_config) {
@@ -679,7 +679,7 @@ async function build(options, viteConfig = {}) {
679
679
  console.log(_kolorist.yellow.call(void 0, " Monaco is disabled in the build, to enabled it, set `monaco: true` in the frontmatter"));
680
680
  } else {
681
681
  console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
682
- await _vite.build.call(void 0, await _chunkXIB52LE6js.mergeViteConfigs.call(void 0, options, inlineConfig, {
682
+ await _vite.build.call(void 0, await _chunkGH4JJSLKjs.mergeViteConfigs.call(void 0, options, inlineConfig, {
683
683
  root: _path.join.call(void 0, options.clientRoot, "iframes/monaco"),
684
684
  base: `${config.base}iframes/monaco/`,
685
685
  build: {
@@ -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 _chunkXIB52LE6js = require('./chunk-XIB52LE6.js');
4
+ var _chunkGH4JJSLKjs = require('./chunk-GH4JJSLK.js');
5
5
 
6
6
 
7
7
 
@@ -2380,14 +2380,14 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
2380
2380
  const rawConfig = await _vite.resolveConfig.call(void 0, {}, "serve");
2381
2381
  const pluginOptions = rawConfig.slidev || {};
2382
2382
  process.env.EDITOR = process.env.EDITOR || "code";
2383
- const server = await _vite.createServer.call(void 0, await _chunkXIB52LE6js.mergeViteConfigs.call(void 0, options, viteConfig, {
2383
+ const server = await _vite.createServer.call(void 0, await _chunkGH4JJSLKjs.mergeViteConfigs.call(void 0, options, viteConfig, {
2384
2384
  optimizeDeps: {
2385
2385
  entries: [
2386
2386
  _path.join.call(void 0, options.clientRoot, "main.ts")
2387
2387
  ]
2388
2388
  },
2389
2389
  plugins: [
2390
- await _chunkXIB52LE6js.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
2390
+ await _chunkGH4JJSLKjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
2391
2391
  ]
2392
2392
  }, "serve"));
2393
2393
  return server;
@@ -2398,16 +2398,16 @@ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
2398
2398
  var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
2399
2399
 
2400
2400
  // package.json
2401
- var version = "0.34.2";
2401
+ var version = "0.35.1";
2402
2402
 
2403
2403
  // node/themes.ts
2404
2404
  _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
2405
2405
  var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
2406
2406
 
2407
- // ../../node_modules/.pnpm/@antfu+ni@0.16.3/node_modules/@antfu/ni/dist/index.mjs
2407
+ // ../../node_modules/.pnpm/@antfu+ni@0.17.2/node_modules/@antfu/ni/dist/index.mjs
2408
2408
  _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
2409
2409
 
2410
- // ../../node_modules/.pnpm/@antfu+ni@0.16.3/node_modules/@antfu/ni/dist/chunks/runner.mjs
2410
+ // ../../node_modules/.pnpm/@antfu+ni@0.17.2/node_modules/@antfu/ni/dist/chunks/runner.mjs
2411
2411
  _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
2412
2412
 
2413
2413
  var _readline = require('readline'); var _readline2 = _interopRequireDefault(_readline);
@@ -2427,7 +2427,7 @@ var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
2427
2427
  var _util = require('util'); var _util2 = _interopRequireDefault(_util);
2428
2428
 
2429
2429
  var _tty = require('tty'); var _tty2 = _interopRequireDefault(_tty);
2430
- var version2 = "0.16.3";
2430
+ var version2 = "0.17.2";
2431
2431
  var npmRun = (agent) => (args) => {
2432
2432
  if (args.length > 1)
2433
2433
  return `${agent} run ${args[0]} -- ${args.slice(1).join(" ")}`;
@@ -2460,6 +2460,19 @@ var pnpm = {
2460
2460
  "uninstall": "pnpm remove {0}",
2461
2461
  "global_uninstall": "pnpm remove --global {0}"
2462
2462
  };
2463
+ var bun = {
2464
+ "agent": "bun {0}",
2465
+ "run": "bun run {0}",
2466
+ "install": "bun install {0}",
2467
+ "frozen": "bun install --no-save",
2468
+ "global": "bun add -g {0}",
2469
+ "add": "bun add {0}",
2470
+ "upgrade": null,
2471
+ "upgrade-interactive": null,
2472
+ "execute": null,
2473
+ "uninstall": "bun remove {0}",
2474
+ "global_uninstall": "bun remove -g {0}"
2475
+ };
2463
2476
  var AGENTS = {
2464
2477
  "npm": {
2465
2478
  "agent": "npm {0}",
@@ -2487,16 +2500,19 @@ var AGENTS = {
2487
2500
  "pnpm@6": {
2488
2501
  ...pnpm,
2489
2502
  run: npmRun("pnpm")
2490
- }
2503
+ },
2504
+ "bun": bun
2491
2505
  };
2492
2506
  var agents = Object.keys(AGENTS);
2493
2507
  var LOCKS = {
2508
+ "bun.lockb": "bun",
2494
2509
  "pnpm-lock.yaml": "pnpm",
2495
2510
  "yarn.lock": "yarn",
2496
2511
  "package-lock.json": "npm",
2497
2512
  "npm-shrinkwrap.json": "npm"
2498
2513
  };
2499
2514
  var INSTALL_PAGE = {
2515
+ "bun": "https://bun.sh",
2500
2516
  "pnpm": "https://pnpm.js.org/en/installation",
2501
2517
  "pnpm@6": "https://pnpm.js.org/en/installation",
2502
2518
  "yarn": "https://classic.yarnpkg.com/en/docs/install",
@@ -2738,6 +2754,8 @@ var parseNi = (agent, args, ctx) => {
2738
2754
  console.log(`@antfu/ni v${version2}`);
2739
2755
  process.exit(0);
2740
2756
  }
2757
+ if (agent === "bun")
2758
+ args = args.map((i) => i === "-D" ? "-d" : i);
2741
2759
  if (args.includes("-g"))
2742
2760
  return getCommand(agent, "global", exclude(args, "-g"));
2743
2761
  if (args.includes("--frozen-if-present")) {
@@ -9488,7 +9506,7 @@ async function run(fn, args, options = {}) {
9488
9506
  await execaCommand(command, { stdio: "inherit", encoding: "utf-8", cwd });
9489
9507
  }
9490
9508
 
9491
- // ../../node_modules/.pnpm/@antfu+ni@0.16.3/node_modules/@antfu/ni/dist/index.mjs
9509
+ // ../../node_modules/.pnpm/@antfu+ni@0.17.2/node_modules/@antfu/ni/dist/index.mjs
9492
9510
 
9493
9511
 
9494
9512
 
@@ -9513,25 +9531,29 @@ var _debug2 = require('debug'); var _debug3 = _interopRequireDefault(_debug2);
9513
9531
  _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
9514
9532
  var import_semver = _chunkSQLX75IOjs.__toESM.call(void 0, require_semver2());
9515
9533
 
9516
- function getPackageJson(root) {
9517
- const file = _chunkSQLX75IOjs.resolveImportPath.call(void 0, `${root}/package.json`, true);
9518
- if (file && _fsextra2.default.existsSync(file))
9519
- return _fsextra2.default.readJSON(file);
9520
- return {};
9534
+ async function getPackageJson(root) {
9535
+ try {
9536
+ const file = _chunkSQLX75IOjs.resolveImportPath.call(void 0, `${root}/package.json`, true);
9537
+ if (file && _fsextra2.default.existsSync(file))
9538
+ return await _fsextra2.default.readJSON(file);
9539
+ return {};
9540
+ } catch (e) {
9541
+ return {};
9542
+ }
9521
9543
  }
9522
9544
  async function getAddons(userRoot, config2) {
9523
9545
  const { slidev = {} } = await getPackageJson(userRoot);
9524
9546
  const configAddons = Array.isArray(config2.addons) ? config2.addons : [];
9525
9547
  const addons = configAddons.concat(Array.isArray(slidev == null ? void 0 : slidev.addons) ? slidev.addons : []);
9526
- return getRecursivePlugins(addons.map(resolvePluginName));
9548
+ return (await getRecursivePlugins(addons.map(resolvePluginName), 3)).filter(Boolean);
9527
9549
  }
9528
- async function getRecursivePlugins(addons) {
9550
+ async function getRecursivePlugins(addons, depth) {
9529
9551
  const addonsArray = await Promise.all(addons.map(async (addon) => {
9530
9552
  const { slidev = {}, engines = {} } = await getPackageJson(addon);
9531
9553
  checkEngine(addon, engines);
9532
9554
  let addons2 = Array.isArray(slidev == null ? void 0 : slidev.addons) ? slidev.addons : [];
9533
- if (addons2.length > 0)
9534
- addons2 = await getRecursivePlugins(addons2.map(resolvePluginName));
9555
+ if (addons2.length > 0 && depth)
9556
+ addons2 = await getRecursivePlugins(addons2.map(resolvePluginName), depth - 1);
9535
9557
  addons2.push(addon);
9536
9558
  return addons2;
9537
9559
  }));
@@ -224,7 +224,8 @@ async function loadDrawings(options) {
224
224
  const files = await _fastglob2.default.call(void 0, "*.svg", {
225
225
  onlyFiles: true,
226
226
  cwd: dir,
227
- absolute: true
227
+ absolute: true,
228
+ suppressErrors: true
228
229
  });
229
230
  const obj = {};
230
231
  Promise.all(files.map(async (path) => {
@@ -267,9 +268,10 @@ var dependencies = {
267
268
  "@antfu/utils": "^0.5.2",
268
269
  "@slidev/parser": "workspace:*",
269
270
  "@slidev/types": "workspace:*",
270
- "@unocss/reset": "^0.42.0",
271
- "@vueuse/core": "^8.7.5",
272
- "@vueuse/head": "^0.7.6",
271
+ "@unocss/reset": "^0.45.1",
272
+ "@vueuse/core": "^9.0.1",
273
+ "@vueuse/head": "^0.7.8",
274
+ "@vueuse/math": "^9.0.1",
273
275
  "@vueuse/motion": "^2.0.0-beta.18",
274
276
  codemirror: "^5.65.5",
275
277
  defu: "^6.0.0",
@@ -284,12 +286,12 @@ var dependencies = {
284
286
  prettier: "^2.7.1",
285
287
  recordrtc: "^5.6.2",
286
288
  resolve: "^1.22.1",
287
- unocss: "^0.42.0",
288
- "vite-plugin-windicss": "^1.8.6",
289
+ unocss: "^0.45.1",
290
+ "vite-plugin-windicss": "^1.8.7",
289
291
  vue: "^3.2.37",
290
- "vue-router": "^4.0.16",
292
+ "vue-router": "^4.1.3",
291
293
  "vue-starport": "^0.3.0",
292
- windicss: "^3.5.5"
294
+ windicss: "^3.5.6"
293
295
  };
294
296
 
295
297
  // node/vite/searchRoot.ts
@@ -771,7 +773,8 @@ defineProps<{ no: number | string }>()`);
771
773
  for (const root of roots2) {
772
774
  const layoutPaths = await _fastglob2.default.call(void 0, "layouts/**/*.{vue,ts}", {
773
775
  cwd: root,
774
- absolute: true
776
+ absolute: true,
777
+ suppressErrors: true
775
778
  });
776
779
  for (const layoutPath of layoutPaths) {
777
780
  const layout = _path.basename.call(void 0, layoutPath).replace(/\.\w+$/, "");
@@ -995,8 +998,18 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
995
998
  awaitFn = `injection_return = ${awaitFn}`;
996
999
  }
997
1000
  if (/\binjection_arg\b/g.test(code)) {
998
- fn += "(injection_arg)";
999
- awaitFn += "(injection_arg)";
1001
+ fn += "(";
1002
+ awaitFn += "(";
1003
+ const matches = Array.from(code.matchAll(/\binjection_arg(_\d+)?\b/g));
1004
+ const dedupedMatches = Array.from(new Set(matches.map((m) => m[0])));
1005
+ dedupedMatches.forEach((key, index) => {
1006
+ const isLast = index === dedupedMatches.length - 1;
1007
+ const arg = key + (isLast ? "" : ",");
1008
+ fn += arg;
1009
+ awaitFn += arg;
1010
+ });
1011
+ fn += ")";
1012
+ awaitFn += ")";
1000
1013
  } else {
1001
1014
  fn += "()";
1002
1015
  awaitFn += "()";
@@ -1021,6 +1034,7 @@ var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsba
1021
1034
 
1022
1035
 
1023
1036
  var _markdownitfootnote = require('markdown-it-footnote'); var _markdownitfootnote2 = _interopRequireDefault(_markdownitfootnote);
1037
+ var _markdownittasklists = require('@hedgedoc/markdown-it-task-lists'); var _markdownittasklists2 = _interopRequireDefault(_markdownittasklists);
1024
1038
  var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
1025
1039
  var _plantumlencoder = require('plantuml-encoder');
1026
1040
 
@@ -1326,6 +1340,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1326
1340
  }
1327
1341
  });
1328
1342
  md2.use(_markdownitfootnote2.default);
1343
+ md2.use(_markdownittasklists2.default, { enabled: true, lineNumber: true, label: true });
1329
1344
  md2.use(math_plugin, KatexOptions);
1330
1345
  setups.forEach((i) => i(md2));
1331
1346
  (_a = mdOptions == null ? void 0 : mdOptions.markdownItSetup) == null ? void 0 : _a.call(mdOptions, md2);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
3
  mergeViteConfigs
4
- } from "./chunk-4NHF5SPM.mjs";
4
+ } from "./chunk-X2HQWYH2.mjs";
5
5
  import {
6
6
  __commonJS,
7
7
  __dirname,
@@ -2399,16 +2399,16 @@ init_esm_shims();
2399
2399
  import * as parser from "@slidev/parser/fs";
2400
2400
 
2401
2401
  // package.json
2402
- var version = "0.34.2";
2402
+ var version = "0.35.1";
2403
2403
 
2404
2404
  // node/themes.ts
2405
2405
  init_esm_shims();
2406
2406
  import prompts2 from "prompts";
2407
2407
 
2408
- // ../../node_modules/.pnpm/@antfu+ni@0.16.3/node_modules/@antfu/ni/dist/index.mjs
2408
+ // ../../node_modules/.pnpm/@antfu+ni@0.17.2/node_modules/@antfu/ni/dist/index.mjs
2409
2409
  init_esm_shims();
2410
2410
 
2411
- // ../../node_modules/.pnpm/@antfu+ni@0.16.3/node_modules/@antfu/ni/dist/chunks/runner.mjs
2411
+ // ../../node_modules/.pnpm/@antfu+ni@0.17.2/node_modules/@antfu/ni/dist/chunks/runner.mjs
2412
2412
  init_esm_shims();
2413
2413
  import require$$0, { resolve } from "path";
2414
2414
  import require$$0$5 from "readline";
@@ -2428,7 +2428,7 @@ import require$$0$3 from "stream";
2428
2428
  import require$$2$1 from "util";
2429
2429
  import { promises } from "fs";
2430
2430
  import require$$1 from "tty";
2431
- var version2 = "0.16.3";
2431
+ var version2 = "0.17.2";
2432
2432
  var npmRun = (agent) => (args) => {
2433
2433
  if (args.length > 1)
2434
2434
  return `${agent} run ${args[0]} -- ${args.slice(1).join(" ")}`;
@@ -2461,6 +2461,19 @@ var pnpm = {
2461
2461
  "uninstall": "pnpm remove {0}",
2462
2462
  "global_uninstall": "pnpm remove --global {0}"
2463
2463
  };
2464
+ var bun = {
2465
+ "agent": "bun {0}",
2466
+ "run": "bun run {0}",
2467
+ "install": "bun install {0}",
2468
+ "frozen": "bun install --no-save",
2469
+ "global": "bun add -g {0}",
2470
+ "add": "bun add {0}",
2471
+ "upgrade": null,
2472
+ "upgrade-interactive": null,
2473
+ "execute": null,
2474
+ "uninstall": "bun remove {0}",
2475
+ "global_uninstall": "bun remove -g {0}"
2476
+ };
2464
2477
  var AGENTS = {
2465
2478
  "npm": {
2466
2479
  "agent": "npm {0}",
@@ -2488,16 +2501,19 @@ var AGENTS = {
2488
2501
  "pnpm@6": {
2489
2502
  ...pnpm,
2490
2503
  run: npmRun("pnpm")
2491
- }
2504
+ },
2505
+ "bun": bun
2492
2506
  };
2493
2507
  var agents = Object.keys(AGENTS);
2494
2508
  var LOCKS = {
2509
+ "bun.lockb": "bun",
2495
2510
  "pnpm-lock.yaml": "pnpm",
2496
2511
  "yarn.lock": "yarn",
2497
2512
  "package-lock.json": "npm",
2498
2513
  "npm-shrinkwrap.json": "npm"
2499
2514
  };
2500
2515
  var INSTALL_PAGE = {
2516
+ "bun": "https://bun.sh",
2501
2517
  "pnpm": "https://pnpm.js.org/en/installation",
2502
2518
  "pnpm@6": "https://pnpm.js.org/en/installation",
2503
2519
  "yarn": "https://classic.yarnpkg.com/en/docs/install",
@@ -2739,6 +2755,8 @@ var parseNi = (agent, args, ctx) => {
2739
2755
  console.log(`@antfu/ni v${version2}`);
2740
2756
  process.exit(0);
2741
2757
  }
2758
+ if (agent === "bun")
2759
+ args = args.map((i) => i === "-D" ? "-d" : i);
2742
2760
  if (args.includes("-g"))
2743
2761
  return getCommand(agent, "global", exclude(args, "-g"));
2744
2762
  if (args.includes("--frozen-if-present")) {
@@ -9505,25 +9523,29 @@ import _debug from "debug";
9505
9523
  init_esm_shims();
9506
9524
  var import_semver = __toESM(require_semver2());
9507
9525
  import fs2 from "fs-extra";
9508
- function getPackageJson(root) {
9509
- const file = resolveImportPath(`${root}/package.json`, true);
9510
- if (file && fs2.existsSync(file))
9511
- return fs2.readJSON(file);
9512
- return {};
9526
+ async function getPackageJson(root) {
9527
+ try {
9528
+ const file = resolveImportPath(`${root}/package.json`, true);
9529
+ if (file && fs2.existsSync(file))
9530
+ return await fs2.readJSON(file);
9531
+ return {};
9532
+ } catch (e) {
9533
+ return {};
9534
+ }
9513
9535
  }
9514
9536
  async function getAddons(userRoot, config2) {
9515
9537
  const { slidev = {} } = await getPackageJson(userRoot);
9516
9538
  const configAddons = Array.isArray(config2.addons) ? config2.addons : [];
9517
9539
  const addons = configAddons.concat(Array.isArray(slidev == null ? void 0 : slidev.addons) ? slidev.addons : []);
9518
- return getRecursivePlugins(addons.map(resolvePluginName));
9540
+ return (await getRecursivePlugins(addons.map(resolvePluginName), 3)).filter(Boolean);
9519
9541
  }
9520
- async function getRecursivePlugins(addons) {
9542
+ async function getRecursivePlugins(addons, depth) {
9521
9543
  const addonsArray = await Promise.all(addons.map(async (addon) => {
9522
9544
  const { slidev = {}, engines = {} } = await getPackageJson(addon);
9523
9545
  checkEngine(addon, engines);
9524
9546
  let addons2 = Array.isArray(slidev == null ? void 0 : slidev.addons) ? slidev.addons : [];
9525
- if (addons2.length > 0)
9526
- addons2 = await getRecursivePlugins(addons2.map(resolvePluginName));
9547
+ if (addons2.length > 0 && depth)
9548
+ addons2 = await getRecursivePlugins(addons2.map(resolvePluginName), depth - 1);
9527
9549
  addons2.push(addon);
9528
9550
  return addons2;
9529
9551
  }));
@@ -225,7 +225,8 @@ async function loadDrawings(options) {
225
225
  const files = await fg("*.svg", {
226
226
  onlyFiles: true,
227
227
  cwd: dir,
228
- absolute: true
228
+ absolute: true,
229
+ suppressErrors: true
229
230
  });
230
231
  const obj = {};
231
232
  Promise.all(files.map(async (path) => {
@@ -268,9 +269,10 @@ var dependencies = {
268
269
  "@antfu/utils": "^0.5.2",
269
270
  "@slidev/parser": "workspace:*",
270
271
  "@slidev/types": "workspace:*",
271
- "@unocss/reset": "^0.42.0",
272
- "@vueuse/core": "^8.7.5",
273
- "@vueuse/head": "^0.7.6",
272
+ "@unocss/reset": "^0.45.1",
273
+ "@vueuse/core": "^9.0.1",
274
+ "@vueuse/head": "^0.7.8",
275
+ "@vueuse/math": "^9.0.1",
274
276
  "@vueuse/motion": "^2.0.0-beta.18",
275
277
  codemirror: "^5.65.5",
276
278
  defu: "^6.0.0",
@@ -285,12 +287,12 @@ var dependencies = {
285
287
  prettier: "^2.7.1",
286
288
  recordrtc: "^5.6.2",
287
289
  resolve: "^1.22.1",
288
- unocss: "^0.42.0",
289
- "vite-plugin-windicss": "^1.8.6",
290
+ unocss: "^0.45.1",
291
+ "vite-plugin-windicss": "^1.8.7",
290
292
  vue: "^3.2.37",
291
- "vue-router": "^4.0.16",
293
+ "vue-router": "^4.1.3",
292
294
  "vue-starport": "^0.3.0",
293
- windicss: "^3.5.5"
295
+ windicss: "^3.5.6"
294
296
  };
295
297
 
296
298
  // node/vite/searchRoot.ts
@@ -772,7 +774,8 @@ defineProps<{ no: number | string }>()`);
772
774
  for (const root of roots2) {
773
775
  const layoutPaths = await fg2("layouts/**/*.{vue,ts}", {
774
776
  cwd: root,
775
- absolute: true
777
+ absolute: true,
778
+ suppressErrors: true
776
779
  });
777
780
  for (const layoutPath of layoutPaths) {
778
781
  const layout = basename2(layoutPath).replace(/\.\w+$/, "");
@@ -996,8 +999,18 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
996
999
  awaitFn = `injection_return = ${awaitFn}`;
997
1000
  }
998
1001
  if (/\binjection_arg\b/g.test(code)) {
999
- fn += "(injection_arg)";
1000
- awaitFn += "(injection_arg)";
1002
+ fn += "(";
1003
+ awaitFn += "(";
1004
+ const matches = Array.from(code.matchAll(/\binjection_arg(_\d+)?\b/g));
1005
+ const dedupedMatches = Array.from(new Set(matches.map((m) => m[0])));
1006
+ dedupedMatches.forEach((key, index) => {
1007
+ const isLast = index === dedupedMatches.length - 1;
1008
+ const arg = key + (isLast ? "" : ",");
1009
+ fn += arg;
1010
+ awaitFn += arg;
1011
+ });
1012
+ fn += ")";
1013
+ awaitFn += ")";
1001
1014
  } else {
1002
1015
  fn += "()";
1003
1016
  awaitFn += "()";
@@ -1022,6 +1035,7 @@ import * as base64 from "js-base64";
1022
1035
  import { slash as slash5 } from "@antfu/utils";
1023
1036
  import mila2 from "markdown-it-link-attributes";
1024
1037
  import mif from "markdown-it-footnote";
1038
+ import mitl from "@hedgedoc/markdown-it-task-lists";
1025
1039
  import * as Shiki from "shiki";
1026
1040
  import { encode as encode2 } from "plantuml-encoder";
1027
1041
 
@@ -1327,6 +1341,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1327
1341
  }
1328
1342
  });
1329
1343
  md2.use(mif);
1344
+ md2.use(mitl, { enabled: true, lineNumber: true, label: true });
1330
1345
  md2.use(math_plugin, KatexOptions);
1331
1346
  setups.forEach((i) => i(md2));
1332
1347
  (_a = mdOptions == null ? void 0 : mdOptions.markdownItSetup) == null ? void 0 : _a.call(mdOptions, md2);
package/dist/cli.js CHANGED
@@ -6,10 +6,10 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkEN47OEVJjs = require('./chunk-EN47OEVJ.js');
9
+ var _chunk2RFAYXDAjs = require('./chunk-2RFAYXDA.js');
10
10
 
11
11
 
12
- var _chunkXIB52LE6js = require('./chunk-XIB52LE6.js');
12
+ var _chunkGH4JJSLKjs = require('./chunk-GH4JJSLK.js');
13
13
 
14
14
 
15
15
 
@@ -18,7 +18,7 @@ var _chunkSQLX75IOjs = require('./chunk-SQLX75IO.js');
18
18
 
19
19
  // node/cli.ts
20
20
  _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
21
- var import_fast_deep_equal = _chunkSQLX75IOjs.__toESM.call(void 0, _chunkXIB52LE6js.require_fast_deep_equal.call(void 0, ));
21
+ var import_fast_deep_equal = _chunkSQLX75IOjs.__toESM.call(void 0, _chunkGH4JJSLKjs.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);
@@ -38,7 +38,7 @@ var CONFIG_RESTART_FIELDS = [
38
38
  "fonts",
39
39
  "css"
40
40
  ];
41
- var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkEN47OEVJjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
41
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunk2RFAYXDAjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
42
42
  cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
43
43
  alias: "p",
44
44
  type: "number",
@@ -81,9 +81,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
81
81
  async function initServer() {
82
82
  if (server)
83
83
  await server.close();
84
- const options = await _chunkEN47OEVJjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
84
+ const options = await _chunk2RFAYXDAjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
85
85
  port = userPort || await findFreePort(3030);
86
- server = await _chunkEN47OEVJjs.createServer.call(void 0, options, {
86
+ server = await _chunk2RFAYXDAjs.createServer.call(void 0, options, {
87
87
  server: {
88
88
  port,
89
89
  strictPort: true,
@@ -94,7 +94,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
94
94
  logLevel: log
95
95
  }, {
96
96
  onDataReload(newData, data) {
97
- if (!theme && _chunkEN47OEVJjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkEN47OEVJjs.resolveThemeName.call(void 0, data.config.theme)) {
97
+ if (!theme && _chunk2RFAYXDAjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunk2RFAYXDAjs.resolveThemeName.call(void 0, data.config.theme)) {
98
98
  console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
99
99
  initServer();
100
100
  } else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
@@ -170,8 +170,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
170
170
  type: "boolean",
171
171
  describe: "allow download as PDF"
172
172
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
173
- const { build } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./build-ZRCGLMWG.js")));
174
- const options = await _chunkEN47OEVJjs.resolveOptions.call(void 0, { entry, theme }, "build");
173
+ const { build } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./build-Z26FNYJ3.js")));
174
+ const options = await _chunk2RFAYXDAjs.resolveOptions.call(void 0, { entry, theme }, "build");
175
175
  if (download && !options.data.config.download)
176
176
  options.data.config.download = download;
177
177
  printInfo(options);
@@ -184,26 +184,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
184
184
  });
185
185
  });
186
186
  cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
187
- const data = await _chunkEN47OEVJjs.parser.load(entry);
188
- _chunkEN47OEVJjs.parser.prettify(data);
189
- await _chunkEN47OEVJjs.parser.save(data);
187
+ const data = await _chunk2RFAYXDAjs.parser.load(entry);
188
+ _chunk2RFAYXDAjs.parser.prettify(data);
189
+ await _chunk2RFAYXDAjs.parser.save(data);
190
190
  });
191
191
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
192
192
  return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
193
193
  type: "string",
194
194
  default: "theme"
195
195
  }), async ({ entry, dir, theme: themeInput }) => {
196
- const data = await _chunkEN47OEVJjs.parser.load(entry);
197
- const theme = _chunkEN47OEVJjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
196
+ const data = await _chunk2RFAYXDAjs.parser.load(entry);
197
+ const theme = _chunk2RFAYXDAjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
198
198
  if (theme === "none") {
199
199
  console.error('Can not eject theme "none"');
200
200
  process.exit(1);
201
201
  }
202
- if (_chunkEN47OEVJjs.isPath.call(void 0, theme)) {
202
+ if (_chunk2RFAYXDAjs.isPath.call(void 0, theme)) {
203
203
  console.error("Theme is already ejected");
204
204
  process.exit(1);
205
205
  }
206
- const roots = _chunkEN47OEVJjs.getThemeRoots.call(void 0, theme, entry);
206
+ const roots = _chunk2RFAYXDAjs.getThemeRoots.call(void 0, theme, entry);
207
207
  if (!roots.length) {
208
208
  console.error(`Does not found theme "${theme}"`);
209
209
  process.exit(1);
@@ -215,7 +215,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
215
215
  const dirPath = `./${dir}`;
216
216
  data.slides[0].frontmatter.theme = dirPath;
217
217
  data.slides[0].raw = null;
218
- await _chunkEN47OEVJjs.parser.save(data);
218
+ await _chunk2RFAYXDAjs.parser.save(data);
219
219
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
220
220
  });
221
221
  }, () => {
@@ -259,15 +259,15 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
259
259
  process.env.NODE_ENV = "production";
260
260
  const { exportSlides } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./export-TH7MNEXN.js")));
261
261
  const port = await findFreePort(12445);
262
- const options = await _chunkEN47OEVJjs.resolveOptions.call(void 0, { entry, theme }, "build");
262
+ const options = await _chunk2RFAYXDAjs.resolveOptions.call(void 0, { entry, theme }, "build");
263
263
  output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
264
- const server = await _chunkEN47OEVJjs.createServer.call(void 0, options, {
264
+ const server = await _chunk2RFAYXDAjs.createServer.call(void 0, options, {
265
265
  server: { port },
266
266
  clearScreen: false
267
267
  });
268
268
  await server.listen(port);
269
269
  printInfo(options);
270
- _chunkEN47OEVJjs.parser.filterDisabled(options.data);
270
+ _chunk2RFAYXDAjs.parser.filterDisabled(options.data);
271
271
  const width = options.data.config.canvasWidth;
272
272
  const height = Math.round(width / options.data.config.aspectRatio);
273
273
  output = await exportSlides({
@@ -305,7 +305,7 @@ function printInfo(options, port, remote) {
305
305
  console.log();
306
306
  console.log();
307
307
  console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
308
- console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkEN47OEVJjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
308
+ console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunk2RFAYXDAjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
309
309
  console.log();
310
310
  console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
311
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));
package/dist/cli.mjs CHANGED
@@ -6,10 +6,10 @@ import {
6
6
  resolveOptions,
7
7
  resolveThemeName,
8
8
  version
9
- } from "./chunk-4BYU5VF4.mjs";
9
+ } from "./chunk-I7YYQ2YV.mjs";
10
10
  import {
11
11
  require_fast_deep_equal
12
- } from "./chunk-4NHF5SPM.mjs";
12
+ } from "./chunk-X2HQWYH2.mjs";
13
13
  import {
14
14
  __dirname,
15
15
  __require,
@@ -171,7 +171,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
171
171
  type: "boolean",
172
172
  describe: "allow download as PDF"
173
173
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
174
- const { build } = await Promise.resolve().then(() => __toESM(__require("./build-F5QDKRVS.mjs")));
174
+ const { build } = await Promise.resolve().then(() => __toESM(__require("./build-52YMLBLI.mjs")));
175
175
  const options = await resolveOptions({ entry, theme }, "build");
176
176
  if (download && !options.data.config.download)
177
177
  options.data.config.download = download;
package/dist/index.js CHANGED
@@ -9,11 +9,11 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkEN47OEVJjs = require('./chunk-EN47OEVJ.js');
12
+ var _chunk2RFAYXDAjs = require('./chunk-2RFAYXDA.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkXIB52LE6js = require('./chunk-XIB52LE6.js');
16
+ var _chunkGH4JJSLKjs = require('./chunk-GH4JJSLK.js');
17
17
 
18
18
 
19
19
  var _chunkSQLX75IOjs = require('./chunk-SQLX75IO.js');
@@ -36,4 +36,4 @@ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
36
36
 
37
37
 
38
38
 
39
- exports.ViteSlidevPlugin = _chunkXIB52LE6js.ViteSlidevPlugin; exports.createServer = _chunkEN47OEVJjs.createServer; exports.createWindiCSSPlugin = _chunkXIB52LE6js.createWindiCSSPlugin; exports.getAddonRoots = _chunkEN47OEVJjs.getAddonRoots; exports.getCLIRoot = _chunkEN47OEVJjs.getCLIRoot; exports.getClientRoot = _chunkEN47OEVJjs.getClientRoot; exports.getRoot = _chunkEN47OEVJjs.getRoot; exports.getThemeRoots = _chunkEN47OEVJjs.getThemeRoots; exports.getUserRoot = _chunkEN47OEVJjs.getUserRoot; exports.isPath = _chunkEN47OEVJjs.isPath; exports.parser = _chunkEN47OEVJjs.parser; exports.resolveOptions = _chunkEN47OEVJjs.resolveOptions;
39
+ exports.ViteSlidevPlugin = _chunkGH4JJSLKjs.ViteSlidevPlugin; exports.createServer = _chunk2RFAYXDAjs.createServer; exports.createWindiCSSPlugin = _chunkGH4JJSLKjs.createWindiCSSPlugin; exports.getAddonRoots = _chunk2RFAYXDAjs.getAddonRoots; exports.getCLIRoot = _chunk2RFAYXDAjs.getCLIRoot; exports.getClientRoot = _chunk2RFAYXDAjs.getClientRoot; exports.getRoot = _chunk2RFAYXDAjs.getRoot; exports.getThemeRoots = _chunk2RFAYXDAjs.getThemeRoots; exports.getUserRoot = _chunk2RFAYXDAjs.getUserRoot; exports.isPath = _chunk2RFAYXDAjs.isPath; exports.parser = _chunk2RFAYXDAjs.parser; exports.resolveOptions = _chunk2RFAYXDAjs.resolveOptions;
package/dist/index.mjs CHANGED
@@ -9,11 +9,11 @@ import {
9
9
  isPath,
10
10
  parser,
11
11
  resolveOptions
12
- } from "./chunk-4BYU5VF4.mjs";
12
+ } from "./chunk-I7YYQ2YV.mjs";
13
13
  import {
14
14
  ViteSlidevPlugin,
15
15
  createWindiCSSPlugin
16
- } from "./chunk-4NHF5SPM.mjs";
16
+ } from "./chunk-X2HQWYH2.mjs";
17
17
  import {
18
18
  init_esm_shims
19
19
  } from "./chunk-GVA336JI.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.34.2",
3
+ "version": "0.35.1",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -43,12 +43,13 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@antfu/utils": "^0.5.2",
46
- "@iconify-json/carbon": "^1.1.6",
46
+ "@hedgedoc/markdown-it-task-lists": "^1.0.5",
47
+ "@iconify-json/carbon": "^1.1.7",
47
48
  "@iconify-json/ph": "^1.1.2",
48
- "@slidev/client": "0.34.2",
49
- "@slidev/parser": "0.34.2",
50
- "@slidev/types": "0.34.2",
51
- "@vitejs/plugin-vue": "^2.3.3",
49
+ "@slidev/client": "0.35.1",
50
+ "@slidev/parser": "0.35.1",
51
+ "@slidev/types": "0.35.1",
52
+ "@vitejs/plugin-vue": "^3.0.1",
52
53
  "@vue/compiler-sfc": "^3.2.37",
53
54
  "cli-progress": "^3.11.2",
54
55
  "codemirror": "^5.65.5",
@@ -77,16 +78,16 @@
77
78
  "resolve-from": "^5.0.0",
78
79
  "resolve-global": "^1.0.0",
79
80
  "shiki": "^0.10.1",
80
- "unocss": "^0.42.0",
81
- "unplugin-icons": "^0.14.6",
82
- "unplugin-vue-components": "^0.20.1",
83
- "vite": "^2.9.13",
84
- "vite-plugin-remote-assets": "^0.2.2",
85
- "vite-plugin-vue-markdown": "^0.20.1",
86
- "vite-plugin-vue-server-ref": "^0.2.4",
87
- "vite-plugin-windicss": "^1.8.6",
81
+ "unocss": "^0.45.1",
82
+ "unplugin-icons": "^0.14.8",
83
+ "unplugin-vue-components": "^0.21.2",
84
+ "vite": "^3.0.4",
85
+ "vite-plugin-remote-assets": "^0.3.0",
86
+ "vite-plugin-vue-markdown": "^0.21.1",
87
+ "vite-plugin-vue-server-ref": "^0.3.0",
88
+ "vite-plugin-windicss": "^1.8.7",
88
89
  "vue": "^3.2.37",
89
- "windicss": "^3.5.5",
90
+ "windicss": "^3.5.6",
90
91
  "yargs": "^17.5.1"
91
92
  },
92
93
  "devDependencies": {