@slidev/cli 0.35.2 → 0.35.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.
@@ -2,7 +2,7 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-X2HQWYH2.mjs";
5
+ } from "./chunk-54NZDFOD.mjs";
6
6
  import {
7
7
  __require,
8
8
  __toESM,
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkGH4JJSLKjs = require('./chunk-GH4JJSLK.js');
5
+ var _chunk2SBR5VZFjs = require('./chunk-2SBR5VZF.js');
6
6
 
7
7
 
8
8
 
@@ -655,13 +655,13 @@ async function build(options, viteConfig = {}) {
655
655
  let originalIndexHTML;
656
656
  if (_fsextra2.default.existsSync(indexPath))
657
657
  originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
658
- await _fsextra2.default.writeFile(indexPath, await _chunkGH4JJSLKjs.getIndexHtml.call(void 0, options), "utf-8");
658
+ await _fsextra2.default.writeFile(indexPath, await _chunk2SBR5VZFjs.getIndexHtml.call(void 0, options), "utf-8");
659
659
  let config = void 0;
660
660
  try {
661
- const inlineConfig = await _chunkGH4JJSLKjs.mergeViteConfigs.call(void 0, options, viteConfig, {
661
+ const inlineConfig = await _chunk2SBR5VZFjs.mergeViteConfigs.call(void 0, options, viteConfig, {
662
662
  root: options.userRoot,
663
663
  plugins: [
664
- await _chunkGH4JJSLKjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
664
+ await _chunk2SBR5VZFjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
665
665
  {
666
666
  name: "resolve-config",
667
667
  configResolved(_config) {
@@ -679,7 +679,7 @@ async function build(options, viteConfig = {}) {
679
679
  console.log(_kolorist.yellow.call(void 0, " Monaco is disabled in the build, to enabled it, set `monaco: true` in the frontmatter"));
680
680
  } else {
681
681
  console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
682
- await _vite.build.call(void 0, await _chunkGH4JJSLKjs.mergeViteConfigs.call(void 0, options, inlineConfig, {
682
+ await _vite.build.call(void 0, await _chunk2SBR5VZFjs.mergeViteConfigs.call(void 0, options, inlineConfig, {
683
683
  root: _path.join.call(void 0, options.clientRoot, "iframes/monaco"),
684
684
  base: `${config.base}iframes/monaco/`,
685
685
  build: {
@@ -238,7 +238,7 @@ async function loadDrawings(options) {
238
238
  }));
239
239
  return obj;
240
240
  }
241
- async function writeDarwings(options, drawing) {
241
+ async function writeDrawings(options, drawing) {
242
242
  const dir = resolveDrawingsDir(options);
243
243
  if (!dir)
244
244
  return;
@@ -1629,7 +1629,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1629
1629
  if (!options.data.config.drawings.persist)
1630
1630
  return;
1631
1631
  if (key === "drawings")
1632
- writeDarwings(options, patch != null ? patch : data);
1632
+ writeDrawings(options, patch != null ? patch : data);
1633
1633
  }
1634
1634
  }),
1635
1635
  createConfigPlugin(options),
@@ -239,7 +239,7 @@ async function loadDrawings(options) {
239
239
  }));
240
240
  return obj;
241
241
  }
242
- async function writeDarwings(options, drawing) {
242
+ async function writeDrawings(options, drawing) {
243
243
  const dir = resolveDrawingsDir(options);
244
244
  if (!dir)
245
245
  return;
@@ -1630,7 +1630,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1630
1630
  if (!options.data.config.drawings.persist)
1631
1631
  return;
1632
1632
  if (key === "drawings")
1633
- writeDarwings(options, patch != null ? patch : data);
1633
+ writeDrawings(options, patch != null ? patch : data);
1634
1634
  }
1635
1635
  }),
1636
1636
  createConfigPlugin(options),
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
3
  mergeViteConfigs
4
- } from "./chunk-X2HQWYH2.mjs";
4
+ } from "./chunk-54NZDFOD.mjs";
5
5
  import {
6
6
  __commonJS,
7
7
  __dirname,
@@ -2399,7 +2399,7 @@ init_esm_shims();
2399
2399
  import * as parser from "@slidev/parser/fs";
2400
2400
 
2401
2401
  // package.json
2402
- var version = "0.35.2";
2402
+ var version = "0.35.4";
2403
2403
 
2404
2404
  // node/themes.ts
2405
2405
  init_esm_shims();
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
3
 
4
- var _chunkGH4JJSLKjs = require('./chunk-GH4JJSLK.js');
4
+ var _chunk2SBR5VZFjs = require('./chunk-2SBR5VZF.js');
5
5
 
6
6
 
7
7
 
@@ -2380,14 +2380,14 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
2380
2380
  const rawConfig = await _vite.resolveConfig.call(void 0, {}, "serve");
2381
2381
  const pluginOptions = rawConfig.slidev || {};
2382
2382
  process.env.EDITOR = process.env.EDITOR || "code";
2383
- const server = await _vite.createServer.call(void 0, await _chunkGH4JJSLKjs.mergeViteConfigs.call(void 0, options, viteConfig, {
2383
+ const server = await _vite.createServer.call(void 0, await _chunk2SBR5VZFjs.mergeViteConfigs.call(void 0, options, viteConfig, {
2384
2384
  optimizeDeps: {
2385
2385
  entries: [
2386
2386
  _path.join.call(void 0, options.clientRoot, "main.ts")
2387
2387
  ]
2388
2388
  },
2389
2389
  plugins: [
2390
- await _chunkGH4JJSLKjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
2390
+ await _chunk2SBR5VZFjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
2391
2391
  ]
2392
2392
  }, "serve"));
2393
2393
  return server;
@@ -2398,7 +2398,7 @@ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
2398
2398
  var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
2399
2399
 
2400
2400
  // package.json
2401
- var version = "0.35.2";
2401
+ var version = "0.35.4";
2402
2402
 
2403
2403
  // node/themes.ts
2404
2404
  _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
package/dist/cli.js CHANGED
@@ -6,10 +6,10 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkOIH6DIQ4js = require('./chunk-OIH6DIQ4.js');
9
+ var _chunkRWZBP7KJjs = require('./chunk-RWZBP7KJ.js');
10
10
 
11
11
 
12
- var _chunkGH4JJSLKjs = require('./chunk-GH4JJSLK.js');
12
+ var _chunk2SBR5VZFjs = require('./chunk-2SBR5VZF.js');
13
13
 
14
14
 
15
15
 
@@ -18,7 +18,7 @@ var _chunkSQLX75IOjs = require('./chunk-SQLX75IO.js');
18
18
 
19
19
  // node/cli.ts
20
20
  _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
21
- var import_fast_deep_equal = _chunkSQLX75IOjs.__toESM.call(void 0, _chunkGH4JJSLKjs.require_fast_deep_equal.call(void 0, ));
21
+ var import_fast_deep_equal = _chunkSQLX75IOjs.__toESM.call(void 0, _chunk2SBR5VZFjs.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);
@@ -38,7 +38,7 @@ var CONFIG_RESTART_FIELDS = [
38
38
  "fonts",
39
39
  "css"
40
40
  ];
41
- var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkOIH6DIQ4js.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
41
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkRWZBP7KJjs.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",
@@ -81,9 +81,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
81
81
  async function initServer() {
82
82
  if (server)
83
83
  await server.close();
84
- const options = await _chunkOIH6DIQ4js.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
84
+ const options = await _chunkRWZBP7KJjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
85
85
  port = userPort || await findFreePort(3030);
86
- server = await _chunkOIH6DIQ4js.createServer.call(void 0, options, {
86
+ server = await _chunkRWZBP7KJjs.createServer.call(void 0, options, {
87
87
  server: {
88
88
  port,
89
89
  strictPort: true,
@@ -94,7 +94,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
94
94
  logLevel: log
95
95
  }, {
96
96
  onDataReload(newData, data) {
97
- if (!theme && _chunkOIH6DIQ4js.resolveThemeName.call(void 0, newData.config.theme) !== _chunkOIH6DIQ4js.resolveThemeName.call(void 0, data.config.theme)) {
97
+ if (!theme && _chunkRWZBP7KJjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkRWZBP7KJjs.resolveThemeName.call(void 0, data.config.theme)) {
98
98
  console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
99
99
  initServer();
100
100
  } else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
@@ -170,8 +170,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
170
170
  type: "boolean",
171
171
  describe: "allow download as PDF"
172
172
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
173
- const { build } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./build-Z26FNYJ3.js")));
174
- const options = await _chunkOIH6DIQ4js.resolveOptions.call(void 0, { entry, theme }, "build");
173
+ const { build } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./build-YURLBXT3.js")));
174
+ const options = await _chunkRWZBP7KJjs.resolveOptions.call(void 0, { entry, theme }, "build");
175
175
  if (download && !options.data.config.download)
176
176
  options.data.config.download = download;
177
177
  printInfo(options);
@@ -184,26 +184,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
184
184
  });
185
185
  });
186
186
  cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
187
- const data = await _chunkOIH6DIQ4js.parser.load(entry);
188
- _chunkOIH6DIQ4js.parser.prettify(data);
189
- await _chunkOIH6DIQ4js.parser.save(data);
187
+ const data = await _chunkRWZBP7KJjs.parser.load(entry);
188
+ _chunkRWZBP7KJjs.parser.prettify(data);
189
+ await _chunkRWZBP7KJjs.parser.save(data);
190
190
  });
191
191
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
192
192
  return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
193
193
  type: "string",
194
194
  default: "theme"
195
195
  }), async ({ entry, dir, theme: themeInput }) => {
196
- const data = await _chunkOIH6DIQ4js.parser.load(entry);
197
- const theme = _chunkOIH6DIQ4js.resolveThemeName.call(void 0, themeInput || data.config.theme);
196
+ const data = await _chunkRWZBP7KJjs.parser.load(entry);
197
+ const theme = _chunkRWZBP7KJjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
198
198
  if (theme === "none") {
199
199
  console.error('Can not eject theme "none"');
200
200
  process.exit(1);
201
201
  }
202
- if (_chunkOIH6DIQ4js.isPath.call(void 0, theme)) {
202
+ if (_chunkRWZBP7KJjs.isPath.call(void 0, theme)) {
203
203
  console.error("Theme is already ejected");
204
204
  process.exit(1);
205
205
  }
206
- const roots = _chunkOIH6DIQ4js.getThemeRoots.call(void 0, theme, entry);
206
+ const roots = _chunkRWZBP7KJjs.getThemeRoots.call(void 0, theme, entry);
207
207
  if (!roots.length) {
208
208
  console.error(`Does not found theme "${theme}"`);
209
209
  process.exit(1);
@@ -215,7 +215,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
215
215
  const dirPath = `./${dir}`;
216
216
  data.slides[0].frontmatter.theme = dirPath;
217
217
  data.slides[0].raw = null;
218
- await _chunkOIH6DIQ4js.parser.save(data);
218
+ await _chunkRWZBP7KJjs.parser.save(data);
219
219
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
220
220
  });
221
221
  }, () => {
@@ -259,15 +259,15 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
259
259
  process.env.NODE_ENV = "production";
260
260
  const { exportSlides } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "./export-TH7MNEXN.js")));
261
261
  const port = await findFreePort(12445);
262
- const options = await _chunkOIH6DIQ4js.resolveOptions.call(void 0, { entry, theme }, "build");
262
+ const options = await _chunkRWZBP7KJjs.resolveOptions.call(void 0, { entry, theme }, "build");
263
263
  output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
264
- const server = await _chunkOIH6DIQ4js.createServer.call(void 0, options, {
264
+ const server = await _chunkRWZBP7KJjs.createServer.call(void 0, options, {
265
265
  server: { port },
266
266
  clearScreen: false
267
267
  });
268
268
  await server.listen(port);
269
269
  printInfo(options);
270
- _chunkOIH6DIQ4js.parser.filterDisabled(options.data);
270
+ _chunkRWZBP7KJjs.parser.filterDisabled(options.data);
271
271
  const width = options.data.config.canvasWidth;
272
272
  const height = Math.round(width / options.data.config.aspectRatio);
273
273
  output = await exportSlides({
@@ -305,7 +305,7 @@ function printInfo(options, port, remote) {
305
305
  console.log();
306
306
  console.log();
307
307
  console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
308
- console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkOIH6DIQ4js.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
308
+ console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkRWZBP7KJjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
309
309
  console.log();
310
310
  console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
311
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));
package/dist/cli.mjs CHANGED
@@ -6,10 +6,10 @@ import {
6
6
  resolveOptions,
7
7
  resolveThemeName,
8
8
  version
9
- } from "./chunk-DQSKYR2M.mjs";
9
+ } from "./chunk-CG7FMSNH.mjs";
10
10
  import {
11
11
  require_fast_deep_equal
12
- } from "./chunk-X2HQWYH2.mjs";
12
+ } from "./chunk-54NZDFOD.mjs";
13
13
  import {
14
14
  __dirname,
15
15
  __require,
@@ -171,7 +171,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
171
171
  type: "boolean",
172
172
  describe: "allow download as PDF"
173
173
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
174
- const { build } = await Promise.resolve().then(() => __toESM(__require("./build-52YMLBLI.mjs")));
174
+ const { build } = await Promise.resolve().then(() => __toESM(__require("./build-IINHUSXF.mjs")));
175
175
  const options = await resolveOptions({ entry, theme }, "build");
176
176
  if (download && !options.data.config.download)
177
177
  options.data.config.download = download;
package/dist/index.js CHANGED
@@ -9,11 +9,11 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkOIH6DIQ4js = require('./chunk-OIH6DIQ4.js');
12
+ var _chunkRWZBP7KJjs = require('./chunk-RWZBP7KJ.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkGH4JJSLKjs = require('./chunk-GH4JJSLK.js');
16
+ var _chunk2SBR5VZFjs = require('./chunk-2SBR5VZF.js');
17
17
 
18
18
 
19
19
  var _chunkSQLX75IOjs = require('./chunk-SQLX75IO.js');
@@ -36,4 +36,4 @@ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
36
36
 
37
37
 
38
38
 
39
- exports.ViteSlidevPlugin = _chunkGH4JJSLKjs.ViteSlidevPlugin; exports.createServer = _chunkOIH6DIQ4js.createServer; exports.createWindiCSSPlugin = _chunkGH4JJSLKjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkOIH6DIQ4js.getAddonRoots; exports.getCLIRoot = _chunkOIH6DIQ4js.getCLIRoot; exports.getClientRoot = _chunkOIH6DIQ4js.getClientRoot; exports.getRoot = _chunkOIH6DIQ4js.getRoot; exports.getThemeRoots = _chunkOIH6DIQ4js.getThemeRoots; exports.getUserRoot = _chunkOIH6DIQ4js.getUserRoot; exports.isPath = _chunkOIH6DIQ4js.isPath; exports.parser = _chunkOIH6DIQ4js.parser; exports.resolveOptions = _chunkOIH6DIQ4js.resolveOptions;
39
+ exports.ViteSlidevPlugin = _chunk2SBR5VZFjs.ViteSlidevPlugin; exports.createServer = _chunkRWZBP7KJjs.createServer; exports.createWindiCSSPlugin = _chunk2SBR5VZFjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkRWZBP7KJjs.getAddonRoots; exports.getCLIRoot = _chunkRWZBP7KJjs.getCLIRoot; exports.getClientRoot = _chunkRWZBP7KJjs.getClientRoot; exports.getRoot = _chunkRWZBP7KJjs.getRoot; exports.getThemeRoots = _chunkRWZBP7KJjs.getThemeRoots; exports.getUserRoot = _chunkRWZBP7KJjs.getUserRoot; exports.isPath = _chunkRWZBP7KJjs.isPath; exports.parser = _chunkRWZBP7KJjs.parser; exports.resolveOptions = _chunkRWZBP7KJjs.resolveOptions;
package/dist/index.mjs CHANGED
@@ -9,11 +9,11 @@ import {
9
9
  isPath,
10
10
  parser,
11
11
  resolveOptions
12
- } from "./chunk-DQSKYR2M.mjs";
12
+ } from "./chunk-CG7FMSNH.mjs";
13
13
  import {
14
14
  ViteSlidevPlugin,
15
15
  createWindiCSSPlugin
16
- } from "./chunk-X2HQWYH2.mjs";
16
+ } from "./chunk-54NZDFOD.mjs";
17
17
  import {
18
18
  init_esm_shims
19
19
  } from "./chunk-GVA336JI.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.35.2",
3
+ "version": "0.35.4",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -46,9 +46,9 @@
46
46
  "@hedgedoc/markdown-it-task-lists": "^1.0.5",
47
47
  "@iconify-json/carbon": "^1.1.7",
48
48
  "@iconify-json/ph": "^1.1.2",
49
- "@slidev/client": "0.35.2",
50
- "@slidev/parser": "0.35.2",
51
- "@slidev/types": "0.35.2",
49
+ "@slidev/client": "0.35.4",
50
+ "@slidev/parser": "0.35.4",
51
+ "@slidev/types": "0.35.4",
52
52
  "@vitejs/plugin-vue": "^3.0.1",
53
53
  "@vue/compiler-sfc": "^3.2.37",
54
54
  "cli-progress": "^3.11.2",
@@ -83,7 +83,7 @@
83
83
  "unplugin-vue-components": "^0.21.2",
84
84
  "vite": "^3.0.4",
85
85
  "vite-plugin-remote-assets": "^0.3.0",
86
- "vite-plugin-vue-markdown": "^0.21.1",
86
+ "vite-plugin-vue-markdown": "^0.20.1",
87
87
  "vite-plugin-vue-server-ref": "^0.3.0",
88
88
  "vite-plugin-windicss": "^1.8.7",
89
89
  "vue": "^3.2.37",