@slidev/cli 0.31.1 → 0.31.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
@@ -1,6 +1,6 @@
1
1
  "use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkDQJN3MWPjs = require('./chunk-DQJN3MWP.js');
3
+ var _chunk6FP4S4BJjs = require('./chunk-6FP4S4BJ.js');
4
4
 
5
5
 
6
6
 
@@ -8,19 +8,19 @@ var _chunkDQJN3MWPjs = require('./chunk-DQJN3MWP.js');
8
8
 
9
9
 
10
10
 
11
- var _chunkIIMPX7JQjs = require('./chunk-IIMPX7JQ.js');
11
+ var _chunkVNV7XQUUjs = require('./chunk-VNV7XQUU.js');
12
12
 
13
13
 
14
- var _chunkW64GQHIHjs = require('./chunk-W64GQHIH.js');
14
+ var _chunkRQ7QDWD6js = require('./chunk-RQ7QDWD6.js');
15
15
 
16
16
 
17
17
 
18
18
 
19
- var _chunkOVW2G2MHjs = require('./chunk-OVW2G2MH.js');
19
+ var _chunkOYCSUJS7js = require('./chunk-OYCSUJS7.js');
20
20
 
21
21
  // node/cli.ts
22
- _chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
23
- var import_fast_deep_equal = _chunkOVW2G2MHjs.__toESM.call(void 0, _chunkW64GQHIHjs.require_fast_deep_equal.call(void 0, ));
22
+ _chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
23
+ var import_fast_deep_equal = _chunkOYCSUJS7js.__toESM.call(void 0, _chunkRQ7QDWD6js.require_fast_deep_equal.call(void 0, ));
24
24
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
25
25
  var _net = require('net'); var _net2 = _interopRequireDefault(_net);
26
26
  var _os = require('os'); var _os2 = _interopRequireDefault(_os);
@@ -38,7 +38,7 @@ var CONFIG_RESTART_FIELDS = [
38
38
  "routerMode",
39
39
  "fonts"
40
40
  ];
41
- var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkIIMPX7JQjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
41
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkVNV7XQUUjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
42
42
  cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
43
43
  alias: "p",
44
44
  type: "number",
@@ -49,8 +49,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
49
49
  type: "boolean",
50
50
  describe: "open in browser"
