@slidev/cli 52.19.1 → 52.19.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.
@@ -1,4 +1,4 @@
1
- import { n as resolveViteConfigs } from "./serve-DzftUF4M.mjs";
1
+ import { n as resolveViteConfigs } from "./serve-CLfxiJWo.mjs";
2
2
  import { join, resolve } from "pathe";
3
3
  import { build as build$1 } from "vite";
4
4
  import { existsSync } from "node:fs";
@@ -52,7 +52,7 @@ async function build(options, viteConfig = {}, args) {
52
52
  dev: true
53
53
  }));
54
54
  server.listen(port);
55
- const { exportSlides } = await import("./export-B_maVZXE.mjs");
55
+ const { exportSlides } = await import("./export-DbxUfS31.mjs");
56
56
  const tempDir = resolve(outDir, "temp");
57
57
  await fs$1.mkdir(tempDir, { recursive: true });
58
58
  await exportSlides({
@@ -93,7 +93,7 @@ async function build(options, viteConfig = {}, args) {
93
93
  "true",
94
94
  "auto"
95
95
  ].includes(options.data.config.download)) {
96
- const { exportSlides, getExportOptions } = await import("./export-B_maVZXE.mjs");
96
+ const { exportSlides, getExportOptions } = await import("./export-DbxUfS31.mjs");
97
97
  const port = 12445;
98
98
  const app = connect();
99
99
  const server = http.createServer(app);
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { i as isInstalledGlobally, o as resolveEntry } from "./resolver-BIhhHpe7.mjs";
2
- import { c as getThemeMeta, d as loadSetups, f as updateFrontmatterPatch, l as resolveTheme, o as resolveOptions, s as parser, t as createServer, u as version } from "./serve-DzftUF4M.mjs";
2
+ import { c as getThemeMeta, d as loadSetups, f as updateFrontmatterPatch, l as resolveTheme, o as resolveOptions, s as parser, t as createServer, u as version } from "./serve-CLfxiJWo.mjs";
3
3
  import process from "node:process";
4
4
  import path from "pathe";
5
5
  import fs from "node:fs/promises";
@@ -161,10 +161,14 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
161
161
  } });
162
162
  await server.listen();
163
163
  let tunnelUrl = "";
164
- if (tunnel) if (remote != null) tunnelUrl = await openTunnel(port);
165
- else console.log(yellow("\n --remote is required for tunneling, Cloudflare Quick Tunnel is not enabled.\n"));
164
+ if (tunnel) {
165
+ if (remote != null) tunnelUrl = await openTunnel(port);
166
+ else console.log(yellow("\n --remote is required for tunneling, Cloudflare Quick Tunnel is not enabled.\n"));
167
+ }
166
168
  let publicIp;
167
- if (remote) publicIp = await import("public-ip").then((r) => r.publicIpv4());
169
+ if (remote) try {
170
+ publicIp = await import("public-ip").then((r) => r.publicIpv4());
171
+ } catch {}
168
172
  lastRemoteUrl = printInfo(options, port, base, remote, tunnelUrl, publicIp);
169
173
  if (open) await openSlidevInBrowser();
170
174
  return options;
@@ -227,8 +231,10 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
227
231
  const code = r.renderUnicodeCompact(lastRemoteUrl);
228
232
  console.log(`\n${dim(" QR Code for remote control: ")}\n ${blue(lastRemoteUrl)}\n`);
229
233
  console.log(code.split("\n").map((i) => ` ${i}`).join("\n"));
230
- const publicIp = await import("public-ip").then((r) => r.publicIpv4());
231
- if (publicIp) console.log(`\n${dim(" Public IP: ")} ${blue(publicIp)}\n`);
234
+ try {
235
+ const publicIp = await import("public-ip").then((r) => r.publicIpv4());
236
+ if (publicIp) console.log(`\n${dim(" Public IP: ")} ${blue(publicIp)}\n`);
237
+ } catch {}
232
238
  });
233
239
  }
234
240
  }
