@slidev/cli 0.50.0-beta.10 → 0.50.0-beta.12

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,6 +1,6 @@
1
1
  import {
2
2
  resolveViteConfigs
3
- } from "./chunk-Q74EQR62.js";
3
+ } from "./chunk-V7IZOTC6.js";
4
4
  import "./chunk-UNQ5DBLZ.js";
5
5
 
6
6
  // node/commands/build.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveViteConfigs
3
- } from "./chunk-Q74EQR62.js";
3
+ } from "./chunk-V7IZOTC6.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-UNQ5DBLZ.js";
10
10
 
11
11
  // package.json
12
- var version = "0.50.0-beta.10";
12
+ var version = "0.50.0-beta.12";
13
13
 
14
14
  // node/integrations/themes.ts
15
15
  import { join } from "node:path";
@@ -39,7 +39,7 @@ import * as parser from "@slidev/parser/fs";
39
39
 
40
40
  // node/options.ts
41
41
  import path3 from "node:path";
42
- import { uniq as uniq5 } from "@antfu/utils";
42
+ import { objectMap as objectMap2, uniq as uniq5 } from "@antfu/utils";
43
43
  import Debug from "debug";
44
44
  import fg4 from "fast-glob";
45
45
  import mm from "micromatch";
@@ -2659,19 +2659,24 @@ async function createDataUtils(resolved) {
2659
2659
  };
2660
2660
  }
2661
2661
  function getDefine(options) {
2662
- return {
2663
- __DEV__: options.mode === "dev" ? "true" : "false",
2664
- __SLIDEV_CLIENT_ROOT__: JSON.stringify(toAtFS(options.clientRoot)),
2665
- __SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
2666
- __SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
2667
- __SLIDEV_FEATURE_EDITOR__: JSON.stringify(options.mode === "dev" && options.data.config.editor !== false),
2668
- __SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
2669
- __SLIDEV_FEATURE_RECORD__: JSON.stringify(options.data.config.record === true || options.data.config.record === options.mode),
2670
- __SLIDEV_FEATURE_PRESENTER__: JSON.stringify(options.data.config.presenter === true || options.data.config.presenter === options.mode),
2671
- __SLIDEV_FEATURE_PRINT__: JSON.stringify(options.mode === "export" || options.mode === "build" && [true, "true", "auto"].includes(options.data.config.download)),
2672
- __SLIDEV_FEATURE_WAKE_LOCK__: JSON.stringify(options.data.config.wakeLock === true || options.data.config.wakeLock === options.mode),
2673
- __SLIDEV_HAS_SERVER__: options.mode !== "build" ? "true" : "false"
2674
- };
2662
+ const matchMode = (mode) => mode === true || mode === options.mode;
2663
+ return objectMap2(
2664
+ {
2665
+ __DEV__: options.mode === "dev",
2666
+ __SLIDEV_CLIENT_ROOT__: toAtFS(options.clientRoot),
2667
+ __SLIDEV_HASH_ROUTE__: options.data.config.routerMode === "hash",
2668
+ __SLIDEV_FEATURE_DRAWINGS__: matchMode(options.data.config.drawings.enabled),
2669
+ __SLIDEV_FEATURE_EDITOR__: options.mode === "dev" && options.data.config.editor !== false,
2670
+ __SLIDEV_FEATURE_DRAWINGS_PERSIST__: !!options.data.config.drawings.persist,
2671
+ __SLIDEV_FEATURE_RECORD__: matchMode(options.data.config.record),
2672
+ __SLIDEV_FEATURE_PRESENTER__: matchMode(options.data.config.presenter),
2673
+ __SLIDEV_FEATURE_PRINT__: options.mode === "export" || options.mode === "build" && [true, "true", "auto"].includes(options.data.config.download),
2674
+ __SLIDEV_FEATURE_BROWSER_EXPORTER__: matchMode(options.data.config.browserExporter),
2675
+ __SLIDEV_FEATURE_WAKE_LOCK__: matchMode(options.data.config.wakeLock),
2676
+ __SLIDEV_HAS_SERVER__: options.mode !== "build"
2677
+ },
2678
+ (v, k) => [v, JSON.stringify(k)]
2679
+ );
2675
2680
  }
2676
2681
 