51
51
  }).option("remote", {
52
- default: false,
53
- type: "boolean",
52
+ type: "string",
54
53
  describe: "listen public host and enable remote control"
55
54
  }).option("log", {
56
55
  default: "warn",
@@ -82,20 +81,20 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
82
81
  async function initServer() {
83
82
  if (server)
84
83
  await server.close();
85
- const options = await _chunkIIMPX7JQjs.resolveOptions.call(void 0, { entry, theme }, "dev");
84
+ const options = await _chunkVNV7XQUUjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
86
85
  port = userPort || await findFreePort(3030);
87
- server = await _chunkDQJN3MWPjs.createServer.call(void 0, options, {
86
+ server = await _chunk6FP4S4BJjs.createServer.call(void 0, options, {
88
87
  server: {
89
88
  port,
90
89
  strictPort: true,
91
90
  open,
92
- host: remote ? "0.0.0.0" : "localhost",
91
+ host: remote !== void 0 ? "0.0.0.0" : "localhost",
93
92
  force
94
93
  },
95
94
  logLevel: log
96
95
  }, {
97
96
  onDataReload(newData, data) {
98
- if (!theme && _chunkIIMPX7JQjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkIIMPX7JQjs.resolveThemeName.call(void 0, data.config.theme)) {
97
+ if (!theme && _chunkVNV7XQUUjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkVNV7XQUUjs.resolveThemeName.call(void 0, data.config.theme)) {
99
98
  console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
100
99
  initServer();
101
100
  } else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
@@ -171,8 +170,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
171
170
  type: "boolean",
172
171
  describe: "allow download as PDF"
173
172
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
174
- const { build } = await Promise.resolve().then(() => _chunkOVW2G2MHjs.__toESM.call(void 0, _chunkOVW2G2MHjs.__require.call(void 0, "./build-WXX7THGM.js")));
175
- const options = await _chunkIIMPX7JQjs.resolveOptions.call(void 0, { entry, theme }, "build");
173
+ const { build } = await Promise.resolve().then(() => _chunkOYCSUJS7js.__toESM.call(void 0, _chunkOYCSUJS7js.__require.call(void 0, "./build-5QYEFLVL.js")));
174
+ const options = await _chunkVNV7XQUUjs.resolveOptions.call(void 0, { entry, theme }, "build");
176
175
  if (download && !options.data.config.download)
177
176
  options.data.config.download = download;
178
177
  printInfo(options);
@@ -185,26 +184,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
185
184
  });
186
185
  });
187
186
  cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
188
- const data = await _chunkIIMPX7JQjs.fs_exports.load(entry);
189
- _chunkIIMPX7JQjs.fs_exports.prettify(data);
190
- await _chunkIIMPX7JQjs.fs_exports.save(data);
187
+ const data = await _chunkVNV7XQUUjs.parser.load(entry);
188
+ _chunkVNV7XQUUjs.parser.prettify(data);
189
+ await _chunkVNV7XQUUjs.parser.save(data);
191
190
  });
192
191
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
193
192
  return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
194
193
  type: "string",
195
194
  default: "theme"
196
195
  }), async ({ entry, dir, theme: themeInput }) => {
197
- const data = await _chunkIIMPX7JQjs.fs_exports.load(entry);
198
- const theme = _chunkIIMPX7JQjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
196
+ const data = await _chunkVNV7XQUUjs.parser.load(entry);
197
+ const theme = _chunkVNV7XQUUjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
199
198
  if (theme === "none") {
200
199
  console.error('Can not eject theme "none"');
201
200
  process.exit(1);
202
201
  }
203
- if (_chunkIIMPX7JQjs.isPath.call(void 0, theme)) {
202
+ if (_chunkVNV7XQUUjs.isPath.call(void 0, theme)) {
204
203
  console.error("Theme is already ejected");
205
204
  process.exit(1);
206
205
  }
207
- const roots = _chunkIIMPX7JQjs.getThemeRoots.call(void 0, theme, entry);
206
+ const roots = _chunkVNV7XQUUjs.getThemeRoots.call(void 0, theme, entry);
208
207
  if (!roots.length) {
209
208
  console.error(`Does not found theme "${theme}"`);
210
209
  process.exit(1);
@@ -216,7 +215,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
216
215
  const dirPath = `./${dir}`;
217
216
  data.slides[0].frontmatter.theme = dirPath;
218
217
  data.slides[0].raw = null;
219
- await _chunkIIMPX7JQjs.fs_exports.save(data);
218
+ await _chunkVNV7XQUUjs.parser.save(data);
220
219
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
221
220
  });
222
221
  }, () => {
@@ -258,17 +257,17 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
258
257
  "with-clicks": withClicks
259
258
  }) => {
260
259
  process.env.NODE_ENV = "production";
261
- const { exportSlides } = await Promise.resolve().then(() => _chunkOVW2G2MHjs.__toESM.call(void 0, _chunkOVW2G2MHjs.__require.call(void 0, "./export-HDUCFTTI.js")));
260
+ const { exportSlides } = await Promise.resolve().then(() => _chunkOYCSUJS7js.__toESM.call(void 0, _chunkOYCSUJS7js.__require.call(void 0, "./export-W52T2VBO.js")));
262
261
  const port = await findFreePort(12445);
263
- const options = await _chunkIIMPX7JQjs.resolveOptions.call(void 0, { entry, theme }, "build");
262
+ const options = await _chunkVNV7XQUUjs.resolveOptions.call(void 0, { entry, theme }, "build");
264
263
  output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
265
- const server = await _chunkDQJN3MWPjs.createServer.call(void 0, options, {
264
+ const server = await _chunk6FP4S4BJjs.createServer.call(void 0, options, {
266
265
  server: { port },
267
266
  clearScreen: false
268
267
  });
269
268
  await server.listen(port);
270
269
  printInfo(options);
271
- _chunkIIMPX7JQjs.fs_exports.filterDisabled(options.data);
270
+ _chunkVNV7XQUUjs.parser.filterDisabled(options.data);
272
271
  const width = options.data.config.canvasWidth;
273
272
  const height = Math.round(width / options.data.config.aspectRatio);
274
273
  output = await exportSlides({
@@ -306,24 +305,27 @@ function printInfo(options, port, remote) {
306
305
  console.log();
307
306
  console.log();
308
307
  console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
309
- console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkIIMPX7JQjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
308
+ console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkVNV7XQUUjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
310
309
  console.log();
311
310
  console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
312
311
  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));
313
312
  if (port) {
314
- const presenterPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}presenter`;
313
+ const query = remote ? `?password=${remote}` : "";
314
+ const presenterPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}presenter/${query}`;
315
315
  console.log();
316
- console.log(`${_kolorist.dim.call(void 0, " slide show ")} > ${_kolorist.cyan.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}/`)}`);
317
- console.log(`${_kolorist.dim.call(void 0, " presenter mode ")} > ${_kolorist.blue.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}${presenterPath}`)}`);
318
- if (remote) {
316
+ console.log(`${_kolorist.dim.call(void 0, " public slide show ")} > ${_kolorist.cyan.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}/`)}`);
317
+ if (query)
318
+ console.log(`${_kolorist.dim.call(void 0, " private slide show ")} > ${_kolorist.cyan.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}/${query}`)}`);
319
+ console.log(`${_kolorist.dim.call(void 0, " presenter mode ")} > ${_kolorist.blue.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}${presenterPath}`)}`);
320
+ if (remote !== void 0) {
319
321
  Object.values(_os2.default.networkInterfaces()).forEach((v) => (v || []).filter((details) => details.family === "IPv4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
320
- console.log(`${_kolorist.dim.call(void 0, " remote control ")} > ${_kolorist.blue.call(void 0, `http://${address}:${port}${presenterPath}`)}`);
322
+ console.log(`${_kolorist.dim.call(void 0, " remote control ")} > ${_kolorist.blue.call(void 0, `http://${address}:${port}${presenterPath}`)}`);
321
323
  }));
322
324
  } else {
323
- console.log(`${_kolorist.dim.call(void 0, " remote control ")} > ${_kolorist.dim.call(void 0, "pass --remote to enable")}`);
325
+ console.log(`${_kolorist.dim.call(void 0, " remote control ")} > ${_kolorist.dim.call(void 0, "pass --remote to enable")}`);
324
326
  }
325
327
  console.log();
326
- console.log(`${_kolorist.dim.call(void 0, " shortcuts ")} > ${_kolorist.underline.call(void 0, "r")}${_kolorist.dim.call(void 0, "estart | ")}${_kolorist.underline.call(void 0, "o")}${_kolorist.dim.call(void 0, "pen | ")}${_kolorist.underline.call(void 0, "e")}${_kolorist.dim.call(void 0, "dit")}`);
328
+ console.log(`${_kolorist.dim.call(void 0, " shortcuts ")} > ${_kolorist.underline.call(void 0, "r")}${_kolorist.dim.call(void 0, "estart | ")}${_kolorist.underline.call(void 0, "o")}${_kolorist.dim.call(void 0, "pen | ")}${_kolorist.underline.call(void 0, "e")}${_kolorist.dim.call(void 0, "dit")}`);
327
329
  }
328
330
  console.log();
329
331
  console.log();
package/dist/cli.mjs CHANGED
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-T33EPP2B.mjs";
3
+ } from "./chunk-A6EFYWHQ.mjs";
4
4
  import {
5
- fs_exports,
6
5
  getThemeRoots,
7
6
  isPath,
7
+ parser,
8
8
  resolveOptions,
9
9
  resolveThemeName,
10
10
  version
11
- } from "./chunk-6URMXVHV.mjs";
11
+ } from "./chunk-7HNXF4RI.mjs";
12
12
  import {
13
13
  require_fast_deep_equal
14
- } from "./chunk-SJH4ZSSX.mjs";
14
+ } from "./chunk-NKDK3BW7.mjs";
15
15
  import {
16
16
  __dirname,
17
17
  __require,
18
18
  __toESM,
19
19
  init_esm_shims
20
- } from "./chunk-D6ZT4BYV.mjs";
20
+ } from "./chunk-25USV2L5.mjs";
21
21
 
22
22
  // node/cli.ts
23
23
  init_esm_shims();
@@ -50,8 +50,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
50
50
  type: "boolean",
51
51
  describe: "open in browser"
52
52
  }).option("remote", {
53
- default: false,
54
- type: "boolean",
53
+ type: "string",
55
54
  describe: "listen public host and enable remote control"
56
55
  }).option("log", {
57
56
  default: "warn",
@@ -83,14 +82,14 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
83
82
  async function initServer() {
84
83
  if (server)
85
84
  await server.close();
86
- const options = await resolveOptions({ entry, theme }, "dev");
85
+ const options = await resolveOptions({ entry, remote, theme }, "dev");
87
86
  port = userPort || await findFreePort(3030);
88
87
  server = await createServer(options, {
89
88
  server: {
90
89
  port,
91
90
  strictPort: true,
92
91
  open,
93
- host: remote ? "0.0.0.0" : "localhost",
92
+ host: remote !== void 0 ? "0.0.0.0" : "localhost",
94
93
  force
95
94
  },
96
95
  logLevel: log
@@ -172,7 +171,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
172
171
  type: "boolean",
173
172
  describe: "allow download as PDF"
174
173
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
175
- const { build } = await Promise.resolve().then(() => __toESM(__require("./build-6XVXRYOT.mjs")));
174
+ const { build } = await Promise.resolve().then(() => __toESM(__require("./build-QLCAUS73.mjs")));
176
175
  const options = await resolveOptions({ entry, theme }, "build");
177
176
  if (download && !options.data.config.download)
178
177
  options.data.config.download = download;
@@ -186,16 +185,16 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
186
185
  });
187
186
  });
188
187
  cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
189
- const data = await fs_exports.load(entry);
190
- fs_exports.prettify(data);
191
- await fs_exports.save(data);
188
+ const data = await parser.load(entry);
189
+ parser.prettify(data);
190
+ await parser.save(data);
192
191
  });
193
192
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
194
193
  return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
195
194
  type: "string",
196
195
  default: "theme"
197
196
  }), async ({ entry, dir, theme: themeInput }) => {
198
- const data = await fs_exports.load(entry);
197
+ const data = await parser.load(entry);
199
198
  const theme = resolveThemeName(themeInput || data.config.theme);
200
199
  if (theme === "none") {
201
200
  console.error('Can not eject theme "none"');
@@ -217,7 +216,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
217
216
  const dirPath = `./${dir}`;
218
217
  data.slides[0].frontmatter.theme = dirPath;
219
218
  data.slides[0].raw = null;
220
- await fs_exports.save(data);
219
+ await parser.save(data);
221
220
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
222
221
  });
223
222
  }, () => {
@@ -259,7 +258,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
259
258
  "with-clicks": withClicks
260
259
  }) => {
261
260
  process.env.NODE_ENV = "production";
262
- const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-7O4RPYTW.mjs")));
261
+ const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-RFA6N32W.mjs")));
263
262
  const port = await findFreePort(12445);
264
263
  const options = await resolveOptions({ entry, theme }, "build");
265
264
  output = output || options.data.config.exportFilename || `${path.basename(entry, ".md")}-export`;
@@ -269,7 +268,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
269
268
  });
270
269
  await server.listen(port);
271
270
  printInfo(options);
272
- fs_exports.filterDisabled(options.data);
271
+ parser.filterDisabled(options.data);
273
272
  const width = options.data.config.canvasWidth;
274
273
  const height = Math.round(width / options.data.config.aspectRatio);
275
274
  output = await exportSlides({
@@ -312,19 +311,22 @@ function printInfo(options, port, remote) {
312
311
  console.log(dim(" theme ") + (options.theme ? green(options.theme) : gray("none")));
313
312
  console.log(dim(" entry ") + dim(path.dirname(options.entry) + path.sep) + path.basename(options.entry));
314
313
  if (port) {
315
- const presenterPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}presenter`;
314
+ const query = remote ? `?password=${remote}` : "";
315
+ const presenterPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}presenter/${query}`;
316
316
  console.log();
317
- console.log(`${dim(" slide show ")} > ${cyan(`http://localhost:${bold(port)}/`)}`);
318
- console.log(`${dim(" presenter mode ")} > ${blue(`http://localhost:${bold(port)}${presenterPath}`)}`);
319
- if (remote) {
317
+ console.log(`${dim(" public slide show ")} > ${cyan(`http://localhost:${bold(port)}/`)}`);
318
+ if (query)
319
+ console.log(`${dim(" private slide show ")} > ${cyan(`http://localhost:${bold(port)}/${query}`)}`);
320
+ console.log(`${dim(" presenter mode ")} > ${blue(`http://localhost:${bold(port)}${presenterPath}`)}`);
321
+ if (remote !== void 0) {
320
322
  Object.values(os.networkInterfaces()).forEach((v) => (v || []).filter((details) => details.family === "IPv4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
321
- console.log(`${dim(" remote control ")} > ${blue(`http://${address}:${port}${presenterPath}`)}`);
323
+ console.log(`${dim(" remote control ")} > ${blue(`http://${address}:${port}${presenterPath}`)}`);
322
324
  }));
323
325
  } else {
324
- console.log(`${dim(" remote control ")} > ${dim("pass --remote to enable")}`);
326
+ console.log(`${dim(" remote control ")} > ${dim("pass --remote to enable")}`);
325
327
  }
326
328
  console.log();
327
- console.log(`${dim(" shortcuts ")} > ${underline("r")}${dim("estart | ")}${underline("o")}${dim("pen | ")}${underline("e")}${dim("dit")}`);
329
+ console.log(`${dim(" shortcuts ")} > ${underline("r")}${dim("estart | ")}${underline("o")}${dim("pen | ")}${underline("e")}${dim("dit")}`);
328
330
  }
329
331
  console.log();
330
332
  console.log();
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  packageExists
3
- } from "./chunk-6URMXVHV.mjs";
3
+ } from "./chunk-7HNXF4RI.mjs";
4
4
  import {
5
5
  __require,
6
6
  __toESM,
7
7
  init_esm_shims
8
- } from "./chunk-D6ZT4BYV.mjs";
8
+ } from "./chunk-25USV2L5.mjs";
9
9
 
10
10
  // node/export.ts
11
11
  init_esm_shims();
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkIIMPX7JQjs = require('./chunk-IIMPX7JQ.js');
3
+ var _chunkVNV7XQUUjs = require('./chunk-VNV7XQUU.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunkOVW2G2MHjs = require('./chunk-OVW2G2MH.js');
8
+ var _chunkOYCSUJS7js = require('./chunk-OYCSUJS7.js');
9
9
 
10
10
  // node/export.ts
11
- _chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
11
+ _chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
12
12
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
13
13
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
14
14
  var _kolorist = require('kolorist');
@@ -62,10 +62,10 @@ async function exportSlides({
62
62
  height = 1080,
63
63
  withClicks = false
64
64
  }) {
65
- if (!_chunkIIMPX7JQjs.packageExists.call(void 0, "playwright-chromium"))
65
+ if (!_chunkVNV7XQUUjs.packageExists.call(void 0, "playwright-chromium"))
66
66
  throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D playwright-chromium`");
