@slidev/cli 52.6.0 → 52.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { t as resolveViteConfigs } from "./shared-BQQJCtZ8.js";
2
- import "./resolver-VcRws4SK.js";
1
+ import { t as resolveViteConfigs } from "./shared-MlFI4qjX.mjs";
2
+ import "./resolver-Dl3RCceV.mjs";
3
3
  import fs from "node:fs/promises";
4
4
  import { join, resolve } from "node:path";
5
5
  import { build as build$1 } from "vite";
@@ -45,7 +45,7 @@ async function build(options, viteConfig = {}, args) {
45
45
  dev: true
46
46
  }));
47
47
  server.listen(port);
48
- const { exportSlides } = await import("./export-KSfPJ_za.js");
48
+ const { exportSlides } = await import("./export-dSJYnjas.mjs");
49
49
  const tempDir = resolve(outDir, "temp");
50
50
  await fs.mkdir(tempDir, { recursive: true });
51
51
  await exportSlides({
@@ -86,7 +86,7 @@ async function build(options, viteConfig = {}, args) {
86
86
  "true",
87
87
  "auto"
88
88
  ].includes(options.data.config.download)) {
89
- const { exportSlides, getExportOptions } = await import("./export-KSfPJ_za.js");
89
+ const { exportSlides, getExportOptions } = await import("./export-dSJYnjas.mjs");
90
90
  const port = 12445;
91
91
  const app = connect();
92
92
  const server = http.createServer(app);
@@ -0,0 +1,24 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+
23
+ //#endregion
24
+ export { };
@@ -1,6 +1,6 @@
1
- import { a as loadSetups, c as resolveTheme, d as version, i as resolveOptions, l as resolveAddons, o as parser, s as getThemeMeta, u as updateFrontmatterPatch } from "./shared-BQQJCtZ8.js";
2
- import { i as resolveEntry, n as getRoots, r as isInstalledGlobally } from "./resolver-VcRws4SK.js";
3
- import { t as createServer } from "./serve-AMxCE-eO.js";
1
+ import { a as loadSetups, c as resolveTheme, d as version, i as resolveOptions, l as resolveAddons, o as parser, s as getThemeMeta, u as updateFrontmatterPatch } from "./shared-MlFI4qjX.mjs";
2
+ import { i as resolveEntry, n as getRoots, r as isInstalledGlobally } from "./resolver-Dl3RCceV.mjs";
3
+ import { t as createServer } from "./serve-CqkRxlTS.mjs";
4
4
  import { exec } from "node:child_process";
5
5
  import fs from "node:fs/promises";
6
6
  import os from "node:os";
@@ -292,7 +292,7 @@ cli.command("build [entry..]", "Build hostable SPA", (args) => exportOptions(com
292
292
  describe: "enable the inspect plugin for debugging"
293
293
  }).strict().help(), async (args) => {
294
294
  const { entry, theme, base, download, out, inspect } = args;
295
- const { build } = await import("./build-BebQXF0N.js");
295
+ const { build } = await import("./build-f96YUNej.mjs");
296
296
  for (const entryFile of entry) {
297
297
  const options = await resolveOptions({
298
298
  entry: entryFile,
@@ -355,7 +355,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
355
355
  });
356
356
  cli.command("export [entry..]", "Export slides to PDF", (args) => exportOptions(commonOptions(args)).strict().help(), async (args) => {
357
357
  const { entry, theme } = args;
358
- const { exportSlides, getExportOptions } = await import("./export-KSfPJ_za.js");
358
+ const { exportSlides, getExportOptions } = await import("./export-dSJYnjas.mjs");
359
359
  const port = await getPort(12445);
360
360
  let warned = false;
361
361
  for (const entryFile of entry) {
@@ -402,7 +402,7 @@ cli.command("export-notes [entry..]", "Export slide notes to PDF", (args) => arg
402
402
  type: "number",
403
403
  describe: "wait for the specified ms before exporting"
404
404
  }).strict().help(), async ({ entry, output, timeout, wait }) => {
405
- const { exportNotes } = await import("./export-KSfPJ_za.js");
405
+ const { exportNotes } = await import("./export-dSJYnjas.mjs");
406
406
  const port = await getPort(12445);
407
407
  for (const entryFile of entry) {
408
408
  const options = await resolveOptions({ entry: entryFile }, "export");
@@ -1,4 +1,4 @@
1
- import { n as getRoots } from "./resolver-VcRws4SK.js";
1
+ import { n as getRoots } from "./resolver-Dl3RCceV.mjs";
2
2
  import fs from "node:fs/promises";
3
3
  import path, { dirname, relative } from "node:path";
4
4
  import process from "node:process";
@@ -268,9 +268,10 @@ async function exportSlides({ port = 18724, total = 0, range: range$1, format =
268
268
  const slideContainers = page.locator(".print-slide-container");
269
269
  const count = await slideContainers.count();
270
270
  for (let i = 0; i < count; i++) {
271
- progress.update(i + 1);
272
271
  const id = await slideContainers.nth(i).getAttribute("id") || "";
273
272
  const slideNo = +id.split("-")[0];
273
+ if (!pages.includes(slideNo)) continue;
274
+ progress.update(result.length + 1);
274
275
  const buffer = await slideContainers.nth(i).screenshot({ omitBackground });
275
276
  const filename = `${withClicks ? id : slideNo}.png`;
276
277
  result.push({
@@ -314,7 +315,7 @@ async function exportSlides({ port = 18724, total = 0, range: range$1, format =
314
315
  }
315
316
  async function genPageMd() {
316
317
  const pngs = await genPagePng(dirname(output));
317
- const content = slides.map(({ title, index, note }) => pngs.filter(({ slideIndex }) => slideIndex === index).map(({ filename }) => `![${title || index + 1}](./${filename})\n\n`).join("") + (note ? `${note.trim()}\n\n` : "")).join("---\n\n");
318
+ const content = slides.filter(({ index }) => pages.includes(index + 1)).map(({ title, index, note }) => pngs.filter(({ slideIndex }) => slideIndex === index).map(({ filename }) => `![${title || index + 1}](./${filename})\n\n`).join("") + (note ? `${note.trim()}\n\n` : "")).join("---\n\n");
318
319
  await fs.writeFile(ensureSuffix(".md", output), content);
319
320
  }
320
321
  async function genPagePptx(pngs) {
package/dist/index.mjs ADDED
@@ -0,0 +1,5 @@
1
+ import { i as resolveOptions, n as ViteSlidevPlugin, o as parser, r as createDataUtils } from "./shared-MlFI4qjX.mjs";
2
+ import "./resolver-Dl3RCceV.mjs";
3
+ import { t as createServer } from "./serve-CqkRxlTS.mjs";
4
+
5
+ export { ViteSlidevPlugin, createDataUtils, createServer, parser, resolveOptions };
@@ -1,4 +1,4 @@
1
- import { t as resolveViteConfigs } from "./shared-BQQJCtZ8.js";
1
+ import { t as resolveViteConfigs } from "./shared-MlFI4qjX.mjs";
2
2
  import { join } from "node:path";
3
3
  import process from "node:process";
4
4
  import { createServer } from "vite";
@@ -1,4 +1,4 @@
1
- import { a as resolveImportPath, i as resolveEntry, n as getRoots, o as resolveImportUrl, r as isInstalledGlobally, s as toAtFS, t as createResolver } from "./resolver-VcRws4SK.js";
1
+ import { a as resolveImportPath, i as resolveEntry, n as getRoots, o as resolveImportUrl, r as isInstalledGlobally, s as toAtFS, t as createResolver } from "./resolver-Dl3RCceV.mjs";
2
2
  import { builtinModules } from "node:module";
3
3
  import fs, { readFile } from "node:fs/promises";
4
4
  import path, { basename, dirname, join, resolve } from "node:path";
@@ -42,7 +42,7 @@ import Vue from "@vitejs/plugin-vue";
42
42
  import VueJsx from "@vitejs/plugin-vue-jsx";
43
43
 
44
44
  //#region package.json
45
- var version = "52.6.0";
45
+ var version = "52.7.0";
46
46
 
47
47
  //#endregion
48
48
  //#region node/syntax/markdown-it/markdown-it-link.ts
@@ -1675,6 +1675,27 @@ function getCodeBlocks(md) {
1675
1675
  }
1676
1676
  };
1677
1677
  }
1678
+ function getCommentBlocks(md) {
1679
+ const commentBlocks = Array.from(md.matchAll(/<!--[\s\S]*?-->/g)).map((m) => {
1680
+ const start = m.index;
1681
+ const end = m.index + m[0].length;
1682
+ return [
1683
+ start,
1684
+ end,
1685
+ md.slice(0, start).match(/\n/g)?.length || 0,
1686
+ md.slice(0, end).match(/\n/g)?.length || 0
1687
+ ];
1688
+ });
1689
+ return {
1690
+ commentBlocks,
1691
+ isInsideCommentBlocks(idx) {
1692
+ return commentBlocks.some(([s, e]) => s <= idx && idx <= e);
1693
+ },
1694
+ isLineInsideCommentBlocks(line) {
1695
+ return commentBlocks.some(([, , s, e]) => s <= line && line <= e);
1696
+ }
1697
+ };
1698
+ }
1678
1699
  /**
1679
1700
  * Escape `{{` in code block to prevent Vue interpret it, #99, #1316
1680
1701
  */
@@ -1827,8 +1848,10 @@ function transformCodeWrapper(ctx) {
1827
1848
  */
1828
1849
  function transformPageCSS(ctx) {
1829
1850
  const codeBlocks = getCodeBlocks(ctx.s.original);
1851
+ const commentBlocks = getCommentBlocks(ctx.s.original);
1830
1852
  ctx.s.replace(/(\n<style[^>]*>)([\s\S]+?)(<\/style>)/g, (full, start, css, end, index) => {
1831
1853
  if (codeBlocks.isInsideCodeblocks(index)) return full;
1854
+ if (commentBlocks.isInsideCommentBlocks(index)) return ``;
1832
1855
  if (!start.includes("scoped")) start = start.replace("<style", "<style scoped");
1833
1856
  return `${start}\n${css}${end}`;
1834
1857
  });
@@ -1927,6 +1950,7 @@ function transformPlantUml(ctx) {
1927
1950
  function transformSlotSugar(ctx) {
1928
1951
  const linesWithNewline = ctx.s.original.split(/(\r?\n)/g);
1929
1952
  const codeBlocks = getCodeBlocks(ctx.s.original);
1953
+ const commentBlocks = getCommentBlocks(ctx.s.original);
1930
1954
  const lines = [];
1931
1955
  for (let i = 0; i < linesWithNewline.length; i += 2) {
1932
1956
  const line = linesWithNewline[i];
@@ -1938,7 +1962,7 @@ function transformSlotSugar(ctx) {
1938
1962
  lines.forEach((line) => {
1939
1963
  const start = offset;
1940
1964
  offset += line.length;
1941
- if (codeBlocks.isInsideCodeblocks(offset)) return;
1965
+ if (codeBlocks.isInsideCodeblocks(offset) || commentBlocks.isInsideCommentBlocks(offset)) return;
1942
1966
  const match = line.match(/^::\s*([\w.\-:]+)\s*::(\s*)$/);
1943
1967
  if (match) {
1944
1968
  ctx.s.overwrite(start, offset - match[2].length, `${prevSlot ? "\n\n</template>\n" : "\n"}<template v-slot:${match[1]}="slotProps">\n`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
3
  "type": "module",
4
- "version": "52.6.0",
4
+ "version": "52.7.0",
5
5
  "description": "Presentation slides for developers",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -14,14 +14,14 @@
14
14
  "bugs": "https://github.com/slidevjs/slidev/issues",
15
15
  "exports": {
16
16
  ".": {
17
- "types": "./dist/index.d.ts",
18
- "import": "./dist/index.js"
17
+ "types": "./dist/index.d.mts",
18
+ "import": "./dist/index.mjs"
19
19
  },
20
20
  "./*": "./*"
21
21
  },
22
- "main": "dist/index.js",
23
- "module": "dist/index.js",
24
- "types": "dist/index.d.ts",
22
+ "main": "dist/index.mjs",
23
+ "module": "dist/index.mjs",
24
+ "types": "dist/index.d.mts",
25
25
  "bin": {
26
26
  "slidev": "./bin/slidev.mjs"
27
27
  },
@@ -42,15 +42,15 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@antfu/ni": "^27.0.0",
45
+ "@antfu/ni": "^27.0.1",
46
46
  "@antfu/utils": "^9.3.0",
47
47
  "@iconify-json/carbon": "^1.2.14",
48
48
  "@iconify-json/ph": "^1.2.2",
49
49
  "@iconify-json/svg-spinners": "^1.2.4",
50
50
  "@lillallol/outline-pdf": "^4.0.0",
51
- "@shikijs/markdown-it": "^3.13.0",
52
- "@shikijs/twoslash": "^3.13.0",
53
- "@shikijs/vitepress-twoslash": "^3.13.0",
51
+ "@shikijs/markdown-it": "^3.15.0",
52
+ "@shikijs/twoslash": "^3.15.0",
53
+ "@shikijs/vitepress-twoslash": "^3.15.0",
54
54
  "@unocss/extractor-mdc": "^66.5.4",
55
55
  "@unocss/reset": "^66.5.4",
56
56
  "@vitejs/plugin-vue": "^6.0.1",
@@ -76,7 +76,7 @@
76
76
  "markdown-it-footnote": "^4.0.0",
77
77
  "markdown-it-mdc": "^0.2.6",
78
78
  "mlly": "^1.8.0",
79
- "monaco-editor": "^0.53.0",
79
+ "monaco-editor": "^0.54.0",
80
80
  "open": "^10.2.0",
81
81
  "pdf-lib": "^1.17.1",
82
82
  "picomatch": "^4.0.3",
@@ -88,8 +88,8 @@
88
88
  "resolve-from": "^5.0.0",
89
89
  "resolve-global": "^2.0.0",
90
90
  "semver": "^7.7.3",
91
- "shiki": "^3.13.0",
92
- "shiki-magic-move": "^1.2.0",
91
+ "shiki": "^3.15.0",
92
+ "shiki-magic-move": "^1.2.1",
93
93
  "sirv": "^3.0.2",
94
94
  "source-map-js": "^1.2.1",
95
95
  "typescript": "^5.9.3",
@@ -100,18 +100,18 @@
100
100
  "unplugin-vue-markdown": "^29.2.0",
101
101
  "untun": "^0.1.3",
102
102
  "uqr": "^0.1.2",
103
- "vite": "^7.1.12",
103
+ "vite": "^7.2.2",
104
104
  "vite-plugin-inspect": "^11.3.3",
105
105
  "vite-plugin-remote-assets": "^2.1.0",
106
106
  "vite-plugin-static-copy": "^3.1.4",
107
107
  "vite-plugin-vue-server-ref": "^1.0.0",
108
108
  "vitefu": "^1.1.1",
109
- "vue": "^3.5.22",
109
+ "vue": "^3.5.23",
110
110
  "yaml": "^2.8.1",
111
111
  "yargs": "^18.0.0",
112
- "@slidev/client": "52.6.0",
113
- "@slidev/types": "52.6.0",
114
- "@slidev/parser": "52.6.0"
112
+ "@slidev/parser": "52.7.0",
113
+ "@slidev/client": "52.7.0",
114
+ "@slidev/types": "52.7.0"
115
115
  },
116
116
  "devDependencies": {
117
117
  "@hedgedoc/markdown-it-plugins": "^2.1.4",
package/dist/index.js DELETED
@@ -1,5 +0,0 @@
1
- import { i as resolveOptions, n as ViteSlidevPlugin, o as parser, r as createDataUtils } from "./shared-BQQJCtZ8.js";
2
- import "./resolver-VcRws4SK.js";
3
- import { t as createServer } from "./serve-AMxCE-eO.js";
4
-
5
- export { ViteSlidevPlugin, createDataUtils, createServer, parser, resolveOptions };
File without changes
File without changes