@slidev/cli 0.32.3 → 0.32.4

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/dist/cli.js CHANGED
@@ -6,19 +6,19 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkN7XL66RPjs = require('./chunk-N7XL66RP.js');
9
+ var _chunkERHEJGU7js = require('./chunk-ERHEJGU7.js');
10
10
 
11
11
 
12
- var _chunkIW3TSLZFjs = require('./chunk-IW3TSLZF.js');
12
+ var _chunkKFVTOCEDjs = require('./chunk-KFVTOCED.js');
13
13
 
14
14
 
15
15
 
16
16
 
17
- var _chunkJWGORJY6js = require('./chunk-JWGORJY6.js');
17
+ var _chunkFFZLS6QKjs = require('./chunk-FFZLS6QK.js');
18
18
 
19
19
  // node/cli.ts
20
- _chunkJWGORJY6js.init_cjs_shims.call(void 0, );
21
- var import_fast_deep_equal = _chunkJWGORJY6js.__toESM.call(void 0, _chunkIW3TSLZFjs.require_fast_deep_equal.call(void 0, ));
20
+ _chunkFFZLS6QKjs.init_cjs_shims.call(void 0, );
21
+ var import_fast_deep_equal = _chunkFFZLS6QKjs.__toESM.call(void 0, _chunkKFVTOCEDjs.require_fast_deep_equal.call(void 0, ));
22
22
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
23
23
  var _net = require('net'); var _net2 = _interopRequireDefault(_net);
24
24
  var _os = require('os'); var _os2 = _interopRequireDefault(_os);
@@ -36,7 +36,7 @@ var CONFIG_RESTART_FIELDS = [
36
36
  "routerMode",
37
37
  "fonts"
38
38
  ];
39
- var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkN7XL66RPjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
39
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkERHEJGU7js.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
40
40
  cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
41
41
  alias: "p",
42
42
  type: "number",
@@ -79,9 +79,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
79
79
  async function initServer() {
80
80
  if (server)
81
81
  await server.close();
82
- const options = await _chunkN7XL66RPjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
82
+ const options = await _chunkERHEJGU7js.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
83
83
  port = userPort || await findFreePort(3030);
84
- server = await _chunkN7XL66RPjs.createServer.call(void 0, options, {
84
+ server = await _chunkERHEJGU7js.createServer.call(void 0, options, {
85
85
  server: {
86
86
  port,
87
87
  strictPort: true,
@@ -92,7 +92,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
92
92
  logLevel: log
93
93
  }, {
94
94
  onDataReload(newData, data) {
95
- if (!theme && _chunkN7XL66RPjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkN7XL66RPjs.resolveThemeName.call(void 0, data.config.theme)) {
95
+ if (!theme && _chunkERHEJGU7js.resolveThemeName.call(void 0, newData.config.theme) !== _chunkERHEJGU7js.resolveThemeName.call(void 0, data.config.theme)) {
96
96
  console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
97
97
  initServer();
98
98
  } else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
@@ -168,8 +168,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
168
168
  type: "boolean",
169
169
  describe: "allow download as PDF"
170
170
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
171
- const { build } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "./build-M2QTEV63.js")));
172
- const options = await _chunkN7XL66RPjs.resolveOptions.call(void 0, { entry, theme }, "build");
171
+ const { build } = await Promise.resolve().then(() => _chunkFFZLS6QKjs.__toESM.call(void 0, _chunkFFZLS6QKjs.__require.call(void 0, "./build-SKQZLTIO.js")));
172
+ const options = await _chunkERHEJGU7js.resolveOptions.call(void 0, { entry, theme }, "build");
173
173
  if (download && !options.data.config.download)
174
174
  options.data.config.download = download;
175
175
  printInfo(options);
@@ -182,26 +182,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
182
182
  });
183
183
  });
184
184
  cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
185
- const data = await _chunkN7XL66RPjs.parser.load(entry);
186
- _chunkN7XL66RPjs.parser.prettify(data);
187
- await _chunkN7XL66RPjs.parser.save(data);
185
+ const data = await _chunkERHEJGU7js.parser.load(entry);
186
+ _chunkERHEJGU7js.parser.prettify(data);
187
+ await _chunkERHEJGU7js.parser.save(data);
188
188
  });
189
189
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
190
190
  return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
191
191
  type: "string",
192
192
  default: "theme"