67
67
  const pages = _core.parseRangeString.call(void 0, total, range);
68
- const { chromium } = await Promise.resolve().then(() => _chunkOVW2G2MHjs.__toESM.call(void 0, _chunkOVW2G2MHjs.__require.call(void 0, "playwright-chromium")));
68
+ const { chromium } = await Promise.resolve().then(() => _chunkOYCSUJS7js.__toESM.call(void 0, _chunkOYCSUJS7js.__require.call(void 0, "playwright-chromium")));
69
69
  const browser = await chromium.launch();
70
70
  const context = await browser.newContext({
71
71
  viewport: {
package/dist/index.d.ts CHANGED
@@ -6,9 +6,11 @@ import WindiCSS from 'vite-plugin-windicss';
6
6
  import RemoteAssets from 'vite-plugin-remote-assets';
7
7
  import ServerRef from 'vite-plugin-vue-server-ref';
8
8
  import { ArgumentsType } from '@antfu/utils';
9
- import { SlidevMarkdown, SlidevThemeMeta, SlidevConfig, FontOptions, ResolvedFontOptions, SlideInfoBase, SlidevFeatureFlags, SlideInfoWithPath } from '@slidev/types';
9
+ import { SlidevMarkdown } from '@slidev/types';
10
10
  import * as vite from 'vite';
11
11
  import { InlineConfig, Plugin } from 'vite';
12
+ import * as fs from '@slidev/parser/fs';
13
+ export { fs as parser };
12
14
 
13
15
  interface SlidevEntryOptions {
14
16
  /**
@@ -21,6 +23,10 @@ interface SlidevEntryOptions {
21
23
  * Theme id
22
24
  */
23
25
  theme?: string;
26
+ /**
27
+ * Remote password
28
+ */
29
+ remote?: string;
24
30
  /**
25
31
  * Root path
26
32
  *
@@ -38,6 +44,7 @@ interface ResolvedSlidevOptions {
38
44
  themeRoots: string[];
39
45
  roots: string[];
40
46
  mode: 'dev' | 'build';
47
+ remote?: string;
41
48
  }
42
49
  interface SlidevPluginOptions extends SlidevEntryOptions {
43
50
  vue?: ArgumentsType<typeof Vue>[0];
@@ -78,70 +85,4 @@ declare function ViteSlidevPlugin(options: ResolvedSlidevOptions, pluginOptions:
78
85
 
79
86
  declare function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, data }: ResolvedSlidevOptions, { windicss: windiOptions }: SlidevPluginOptions): Promise<vite.Plugin[]>;
80
87
 
81
- /**
82
- * 1,3-5,8 => [1, 3, 4, 5, 8]
83
- */
84
- declare function parseRangeString(total: number, rangeStr?: string): number[];
85
- /**
86
- * Accepts `16/9` `1:1` `3x4`
87
- */
88
- declare function parseAspectRatio(str: string | number): number;
89
-
90
- declare function resolveConfig(headmatter: any, themeMeta?: SlidevThemeMeta): SlidevConfig;
91
- declare function resolveFonts(fonts?: FontOptions): ResolvedFontOptions;
92
-
93
- declare function stringify(data: SlidevMarkdown): string;
94
- declare function filterDisabled(data: SlidevMarkdown): SlidevMarkdown;
95
- declare function stringifySlide(data: SlideInfoBase, idx?: number): string;
96
- declare function prettifySlide(data: SlideInfoBase): SlideInfoBase;
97
- declare function prettify(data: SlidevMarkdown): SlidevMarkdown;
98
- declare function detectFeatures(code: string): SlidevFeatureFlags;
99
- declare function parseSlide(raw: string): SlideInfoBase;
100
- declare function parse(markdown: string, filepath?: string, themeMeta?: SlidevThemeMeta): SlidevMarkdown;
101
- declare function mergeFeatureFlags(a: SlidevFeatureFlags, b: SlidevFeatureFlags): SlidevFeatureFlags;
102
- declare function scanMonacoModules(md: string): string[];
103
-
104
- declare function load(filepath: string, themeMeta?: SlidevThemeMeta, content?: string): Promise<SlidevMarkdown>;
105
- declare function save(data: SlidevMarkdown, filepath?: string): Promise<void>;
106
- declare function saveExternalSlide(slide: SlideInfoWithPath): Promise<void>;
107
-
108
- declare const fs_load: typeof load;
109
- declare const fs_save: typeof save;
110
- declare const fs_saveExternalSlide: typeof saveExternalSlide;
111
- declare const fs_parseRangeString: typeof parseRangeString;
112
- declare const fs_parseAspectRatio: typeof parseAspectRatio;
113
- declare const fs_resolveConfig: typeof resolveConfig;
114
- declare const fs_resolveFonts: typeof resolveFonts;
115
- declare const fs_stringify: typeof stringify;
116
- declare const fs_filterDisabled: typeof filterDisabled;
117
- declare const fs_stringifySlide: typeof stringifySlide;
118
- declare const fs_prettifySlide: typeof prettifySlide;
119
- declare const fs_prettify: typeof prettify;
120
- declare const fs_detectFeatures: typeof detectFeatures;
121
- declare const fs_parseSlide: typeof parseSlide;
122
- declare const fs_parse: typeof parse;
123
- declare const fs_mergeFeatureFlags: typeof mergeFeatureFlags;
124
- declare const fs_scanMonacoModules: typeof scanMonacoModules;
125
- declare namespace fs {
126
- export {
127
- fs_load as load,
128
- fs_save as save,
129
- fs_saveExternalSlide as saveExternalSlide,
130
- fs_parseRangeString as parseRangeString,
131
- fs_parseAspectRatio as parseAspectRatio,
132
- fs_resolveConfig as resolveConfig,
133
- fs_resolveFonts as resolveFonts,
134
- fs_stringify as stringify,
135
- fs_filterDisabled as filterDisabled,
136
- fs_stringifySlide as stringifySlide,
137
- fs_prettifySlide as prettifySlide,
138
- fs_prettify as prettify,
139
- fs_detectFeatures as detectFeatures,
140
- fs_parseSlide as parseSlide,
141
- fs_parse as parse,
142
- fs_mergeFeatureFlags as mergeFeatureFlags,
143
- fs_scanMonacoModules as scanMonacoModules,
144
- };
145
- }
146
-
147
- export { ResolvedSlidevOptions, SlidevEntryOptions, SlidevPluginOptions, SlidevServerOptions, ViteSlidevPlugin, createServer, createWindiCSSPlugin, getCLIRoot, getClientRoot, getThemeRoots, getUserRoot, isPath, fs as parser, resolveOptions };
88
+ export { ResolvedSlidevOptions, SlidevEntryOptions, SlidevPluginOptions, SlidevServerOptions, ViteSlidevPlugin, createServer, createWindiCSSPlugin, getCLIRoot, getClientRoot, getThemeRoots, getUserRoot, isPath, resolveOptions };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkDQJN3MWPjs = require('./chunk-DQJN3MWP.js');
3
+ var _chunk6FP4S4BJjs = require('./chunk-6FP4S4BJ.js');
4
4
 
5
5
 
6
6
 
@@ -9,20 +9,20 @@ var _chunkDQJN3MWPjs = require('./chunk-DQJN3MWP.js');
9
9
 
10
10
 
11
11
 
12
- var _chunkIIMPX7JQjs = require('./chunk-IIMPX7JQ.js');
12
+ var _chunkVNV7XQUUjs = require('./chunk-VNV7XQUU.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkW64GQHIHjs = require('./chunk-W64GQHIH.js');
16
+ var _chunkRQ7QDWD6js = require('./chunk-RQ7QDWD6.js');
17
17
 
18
18
 
19
- var _chunkOVW2G2MHjs = require('./chunk-OVW2G2MH.js');
19
+ var _chunkOYCSUJS7js = require('./chunk-OYCSUJS7.js');
20
20
 
21
21
  // node/index.ts
22
- _chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
22
+ _chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
23
23
 
24
24
  // node/declare.ts
25
- _chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
25
+ _chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
26
26
 
27
27
 
28
28
 
@@ -34,4 +34,4 @@ _chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
34
34
 
35
35
 
36
36
 
37
- exports.ViteSlidevPlugin = _chunkW64GQHIHjs.ViteSlidevPlugin; exports.createServer = _chunkDQJN3MWPjs.createServer; exports.createWindiCSSPlugin = _chunkW64GQHIHjs.createWindiCSSPlugin; exports.getCLIRoot = _chunkIIMPX7JQjs.getCLIRoot; exports.getClientRoot = _chunkIIMPX7JQjs.getClientRoot; exports.getThemeRoots = _chunkIIMPX7JQjs.getThemeRoots; exports.getUserRoot = _chunkIIMPX7JQjs.getUserRoot; exports.isPath = _chunkIIMPX7JQjs.isPath; exports.parser = _chunkIIMPX7JQjs.fs_exports; exports.resolveOptions = _chunkIIMPX7JQjs.resolveOptions;
37
+ exports.ViteSlidevPlugin = _chunkRQ7QDWD6js.ViteSlidevPlugin; exports.createServer = _chunk6FP4S4BJjs.createServer; exports.createWindiCSSPlugin = _chunkRQ7QDWD6js.createWindiCSSPlugin; exports.getCLIRoot = _chunkVNV7XQUUjs.getCLIRoot; exports.getClientRoot = _chunkVNV7XQUUjs.getClientRoot; exports.getThemeRoots = _chunkVNV7XQUUjs.getThemeRoots; exports.getUserRoot = _chunkVNV7XQUUjs.getUserRoot; exports.isPath = _chunkVNV7XQUUjs.isPath; exports.parser = _chunkVNV7XQUUjs.parser; exports.resolveOptions = _chunkVNV7XQUUjs.resolveOptions;
package/dist/index.mjs CHANGED
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-T33EPP2B.mjs";
3
+ } from "./chunk-A6EFYWHQ.mjs";
4
4
  import {
5
- fs_exports,
6
5
  getCLIRoot,
7
6
  getClientRoot,
8
7
  getThemeRoots,
9
8
  getUserRoot,
10
9
  isPath,
10
+ parser,
11
11
  resolveOptions
12
- } from "./chunk-6URMXVHV.mjs";
12
+ } from "./chunk-7HNXF4RI.mjs";
13
13
  import {
14
14
  ViteSlidevPlugin,
15
15
  createWindiCSSPlugin
16
- } from "./chunk-SJH4ZSSX.mjs";
16
+ } from "./chunk-NKDK3BW7.mjs";
17
17
  import {
18
18
  init_esm_shims
19
- } from "./chunk-D6ZT4BYV.mjs";
19
+ } from "./chunk-25USV2L5.mjs";
20
20
 
21
21
  // node/index.ts
22
22
  init_esm_shims();
@@ -32,6 +32,6 @@ export {
32
32
  getThemeRoots,
33
33
  getUserRoot,
34
34
  isPath,
35
- fs_exports as parser,
35
+ parser,
36
36
  resolveOptions
37
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.31.1",
3
+ "version": "0.31.4",
4
4
  "description": "Presentation slides for developers",
5
5
  "homepage": "https://sli.dev",
6
6
  "bugs": "https://github.com/slidevjs/slidev/issues",
@@ -39,13 +39,13 @@
39
39
  }
40
40
  },
