@slidev/cli 0.49.10 → 0.49.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.
@@ -0,0 +1,29 @@
1
+ import {
2
+ resolveViteConfigs
3
+ } from "./chunk-KNG6PIQ7.mjs";
4
+
5
+ // node/commands/server.ts
6
+ import { join } from "node:path";
7
+ import process from "node:process";
8
+ import { createServer as createViteServer } from "vite";
9
+ async function createServer(options, viteConfig = {}, serverOptions) {
10
+ process.env.EDITOR = process.env.EDITOR || "code";
11
+ const inlineConfig = await resolveViteConfigs(
12
+ options,
13
+ {
14
+ optimizeDeps: {
15
+ entries: [
16
+ join(options.clientRoot, "main.ts")
17
+ ]
18
+ }
19
+ },
20
+ viteConfig,
21
+ "serve",
22
+ serverOptions
23
+ );
24
+ return await createViteServer(inlineConfig);
25
+ }
26
+
27
+ export {
28
+ createServer
29
+ };
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-YTSG6ZR5.mjs";
3
+ } from "./chunk-Z7QBEIOP.mjs";
4
4
  import {
5
5
  getThemeMeta,
6
6
  parser,
@@ -8,7 +8,7 @@ import {
8
8
  resolveOptions,
9
9
  resolveTheme,
10
10
  version
11
- } from "./chunk-SRWMA3GA.mjs";
11
+ } from "./chunk-KNG6PIQ7.mjs";
12
12
  import {
13
13
  loadSetups
14
14
  } from "./chunk-LOUKLO2C.mjs";
@@ -328,7 +328,7 @@ cli.command(
328
328
  }).strict().help(),
