@slidev/cli 51.5.0 → 51.6.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.
package/README.md CHANGED
@@ -36,7 +36,7 @@ Presentation <b>slide</b>s for <b>dev</b>elopers 🧑‍💻👩‍💻👨‍
36
36
 
37
37
  ## Features
38
38
 
39
- - 📝 [**Markdown-based**](https://sli.dev/guide/syntax) - foucus on content and use your favorite editor
39
+ - 📝 [**Markdown-based**](https://sli.dev/guide/syntax) - focus on content and use your favorite editor
40
40
  - 🧑‍💻 [**Developer Friendly**](https://sli.dev/guide/syntax#code-blocks) - built-in code highlighting, live coding, etc.
41
41
  - 🎨 [**Themable**](https://sli.dev/resources/theme-gallery) - theme can be shared and used with npm packages
42
42
  - 🌈 [**Stylish**](https://sli.dev/guide/syntax#embedded-styles) - on-demand utilities via [UnoCSS](https://github.com/unocss/unocss).
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveViteConfigs
3
- } from "./chunk-7TKX73CW.js";
3
+ } from "./chunk-Y2DHOFI5.js";
4
4
  import "./chunk-TJFRPB4N.js";
5
5
 
6
6
  // node/commands/build.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveViteConfigs
3
- } from "./chunk-7TKX73CW.js";
3
+ } from "./chunk-Y2DHOFI5.js";
4
4
 
5
5
  // node/commands/serve.ts
6
6
  import { join } from "node:path";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-TJFRPB4N.js";
10
10
 
11
11
  // package.json
12
- var version = "51.5.0";
12
+ var version = "51.6.0";
13
13
 
14
14
  // node/utils.ts
15
15
  import { fileURLToPath } from "node:url";
@@ -150,7 +150,7 @@ import { join as join13 } from "node:path";
150
150
  import { slash as slash4 } from "@antfu/utils";
151
151
  import { white, yellow as yellow2 } from "ansis";
152
152
  import { escapeHtml } from "markdown-it/lib/common/utils.mjs";
153
- import { createHead, transformHtmlTemplate } from "unhead/server";
153
+ import { createHead, extractUnheadInputFromHtml, transformHtmlTemplate } from "unhead/server";
154
154
 
155
155
  // node/commands/shared.ts
156
156
  import { existsSync as existsSync12 } from "node:fs";
@@ -2518,22 +2518,21 @@ function toAttrValue(unsafe) {
2518
2518
  }
2519
2519
  async function setupIndexHtml({ mode, entry, clientRoot, userRoot, roots, data, base }) {
2520
2520
  let main = readFileSync2(join13(clientRoot, "index.html"), "utf-8");
2521
- let head = "";
2522
2521
  let body = "";
2522
+ const inputs = [];
2523
2523
  for (const root of roots) {
2524
2524
  const path5 = join13(root, "index.html");
2525
2525
  if (!existsSync13(path5))
2526
2526
  continue;
2527
- const index = readFileSync2(path5, "utf-8");
2528
- if (root === userRoot && index.includes("<!DOCTYPE")) {
2527
+ const html2 = readFileSync2(path5, "utf-8");
2528
+ if (root === userRoot && html2.includes("<!DOCTYPE")) {
2529
2529
  console.error(yellow2(`[Slidev] Ignored provided index.html with doctype declaration. (${white(path5)})`));
2530
2530
  console.error(yellow2("This file may be generated by Slidev, please remove it from your project."));
2531
2531
  continue;
2532
2532
  }
2533
- head += `
2534
- ${(index.match(/<head>([\s\S]*?)<\/head>/i)?.[1] || "").trim()}`;
2533
+ inputs.push(extractUnheadInputFromHtml(html2).input);
2535
2534
  body += `
2536
- ${(index.match(/<body>([\s\S]*?)<\/body>/i)?.[1] || "").trim()}`;
2535
+ ${(html2.match(/<body>([\s\S]*?)<\/body>/i)?.[1] || "").trim()}`;
2537
2536
  }
2538
2537
  if (data.features.tweet) {
2539
2538
  body += '\n<script async src="https://platform.twitter.com/widgets.js"></script>';
@@ -2554,12 +2553,12 @@ ${(index.match(/<body>([\s\S]*?)<\/body>/i)?.[1] || "").trim()}`;
2554
2553
  const unhead = createHead({
2555
2554
  init: [
2556
2555
  {
2557
- htmlAttrs: { lang: data.headmatter.lang ?? "en" },
2556
+ htmlAttrs: data.headmatter.lang ? { lang: data.headmatter.lang } : void 0,
2558
2557
  title,
2559
2558
  link: [
2560
- { rel: "icon", href: data.config.favicon },
2559
+ data.config.favicon ? { rel: "icon", href: data.config.favicon } : null,
2561
2560
  ...webFontsLink
2562
- ],
2561
+ ].filter((x) => x),
2563
2562
  meta: [
2564
2563
  { property: "slidev:version", content: version },
2565
2564
  { charset: "slidev:entry", content: mode === "dev" && slash4(entry) },
@@ -2576,12 +2575,13 @@ ${(index.match(/<body>([\s\S]*?)<\/body>/i)?.[1] || "").trim()}`;
2576
2575
  { property: "twitter:description", content: seoMeta.twitterDescription },
2577
2576
  { property: "twitter:image", content: seoMeta.twitterImage },
2578
2577
  { property: "twitter:url", content: seoMeta.twitterUrl }
2579
- ]
2580
- }
2578
+ ].filter((x) => x.content)
2579
+ },
2580
+ ...inputs
2581
2581
  ]
2582
2582
  });
2583
2583
  const baseInDev = mode === "dev" && base ? base.slice(0, -1) : "";
2584
- main = main.replace("__ENTRY__", baseInDev + toAtFS(join13(clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
2584
+ main = main.replace("__ENTRY__", baseInDev + toAtFS(join13(clientRoot, "main.ts"))).replace("<!-- body -->", body);
2585
2585
  const html = await transformHtmlTemplate(unhead, main);
2586
2586
  return html;
2587
2587
  }
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-HD7KRKPM.js";
3
+ } from "./chunk-BCA62OS7.js";
4
4
  import {
5
5
  getThemeMeta,
6
6
  loadSetups,
@@ -10,7 +10,7 @@ import {
10
10
  resolveTheme,
11
11
  updateFrontmatterPatch,
12
12
  version
13
- } from "./chunk-7TKX73CW.js";
13
+ } from "./chunk-Y2DHOFI5.js";
14
14
  import {
15
15
  getRoots,
16
16
  isInstalledGlobally,
@@ -339,7 +339,7 @@ cli.command(
339
339
  }).strict().help(),
340
340
  async (args) => {
341
341
  const { entry, theme, base, download, out, inspect } = args;
342
- const { build } = await import("./build-C2XVOCCA.js");
342
+ const { build } = await import("./build-Z7GTSSXD.js");
343
343
  for (const entryFile of entry) {
344
344
  const options = await resolveOptions({ entry: entryFile, theme, inspect, download, base }, "build");
345
345
  printInfo(options);
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-HD7KRKPM.js";
3
+ } from "./chunk-BCA62OS7.js";
4
4
  import {
5
5
  ViteSlidevPlugin,
6
6
  createDataUtils,
7
7
  parser,
8
8
  resolveOptions
9
- } from "./chunk-7TKX73CW.js";
9
+ } from "./chunk-Y2DHOFI5.js";
10
10
  import "./chunk-TJFRPB4N.js";
11
11
  export {
12
12
  ViteSlidevPlugin,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
3
  "type": "module",
4
- "version": "51.5.0",
4
+ "version": "51.6.0",
5
5
  "description": "Presentation slides for developers",
6
6
  "author": "antfu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -43,14 +43,14 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@antfu/ni": "^24.3.0",
46
- "@antfu/utils": "^9.1.0",
46
+ "@antfu/utils": "^9.2.0",
47
47
  "@iconify-json/carbon": "^1.2.8",
48
48
  "@iconify-json/ph": "^1.2.2",
49
49
  "@iconify-json/svg-spinners": "^1.2.2",
50
50
  "@lillallol/outline-pdf": "^4.0.0",
51
- "@shikijs/markdown-it": "^3.2.1",
52
- "@shikijs/twoslash": "^3.2.1",
53
- "@shikijs/vitepress-twoslash": "^3.2.1",
51
+ "@shikijs/markdown-it": "^3.3.0",
52
+ "@shikijs/twoslash": "^3.3.0",
53
+ "@shikijs/vitepress-twoslash": "^3.3.0",
54
54
  "@unocss/extractor-mdc": "^66.0.0",
55
55
  "@unocss/reset": "^66.0.0",
56
56
  "@vitejs/plugin-vue": "^5.2.3",
@@ -67,7 +67,7 @@
67
67
  "htmlparser2": "^10.0.0",
68
68
  "is-installed-globally": "^1.0.0",
69
69
  "jiti": "^2.4.2",
70
- "katex": "^0.16.21",
70
+ "katex": "^0.16.22",
71
71
  "local-pkg": "^1.1.1",
72
72
  "lz-string": "^1.5.0",
73
73
  "magic-string": "^0.30.17",
@@ -77,7 +77,7 @@
77
77
  "markdown-it-mdc": "^0.2.5",
78
78
  "mlly": "^1.7.4",
79
79
  "monaco-editor": "0.51.0",
80
- "open": "^10.1.0",
80
+ "open": "^10.1.1",
81
81
  "pdf-lib": "^1.17.1",
82
82
  "picomatch": "^4.0.2",
83
83
  "plantuml-encoder": "^1.4.0",
@@ -88,34 +88,34 @@
88
88
  "resolve-from": "^5.0.0",
89
89
  "resolve-global": "^2.0.0",
90
90
  "semver": "^7.7.1",
91
- "shiki": "^3.2.1",
91
+ "shiki": "^3.3.0",
92
92
  "shiki-magic-move": "^1.1.0",
93
93
  "sirv": "^3.0.1",
94
94
  "source-map-js": "^1.2.1",
95
- "typescript": "^5.8.2",
96
- "unhead": "^2.0.2",
95
+ "typescript": "^5.8.3",
96
+ "unhead": "^2.0.8",
97
97
  "unocss": "^66.0.0",
98
98
  "unplugin-icons": "^22.1.0",
99
- "unplugin-vue-components": "^28.4.1",
99
+ "unplugin-vue-components": "^28.5.0",
100
100
  "unplugin-vue-markdown": "^28.3.1",
101
101
  "untun": "^0.1.3",
102
102
  "uqr": "^0.1.2",
103
- "vite": "^6.2.3",
104
- "vite-plugin-inspect": "^11.0.0",
103
+ "vite": "^6.3.2",
104
+ "vite-plugin-inspect": "^11.0.1",
105
105
  "vite-plugin-remote-assets": "^2.0.0",
106
- "vite-plugin-static-copy": "^2.3.0",
106
+ "vite-plugin-static-copy": "^2.3.1",
107
107
  "vite-plugin-vue-server-ref": "^1.0.0",
108
108
  "vitefu": "^1.0.6",
109
109
  "vue": "^3.5.13",
110
110
  "yaml": "^2.7.1",
111
111
  "yargs": "^17.7.2",
112
- "@slidev/client": "51.5.0",
113
- "@slidev/parser": "51.5.0",
114
- "@slidev/types": "51.5.0"
112
+ "@slidev/client": "51.6.0",
113
+ "@slidev/parser": "51.6.0",
114
+ "@slidev/types": "51.6.0"
115
115
  },
116
116
  "devDependencies": {
117
117
  "@hedgedoc/markdown-it-plugins": "^2.1.4",
118
- "@types/picomatch": "^3.0.2",
118
+ "@types/picomatch": "^4.0.0",
119
119
  "@types/plantuml-encoder": "^1.4.2"
120
120
  },
121
121
  "scripts": {