@slidev/cli 0.48.0-beta.0 → 0.48.0-beta.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.
@@ -2,7 +2,7 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-JHZKCONU.mjs";
5
+ } from "./chunk-FIXL4WBO.mjs";
6
6
  import "./chunk-CTBVOVLQ.mjs";
7
7
  import "./chunk-DWXI5WEO.mjs";
8
8
  import "./chunk-BXO7ZPPU.mjs";
@@ -276,7 +276,7 @@ function getDefine(options) {
276
276
 
277
277
  // node/plugins/loaders.ts
278
278
  import { basename as basename2, join as join5 } from "node:path";
279
- import { isString, notNullish, objectMap, range, slash, uniq as uniq3 } from "@antfu/utils";
279
+ import { isString, isTruthy, notNullish, objectMap, range, slash, uniq as uniq3 } from "@antfu/utils";
280
280
  import fg2 from "fast-glob";
281
281
  import fs4 from "fs-extra";
282
282
  import Markdown from "markdown-it";
@@ -359,7 +359,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
359
359
  hmrPages.add(idx);
360
360
  if (slide.source) {
361
361
  Object.assign(slide.source, body);
362
- await parser.saveExternalSlide(slide.source);
362
+ await parser.saveExternalSlide(data, slide.source.filepath);
363
363
  } else {
364
364
  Object.assign(slide, body);
365
365
  await parser.save(data, entry);
@@ -587,6 +587,39 @@ ${title}
587
587
  if (replaced !== code)
588
588
  return replaced;
589
589
  }
590
+ },
591
+ {
592
+ name: "slidev:index-html-transform",
593
+ transformIndexHtml() {
594
+ const { info, author, keywords } = data.headmatter;
595
+ return [
596
+ {
597
+ tag: "title",
598
+ children: getTitle()
599
+ },
600
+ info && {
601
+ tag: "meta",
602
+ attrs: {
603
+ name: "description",
604
+ content: info
605
+ }
606
+ },
607
+ author && {
608
+ tag: "meta",
609
+ attrs: {
610
+ name: "author",
611
+ content: author
612
+ }
613
+ },
614
+ keywords && {
615
+ tag: "meta",
616
+ attrs: {
617
+ name: "keywords",
618
+ content: Array.isArray(keywords) ? keywords.join(", ") : keywords
619
+ }
620
+ }
621
+ ].filter(isTruthy);
622
+ }
590
623
  }
591
624
  ];