329
329
  async (args) => {
330
330
  const { entry, theme, base, download, out, inspect } = args;
331
- const { build } = await import("./build-I53OZ3FH.mjs");
331
+ const { build } = await import("./build-U63KCQIF.mjs");
332
332
  for (const entryFile of entry) {
333
333
  const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
334
334
  if (download && !options.data.config.download)
@@ -408,7 +408,7 @@ cli.command(
408
408
  (args) => exportOptions(commonOptions(args)).strict().help(),
409
409
  async (args) => {
410
410
  const { entry, theme } = args;
411
- const { exportSlides, getExportOptions } = await import("./export-BSOHDR2A.mjs");
411
+ const { exportSlides, getExportOptions } = await import("./export-IRR3JZOI.mjs");
412
412
  const port = await getPort(12445);
413
413
  for (const entryFile of entry) {
414
414
  const options = await resolveOptions({ entry: entryFile, theme }, "export");
@@ -457,7 +457,7 @@ cli.command(
457
457
  timeout,
458
458
  wait
459
459
  }) => {
460
- const { exportNotes } = await import("./export-BSOHDR2A.mjs");
460
+ const { exportNotes } = await import("./export-IRR3JZOI.mjs");
461
461
  const port = await getPort(12445);
462
462
  for (const entryFile of entry) {
463
463
  const options = await resolveOptions({ entry: entryFile }, "export");
@@ -509,6 +509,10 @@ function exportOptions(args) {
509
509
  }).option("wait", {
510
510
  type: "number",
511
511
  describe: "wait for the specified ms before exporting"
512
+ }).option("wait-until", {
513
+ type: "string",
514
+ choices: ["networkidle", "load", "domcontentloaded", "none"],
515
+ describe: "wait until the specified event before exporting each slide"
512
516
  }).option("range", {
513
517
  type: "string",
514
518
  describe: 'page ranges to export, for example "1,4-5,6"'
@@ -78,7 +78,8 @@ async function exportNotes({
78
78
  base = "/",
79
79
  output = "notes",
80
80
  timeout = 3e4,
81
- wait = 0
81
+ wait = 0,
82
+ waitUntil
82
83
  }) {
83
84
  const { chromium } = await importPlaywright();
84
85
  const browser = await chromium.launch();
@@ -88,8 +89,9 @@ async function exportNotes({
88
89
  progress.start(1);
89
90
  if (!output.endsWith(".pdf"))
90
91
  output = `${output}.pdf`;
91
- await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil: "networkidle", timeout });
92
- await page.waitForLoadState("networkidle");
92
+ await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil, timeout });
93
+ if (waitUntil)
94
+ await page.waitForLoadState(waitUntil);
93
95
  await page.emulateMedia({ media: "screen" });
94
96
  if (wait)
95
97
  await page.waitForTimeout(wait);
@@ -126,7 +128,8 @@ async function exportSlides({
126
128
  executablePath = void 0,
127
129
  withToc = false,
128
130
  perSlide = false,
129
- scale = 1
131
+ scale = 1,
132
+ waitUntil
130
133
  }) {
131
134
  const pages = parseRangeString(total, range);
132
135
  const { chromium } = await importPlaywright();
@@ -155,10 +158,11 @@ async function exportSlides({
155
158
  query.set("clicks", clicks);
156
159
  const url = routerMode === "hash" ? `http://localhost:${port}${base}?${query}#${no}` : `http://localhost:${port}${base}${no}?${query}`;
157
160
  await page.goto(url, {
158
- waitUntil: "networkidle",
161
+ waitUntil,
159
162
  timeout
160
163
  });
161
- await page.waitForLoadState("networkidle");
164
+ if (waitUntil)
165
+ await page.waitForLoadState(waitUntil);
162
166
  await page.emulateMedia({ colorScheme: dark ? "dark" : "light", media: "screen" });
163
167
  const slide = no === "print" ? page.locator("body") : page.locator(`[data-slidev-no="${no}"]`);
164
168
  await slide.waitFor();
@@ -442,6 +446,7 @@ function getExportOptions(args, options, outDir, outFilename) {
442
446
  ...options.data.config.export,
443
447
  ...args,
444
448
  ...clearUndefined({
449
+ waitUntil: args["wait-until"],
445
450
  withClicks: args["with-clicks"],
446
451
  executablePath: args["executable-path"],
447
452
  withToc: args["with-toc"],
@@ -454,6 +459,7 @@ function getExportOptions(args, options, outDir, outFilename) {
454
459
  format,
455
460
  timeout,
456
461
  wait,
462
+ waitUntil,
457
463
  range,
458
464
  dark,
459
465
  withClicks,
@@ -473,6 +479,7 @@ function getExportOptions(args, options, outDir, outFilename) {
473
479
  format: format || "pdf",
474
480
  timeout: timeout ?? 3e4,
475
481
  wait: wait ?? 0,
482
+ waitUntil: waitUntil === "none" ? void 0 : waitUntil,
476
483
  dark: dark || options.data.config.colorSchema === "dark",
477
484
  routerMode: options.data.config.routerMode,
478
485
  width: options.data.config.canvasWidth,
package/dist/index.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-YTSG6ZR5.mjs";
3
+ } from "./chunk-Z7QBEIOP.mjs";
4
4
  import {
5
5
  ViteSlidevPlugin,
6
6
  createDataUtils,
7
7
  parser,
8
8
  resolveOptions
9
- } from "./chunk-SRWMA3GA.mjs";
9
+ } from "./chunk-KNG6PIQ7.mjs";
10
10
  import "./chunk-LOUKLO2C.mjs";
11
11
  import "./chunk-RG2EEPCO.mjs";
12
12
  import "./chunk-BXO7ZPPU.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.49.10",
3
+ "version": "0.49.12",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -44,20 +44,19 @@
44
44
  "dependencies": {
45
45
  "@antfu/ni": "^0.21.12",
46
46
  "@antfu/utils": "^0.7.8",
47
- "@iconify-json/carbon": "^1.1.34",
47
+ "@iconify-json/carbon": "^1.1.36",
48
48
  "@iconify-json/ph": "^1.1.13",
49
49
  "@iconify-json/svg-spinners": "^1.1.2",
50
50
  "@lillallol/outline-pdf": "^4.0.0",
51
- "@shikijs/markdown-it": "^1.6.1",
52
- "@shikijs/twoslash": "^1.6.1",
53
- "@shikijs/vitepress-twoslash": "^1.6.1",
54
- "@unocss/extractor-mdc": "^0.60.4",
55
- "@unocss/reset": "^0.60.4",
51
+ "@shikijs/markdown-it": "^1.9.1",
52
+ "@shikijs/twoslash": "^1.9.1",
53
+ "@shikijs/vitepress-twoslash": "^1.9.1",
54
+ "@unocss/extractor-mdc": "^0.61.0",
55
+ "@unocss/reset": "^0.61.0",
56
56
  "@vitejs/plugin-vue": "^5.0.5",
57
- "@vitejs/plugin-vue-jsx": "^3.1.0",
57
+ "@vitejs/plugin-vue-jsx": "^4.0.0",
58
58
  "chokidar": "^3.6.0",
59
59
  "cli-progress": "^3.12.0",
60
- "codemirror": "^5.65.16",
61
60
  "connect": "^3.7.0",
62
61
  "debug": "^4.3.5",
63
62
  "fast-deep-equal": "^3.1.3",
@@ -67,7 +66,7 @@
67
66
  "global-directory": "^4.0.1",
68
67
  "htmlparser2": "^9.1.0",
69
68
  "is-installed-globally": "^1.0.0",
70
- "jiti": "^1.21.0",
69
+ "jiti": "^1.21.6",
71
70
  "katex": "^0.16.10",
72
71
  "kolorist": "^1.8.0",
73
72
  "local-pkg": "^0.5.0",
@@ -78,8 +77,8 @@
78
77
  "markdown-it-footnote": "^4.0.0",
79
78
  "markdown-it-mdc": "^0.2.5",
80
79
  "micromatch": "^4.0.7",
81
- "mlly": "^1.7.0",
82
- "monaco-editor": "^0.49.0",
80
+ "mlly": "^1.7.1",
81
+ "monaco-editor": "^0.50.0",
83
82
  "open": "^10.1.0",
84
83
  "pdf-lib": "^1.17.1",
85
84
  "plantuml-encoder": "^1.4.0",
@@ -91,28 +90,28 @@
91
90
  "resolve-from": "^5.0.0",
92
91
  "resolve-global": "^2.0.0",
93
92
  "semver": "^7.6.2",
94
- "shiki": "^1.6.1",
93
+ "shiki": "^1.9.1",
95
94
  "shiki-magic-move": "^0.4.2",
96
95
  "sirv": "^2.0.4",
97
96
  "source-map-js": "^1.2.0",
98
- "typescript": "^5.4.5",
99
- "unocss": "^0.60.4",
97
+ "typescript": "^5.5.2",
98
+ "unocss": "^0.61.0",
100
99
  "unplugin-icons": "^0.19.0",
101
- "unplugin-vue-components": "^0.27.0",
100
+ "unplugin-vue-components": "^0.27.1",
102
101
  "unplugin-vue-markdown": "^0.26.2",
103
102
  "untun": "^0.1.3",
104
103
  "uqr": "^0.1.2",
105
- "vite": "^5.2.12",
104
+ "vite": "^5.3.1",
106
105
  "vite-plugin-inspect": "^0.8.4",
107
106
  "vite-plugin-remote-assets": "^0.4.1",
108
107
  "vite-plugin-static-copy": "^1.0.5",
109
108
  "vite-plugin-vue-server-ref": "^0.4.2",
110
109
  "vitefu": "^0.2.5",
111
- "vue": "^3.4.27",
110
+ "vue": "^3.4.30",
112
111
  "yargs": "^17.7.2",
113
- "@slidev/client": "0.49.10",
114
- "@slidev/types": "0.49.10",
115
- "@slidev/parser": "0.49.10"
112
+ "@slidev/client": "0.49.12",
113
+ "@slidev/parser": "0.49.12",
114
+ "@slidev/types": "0.49.12"
116
115
  },
117
116
  "devDependencies": {
118
117
  "@hedgedoc/markdown-it-plugins": "^2.1.4",
package/template.md CHANGED
@@ -49,23 +49,23 @@ transition: fade-out
49
49
 
50
50
  # What is Slidev?
51
51
 
52
- Slidev is a slides maker and presenter designed for developers, consist of the following features
52
+ Slidev is a slide maker and accompanying presentation tool designed for developers. It consists of the following features:
53
53
 
54
- - 📝 **Text-based** - focus on the content with Markdown, and then style them later
55
- - 🎨 **Themable** - theme can be shared and used with npm packages
54
+ - 📝 **Text-based** - focus on the content with Markdown, and apply styles later
55
+ - 🎨 **Themable** - themes can be shared and used as npm packages
56
56
  - 🧑‍💻 **Developer Friendly** - code highlighting, live coding with autocompletion
57
- - 🤹 **Interactive** - embedding Vue components to enhance your expressions
57
+ - 🤹 **Interactive** - embedding Vue components to enhance your slides
58
58
  - 🎥 **Recording** - built-in recording and camera view
59
- - 📤 **Portable** - export into PDF, PPTX, PNGs, or even a hostable SPA
60
- - 🛠 **Hackable** - anything possible on a webpage
59
+ - 📤 **Portable** - export to PDF, PPTX, PNGs, or even a hostable SPA
60
+ - 🛠 **Hackable** - virtually anything that's possible on a webpage is possible in Slidev
61
61
 
62
62
  <br>
63
63
  <br>
64
64
 
65
- Read more about [Why Slidev?](https://sli.dev/guide/why)
65
+ Read more about Slidev in [Why Slidev?](https://sli.dev/guide/why)
66
66
 
67
67
  <!--
68
- You can have `style` tag in markdown to override the style for the current page.
68
+ You can have `style` tags in markdown to override the style for the current page.
69
69
  Learn more: https://sli.dev/guide/syntax#embedded-styles
70
70
  -->
71
71
 
@@ -104,7 +104,7 @@ level: 2
104
104
 
105
105
  # Navigation
106
106
 
107
- Hover on the bottom-left corner to see the navigation's controls panel, [learn more](https://sli.dev/guide/navigation.html)
107
+ Hover on the bottom-left corner to see the navigation's control panel, [learn more](https://sli.dev/guide/navigation.html)
108
108
 
109
109
  ## Keyboard Shortcuts
110
110
 
@@ -131,7 +131,7 @@ image: https://cover.sli.dev
131
131
 
132
132
  # Code
133
133
 
134
- Use code snippets and get the highlighting directly, and even types hover![^1]
134
+ Use code snippets and get automatic highlighting, and even types hover![^1]
135
135
 
136
136
  ```ts {all|5|7|7-8|10|all} twoslash
137
137
  // TwoSlash enables TypeScript hover information
@@ -176,7 +176,7 @@ doubled.value = 2
176
176
 
177
177
  You can use Vue components directly inside your slides.
178
178
 
179
- We have provided a few built-in components like `<Tweet/>` and `<Youtube/>` that you can use directly. And adding your custom components is also super easy.
179
+ We have provided a few built-in components like `<Tweet/>` and `<Youtube/>` that you can use directly. Adding your own custom components is also super easy.
180
180
 
181
181
  ```html
182
182
  <Counter :count="10" />
@@ -200,7 +200,7 @@ Check out [the guides](https://sli.dev/builtin/components.html) for more.
200
200
  </div>
201
201
 
202
202
  <!--
203
- Presenter note with **bold**, *italic*, and ~~striked~~ text.
203
+ Presenter notes with **bold**, *italic*, and ~~strike~~ text.
204
204
 
205
205
  Also, HTML elements are valid:
206
206
  <div class="flex w-full">
@@ -215,7 +215,7 @@ class: px-20
215
215
 
216
216
  # Themes
217
217
 
218
- Slidev comes with powerful theming support. Themes can provide styles, layouts, components, or even configurations for tools. Switching between themes by just **one edit** in your frontmatter:
218
+ Slidev comes with powerful theming support. Themes can provide styles, layouts, components, or even configurations for tools. Switch between themes on a per-slide basis with just **one change** in your frontmatter:
219
219
 
220
220
  <div grid="~ cols-2 gap-2" m="t-2">
221
221
 
@@ -294,7 +294,7 @@ Animations are powered by [@vueuse/motion](https://motion.vueuse.org/).
294
294
  </div>
295
295
  </div>
296
296
 
297
- <!-- vue script setup scripts can be directly used in markdown, and will only affects current page -->
297
+ <!-- vue script setup scripts can be directly used in markdown, and will only affect the current page -->
298
298
  <script setup lang="ts">
299
299
  const final = {
300
300
  x: 0,
@@ -432,4 +432,4 @@ class: text-center
432
432
 
433
433
  # Learn More
434
434
 
435
- [Documentations](https://sli.dev) · [GitHub](https://github.com/slidevjs/slidev) · [Showcases](https://sli.dev/showcases.html)
435
+ [Documentation](https://sli.dev) · [GitHub](https://github.com/slidevjs/slidev) · [Showcases](https://sli.dev/showcases.html)
@@ -1,44 +0,0 @@
1
- import {
2
- ViteSlidevPlugin,
3
- mergeViteConfigs
4
- } from "./chunk-SRWMA3GA.mjs";
5
-
6
- // node/commands/server.ts
7
- import { join } from "node:path";
8
- import process from "node:process";
9
- import { createServer as createViteServer, mergeConfig } from "vite";
10
- async function createServer(options, viteConfig = {}, serverOptions = {}) {
11
- process.env.EDITOR = process.env.EDITOR || "code";
12
- const config = await mergeViteConfigs(
13
- options,
14
- viteConfig,
15
- {
16
- root: options.userRoot,
17
- optimizeDeps: {
18
- entries: [
19
- join(options.clientRoot, "main.ts")
20
- ]
21
- }
22
- },
23
- "serve"
24
- );
25
- const server = await createViteServer(
26
- mergeConfig(
27
- config,
28
- {
29
- plugins: [
30
- await ViteSlidevPlugin(options, config.slidev || {}, serverOptions)
31
- ],
32
- define: {
33
- // Fixes Vue production mode breaking PDF Export #1245
34
- __VUE_PROD_DEVTOOLS__: JSON.stringify(true)
35
- }
36
- }
37
- )
38
- );
39
- return server;
40
- }
41
-
42
- export {
43
- createServer
44
- };