@slidev/cli 0.32.2 → 0.32.3

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.
@@ -2401,7 +2401,7 @@ init_esm_shims();
2401
2401
  import * as parser from "@slidev/parser/fs";
2402
2402
 
2403
2403
  // package.json
2404
- var version = "0.32.2";
2404
+ var version = "0.32.3";
2405
2405
 
2406
2406
  // node/themes.ts
2407
2407
  init_esm_shims();
@@ -9657,6 +9657,8 @@ function resolveThemeName(name) {
9657
9657
  return `@slidev/theme-${name}`;
9658
9658
  if (packageExists(`slidev-theme-${name}`))
9659
9659
  return `slidev-theme-${name}`;
9660
+ if (packageExists(name))
9661
+ return name;
9660
9662
  if (officialThemes[name] != null)
9661
9663
  return officialThemes[name];
9662
9664
  return `slidev-theme-${name}`;
@@ -2400,7 +2400,7 @@ _chunkJWGORJY6js.init_cjs_shims.call(void 0, );
2400
2400
  var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
2401
2401
 
2402
2402
  // package.json
2403
- var version = "0.32.2";
2403
+ var version = "0.32.3";
2404
2404
 
2405
2405
  // node/themes.ts
2406
2406
  _chunkJWGORJY6js.init_cjs_shims.call(void 0, );
@@ -9665,6 +9665,8 @@ function resolveThemeName(name) {
9665
9665
  return `@slidev/theme-${name}`;
9666
9666
  if (_chunkJWGORJY6js.packageExists.call(void 0, `slidev-theme-${name}`))
9667
9667
  return `slidev-theme-${name}`;
9668
+ if (_chunkJWGORJY6js.packageExists.call(void 0, name))
9669
+ return name;
9668
9670
  if (officialThemes[name] != null)
9669
9671
  return officialThemes[name];
9670
9672
  return `slidev-theme-${name}`;
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkYCIQGGRRjs = require('./chunk-YCIQGGRR.js');
9
+ var _chunkN7XL66RPjs = require('./chunk-N7XL66RP.js');
10
10
 
11
11
 
12
12
  var _chunkIW3TSLZFjs = require('./chunk-IW3TSLZF.js');
@@ -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(_chunkYCIQGGRRjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
39
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkN7XL66RPjs.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 _chunkYCIQGGRRjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
82
+ const options = await _chunkN7XL66RPjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
83
83
  port = userPort || await findFreePort(3030);
84
- server = await _chunkYCIQGGRRjs.createServer.call(void 0, options, {
84
+ server = await _chunkN7XL66RPjs.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 && _chunkYCIQGGRRjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkYCIQGGRRjs.resolveThemeName.call(void 0, data.config.theme)) {
95
+ if (!theme && _chunkN7XL66RPjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkN7XL66RPjs.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]))) {
@@ -169,7 +169,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
169
169
  describe: "allow download as PDF"
170
170
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
171
171
  const { build } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "./build-M2QTEV63.js")));
172
- const options = await _chunkYCIQGGRRjs.resolveOptions.call(void 0, { entry, theme }, "build");
172
+ const options = await _chunkN7XL66RPjs.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 _chunkYCIQGGRRjs.parser.load(entry);
186
- _chunkYCIQGGRRjs.parser.prettify(data);
187
- await _chunkYCIQGGRRjs.parser.save(data);
185
+ const data = await _chunkN7XL66RPjs.parser.load(entry);
186
+ _chunkN7XL66RPjs.parser.prettify(data);
187
+ await _chunkN7XL66RPjs.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 _chunkYCIQGGRRjs.parser.load(entry);
195
- const theme = _chunkYCIQGGRRjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
194
+ const data = await _chunkN7XL66RPjs.parser.load(entry);
195
+ const theme = _chunkN7XL66RPjs.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 (_chunkYCIQGGRRjs.isPath.call(void 0, theme)) {
200
+ if (_chunkN7XL66RPjs.isPath.call(void 0, theme)) {
201
201
  console.error("Theme is already ejected");
202
202
  process.exit(1);
203
203
  }
204
- const roots = _chunkYCIQGGRRjs.getThemeRoots.call(void 0, theme, entry);
204
+ const roots = _chunkN7XL66RPjs.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 _chunkYCIQGGRRjs.parser.save(data);
216
+ await _chunkN7XL66RPjs.parser.save(data);
217
217
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
218
218
  });