41
41
  "dependencies": {
42
- "@antfu/utils": "^0.5.1",
42
+ "@antfu/utils": "^0.5.2",
43
43
  "@iconify-json/carbon": "^1.1.4",
44
44
  "@iconify-json/ph": "^1.1.1",
45
- "@slidev/client": "0.31.1",
46
- "@slidev/parser": "0.31.1",
47
- "@slidev/types": "0.31.1",
48
- "@vitejs/plugin-vue": "^2.3.2",
45
+ "@slidev/client": "0.31.4",
46
+ "@slidev/parser": "0.31.4",
47
+ "@slidev/types": "0.31.4",
48
+ "@vitejs/plugin-vue": "^2.3.3",
49
49
  "@vue/compiler-sfc": "^3.2.33",
50
50
  "cli-progress": "^3.11.0",
51
51
  "codemirror": "^5.65.3",
@@ -74,15 +74,15 @@
74
74
  "resolve-global": "^1.0.0",
75
75
  "shiki": "^0.10.1",
76
76
  "unplugin-icons": "^0.14.3",
77
- "unplugin-vue-components": "^0.19.3",
78
- "vite": "^2.9.8",
79
- "vite-plugin-md": "^0.13.0",
77
+ "unplugin-vue-components": "^0.19.5",
78
+ "vite": "^2.9.9",
79
+ "vite-plugin-md": "^0.13.1",
80
80
  "vite-plugin-remote-assets": "^0.2.2",
81
81
  "vite-plugin-vue-server-ref": "^0.2.4",
82
82
  "vite-plugin-windicss": "^1.8.4",
83
83
  "vue": "^3.2.33",
84
- "windicss": "^3.5.1",
85
- "yargs": "^17.4.1"
84
+ "windicss": "^3.5.3",
85
+ "yargs": "^17.5.0"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@types/plantuml-encoder": "^1.4.0",