2677
2682
  export {
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-T7CH4MWU.js";
3
+ } from "./chunk-UXSAFLQ6.js";
4
4
  import {
5
5
  getThemeMeta,
6
6
  loadSetups,
@@ -9,7 +9,7 @@ import {
9
9
  resolveOptions,
10
10
  resolveTheme,
11
11
  version
12
- } from "./chunk-Q74EQR62.js";
12
+ } from "./chunk-V7IZOTC6.js";
13
13
  import {
14
14
  getRoots,
15
15
  isInstalledGlobally,
@@ -26,7 +26,7 @@ import { verifyConfig } from "@slidev/parser";
26
26
  import equal from "fast-deep-equal";
27
27
  import fs from "fs-extra";
28
28
  import { getPort } from "get-port-please";
29
- import { blue, bold, cyan, dim, gray, green, underline, yellow } from "kolorist";
29
+ import { blue, bold, cyan, dim, gray, green, lightCyan, underline, yellow } from "kolorist";
30
30
  import openBrowser from "open";
31
31
  import yargs from "yargs";
32
32
 
@@ -330,7 +330,7 @@ cli.command(
330
330
  }).strict().help(),
331
331
  async (args) => {
332
332
  const { entry, theme, base, download, out, inspect } = args;
333
- const { build } = await import("./build-E2JY62WB.js");
333
+ const { build } = await import("./build-UR7FNCWY.js");
334
334
  for (const entryFile of entry) {
335
335
  const options = await resolveOptions({ entry: entryFile, theme, inspect, download }, "build");
336
336
  printInfo(options);
@@ -410,8 +410,18 @@ cli.command(
410
410
  const { entry, theme } = args;
411
411
  const { exportSlides, getExportOptions } = await import("./export-I2C456L6.js");
412
412
  const port = await getPort(12445);
413
+ let warned = false;
413
414
  for (const entryFile of entry) {
414
415
  const options = await resolveOptions({ entry: entryFile, theme }, "export");
416
+ if (options.data.config.browserExporter !== false && !warned) {
417
+ warned = true;
418
+ console.log(lightCyan("[Slidev] Try the new browser exporter!"));
419
+ console.log(
420
+ lightCyan("You can use the browser exporter instead by starting the dev server as normal and visit"),
421
+ `${blue("localhost:")}${dim("<port>")}${blue("/export")}
422
+ `
423
+ );
424
+ }
415
425
  const server = await createServer(
416
426
  options,
417
427
  {
@@ -559,8 +569,11 @@ function printInfo(options, port, remote, tunnelUrl, publicIp) {
559
569
  console.log(`${dim(" public slide show ")} > ${cyan(`http://localhost:${bold(port)}/`)}`);
560
570
  if (query)
561
571
  console.log(`${dim(" private slide show ")} > ${cyan(`http://localhost:${bold(port)}/${query}`)}`);
562
- console.log(`${dim(" presenter mode ")} > ${blue(`http://localhost:${bold(port)}${presenterPath}`)}`);
572
+ if (options.utils.define.__SLIDEV_FEATURE_PRESENTER__)
573
+ console.log(`${dim(" presenter mode ")} > ${blue(`http://localhost:${bold(port)}${presenterPath}`)}`);
563
574
  console.log(`${dim(" slides overview ")} > ${blue(`http://localhost:${bold(port)}${overviewPath}`)}`);
575
+ if (options.utils.define.__SLIDEV_FEATURE_BROWSER_EXPORTER__)
576
+ console.log(`${dim(" export slides")} > ${blue(`http://localhost:${bold(port)}/export/`)}`);
564
577
  if (options.inspect)
565
578
  console.log(`${dim(" vite inspector")} > ${yellow(`http://localhost:${bold(port)}/__inspect/`)}`);
566
579
  let lastRemoteUrl = "";
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-T7CH4MWU.js";
3
+ } from "./chunk-UXSAFLQ6.js";
4
4
  import {
5
5
  ViteSlidevPlugin,
6
6
  createDataUtils,
7
7
  parser,
8
8
  resolveOptions
9
- } from "./chunk-Q74EQR62.js";
9
+ } from "./chunk-V7IZOTC6.js";
10
10
  import "./chunk-UNQ5DBLZ.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": "0.50.0-beta.10",
4
+ "version": "0.50.0-beta.12",
5
5
  "description": "Presentation slides for developers",
6
6
  "author": "antfu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -48,17 +48,17 @@
48
48
  "@iconify-json/ph": "^1.2.1",
49
49
  "@iconify-json/svg-spinners": "^1.2.1",
50
50
  "@lillallol/outline-pdf": "^4.0.0",
51
- "@shikijs/markdown-it": "^1.24.0",
52
- "@shikijs/twoslash": "^1.24.0",
53
- "@shikijs/vitepress-twoslash": "^1.24.0",
54
- "@unocss/extractor-mdc": "^0.65.0",
55
- "@unocss/reset": "^0.65.0",
51
+ "@shikijs/markdown-it": "^1.24.2",
52
+ "@shikijs/twoslash": "^1.24.2",
53
+ "@shikijs/vitepress-twoslash": "^1.24.2",
54
+ "@unocss/extractor-mdc": "^0.65.1",
55
+ "@unocss/reset": "^0.65.1",
56
56
  "@vitejs/plugin-vue": "^5.2.1",
57
57
  "@vitejs/plugin-vue-jsx": "^4.1.1",
58
58
  "chokidar": "^4.0.1",
59
59
  "cli-progress": "^3.12.0",
60
60
  "connect": "^3.7.0",
61
- "debug": "^4.3.7",
61
+ "debug": "^4.4.0",
62
62
  "fast-deep-equal": "^3.1.3",
63
63
  "fast-glob": "^3.3.2",
64
64
  "fs-extra": "^11.2.0",
@@ -67,11 +67,11 @@
67
67
  "htmlparser2": "^9.1.0",
68
68
  "is-installed-globally": "^1.0.0",
69
69
  "jiti": "^2.4.1",
70
- "katex": "^0.16.11",
70
+ "katex": "^0.16.15",
71
71
  "kolorist": "^1.8.0",
72
72
  "local-pkg": "^0.5.1",
73
73
  "lz-string": "^1.5.0",
74
- "magic-string": "^0.30.14",
74
+ "magic-string": "^0.30.17",
75
75
  "magic-string-stack": "^0.1.1",
76
76
  "markdown-it": "^14.1.0",
77
77
  "markdown-it-footnote": "^4.0.0",
@@ -89,19 +89,19 @@
89
89
  "resolve-from": "^5.0.0",
90
90
  "resolve-global": "^2.0.0",
91
91
  "semver": "^7.6.3",
92
- "shiki": "^1.24.0",
93
- "shiki-magic-move": "^0.5.0",
92
+ "shiki": "^1.24.2",
93
+ "shiki-magic-move": "^0.5.2",
94
94
  "sirv": "^3.0.0",
95
95
  "source-map-js": "^1.2.1",
96
96
  "typescript": "5.6.3",
97
- "unocss": "^0.65.0",
98
- "unplugin-icons": "^0.20.2",
99
- "unplugin-vue-components": "^0.27.5",
100
- "unplugin-vue-markdown": "^0.27.1",
97
+ "unocss": "^0.65.1",
98
+ "unplugin-icons": "^0.22.0",
99
+ "unplugin-vue-components": "^0.28.0",
100
+ "unplugin-vue-markdown": "^0.28.0",
101
101
  "untun": "^0.1.3",
102
102
  "uqr": "^0.1.2",
103
- "vite": "^6.0.2",
104
- "vite-plugin-inspect": "^0.10.2",
103
+ "vite": "^6.0.3",
104
+ "vite-plugin-inspect": "^0.10.3",
105
105
  "vite-plugin-remote-assets": "^0.6.0",
106
106
  "vite-plugin-static-copy": "^2.2.0",
107
107
  "vite-plugin-vue-server-ref": "^0.4.2",
@@ -109,9 +109,9 @@
109
109
  "vue": "^3.5.13",
110
110
  "yaml": "^2.6.1",
111
111
  "yargs": "^17.7.2",
112
- "@slidev/client": "0.50.0-beta.10",
113
- "@slidev/types": "0.50.0-beta.10",
114
- "@slidev/parser": "0.50.0-beta.10"
112
+ "@slidev/client": "0.50.0-beta.12",
113
+ "@slidev/types": "0.50.0-beta.12",
114
+ "@slidev/parser": "0.50.0-beta.12"
115
115
  },
116
116
  "devDependencies": {
117
117
  "@hedgedoc/markdown-it-plugins": "^2.1.4",