@slidev/cli 52.18.0 → 52.18.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.
@@ -1,4 +1,4 @@
1
- import { n as resolveViteConfigs } from "./serve-1daxO8VB.mjs";
1
+ import { n as resolveViteConfigs } from "./serve-C3LqO47C.mjs";
2
2
  import { join, resolve } from "pathe";
3
3
  import { build as build$1 } from "vite";
4
4
  import { existsSync } from "node:fs";
@@ -10,7 +10,7 @@ import sirv from "sirv";
10
10
  async function build(options, viteConfig = {}, args) {
11
11
  const indexHtmlId = resolve(options.userRoot, "index.html");
12
12
  let config = void 0;
13
- await build$1(await resolveViteConfigs(options, {
13
+ const inlineConfig = await resolveViteConfigs(options, {
14
14
  plugins: [{
15
15
  name: "slidev:build",
16
16
  configResolved(_config) {
@@ -34,7 +34,8 @@ async function build(options, viteConfig = {}, args) {
34
34
  chunkSizeWarningLimit: 2e3,
35
35
  rollupOptions: { input: { index: indexHtmlId } }
36
36
  }
37
- }, viteConfig, "build"));
37
+ }, viteConfig, "build");
38
+ await build$1(inlineConfig);
38
39
  const outDir = resolve(options.userRoot, config.build.outDir);
39
40
  if (options.data.config.seoMeta?.ogImage === "auto" || options.data.config.seoMeta?.ogImage?.startsWith(".")) {
40
41
  const filename = options.data.config.seoMeta?.ogImage === "auto" ? "og-image.png" : options.data.config.seoMeta.ogImage;
package/dist/cli.d.mts CHANGED
@@ -1 +1 @@
1
- export { };
1
+ export {}
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-1daxO8VB.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-C3LqO47C.mjs";
3
3
  import process from "node:process";
4
4
  import path from "pathe";
5
5
  import fs from "node:fs/promises";
@@ -126,7 +126,8 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
126
126
  port,
127
127
  strictPort: true,
128
128
  host,
129
- force
129
+ force,
130
+ ...tunnel && remote != null ? { allowedHosts: [".trycloudflare.com"] } : {}
130
131
  },
131
132
  optimizeDeps: { force },
132
133
  logLevel: log,
@@ -202,7 +203,8 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
202
203
  name: "e",
203
204
  fullname: "edit",
204
205
  action() {
205
- execFile(process.env.EDITOR || "code", [entry]);
206
+ const editor = process.env.EDITOR || "code";
207
+ execFile(editor, [entry]);
206
208
  }
207
209
  },
208
210
  {
@@ -300,7 +302,7 @@ cli.command("build [entry..]", "Build hostable SPA", (args) => exportOptions(com
300
302
  describe: "enable the inspect plugin for debugging"
301
303
  }).strict().help(), async (args) => {
302
304
  const { entry, theme, base, download, out, inspect, "without-notes": withoutNotes, "router-mode": routerMode } = args;
303
- const { build } = await import("./build-DJdJOe3Q.mjs");
305
+ const { build } = await import("./build-CMhuImLu.mjs");
304
306
  for (const entryFile of entry) {
305
307
  const options = await resolveOptions({
306
308
  entry: entryFile,
@@ -329,7 +331,7 @@ cli.command("format [entry..]", "Format the markdown file", (args) => commonOpti
329
331
  }
330
332
  });
331
333
  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 }) => {
332
- const { startMcpStdioServer } = await import("./stdio-BPU_DuqN.mjs");
334
+ const { startMcpStdioServer } = await import("./stdio-BBaEvAO6.mjs");
333
335
  await startMcpStdioServer(await resolveEntry(entry));
334
336
  });
335
337
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
@@ -551,7 +553,7 @@ function printInfo(options, port, base, remote, tunnelUrl, publicIp) {
551
553
  if (options.inspect) console.log(`${dim(" vite inspector")} > ${yellow(`${baseUrl}/__inspect/`)}`);
552
554
  let lastRemoteUrl = "";
553
555
  if (remote !== void 0) {
554
- Object.values(os.networkInterfaces()).forEach((v) => (v || []).filter((details) => String(details.family).slice(-1) === "4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
556
+ Object.values(os.networkInterfaces()).forEach((v) => (v || []).filter((details) => String(details.family).endsWith("4") && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
555
557
  lastRemoteUrl = `http://${address}:${portAndBase}${entryPath}`;
556
558
  console.log(`${dim(" remote control ")} > ${blue(lastRemoteUrl)}`);
557
559
  }));
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-1daxO8VB.mjs";
1
+ import { a as createDataUtils, o as resolveOptions, r as ViteSlidevPlugin, s as parser, t as createServer } from "./serve-C3LqO47C.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.18.0";
715
+ var version = "52.18.1";
716
716
  //#endregion
717
717
  //#region node/integrations/addons.ts
718
718
  async function resolveAddons(addonsInConfig) {
@@ -2022,7 +2022,7 @@ function todoify(token, options) {
2022
2022
  }
2023
2023
  function generateIdForToken(token) {
2024
2024
  if (token.map) return `task-item-${token.map[0]}`;
2025
- else return `task-item-${Math.ceil(Math.random() * (1e4 * 1e3) - 1e3)}`;
2025
+ else return `task-item-${Math.ceil(Math.random() * 1e7 - 1e3)}`;
2026
2026
  }
2027
2027
  function createCheckboxToken(token, enabled, id) {
2028
2028
  const checkbox = new Token("taskListItemCheckbox", "", 0);
@@ -2387,7 +2387,8 @@ function MarkdownItVDrag(md, markdownTransformMap) {
2387
2387
  const sourceMap = s.generateMap();
2388
2388
  smc = new SourceMapConsumer({
2389
2389
  ...sourceMap,
2390
- version: sourceMap.version.toString()
2390
+ version: sourceMap.version.toString(),
2391
+ sourcesContent: sourceMap.sourcesContent?.map((content) => content ?? "")
2391
2392
  });
2392
2393
  sourceMapConsumers.set(s, smc);
2393
2394
  return smc;
@@ -2919,7 +2920,8 @@ function createSlidevMcpServer(ctx) {
2919
2920
  */
2920
2921
  function isSafeDrawingKey(dir, key) {
2921
2922
  if (!/^\d+$/.test(key)) return false;
2922
- const rel = relative(dir, join(dir, `${key}.svg`));
2923
+ const target = join(dir, `${key}.svg`);
2924
+ const rel = relative(dir, target);
2923
2925
  return !rel.startsWith("..") && !isAbsolute(rel);
2924
2926
  }
2925
2927
  function resolveDrawingsDir(options) {
@@ -3209,7 +3211,7 @@ async function createPWAPlugin(options) {
3209
3211
  injectRegister: null,
3210
3212
  base,
3211
3213
  workbox: {
3212
- maximumFileSizeToCacheInBytes: 100 * 1024 * 1024,
3214
+ maximumFileSizeToCacheInBytes: 104857600,
3213
3215
  globPatterns: ["**/*.{js,css,html,woff,woff2,ttf,png,jpg,jpeg,svg,gif,webp,avif,ico,mp4,webm,ogv,mov,m4v,mp3,wav,ogg,oga,m4a,aac,flac,opus,weba}"],
3214
3216
  navigateFallback: "index.html",
3215
3217
  navigateFallbackDenylist: [/^\/(presenter|notes|overview|print|export)/]
@@ -3302,7 +3304,7 @@ async function setupUnocss({ clientRoot, roots, data, utils }) {
3302
3304
  return "default" in loaded ? loaded.default : loaded;
3303
3305
  });
3304
3306
  }
3305
- const config = mergeConfigs([
3307
+ const configs = [
3306
3308
  {
3307
3309
  presets: [presetIcons({
3308
3310
  collectionsNodeResolvePath: utils.iconsResolvePath,
@@ -3312,7 +3314,8 @@ async function setupUnocss({ clientRoot, roots, data, utils }) {
3312
3314
  },
3313
3315
  (await loadModule(resolve(clientRoot, "uno.config.ts"))).default,
3314
3316
  ...await loadSetups(roots, "unocss.ts", [], loadFileConfigs)
3315
- ].filter(Boolean));
3317
+ ].filter(Boolean);
3318
+ const config = mergeConfigs(configs);
3316
3319
  config.theme ||= {};
3317
3320
  config.theme.fontFamily ||= {};
3318
3321
  config.theme.fontFamily.sans ||= data.config.fonts.sans.join(",");
@@ -3450,7 +3453,8 @@ async function resolveViteConfigs(options, baseConfig, overrideConfigs, command,
3450
3453
  //#region node/commands/serve.ts
3451
3454
  async function createServer$1(options, viteConfig = {}, serverOptions) {
3452
3455
  process.env.EDITOR = process.env.EDITOR || "code";
3453
- return await createServer(await resolveViteConfigs(options, { optimizeDeps: { entries: [join(options.clientRoot, "main.ts")] } }, viteConfig, "serve", serverOptions));
3456
+ const inlineConfig = await resolveViteConfigs(options, { optimizeDeps: { entries: [join(options.clientRoot, "main.ts")] } }, viteConfig, "serve", serverOptions);
3457
+ return await createServer(inlineConfig);
3454
3458
  }
3455
3459
  //#endregion
3456
3460
  export { createDataUtils as a, getThemeMeta as c, loadSetups as d, updateFrontmatterPatch as f, createSlidevMcpServer as i, resolveTheme as l, resolveViteConfigs as n, resolveOptions as o, ViteSlidevPlugin as r, parser as s, createServer$1 as t, version as u };
@@ -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-1daxO8VB.mjs";
2
+ import { i as createSlidevMcpServer, s as parser, u as version } from "./serve-C3LqO47C.mjs";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
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.18.0",
4
+ "version": "52.18.1",
5
5
  "description": "Presentation slides for developers",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -47,21 +47,21 @@
47
47
  }
48
48
  },
49
49
  "dependencies": {
50
- "@antfu/ni": "^30.2.0",
50
+ "@antfu/ni": "^30.3.0",
51
51
  "@antfu/utils": "^9.3.0",
52
52
  "@comark/markdown-it": "^0.3.4",
53
53
  "@iconify-json/carbon": "^1.2.24",
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",
57
- "@modelcontextprotocol/sdk": "^1.29.0",
57
+ "@modelcontextprotocol/sdk": "^1.30.0",
58
58
  "@shikijs/magic-move": "^4.3.1",
59
59
  "@shikijs/markdown-it": "^4.3.1",
60
60
  "@shikijs/twoslash": "^4.3.1",
61
61
  "@shikijs/vitepress-twoslash": "^4.3.1",
62
62
  "@unocss/extractor-mdc": "^66.7.5",
63
63
  "@unocss/reset": "^66.7.5",
64
- "@vitejs/plugin-vue": "^6.0.7",
64
+ "@vitejs/plugin-vue": "^6.0.8",
65
65
  "@vitejs/plugin-vue-jsx": "^5.1.6",
66
66
  "ansis": "^4.3.1",
67
67
  "chokidar": "^5.0.0",
@@ -74,17 +74,17 @@
74
74
  "htmlparser2": "^12.0.0",
75
75
  "is-installed-globally": "^1.0.0",
76
76
  "jiti": "^2.7.0",
77
- "katex": "^0.17.0",
77
+ "katex": "^0.18.1",
78
78
  "local-pkg": "^1.2.1",
79
79
  "lz-string": "^1.5.0",
80
- "magic-string": "^0.30.21",
81
- "magic-string-stack": "^1.1.0",
80
+ "magic-string": "^1.1.0",
81
+ "magic-string-stack": "^2.0.0",
82
82
  "markdown-exit": "^1.1.0-beta.2",
83
83
  "markdown-it-footnote": "^4.0.0",
84
84
  "markdown-it-github-alerts": "^1.0.1",
85
85
  "mlly": "^1.8.2",
86
- "monaco-editor": "^0.55.1",
87
- "obug": "^2.1.3",
86
+ "monaco-editor": "^0.56.0",
87
+ "obug": "^2.1.4",
88
88
  "open": "^11.0.0",
89
89
  "pathe": "^2.0.3",
90
90
  "pdf-lib": "^1.17.1",
@@ -101,26 +101,26 @@
101
101
  "sirv": "^3.0.2",
102
102
  "source-map-js": "^1.2.1",
103
103
  "typescript": "^6.0.3",
104
- "unhead": "^3.1.7",
104
+ "unhead": "^3.2.3",
105
105
  "unocss": "^66.7.5",
106
106
  "unplugin-icons": "^23.0.1",
107
107
  "unplugin-vue-components": "^32.1.0",
108
108
  "unplugin-vue-markdown": "^32.0.0",
109
- "untun": "^0.1.3",
109
+ "untun": "^0.2.2",
110
110
  "uqr": "^0.1.3",
111
- "vite": "^8.1.3",
111
+ "vite": "^8.1.5",
112
112
  "vite-plugin-inspect": "^11.4.1",
113
113
  "vite-plugin-remote-assets": "^2.1.0",
114
114
  "vite-plugin-static-copy": "^4.1.1",
115
115
  "vite-plugin-vue-server-ref": "^1.0.0",
116
116
  "vitefu": "^1.1.3",
117
- "vue": "^3.5.39",
117
+ "vue": "^3.5.40",
118
118
  "yaml": "^2.9.0",
119
- "yargs": "^18.0.0",
119
+ "yargs": "^18.1.0",
120
120
  "zod": "^3.25.76",
121
- "@slidev/client": "52.18.0",
122
- "@slidev/types": "52.18.0",
123
- "@slidev/parser": "52.18.0"
121
+ "@slidev/parser": "52.18.1",
122
+ "@slidev/client": "52.18.1",
123
+ "@slidev/types": "52.18.1"
124
124
  },
125
125
  "devDependencies": {
126
126
  "@hedgedoc/markdown-it-plugins": "^2.1.4",