@slidev/cli 0.49.11 → 0.49.13

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-4LA667A3.mjs";
3
+ } from "./chunk-HCZPMBQN.mjs";
4
4
 
5
5
  // node/commands/server.ts
6
6
  import { join } from "node:path";
package/dist/cli.mjs CHANGED
@@ -1,23 +1,20 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-G75DCGK3.mjs";
3
+ } from "./chunk-J54JXUYT.mjs";
4
4
  import {
5
5
  getThemeMeta,
6
+ loadSetups,
6
7
  parser,
7
8
  resolveAddons,
8
9
  resolveOptions,
9
10
  resolveTheme,
10
11
  version
11
- } from "./chunk-4LA667A3.mjs";
12
- import {
13
- loadSetups
14
- } from "./chunk-LOUKLO2C.mjs";
12
+ } from "./chunk-HCZPMBQN.mjs";
15
13
  import {
16
14
  getRoots,
17
15
  isInstalledGlobally,
18
16
  resolveEntry
19
- } from "./chunk-RG2EEPCO.mjs";
20
- import "./chunk-BXO7ZPPU.mjs";
17
+ } from "./chunk-27Q2X57X.mjs";
21
18
 
22
19
  // node/cli.ts
23
20
  import path from "node:path";
@@ -328,7 +325,7 @@ cli.command(
328
325
  }).strict().help(),