592
625
  function updateServerWatcher() {
@@ -820,12 +853,19 @@ ${redirects.join(",\n")}
820
853
  ]`;
821
854
  return [...imports, routesStr, redirectsStr].join("\n");
822
855
  }
823
- function generateConfigs() {
824
- const config = { ...data.config, remote };
825
- if (isString(config.title)) {
826
- const tokens = md.parseInline(config.title, {});
827
- config.title = stringifyMarkdownTokens(tokens);
856
+ function getTitle() {
857
+ if (isString(data.config.title)) {
858
+ const tokens = md.parseInline(data.config.title, {});
859
+ return stringifyMarkdownTokens(tokens);
828
860
  }
861
+ return data.config.title;
862
+ }
863
+ function generateConfigs() {
864
+ const config = {
865
+ ...data.config,
866
+ remote,
867
+ title: getTitle()
868
+ };
829
869
  if (isString(config.info))
830
870
  config.info = md.render(config.info);
831
871
  return `export default ${JSON.stringify(config)}`;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
3
  mergeViteConfigs
4
- } from "./chunk-JHZKCONU.mjs";
4
+ } from "./chunk-FIXL4WBO.mjs";
5
5
  import {
6
6
  packageExists,
7
7
  resolveImportPath
@@ -2521,7 +2521,11 @@ async function createServer(options2, viteConfig = {}, serverOptions = {}) {
2521
2521
  {
2522
2522
  plugins: [
2523
2523
  await ViteSlidevPlugin(options2, config2.slidev || {}, serverOptions)
2524
- ]
2524
+ ],
2525
+ define: {
2526
+ // Fixes Vue production mode breaking PDF Export #1245
2527
+ __VUE_PROD_DEVTOOLS__: JSON.stringify(true)
2528
+ }
2525
2529
  }
2526
2530
  )
2527
2531
  );
@@ -2532,7 +2536,7 @@ async function createServer(options2, viteConfig = {}, serverOptions = {}) {
2532
2536
  import * as parser from "@slidev/parser/fs";
2533
2537
 
2534
2538
  // package.json
2535
- var version = "0.48.0-beta.0";
2539
+ var version = "0.48.0-beta.2";
2536
2540
 
2537
2541
  // node/themes.ts
2538
2542
  import prompts2 from "prompts";
package/dist/cli.mjs CHANGED
@@ -9,8 +9,8 @@ import {
9
9
  resolveOptions,
10
10
  resolveThemeName,
11
11
  version
12
- } from "./chunk-RECJU74U.mjs";
13
- import "./chunk-JHZKCONU.mjs";
12
+ } from "./chunk-PDMXU2K7.mjs";
13
+ import "./chunk-FIXL4WBO.mjs";
14
14
  import {
15
15
  loadSetups
16
16
  } from "./chunk-CTBVOVLQ.mjs";
@@ -269,7 +269,7 @@ cli.command(
269
269
  }).strict().help(),
270
270
  async (args) => {
271
271
  const { entry, theme, watch, base, download, out, inspect } = args;
272
- const { build } = await import("./build-M6ETMXB4.mjs");
272
+ const { build } = await import("./build-BVDM4ZAC.mjs");
273
273
  for (const entryFile of entry) {
274
274
  const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
275
275
  if (download && !options.data.config.download)
@@ -347,7 +347,6 @@ cli.command(
347
347
  (args) => exportOptions(commonOptions(args)).strict().help(),
348
348
  async (args) => {
349
349
  const { entry, theme } = args;
350
- process.env.NODE_ENV = "production";
351
350
  const { exportSlides, getExportOptions } = await import("./export-MLH55TH5.mjs");
352
351
  const port = await findFreePort(12445);
353
352
  for (const entryFile of entry) {
@@ -393,7 +392,6 @@ cli.command(
393
392
  output,
394
393
  timeout
395
394
  }) => {
396
- process.env.NODE_ENV = "production";
397
395
  const { exportNotes } = await import("./export-MLH55TH5.mjs");
398
396
  const port = await findFreePort(12445);
399
397
  for (const entryFile of entry) {
package/dist/index.mjs CHANGED
@@ -9,10 +9,10 @@ import {
9
9
  isPath,
10
10
  parser,
11
11
  resolveOptions
12
- } from "./chunk-RECJU74U.mjs";
12
+ } from "./chunk-PDMXU2K7.mjs";
13
13
  import {
14
14
  ViteSlidevPlugin
15
- } from "./chunk-JHZKCONU.mjs";
15
+ } from "./chunk-FIXL4WBO.mjs";
16
16
  import "./chunk-CTBVOVLQ.mjs";
17
17
  import "./chunk-DWXI5WEO.mjs";
18
18
  import "./chunk-BXO7ZPPU.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.48.0-beta.0",
3
+ "version": "0.48.0-beta.2",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -47,15 +47,15 @@
47
47
  "@iconify-json/ph": "^1.1.11",
48
48
  "@lillallol/outline-pdf": "^4.0.0",
49
49
  "@mrdrogdrog/optional": "^1.2.1",
50
- "@shikijs/markdown-it": "^1.1.2",
51
- "@shikijs/twoslash": "^1.1.2",
52
- "@shikijs/vitepress-twoslash": "^1.1.2",
50
+ "@shikijs/markdown-it": "^1.1.3",
51
+ "@shikijs/twoslash": "^1.1.3",
52
+ "@shikijs/vitepress-twoslash": "^1.1.3",
53
53
  "@unocss/extractor-mdc": "^0.58.5",
54
54
  "@unocss/reset": "^0.58.5",
55
55
  "@vitejs/plugin-vue": "^5.0.4",
56
56
  "@vitejs/plugin-vue-jsx": "^3.1.0",
57
57
  "cli-progress": "^3.12.0",
58
- "codemirror": "^5.65.5",
58
+ "codemirror": "^5.65.16",
59
59
  "connect": "^3.7.0",
60
60
  "debug": "^4.3.4",
61
61
  "fast-deep-equal": "^3.1.3",
@@ -87,7 +87,7 @@
87
87
  "resolve": "^1.22.8",
88
88
  "resolve-from": "^5.0.0",
89
89
  "resolve-global": "^2.0.0",
90
- "shiki": "^1.1.2",
90
+ "shiki": "^1.1.3",
91
91
  "sirv": "^2.0.4",
92
92
  "typescript": "^5.3.3",
93
93
  "unocss": "^0.58.5",
@@ -96,7 +96,7 @@
96
96
  "unplugin-vue-markdown": "^0.26.0",
97
97
  "untun": "^0.1.3",
98
98
  "uqr": "^0.1.2",
99
- "vite": "^5.1.1",
99
+ "vite": "^5.1.3",
100
100
  "vite-plugin-inspect": "^0.8.3",
101
101
  "vite-plugin-remote-assets": "^0.4.1",
102
102
  "vite-plugin-static-copy": "^1.0.1",
@@ -104,9 +104,9 @@
104
104
  "vitefu": "^0.2.5",
105
105
  "vue": "^3.4.19",
106
106
  "yargs": "^17.7.2",
107
- "@slidev/client": "0.48.0-beta.0",
108
- "@slidev/parser": "0.48.0-beta.0",
109
- "@slidev/types": "0.48.0-beta.0"
107
+ "@slidev/client": "0.48.0-beta.2",
108
+ "@slidev/types": "0.48.0-beta.2",
109
+ "@slidev/parser": "0.48.0-beta.2"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@hedgedoc/markdown-it-plugins": "^2.1.4",