219
219
  }, () => {
@@ -257,15 +257,15 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
257
257
  process.env.NODE_ENV = "production";
258
258
  const { exportSlides } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "./export-M6HJUIFY.js")));
259
259
  const port = await findFreePort(12445);
260
- const options = await _chunkYCIQGGRRjs.resolveOptions.call(void 0, { entry, theme }, "build");
260
+ const options = await _chunkN7XL66RPjs.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 _chunkYCIQGGRRjs.createServer.call(void 0, options, {
262
+ const server = await _chunkN7XL66RPjs.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
- _chunkYCIQGGRRjs.parser.filterDisabled(options.data);
268
+ _chunkN7XL66RPjs.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${_chunkYCIQGGRRjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
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)") : ""}`);
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,7 +6,7 @@ import {
6
6
  resolveOptions,
7
7
  resolveThemeName,
8
8
  version
9
- } from "./chunk-KIXPXAQ6.mjs";
9
+ } from "./chunk-M2TT7ZMD.mjs";
10
10
  import {
11
11
  require_fast_deep_equal
12
12
  } from "./chunk-WZ6OPJJF.mjs";
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkYCIQGGRRjs = require('./chunk-YCIQGGRR.js');
12
+ var _chunkN7XL66RPjs = require('./chunk-N7XL66RP.js');
13
13
 
14
14
 
15
15
 
@@ -36,4 +36,4 @@ _chunkJWGORJY6js.init_cjs_shims.call(void 0, );
36
36
 
37
37
 
38
38
 
39
- exports.ViteSlidevPlugin = _chunkIW3TSLZFjs.ViteSlidevPlugin; exports.createServer = _chunkYCIQGGRRjs.createServer; exports.createWindiCSSPlugin = _chunkIW3TSLZFjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkYCIQGGRRjs.getAddonRoots; exports.getCLIRoot = _chunkYCIQGGRRjs.getCLIRoot; exports.getClientRoot = _chunkYCIQGGRRjs.getClientRoot; exports.getRoot = _chunkYCIQGGRRjs.getRoot; exports.getThemeRoots = _chunkYCIQGGRRjs.getThemeRoots; exports.getUserRoot = _chunkYCIQGGRRjs.getUserRoot; exports.isPath = _chunkYCIQGGRRjs.isPath; exports.parser = _chunkYCIQGGRRjs.parser; exports.resolveOptions = _chunkYCIQGGRRjs.resolveOptions;
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;
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  isPath,
10
10
  parser,
11
11
  resolveOptions
12
- } from "./chunk-KIXPXAQ6.mjs";
12
+ } from "./chunk-M2TT7ZMD.mjs";
13
13
  import {
14
14
  ViteSlidevPlugin,
15
15
  createWindiCSSPlugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.32.2",
3
+ "version": "0.32.3",
4
4
  "description": "Presentation slides for developers",
5
5
  "homepage": "https://sli.dev",
6
6
  "bugs": "https://github.com/slidevjs/slidev/issues",
@@ -42,9 +42,9 @@
42
42
  "@antfu/utils": "^0.5.2",
43
43
  "@iconify-json/carbon": "^1.1.5",
44
44
  "@iconify-json/ph": "^1.1.1",
45
- "@slidev/client": "0.32.2",
46
- "@slidev/parser": "0.32.2",
47
- "@slidev/types": "0.32.2",
45
+ "@slidev/client": "0.32.3",
46
+ "@slidev/parser": "0.32.3",
47
+ "@slidev/types": "0.32.3",
48
48
  "@vitejs/plugin-vue": "^2.3.3",
49
49
  "@vue/compiler-sfc": "^3.2.35",
50
50
  "cli-progress": "^3.11.1",