329
326
  async (args) => {
330
327
  const { entry, theme, base, download, out, inspect } = args;
331
- const { build } = await import("./build-2HGCTOR5.mjs");
328
+ const { build } = await import("./build-CLIVCKGZ.mjs");
332
329
  for (const entryFile of entry) {
333
330
  const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
334
331
  if (download && !options.data.config.download)
@@ -408,7 +405,7 @@ cli.command(
408
405
  (args) => exportOptions(commonOptions(args)).strict().help(),
409
406
  async (args) => {
410
407
  const { entry, theme } = args;
411
- const { exportSlides, getExportOptions } = await import("./export-BSOHDR2A.mjs");
408
+ const { exportSlides, getExportOptions } = await import("./export-UMDVDHQ3.mjs");
412
409
  const port = await getPort(12445);
413
410
  for (const entryFile of entry) {
414
411
  const options = await resolveOptions({ entry: entryFile, theme }, "export");
@@ -457,7 +454,7 @@ cli.command(
457
454
  timeout,
458
455
  wait
459
456
  }) => {
460
- const { exportNotes } = await import("./export-BSOHDR2A.mjs");
457
+ const { exportNotes } = await import("./export-UMDVDHQ3.mjs");
461
458
  const port = await getPort(12445);
462
459
  for (const entryFile of entry) {
463
460
  const options = await resolveOptions({ entry: entryFile }, "export");
@@ -509,6 +506,10 @@ function exportOptions(args) {
509
506
  }).option("wait", {
510
507
  type: "number",
511
508
  describe: "wait for the specified ms before exporting"
509
+ }).option("wait-until", {
510
+ type: "string",
511
+ choices: ["networkidle", "load", "domcontentloaded", "none"],
512
+ describe: "wait until the specified event before exporting each slide"
512
513
  }).option("range", {
513
514
  type: "string",
514
515
  describe: 'page ranges to export, for example "1,4-5,6"'
@@ -541,7 +542,7 @@ function printInfo(options, port, remote, tunnelUrl, publicIp) {
541
542
  console.log();
542
543
  verifyConfig(options.data.config, options.data.themeMeta, (v) => console.warn(yellow(` ! ${v}`)));
543
544
  console.log(dim(" theme ") + (options.theme ? green(options.theme) : gray("none")));
544
- console.log(dim(" css engine ") + (options.data.config.css ? blue(options.data.config.css) : gray("none")));
545
+ console.log(dim(" css engine ") + blue("unocss"));
545
546
  console.log(dim(" entry ") + dim(path.dirname(options.entry) + path.sep) + path.basename(options.entry));
546
547
  if (port) {
547
548
  const query = remote ? `?password=${remote}` : "";
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  getRoots
3
- } from "./chunk-RG2EEPCO.mjs";
4
- import "./chunk-BXO7ZPPU.mjs";
3
+ } from "./chunk-27Q2X57X.mjs";
5
4
 
6
5
  // node/commands/export.ts
7
6
  import path from "node:path";
@@ -78,7 +77,8 @@ async function exportNotes({
78
77
  base = "/",
79
78
  output = "notes",
80
79
  timeout = 3e4,
81
- wait = 0
80
+ wait = 0,
81
+ waitUntil
82
82
  }) {
83
83
  const { chromium } = await importPlaywright();
84
84
  const browser = await chromium.launch();
@@ -88,8 +88,9 @@ async function exportNotes({
88
88
  progress.start(1);
89
89
  if (!output.endsWith(".pdf"))
90
90
  output = `${output}.pdf`;
91
- await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil: "networkidle", timeout });
92
- await page.waitForLoadState("networkidle");
91
+ await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil, timeout });
92
+ if (waitUntil)
93
+ await page.waitForLoadState(waitUntil);
93
94
  await page.emulateMedia({ media: "screen" });
94
95
  if (wait)
95
96
  await page.waitForTimeout(wait);
@@ -126,7 +127,8 @@ async function exportSlides({
126
127
  executablePath = void 0,
127
128
  withToc = false,
128
129
  perSlide = false,
129
- scale = 1
130
+ scale = 1,
131
+ waitUntil
130
132
  }) {
131
133
  const pages = parseRangeString(total, range);
132
134
  const { chromium } = await importPlaywright();
@@ -155,10 +157,11 @@ async function exportSlides({
155
157
  query.set("clicks", clicks);
156
158
  const url = routerMode === "hash" ? `http://localhost:${port}${base}?${query}#${no}` : `http://localhost:${port}${base}${no}?${query}`;
157
159
  await page.goto(url, {
158
- waitUntil: "networkidle",
160
+ waitUntil,
159
161
  timeout
160
162
  });
161
- await page.waitForLoadState("networkidle");
163
+ if (waitUntil)
164
+ await page.waitForLoadState(waitUntil);
162
165
  await page.emulateMedia({ colorScheme: dark ? "dark" : "light", media: "screen" });
163
166
  const slide = no === "print" ? page.locator("body") : page.locator(`[data-slidev-no="${no}"]`);
164
167
  await slide.waitFor();
@@ -442,6 +445,7 @@ function getExportOptions(args, options, outDir, outFilename) {
442
445
  ...options.data.config.export,
443
446
  ...args,
444
447
  ...clearUndefined({
448
+ waitUntil: args["wait-until"],
445
449
  withClicks: args["with-clicks"],
446
450
  executablePath: args["executable-path"],
447
451
  withToc: args["with-toc"],
@@ -454,6 +458,7 @@ function getExportOptions(args, options, outDir, outFilename) {
454
458
  format,
455
459
  timeout,
456
460
  wait,
461
+ waitUntil,
457
462
  range,
458
463
  dark,
459
464
  withClicks,
@@ -473,6 +478,7 @@ function getExportOptions(args, options, outDir, outFilename) {
473
478
  format: format || "pdf",
474
479
  timeout: timeout ?? 3e4,
475
480
  wait: wait ?? 0,
481
+ waitUntil: waitUntil === "none" ? void 0 : waitUntil,
476
482
  dark: dark || options.data.config.colorSchema === "dark",
477
483
  routerMode: options.data.config.routerMode,
478
484
  width: options.data.config.canvasWidth,
package/dist/index.mjs CHANGED
@@ -1,15 +1,13 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-G75DCGK3.mjs";
3
+ } from "./chunk-J54JXUYT.mjs";
4
4
  import {
5
5
  ViteSlidevPlugin,
6
6
  createDataUtils,
7
7
  parser,
8
8
  resolveOptions
9
- } from "./chunk-4LA667A3.mjs";
10
- import "./chunk-LOUKLO2C.mjs";
11
- import "./chunk-RG2EEPCO.mjs";
12
- import "./chunk-BXO7ZPPU.mjs";
9
+ } from "./chunk-HCZPMBQN.mjs";
10
+ import "./chunk-27Q2X57X.mjs";
13
11
  export {
14
12
  ViteSlidevPlugin,
15
13
  createDataUtils,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.49.11",
3
+ "version": "0.49.13",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -43,21 +43,20 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@antfu/ni": "^0.21.12",
46
- "@antfu/utils": "^0.7.8",
47
- "@iconify-json/carbon": "^1.1.34",
46
+ "@antfu/utils": "^0.7.10",
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.10.0",
52
+ "@shikijs/twoslash": "^1.10.0",
53
+ "@shikijs/vitepress-twoslash": "^1.10.0",
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,32 +90,32 @@
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.10.0",
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.2",
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.2",
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.31",
112
111
  "yargs": "^17.7.2",
113
- "@slidev/client": "0.49.11",
114
- "@slidev/parser": "0.49.11",
115
- "@slidev/types": "0.49.11"
112
+ "@slidev/client": "0.49.13",
113
+ "@slidev/parser": "0.49.13",
114
+ "@slidev/types": "0.49.13"
116
115
  },
117
116
  "devDependencies": {
118
117
  "@hedgedoc/markdown-it-plugins": "^2.1.4",
119
- "@types/micromatch": "^4.0.7",
118
+ "@types/micromatch": "^4.0.9",
120
119
  "@types/plantuml-encoder": "^1.4.2"
121
120
  },
122
121
  "scripts": {
@@ -1,30 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
- // If the importer is in node compatibility mode or this is not an ESM
20
- // file that has been converted to a CommonJS file using a Babel-
21
- // compatible transform (i.e. "__esModule" has not been set), then set
22
- // "default" to the CommonJS "module.exports" for node compatibility.
23
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
- mod
25
- ));
26
-
27
- export {
28
- __commonJS,
29
- __toESM
30
- };
@@ -1,24 +0,0 @@
1
- // node/setups/load.ts
2
- import { resolve } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import fs from "fs-extra";
5
- import { deepMergeWithArray } from "@antfu/utils";
6
- import jiti from "jiti";
7
- async function loadSetups(clientRoot, roots, name, arg, initial, merge = true) {
8
- let returns = initial;
9
- for (const root of [clientRoot, ...roots].reverse()) {
10
- const path = resolve(root, "setup", name);
11
- if (fs.existsSync(path)) {
12
- const { default: setup } = jiti(fileURLToPath(import.meta.url))(path);
13
- const result = await setup(arg);
14
- if (result !== null) {
15
- returns = typeof merge === "function" ? merge(returns, result) : merge ? deepMergeWithArray(returns, result) : result;
16
- }
17
- }
18
- }
19
- return returns;
20
- }
21
-
22
- export {
23
- loadSetups
24
- };
@@ -1,46 +0,0 @@
1
- import {
2
- loadSetups
3
- } from "./chunk-LOUKLO2C.mjs";
4
- import "./chunk-BXO7ZPPU.mjs";
5
-
6
- // node/vite/unocss.ts
7
- import { resolve } from "node:path";
8
- import { existsSync } from "node:fs";
9
- import { fileURLToPath } from "node:url";
10
- import { uniq } from "@antfu/utils";
11
- import { mergeConfigs } from "unocss";
12
- import jiti from "jiti";
13
- import UnoCSS from "unocss/vite";
14
- async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, data, userRoot }, { unocss: unoOptions = {} }) {
15
- const configFiles = uniq([
16
- resolve(userRoot, "uno.config.ts"),
17
- resolve(userRoot, "unocss.config.ts"),
18
- ...themeRoots.map((i) => `${i}/uno.config.ts`),
19
- ...themeRoots.map((i) => `${i}/unocss.config.ts`),
20
- ...addonRoots.map((i) => `${i}/uno.config.ts`),
21
- ...addonRoots.map((i) => `${i}/unocss.config.ts`),
22
- resolve(clientRoot, "uno.config.ts"),
23
- resolve(clientRoot, "unocss.config.ts")
24
- ]).filter((i) => existsSync(i));
25
- const configs = configFiles.map((i) => {
26
- const loaded = jiti(fileURLToPath(import.meta.url))(i);
27
- const config2 = "default" in loaded ? loaded.default : loaded;
28
- return config2;
29
- }).filter(Boolean);
30
- configs.reverse();
31
- let config = mergeConfigs([...configs, unoOptions]);
32
- config = await loadSetups(clientRoot, roots, "unocss.ts", {}, config, (a, b) => mergeConfigs([a, b]));
33
- config.theme ||= {};
34
- config.theme.fontFamily ||= {};
35
- config.theme.fontFamily.sans ||= data.config.fonts.sans.join(",");
36
- config.theme.fontFamily.mono ||= data.config.fonts.mono.join(",");
37
- config.theme.fontFamily.serif ||= data.config.fonts.serif.join(",");
38
- return UnoCSS({
39
- configFile: false,
40
- configDeps: configFiles,
41
- ...config
42
- });
43
- }
44
- export {
45
- createUnocssPlugin
46
- };