193
193
  }), async ({ entry, dir, theme: themeInput }) => {
194
- const data = await _chunkN7XL66RPjs.parser.load(entry);
195
- const theme = _chunkN7XL66RPjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
194
+ const data = await _chunkERHEJGU7js.parser.load(entry);
195
+ const theme = _chunkERHEJGU7js.resolveThemeName.call(void 0, themeInput || data.config.theme);
196
196
  if (theme === "none") {
197
197
  console.error('Can not eject theme "none"');
198
198
  process.exit(1);
199
199
  }
200
- if (_chunkN7XL66RPjs.isPath.call(void 0, theme)) {
200
+ if (_chunkERHEJGU7js.isPath.call(void 0, theme)) {
201
201
  console.error("Theme is already ejected");
202
202
  process.exit(1);
203
203
  }
204
- const roots = _chunkN7XL66RPjs.getThemeRoots.call(void 0, theme, entry);
204
+ const roots = _chunkERHEJGU7js.getThemeRoots.call(void 0, theme, entry);
205
205
  if (!roots.length) {
206
206
  console.error(`Does not found theme "${theme}"`);
207
207
  process.exit(1);
@@ -213,7 +213,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
213
213
  const dirPath = `./${dir}`;
214
214
  data.slides[0].frontmatter.theme = dirPath;
215
215
  data.slides[0].raw = null;
216
- await _chunkN7XL66RPjs.parser.save(data);
216
+ await _chunkERHEJGU7js.parser.save(data);
217
217
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
218
218
  });
219
219
  }, () => {
@@ -255,17 +255,17 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
255
255
  "with-clicks": withClicks
256
256
  }) => {
257
257
  process.env.NODE_ENV = "production";
258
- const { exportSlides } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "./export-M6HJUIFY.js")));
258
+ const { exportSlides } = await Promise.resolve().then(() => _chunkFFZLS6QKjs.__toESM.call(void 0, _chunkFFZLS6QKjs.__require.call(void 0, "./export-LOKLMK66.js")));
259
259
  const port = await findFreePort(12445);
260
- const options = await _chunkN7XL66RPjs.resolveOptions.call(void 0, { entry, theme }, "build");
260
+ const options = await _chunkERHEJGU7js.resolveOptions.call(void 0, { entry, theme }, "build");
261
261
  output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
262
- const server = await _chunkN7XL66RPjs.createServer.call(void 0, options, {
262
+ const server = await _chunkERHEJGU7js.createServer.call(void 0, options, {
263
263
  server: { port },
264
264
  clearScreen: false
265
265
  });
266
266
  await server.listen(port);
267
267
  printInfo(options);
268
- _chunkN7XL66RPjs.parser.filterDisabled(options.data);
268
+ _chunkERHEJGU7js.parser.filterDisabled(options.data);
269
269
  const width = options.data.config.canvasWidth;
270
270
  const height = Math.round(width / options.data.config.aspectRatio);
271
271
  output = await exportSlides({
@@ -303,7 +303,7 @@ function printInfo(options, port, remote) {
303
303
  console.log();
304
304
  console.log();
305
305
  console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
306
- console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkN7XL66RPjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
306
+ console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkERHEJGU7js.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
307
307
  console.log();
308
308
  console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
309
309
  console.log(_kolorist.dim.call(void 0, " entry ") + _kolorist.dim.call(void 0, _path2.default.dirname(options.entry) + _path2.default.sep) + _path2.default.basename(options.entry));
package/dist/cli.mjs CHANGED
@@ -6,16 +6,16 @@ import {
6
6
  resolveOptions,
7
7
  resolveThemeName,
8
8
  version
9
- } from "./chunk-M2TT7ZMD.mjs";
9
+ } from "./chunk-STSGOSM4.mjs";
10
10
  import {
11
11
  require_fast_deep_equal
12
- } from "./chunk-WZ6OPJJF.mjs";
12
+ } from "./chunk-CNNMHD67.mjs";
13
13
  import {
14
14
  __dirname,
15
15
  __require,
16
16
  __toESM,
17
17
  init_esm_shims
18
- } from "./chunk-NOFZO6W4.mjs";
18
+ } from "./chunk-ZWCVPYOA.mjs";
19
19
 
20
20
  // node/cli.ts
21
21
  init_esm_shims();
@@ -169,7 +169,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
169
169
  type: "boolean",
170
170
  describe: "allow download as PDF"
171
171
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
172
- const { build } = await Promise.resolve().then(() => __toESM(__require("./build-YVXTTUTD.mjs")));
172
+ const { build } = await Promise.resolve().then(() => __toESM(__require("./build-O7J6JH7N.mjs")));
173
173
  const options = await resolveOptions({ entry, theme }, "build");
174
174
  if (download && !options.data.config.download)
175
175
  options.data.config.download = download;
@@ -256,7 +256,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
256
256
  "with-clicks": withClicks
257
257
  }) => {
258
258
  process.env.NODE_ENV = "production";
259
- const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-GIPHUNUX.mjs")));
259
+ const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-5R6FV775.mjs")));
260
260
  const port = await findFreePort(12445);
261
261
  const options = await resolveOptions({ entry, theme }, "build");
262
262
  output = output || options.data.config.exportFilename || `${path.basename(entry, ".md")}-export`;
@@ -3,7 +3,7 @@ import {
3
3
  __toESM,
4
4
  init_esm_shims,
5
5
  packageExists
6
- } from "./chunk-NOFZO6W4.mjs";
6
+ } from "./chunk-ZWCVPYOA.mjs";
7
7
 