@@ -302,7 +308,7 @@ cli.command("build [entry..]", "Build hostable SPA", (args) => exportOptions(com
302
308
  describe: "enable the inspect plugin for debugging"
303
309
  }).strict().help(), async (args) => {
304
310
  const { entry, theme, base, download, out, inspect, "without-notes": withoutNotes, "router-mode": routerMode } = args;
305
- const { build } = await import("./build-CnBLrEp0.mjs");
311
+ const { build } = await import("./build-D2W5VZjC.mjs");
306
312
  for (const entryFile of entry) {
307
313
  const options = await resolveOptions({
308
314
  entry: entryFile,
@@ -331,7 +337,7 @@ cli.command("format [entry..]", "Format the markdown file", (args) => commonOpti
331
337
  }
332
338
  });
333
339
  cli.command("mcp [entry]", "Start an MCP (Model Context Protocol) server over stdio for AI agents to inspect and edit the slides", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
334
- const { startMcpStdioServer } = await import("./stdio-BrKVwy-M.mjs");
340
+ const { startMcpStdioServer } = await import("./stdio-SMQ1-gi9.mjs");
335
341
  await startMcpStdioServer(await resolveEntry(entry));
336
342
  });
337
343
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
@@ -371,7 +377,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
371
377
  });
372
378
  cli.command("export [entry..]", "Export slides to PDF", (args) => exportOptions(commonOptions(args)).strict().help(), async (args) => {
373
379
  const { entry, theme } = args;
374
- const { exportSlides, getExportOptions } = await import("./export-B_maVZXE.mjs");
380
+ const { exportSlides, getExportOptions } = await import("./export-DbxUfS31.mjs");
375
381
  const candidatePort = await getPort(12445);
376
382
  let warned = false;
377
383
  for (const entryFile of entry) {
@@ -423,7 +429,7 @@ cli.command("export-notes [entry..]", "Export slide notes to PDF", (args) => arg
423
429
  type: "number",
424
430
  describe: "wait for the specified ms before exporting"
425
431
  }).strict().help(), async ({ entry, output, timeout, wait }) => {
426
- const { exportNotes } = await import("./export-B_maVZXE.mjs");
432
+ const { exportNotes } = await import("./export-DbxUfS31.mjs");
427
433
  const candidatePort = await getPort(12445);
428
434
  for (const entryFile of entry) {
429
435
  const options = await resolveOptions({ entry: entryFile }, "export");
@@ -354,8 +354,10 @@ async function exportSlides({ port = 18724, total = 0, range, format = "pdf", ou
354
354
  if (titleSlide?.title) pdf.setTitle(titleSlide.title);
355
355
  if (titleSlide?.frontmatter?.info) pdf.setSubject(titleSlide.frontmatter.info);
356
356
  if (titleSlide?.frontmatter?.author) pdf.setAuthor(titleSlide.frontmatter.author);
357
- if (titleSlide?.frontmatter?.keywords) if (Array.isArray(titleSlide?.frontmatter?.keywords)) pdf.setKeywords(titleSlide?.frontmatter?.keywords);
358
- else pdf.setKeywords(titleSlide?.frontmatter?.keywords.split(","));
357
+ if (titleSlide?.frontmatter?.keywords) {
358
+ if (Array.isArray(titleSlide?.frontmatter?.keywords)) pdf.setKeywords(titleSlide?.frontmatter?.keywords);
359
+ else pdf.setKeywords(titleSlide?.frontmatter?.keywords.split(","));
360
+ }
359
361
  }
360
362
  async function addTocToPdf(pdf) {
361
363
  const outlinePdf = outlinePdfFactory(pdfLib);
package/dist/index.d.mts CHANGED
@@ -2,13 +2,13 @@ import { InlineConfig, PluginOption } from "vite";
2
2
  import * as parser from "@slidev/parser/fs";
3
3
  import { ResolvedSlidevOptions, ResolvedSlidevUtils, SlidevEntryOptions, SlidevPluginOptions, SlidevServerOptions } from "@slidev/types";
4
4
  //#region node/commands/serve.d.ts
5
- declare function createServer(options: ResolvedSlidevOptions, viteConfig?: InlineConfig, serverOptions?: SlidevServerOptions): Promise<import("vite").ViteDevServer>;
5
+ export declare function createServer(options: ResolvedSlidevOptions, viteConfig?: InlineConfig, serverOptions?: SlidevServerOptions): Promise<import("vite").ViteDevServer>;
6
6
  //#endregion
7
7
  //#region node/options.d.ts
8
- declare function resolveOptions(entryOptions: SlidevEntryOptions, mode: ResolvedSlidevOptions['mode']): Promise<ResolvedSlidevOptions>;
9
- declare function createDataUtils(resolved: Omit<ResolvedSlidevOptions, 'utils'>): Promise<ResolvedSlidevUtils>;
8
+ export declare function resolveOptions(entryOptions: SlidevEntryOptions, mode: ResolvedSlidevOptions['mode']): Promise<ResolvedSlidevOptions>;
9
+ export declare function createDataUtils(resolved: Omit<ResolvedSlidevOptions, 'utils'>): Promise<ResolvedSlidevUtils>;
10
10
  //#endregion
11
11
  //#region node/vite/index.d.ts
12
- declare function ViteSlidevPlugin(options: ResolvedSlidevOptions, pluginOptions?: SlidevPluginOptions, serverOptions?: SlidevServerOptions): Promise<PluginOption[]>;
12
+ export declare function ViteSlidevPlugin(options: ResolvedSlidevOptions, pluginOptions?: SlidevPluginOptions, serverOptions?: SlidevServerOptions): Promise<PluginOption[]>;
13
13
  //#endregion
14
- export { ViteSlidevPlugin, createDataUtils, createServer, parser, resolveOptions };
14
+ export { parser };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as createDataUtils, o as resolveOptions, r as ViteSlidevPlugin, s as parser, t as createServer } from "./serve-DzftUF4M.mjs";
1
+ import { a as createDataUtils, o as resolveOptions, r as ViteSlidevPlugin, s as parser, t as createServer } from "./serve-CLfxiJWo.mjs";
2
2
  export { ViteSlidevPlugin, createDataUtils, createServer, parser, resolveOptions };
@@ -712,7 +712,7 @@ function createLayoutWrapperPlugin({ data, utils }) {
712
712
  }
713
713
  //#endregion
714
714
  //#region package.json
715
- var version = "52.19.1";
715
+ var version = "52.19.2";
716
716
  //#endregion
717
717
  //#region node/integrations/addons.ts
718
718
  async function resolveAddons(addonsInConfig) {
@@ -1555,11 +1555,13 @@ function createSlidesLoader(options, serverOptions) {
1555
1555
  const slide = data.slides[idx];
1556
1556
  if (body.content && body.content !== slide.source.content) hmrSlidesIndexes.add(idx);
1557
1557
  if (body.content) slide.content = slide.source.content = body.content;
1558
- if (body.frontmatterRaw != null) if (body.frontmatterRaw.trim() === "") slide.source.frontmatterDoc = slide.source.frontmatterStyle = void 0;
1559
- else {
1560
- const parsed = YAML.parseDocument(body.frontmatterRaw);
1561
- if (parsed.errors.length) console.error("ERROR when saving frontmatter", parsed.errors);
1562
- else slide.source.frontmatterDoc = parsed;
1558
+ if (body.frontmatterRaw != null) {
1559
+ if (body.frontmatterRaw.trim() === "") slide.source.frontmatterDoc = slide.source.frontmatterStyle = void 0;
1560
+ else {
1561
+ const parsed = YAML.parseDocument(body.frontmatterRaw);
1562
+ if (parsed.errors.length) console.error("ERROR when saving frontmatter", parsed.errors);
1563
+ else slide.source.frontmatterDoc = parsed;
1564
+ }
1563
1565
  }
1564
1566
  if (body.note != null) slide.note = slide.source.note = body.note;
1565
1567
  if (body.frontmatter) {
@@ -1797,7 +1799,7 @@ async function setupTransformers(roots) {
1797
1799
  return result;
1798
1800
  }
1799
1801
  //#endregion
1800
- //#region ../../node_modules/.pnpm/@hedgedoc+markdown-it-plugins@2.1.4_patch_hash=49e14003b6caa0b7d164cbe71da573809d375bab_5d0803032f59b14bddf561c39219cd80/node_modules/@hedgedoc/markdown-it-plugins/dist/esm/image-size/specialCharacters.js
1802
+ //#region ../../node_modules/.pnpm/@hedgedoc+markdown-it-plugins@2.1.4_patch_hash=49e14003b6caa0b7d164cbe71da573809d375bab_18adf40ca8d248c8719aefb5f4dca995/node_modules/@hedgedoc/markdown-it-plugins/dist/esm/image-size/specialCharacters.js
1801
1803
  var SpecialCharacters;
1802
1804
  (function(SpecialCharacters) {
1803
1805
  SpecialCharacters[SpecialCharacters["EXCLAMATION_MARK"] = 33] = "EXCLAMATION_MARK";
@@ -1813,7 +1815,7 @@ var SpecialCharacters;
1813
1815
  SpecialCharacters[SpecialCharacters["CLOSING_PARENTHESIS"] = 41] = "CLOSING_PARENTHESIS";
1814
1816
  })(SpecialCharacters || (SpecialCharacters = {}));
1815
1817
  //#endregion
1816
- //#region ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/token.mjs
1818
+ //#region ../../node_modules/.pnpm/markdown-it@14.3.2/node_modules/markdown-it/lib/token.mjs
1817
1819
  /**
1818
1820
  * class Token
1819
1821
  **/
@@ -1967,7 +1969,7 @@ Token.prototype.attrJoin = function attrJoin(name, value) {
1967
1969
  else this.attrs[idx][1] = this.attrs[idx][1] + " " + value;
1968
1970
  };
1969
1971
  //#endregion
1970
- //#region ../../node_modules/.pnpm/@hedgedoc+markdown-it-plugins@2.1.4_patch_hash=49e14003b6caa0b7d164cbe71da573809d375bab_5d0803032f59b14bddf561c39219cd80/node_modules/@hedgedoc/markdown-it-plugins/dist/esm/task-lists/index.js
1972
+ //#region ../../node_modules/.pnpm/@hedgedoc+markdown-it-plugins@2.1.4_patch_hash=49e14003b6caa0b7d164cbe71da573809d375bab_18adf40ca8d248c8719aefb5f4dca995/node_modules/@hedgedoc/markdown-it-plugins/dist/esm/task-lists/index.js
1971
1973
  const checkboxRegex = /^ *\[([\sx])] /i;
1972
1974
  function taskLists(md, options = {
1973
1975
  enabled: false,
@@ -2659,11 +2661,13 @@ async function applySlidePatch(data, no, patch) {
2659
2661
  const slide = resolveSlide(data, no);
2660
2662
  const source = slide.source;
2661
2663
  if (patch.content != null) source.content = patch.content;
2662
- if (patch.frontmatterRaw != null) if (patch.frontmatterRaw.trim() === "") source.frontmatterDoc = source.frontmatterStyle = void 0;
2663
- else {
2664
- const parsed = YAML.parseDocument(patch.frontmatterRaw);
2665
- if (parsed.errors.length) throw new Error(`Invalid YAML frontmatter: ${parsed.errors.map((e) => e.message).join("; ")}`);
2666
- source.frontmatterDoc = parsed;
2664
+ if (patch.frontmatterRaw != null) {
2665
+ if (patch.frontmatterRaw.trim() === "") source.frontmatterDoc = source.frontmatterStyle = void 0;
2666
+ else {
2667
+ const parsed = YAML.parseDocument(patch.frontmatterRaw);
2668
+ if (parsed.errors.length) throw new Error(`Invalid YAML frontmatter: ${parsed.errors.map((e) => e.message).join("; ")}`);
2669
+ source.frontmatterDoc = parsed;
2670
+ }
2667
2671
  }
2668
2672
  if (patch.note != null) source.note = patch.note;
2669
2673
  if (patch.frontmatter) updateFrontmatterPatch(source, patch.frontmatter);
@@ -1,5 +1,5 @@
1
1
  import { n as getRoots } from "./resolver-BIhhHpe7.mjs";
2
- import { i as createSlidevMcpServer, s as parser, u as version } from "./serve-DzftUF4M.mjs";
2
+ import { i as createSlidevMcpServer, s as parser, u as version } from "./serve-CLfxiJWo.mjs";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
4
4
  //#region node/mcp/stdio.ts
5
5
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
3
  "type": "module",
4
- "version": "52.19.1",
4
+ "version": "52.19.2",
5
5
  "description": "Presentation slides for developers",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -50,7 +50,7 @@
50
50
  "@antfu/ni": "^30.5.0",
51
51
  "@antfu/utils": "^9.3.0",
52
52
  "@comark/markdown-it": "^0.3.4",
53
- "@iconify-json/carbon": "^1.2.25",
53
+ "@iconify-json/carbon": "^1.2.27",
54
54
  "@iconify-json/ph": "^1.2.2",
55
55
  "@iconify-json/svg-spinners": "^1.2.4",
56
56
  "@lillallol/outline-pdf": "^4.0.0",
@@ -60,11 +60,14 @@
60
60
  "@shikijs/markdown-it": "^4.4.3",
61
61
  "@shikijs/twoslash": "^4.4.3",
62
62
  "@shikijs/vitepress-twoslash": "^4.4.3",
63
- "@unocss/extractor-mdc": "^66.7.5",
64
- "@unocss/reset": "^66.7.5",
65
- "@vitejs/plugin-vue": "^6.0.8",
63
+ "@slidev/client": "52.19.2",
64
+ "@slidev/parser": "52.19.2",
65
+ "@slidev/types": "52.19.2",
66
+ "@unocss/extractor-mdc": "^66.10.3",
67
+ "@unocss/reset": "^66.10.3",
68
+ "@vitejs/plugin-vue": "^6.0.9",
66
69
  "@vitejs/plugin-vue-jsx": "^5.1.6",
67
- "ansis": "^4.3.1",
70
+ "ansis": "^4.4.0",
68
71
  "chokidar": "^5.0.0",
69
72
  "cli-progress": "^3.12.0",
70
73
  "connect": "^3.7.0",
@@ -75,21 +78,21 @@
75
78
  "htmlparser2": "^12.0.0",
76
79
  "is-installed-globally": "^1.0.0",
77
80
  "jiti": "^2.7.0",
78
- "katex": "^0.18.4",
81
+ "katex": "^0.18.7",
79
82
  "local-pkg": "^1.2.1",
80
83
  "lz-string": "^1.5.0",
81
- "magic-string": "^1.2.0",
84
+ "magic-string": "^1.4.1",
82
85
  "magic-string-stack": "^2.0.0",
83
- "markdown-exit": "^1.1.0-beta.2",
86
+ "markdown-exit": "^1.3.0",
84
87
  "markdown-it-footnote": "^4.0.0",
85
88
  "markdown-it-github-alerts": "^1.0.1",
86
89
  "mlly": "^1.8.2",
87
90
  "monaco-editor": "^0.56.0",
88
- "obug": "^2.1.4",
89
- "open": "^11.0.1",
91
+ "obug": "^3.0.0",
92
+ "open": "^11.0.4",
90
93
  "pathe": "^2.0.3",
91
94
  "pdf-lib": "^1.17.1",
92
- "picomatch": "^4.0.5",
95
+ "picomatch": "^4.0.7",
93
96
  "plantuml-encoder": "^1.4.0",
94
97
  "postcss-nested": "^8.0.1",
95
98
  "pptxgenjs": "^4.0.1",
@@ -101,27 +104,24 @@
101
104
  "sirv": "^3.0.2",
102
105
  "source-map-js": "^1.2.1",
103
106
  "typescript": "^6.0.3",
104
- "unhead": "^3.3.2",
105
- "unocss": "^66.7.5",
106
- "unplugin-icons": "^23.0.1",
107
+ "unhead": "^3.4.1",
108
+ "unocss": "^66.10.3",
109
+ "unplugin-icons": "^24.0.0",
107
110
  "unplugin-vue-components": "^32.1.0",
108
- "unplugin-vue-markdown": "^32.0.0",
111
+ "unplugin-vue-markdown": "^32.1.1",
109
112
  "untun": "^0.2.2",
110
113
  "uqr": "^0.1.3",
111
114
  "verkit": "^0.4.0",
112
- "vite": "^8.2.1",
115
+ "vite": "~8.2.0",
113
116
  "vite-plugin-inspect": "^12.0.2",
114
117
  "vite-plugin-remote-assets": "^2.1.0",
115
118
  "vite-plugin-static-copy": "^4.1.1",
116
119
  "vite-plugin-vue-server-ref": "^1.0.0",
117
120
  "vitefu": "^1.1.3",
118
- "vue": "^3.5.41",
119
- "yaml": "^2.9.0",
121
+ "vue": "^3.5.42",
122
+ "yaml": "^2.9.1",
120
123
  "yargs": "^18.1.0",
121
- "zod": "^4.4.3",
122
- "@slidev/client": "52.19.1",
123
- "@slidev/parser": "52.19.1",
124
- "@slidev/types": "52.19.1"
124
+ "zod": "^4.6.5"
125
125
  },
126
126
  "devDependencies": {
127
127
  "@hedgedoc/markdown-it-plugins": "^2.1.4",
@@ -136,8 +136,11 @@ Props: `controls`, `autoplay`, `autoreset`, `poster`, `timestamp`
136
136
  ```md
137
137
  <Tweet id="1423789844234231808" />
138
138
  <Tweet id="1423789844234231808" :scale="0.8" />
139
+ <Tweet url="https://x.com/antfu7/status/1389604687502995457" />
139
140
  ```
140
141
 
142
+ Use either `id` or a full `x.com` or `twitter.com` post URL. When both are present, `id` takes precedence.
143
+
141
144
  ## Conditional
142
145
 
143
146
  ### LightOrDark