8
8
  // node/export.ts
9
9
  init_esm_shims();
@@ -3,10 +3,10 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkJWGORJY6js = require('./chunk-JWGORJY6.js');
6
+ var _chunkFFZLS6QKjs = require('./chunk-FFZLS6QK.js');
7
7
 
8
8
  // node/export.ts
9
- _chunkJWGORJY6js.init_cjs_shims.call(void 0, );
9
+ _chunkFFZLS6QKjs.init_cjs_shims.call(void 0, );
10
10
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
11
11
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
12
12
  var _kolorist = require('kolorist');
@@ -60,10 +60,10 @@ async function exportSlides({
60
60
  height = 1080,
61
61
  withClicks = false
62
62
  }) {
63
- if (!_chunkJWGORJY6js.packageExists.call(void 0, "playwright-chromium"))
63
+ if (!_chunkFFZLS6QKjs.packageExists.call(void 0, "playwright-chromium"))
64
64
  throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D playwright-chromium`");
65
65
  const pages = _core.parseRangeString.call(void 0, total, range);
66
- const { chromium } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "playwright-chromium")));
66
+ const { chromium } = await Promise.resolve().then(() => _chunkFFZLS6QKjs.__toESM.call(void 0, _chunkFFZLS6QKjs.__require.call(void 0, "playwright-chromium")));
67
67
  const browser = await chromium.launch();
68
68
  const context = await browser.newContext({
69
69
  viewport: {
package/dist/index.js CHANGED
@@ -9,20 +9,20 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkN7XL66RPjs = require('./chunk-N7XL66RP.js');
12
+ var _chunkERHEJGU7js = require('./chunk-ERHEJGU7.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkIW3TSLZFjs = require('./chunk-IW3TSLZF.js');
16
+ var _chunkKFVTOCEDjs = require('./chunk-KFVTOCED.js');
17
17
 
18
18
 
19
- var _chunkJWGORJY6js = require('./chunk-JWGORJY6.js');
19
+ var _chunkFFZLS6QKjs = require('./chunk-FFZLS6QK.js');
20
20
 
21
21
  // node/index.ts
22
- _chunkJWGORJY6js.init_cjs_shims.call(void 0, );
22
+ _chunkFFZLS6QKjs.init_cjs_shims.call(void 0, );
23
23
 
24
24
  // node/declare.ts
25
- _chunkJWGORJY6js.init_cjs_shims.call(void 0, );
25
+ _chunkFFZLS6QKjs.init_cjs_shims.call(void 0, );
26
26
 
27
27
 
28
28
 
@@ -36,4 +36,4 @@ _chunkJWGORJY6js.init_cjs_shims.call(void 0, );
36
36
 
37
37
 
38
38
 
39
- exports.ViteSlidevPlugin = _chunkIW3TSLZFjs.ViteSlidevPlugin; exports.createServer = _chunkN7XL66RPjs.createServer; exports.createWindiCSSPlugin = _chunkIW3TSLZFjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkN7XL66RPjs.getAddonRoots; exports.getCLIRoot = _chunkN7XL66RPjs.getCLIRoot; exports.getClientRoot = _chunkN7XL66RPjs.getClientRoot; exports.getRoot = _chunkN7XL66RPjs.getRoot; exports.getThemeRoots = _chunkN7XL66RPjs.getThemeRoots; exports.getUserRoot = _chunkN7XL66RPjs.getUserRoot; exports.isPath = _chunkN7XL66RPjs.isPath; exports.parser = _chunkN7XL66RPjs.parser; exports.resolveOptions = _chunkN7XL66RPjs.resolveOptions;
39
+ exports.ViteSlidevPlugin = _chunkKFVTOCEDjs.ViteSlidevPlugin; exports.createServer = _chunkERHEJGU7js.createServer; exports.createWindiCSSPlugin = _chunkKFVTOCEDjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkERHEJGU7js.getAddonRoots; exports.getCLIRoot = _chunkERHEJGU7js.getCLIRoot; exports.getClientRoot = _chunkERHEJGU7js.getClientRoot; exports.getRoot = _chunkERHEJGU7js.getRoot; exports.getThemeRoots = _chunkERHEJGU7js.getThemeRoots; exports.getUserRoot = _chunkERHEJGU7js.getUserRoot; exports.isPath = _chunkERHEJGU7js.isPath; exports.parser = _chunkERHEJGU7js.parser; exports.resolveOptions = _chunkERHEJGU7js.resolveOptions;
package/dist/index.mjs CHANGED
@@ -9,14 +9,14 @@ import {
9
9
  isPath,
10
10
  parser,
11
11
  resolveOptions
12
- } from "./chunk-M2TT7ZMD.mjs";
12
+ } from "./chunk-STSGOSM4.mjs";
13
13
  import {
14
14
  ViteSlidevPlugin,
15
15
  createWindiCSSPlugin
16
- } from "./chunk-WZ6OPJJF.mjs";
16
+ } from "./chunk-CNNMHD67.mjs";
17
17
  import {
18
18
  init_esm_shims
19
- } from "./chunk-NOFZO6W4.mjs";
19
+ } from "./chunk-ZWCVPYOA.mjs";
20
20
 
21
21
  // node/index.ts
22
22
  init_esm_shims();
package/package.json CHANGED
@@ -1,34 +1,37 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.32.3",
3
+ "version": "0.32.4",
4
4
  "description": "Presentation slides for developers",
5
- "homepage": "https://sli.dev",
6
- "bugs": "https://github.com/slidevjs/slidev/issues",
7
- "license": "MIT",
8
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
+ "license": "MIT",
7
+ "funding": "https://github.com/sponsors/antfu",
8
+ "homepage": "https://sli.dev",
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "https://github.com/slidevjs/slidev"
12
12
  },
13
- "funding": "https://github.com/sponsors/antfu",
14
- "main": "dist/index.js",
15
- "module": "dist/index.mjs",
16
- "types": "dist/index.d.ts",
13
+ "bugs": "https://github.com/slidevjs/slidev/issues",
17
14
  "exports": {
18
15
  ".": {
19
- "import": "./dist/index.mjs",
20
- "require": "./dist/index.js"
16
+ "require": "./dist/index.js",
17
+ "import": "./dist/index.mjs"
21
18
  },
22
19
  "./*": "./*"
23
20
  },
21
+ "main": "dist/index.js",
22
+ "module": "dist/index.mjs",
23
+ "types": "dist/index.d.ts",
24
+ "bin": {
25
+ "slidev": "./bin/slidev.js"
26
+ },
24
27
  "files": [
25
28
  "bin",
26
29
  "client",
27
30
  "dist",
28
31
  "template.md"
29
32
  ],
30
- "bin": {
31
- "slidev": "./bin/slidev.js"
33
+ "engines": {
34
+ "node": ">=14.0.0"
32
35
  },
33
36
  "peerDependencies": {
34
37
  "playwright-chromium": "^1.10.0"
@@ -42,13 +45,13 @@
42
45
  "@antfu/utils": "^0.5.2",
43
46
  "@iconify-json/carbon": "^1.1.5",
44
47
  "@iconify-json/ph": "^1.1.1",
45
- "@slidev/client": "0.32.3",
46
- "@slidev/parser": "0.32.3",
47
- "@slidev/types": "0.32.3",
48
+ "@slidev/client": "0.32.4",
49
+ "@slidev/parser": "0.32.4",
50
+ "@slidev/types": "0.32.4",
48
51
  "@vitejs/plugin-vue": "^2.3.3",
49
- "@vue/compiler-sfc": "^3.2.35",
52
+ "@vue/compiler-sfc": "^3.2.36",
50
53
  "cli-progress": "^3.11.1",
51
- "codemirror": "^5.65.4",
54
+ "codemirror": "^5.65.5",
52
55
  "connect": "^3.7.0",
53
56
  "debug": "^4.3.4",
54
57
  "fast-glob": "^3.2.11",
@@ -74,13 +77,13 @@
74
77
  "resolve-global": "^1.0.0",
75
78
  "shiki": "^0.10.1",
76
79
  "unplugin-icons": "^0.14.3",
77
- "unplugin-vue-components": "^0.19.5",
80
+ "unplugin-vue-components": "^0.19.6",
78
81
  "vite": "^2.9.9",
79
- "vite-plugin-md": "^0.13.1",
82
+ "vite-plugin-md": "^0.14.0",
80
83
  "vite-plugin-remote-assets": "^0.2.2",
81
84
  "vite-plugin-vue-server-ref": "^0.2.4",
82
85
  "vite-plugin-windicss": "^1.8.4",
83
- "vue": "^3.2.35",
86
+ "vue": "^3.2.36",
84
87
  "windicss": "^3.5.4",
85
88
  "yargs": "^17.5.1"
86
89
  },
@@ -90,9 +93,6 @@
90
93
  "semver": "^7.3.7",
91
94
  "sirv": "^2.0.2"
92
95
  },
93
- "engines": {
94
- "node": ">=14.0.0"
95
- },
96
96
  "scripts": {
97
97
  "build": "rimraf dist && tsup node/index.ts node/cli.ts --dts --format cjs,esm --splitting --external @slidev/client/package.json",
98
98
  "dev": "nr build --watch",