@slidev/cli 0.40.14 → 0.41.0

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.
@@ -271,10 +271,10 @@ var dependencies = {
271
271
  "@antfu/utils": "^0.7.2",
272
272
  "@slidev/parser": "workspace:*",
273
273
  "@slidev/types": "workspace:*",
274
- "@unocss/reset": "^0.51.5",
275
- "@vueuse/core": "^10.0.2",
274
+ "@unocss/reset": "^0.51.13",
275
+ "@vueuse/core": "^10.1.2",
276
276
  "@vueuse/head": "^1.1.26",
277
- "@vueuse/math": "^10.0.2",
277
+ "@vueuse/math": "^10.1.2",
278
278
  "@vueuse/motion": "^2.0.0-beta.27",
279
279
  codemirror: "^5.65.5",
280
280
  defu: "^6.1.2",
@@ -283,17 +283,17 @@ var dependencies = {
283
283
  "fuse.js": "^6.6.2",
284
284
  "js-base64": "^3.7.5",
285
285
  "js-yaml": "^4.1.0",
286
- katex: "^0.16.6",
286
+ katex: "^0.16.7",
287
287
  mermaid: "^10.1.0",
288
288
  "monaco-editor": "^0.37.1",
289
289
  nanoid: "^4.0.2",
290
- prettier: "^2.8.7",
290
+ prettier: "^2.8.8",
291
291
  recordrtc: "^5.6.2",
292
292
  resolve: "^1.22.2",
293
- unocss: "^0.51.5",
294
- "vite-plugin-windicss": "^1.8.10",
295
- vue: "^3.2.47",
296
- "vue-router": "^4.1.6",
293
+ unocss: "^0.51.13",
294
+ "vite-plugin-windicss": "^1.9.0",
295
+ vue: "^3.3.2",
296
+ "vue-router": "^4.2.0",
297
297
  "vue-starport": "^0.3.0",
298
298
  windicss: "^3.5.6"
299
299
  };
@@ -982,6 +982,16 @@ export default {
982
982
  // node/plugins/monacoTransform.ts
983
983
 
984
984
 
985
+ async function getPackageData(pkg) {
986
+ const { resolvePackageData } = await eval('import("vite")');
987
+ const info = resolvePackageData(pkg, process.cwd());
988
+ if (!info)
989
+ return;
990
+ const typePath = info.data.types || info.data.typings;
991
+ if (!typePath)
992
+ return;
993
+ return [info, typePath];
994
+ }
985
995
  function createMonacoTypesLoader() {
986
996
  return {
987
997
  name: "slidev:monaco-types-loader",
@@ -993,19 +1003,16 @@ function createMonacoTypesLoader() {
993
1003
  async load(id) {
994
1004
  const match = id.match(/^\/\@slidev-monaco-types\/(.*)$/);
995
1005
  if (match) {
996
- const pkg = match[1];
997
- const { resolvePackageData } = await Promise.resolve().then(() => require("vite"));
998
- const info = resolvePackageData(pkg, process.cwd());
999
- if (!info)
1006
+ const pkg2 = match[1];
1007
+ const packageData = await getPackageData(pkg2) || await getPackageData(`@types/${pkg2}`);
1008
+ if (!packageData)
1000
1009
  return;
1001
- const typePath = info.data.types || info.data.typings;
1002
- if (!typePath)
1003
- return "";
1010
+ const [info2, typePath2] = packageData;
1004
1011
  return [
1005
1012
  "import * as monaco from 'monaco-editor'",
1006
- `import Type from "${_utils.slash.call(void 0, _path.join.call(void 0, info.dir, typePath))}?raw"`,
1007
- ...Object.keys(info.data.dependencies || {}).map((i) => `import "/@slidev-monaco-types/${i}"`),
1008
- `monaco.languages.typescript.typescriptDefaults.addExtraLib(\`declare module "${pkg}" { \${Type} }\`)`
1013
+ `import Type from "${_utils.slash.call(void 0, _path.join.call(void 0, info2.dir, typePath2))}?raw"`,
1014
+ ...Object.keys(info2.data.dependencies || {}).map((i) => `import "/@slidev-monaco-types/${i}"`),
1015
+ `monaco.languages.typescript.typescriptDefaults.addExtraLib(\`declare module "${pkg2}" { \${Type} }\`)`
1009
1016
  ].join("\n");
1010
1017
  }
1011
1018
  }
@@ -1696,6 +1703,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1696
1703
  }
1697
1704
  }),
1698
1705
  publicRoots.length ? _vitepluginstaticcopy.viteStaticCopy.call(void 0, {
1706
+ silent: true,
1699
1707
  targets: publicRoots.map((r) => ({
1700
1708
  src: `${r}/*`,
1701
1709
  dest: "theme"
package/dist/cli.js CHANGED
@@ -9,17 +9,17 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkWUJHPAYAjs = require('./chunk-WUJHPAYA.js');
12
+ var _chunk46ATDXDTjs = require('./chunk-46ATDXDT.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkZVE3I55Ejs = require('./chunk-ZVE3I55E.js');
16
+ var _chunkUJUM4LW4js = require('./chunk-UJUM4LW4.js');
17
17
 
18
18
 
19
19
  var _chunkGE7W2DBEjs = require('./chunk-GE7W2DBE.js');
20
20
 
21
21
  // node/cli.ts
22
- var import_fast_deep_equal = _chunkGE7W2DBEjs.__toESM.call(void 0, _chunkZVE3I55Ejs.require_fast_deep_equal.call(void 0, ));
22
+ var import_fast_deep_equal = _chunkGE7W2DBEjs.__toESM.call(void 0, _chunkUJUM4LW4js.require_fast_deep_equal.call(void 0, ));
23
23
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
24
24
  var _os = require('os'); var _os2 = _interopRequireDefault(_os);
25
25
  var _child_process = require('child_process');
@@ -45,15 +45,15 @@ _fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) =>
45
45
  const roots = (
46
46
  /* uniq */
47
47
  [
48
- _chunkWUJHPAYAjs.getUserRoot.call(void 0, {}).userRoot,
49
- ..._chunkWUJHPAYAjs.getAddonRoots.call(void 0, addons, ""),
50
- _chunkWUJHPAYAjs.getClientRoot.call(void 0, )
48
+ _chunk46ATDXDTjs.getUserRoot.call(void 0, {}).userRoot,
49
+ ..._chunk46ATDXDTjs.getAddonRoots.call(void 0, addons, ""),
50
+ _chunk46ATDXDTjs.getClientRoot.call(void 0, )
51
51
  ]
52
52
  );
53
53
  const mergeArrays = (a, b) => a.concat(b);
54
- return await _chunkZVE3I55Ejs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
54
+ return await _chunkUJUM4LW4js.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
55
55
  });
56
- var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkWUJHPAYAjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
56
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunk46ATDXDTjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
57
57
  cli.command(
58
58
  "* [entry]",
59
59
  "Start a local server for Slidev",
@@ -109,9 +109,9 @@ cli.command(
109
109
  async function initServer() {
110
110
  if (server)
111
111
  await server.close();
112
- const options = await _chunkWUJHPAYAjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
112
+ const options = await _chunk46ATDXDTjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
113
113
  port = userPort || await findFreePort(3030);
114
- server = await _chunkWUJHPAYAjs.createServer.call(void 0,
114
+ server = await _chunk46ATDXDTjs.createServer.call(void 0,
115
115
  options,
116
116
  {
117
117
  server: {
@@ -125,7 +125,7 @@ cli.command(
125
125
  },
126
126
  {
127
127
  onDataReload(newData, data) {
128
- if (!theme && _chunkWUJHPAYAjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkWUJHPAYAjs.resolveThemeName.call(void 0, data.config.theme)) {
128
+ if (!theme && _chunk46ATDXDTjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunk46ATDXDTjs.resolveThemeName.call(void 0, data.config.theme)) {
129
129
  console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
130
130
  initServer();
131
131
  } else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
@@ -243,9 +243,9 @@ cli.command(
243
243
  }).strict().help(),
244
244
  async (args) => {
245
245
  const { entry, theme, watch, base, download, out, inspect } = args;
246
- const { build } = await Promise.resolve().then(() => require("./build-OAINTTBE.js"));
246
+ const { build } = await Promise.resolve().then(() => require("./build-3GLTTQXV.js"));
247
247
  for (const entryFile of entry) {
248
- const options = await _chunkWUJHPAYAjs.resolveOptions.call(void 0, { entry: entryFile, theme, inspect }, "build");
248
+ const options = await _chunk46ATDXDTjs.resolveOptions.call(void 0, { entry: entryFile, theme, inspect }, "build");
249
249
  if (download && !options.data.config.download)
250
250
  options.data.config.download = download;
251
251
  printInfo(options);
@@ -265,9 +265,9 @@ cli.command(
265
265
  (args) => commonOptions(args).strict().help(),
266
266
  async ({ entry }) => {
267
267
  for (const entryFile of entry) {
268
- const data = await _chunkWUJHPAYAjs.parser.load(entryFile);
269
- _chunkWUJHPAYAjs.parser.prettify(data);
270
- await _chunkWUJHPAYAjs.parser.save(data);
268
+ const data = await _chunk46ATDXDTjs.parser.load(entryFile);
269
+ _chunk46ATDXDTjs.parser.prettify(data);
270
+ await _chunk46ATDXDTjs.parser.save(data);
271
271
  }
272
272
  }
273
273
  );
@@ -283,17 +283,17 @@ cli.command(
283
283
  default: "theme"
284
284
  }),
285
285
  async ({ entry, dir, theme: themeInput }) => {
286
- const data = await _chunkWUJHPAYAjs.parser.load(entry);
287
- const theme = _chunkWUJHPAYAjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
286
+ const data = await _chunk46ATDXDTjs.parser.load(entry);
287
+ const theme = _chunk46ATDXDTjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
288
288
  if (theme === "none") {
289
289
  console.error('Cannot eject theme "none"');
290
290
  process.exit(1);
291
291
  }
292
- if (_chunkWUJHPAYAjs.isPath.call(void 0, theme)) {
292
+ if (_chunk46ATDXDTjs.isPath.call(void 0, theme)) {
293
293
  console.error("Theme is already ejected");
294
294
  process.exit(1);
295
295
  }
296
- const roots = _chunkWUJHPAYAjs.getThemeRoots.call(void 0, theme, entry);
296
+ const roots = _chunk46ATDXDTjs.getThemeRoots.call(void 0, theme, entry);
297
297
  if (!roots.length) {
298
298
  console.error(`Could not find theme "${theme}"`);
299
299
  process.exit(1);
@@ -305,7 +305,7 @@ cli.command(
305
305
  const dirPath = `./${dir}`;
306
306
  data.slides[0].frontmatter.theme = dirPath;
307
307
  data.slides[0].raw = null;
308
- await _chunkWUJHPAYAjs.parser.save(data);
308
+ await _chunk46ATDXDTjs.parser.save(data);
309
309
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
310
310
  }
311
311
  );
@@ -325,8 +325,8 @@ cli.command(
325
325
  const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-GTPZJWVE.js"));
326
326
  const port = await findFreePort(12445);
327
327
  for (const entryFile of entry) {
328
- const options = await _chunkWUJHPAYAjs.resolveOptions.call(void 0, { entry: entryFile, theme }, "export");
329
- const server = await _chunkWUJHPAYAjs.createServer.call(void 0,
328
+ const options = await _chunk46ATDXDTjs.resolveOptions.call(void 0, { entry: entryFile, theme }, "export");
329
+ const server = await _chunk46ATDXDTjs.createServer.call(void 0,
330
330
  options,
331
331
  {
332
332
  server: { port },
@@ -335,7 +335,7 @@ cli.command(
335
335
  );
336
336
  await server.listen(port);
337
337
  printInfo(options);
338
- _chunkWUJHPAYAjs.parser.filterDisabled(options.data);
338
+ _chunk46ATDXDTjs.parser.filterDisabled(options.data);
339
339
  const result = await exportSlides({
340
340
  port,
341
341
  ...getExportOptions({ ...args, entry: entryFile }, options)
@@ -371,8 +371,8 @@ cli.command(
371
371
  const { exportNotes } = await Promise.resolve().then(() => require("./export-GTPZJWVE.js"));
372
372
  const port = await findFreePort(12445);
373
373
  for (const entryFile of entry) {
374
- const options = await _chunkWUJHPAYAjs.resolveOptions.call(void 0, { entry: entryFile }, "export");
375
- const server = await _chunkWUJHPAYAjs.createServer.call(void 0,
374
+ const options = await _chunk46ATDXDTjs.resolveOptions.call(void 0, { entry: entryFile }, "export");
375
+ const server = await _chunk46ATDXDTjs.createServer.call(void 0,
376
376
  options,
377
377
  {
378
378
  server: { port },
@@ -381,7 +381,7 @@ cli.command(
381
381
  );
382
382
  await server.listen(port);
383
383
  printInfo(options);
384
- _chunkWUJHPAYAjs.parser.filterDisabled(options.data);
384
+ _chunk46ATDXDTjs.parser.filterDisabled(options.data);
385
385
  const result = await exportNotes({
386
386
  port,
387
387
  output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entryFile, ".md")}-export-notes`),
@@ -442,7 +442,7 @@ function printInfo(options, port, remote, tunnelUrl) {
442
442
  console.log();
443
443
  console.log();
444
444
  console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
445
- console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkWUJHPAYAjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
445
+ console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunk46ATDXDTjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
446
446
  console.log();
447
447
  console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
448
448
  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
@@ -9,11 +9,11 @@ import {
9
9
  resolveOptions,
10
10
  resolveThemeName,
11
11
  version
12
- } from "./chunk-URECPDWL.mjs";
12
+ } from "./chunk-ATJEPFM2.mjs";
13
13
  import {
14
14
  loadSetups,
15
15
  require_fast_deep_equal
16
- } from "./chunk-LOPZV75Y.mjs";
16
+ } from "./chunk-AV6T2PNJ.mjs";
17
17
  import {
18
18
  __toESM
19
19
  } from "./chunk-CTG3GV2W.mjs";
@@ -243,7 +243,7 @@ cli.command(
243
243
  }).strict().help(),
244
244
  async (args) => {
245
245
  const { entry, theme, watch, base, download, out, inspect } = args;
246
- const { build } = await import("./build-7UUJ5HTR.mjs");
246
+ const { build } = await import("./build-KUT3K5TN.mjs");
247
247
  for (const entryFile of entry) {
248
248
  const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
249
249
  if (download && !options.data.config.download)
package/dist/index.js CHANGED
@@ -9,11 +9,11 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkWUJHPAYAjs = require('./chunk-WUJHPAYA.js');
12
+ var _chunk46ATDXDTjs = require('./chunk-46ATDXDT.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkZVE3I55Ejs = require('./chunk-ZVE3I55E.js');
16
+ var _chunkUJUM4LW4js = require('./chunk-UJUM4LW4.js');
17
17
  require('./chunk-GE7W2DBE.js');
18
18
 
19
19
 
@@ -28,4 +28,4 @@ require('./chunk-GE7W2DBE.js');
28
28
 
29
29
 
30
30
 
31
- exports.ViteSlidevPlugin = _chunkZVE3I55Ejs.ViteSlidevPlugin; exports.createServer = _chunkWUJHPAYAjs.createServer; exports.createWindiCSSPlugin = _chunkZVE3I55Ejs.createWindiCSSPlugin; exports.getAddonRoots = _chunkWUJHPAYAjs.getAddonRoots; exports.getCLIRoot = _chunkWUJHPAYAjs.getCLIRoot; exports.getClientRoot = _chunkWUJHPAYAjs.getClientRoot; exports.getRoot = _chunkWUJHPAYAjs.getRoot; exports.getThemeRoots = _chunkWUJHPAYAjs.getThemeRoots; exports.getUserRoot = _chunkWUJHPAYAjs.getUserRoot; exports.isPath = _chunkWUJHPAYAjs.isPath; exports.parser = _chunkWUJHPAYAjs.parser; exports.resolveOptions = _chunkWUJHPAYAjs.resolveOptions;
31
+ exports.ViteSlidevPlugin = _chunkUJUM4LW4js.ViteSlidevPlugin; exports.createServer = _chunk46ATDXDTjs.createServer; exports.createWindiCSSPlugin = _chunkUJUM4LW4js.createWindiCSSPlugin; exports.getAddonRoots = _chunk46ATDXDTjs.getAddonRoots; exports.getCLIRoot = _chunk46ATDXDTjs.getCLIRoot; exports.getClientRoot = _chunk46ATDXDTjs.getClientRoot; exports.getRoot = _chunk46ATDXDTjs.getRoot; exports.getThemeRoots = _chunk46ATDXDTjs.getThemeRoots; exports.getUserRoot = _chunk46ATDXDTjs.getUserRoot; exports.isPath = _chunk46ATDXDTjs.isPath; exports.parser = _chunk46ATDXDTjs.parser; exports.resolveOptions = _chunk46ATDXDTjs.resolveOptions;
package/dist/index.mjs CHANGED
@@ -9,11 +9,11 @@ import {
9
9
  isPath,
10
10
  parser,
11
11
  resolveOptions
12
- } from "./chunk-URECPDWL.mjs";
12
+ } from "./chunk-ATJEPFM2.mjs";
13
13
  import {
14
14
  ViteSlidevPlugin,
15
15
  createWindiCSSPlugin
16
- } from "./chunk-LOPZV75Y.mjs";
16
+ } from "./chunk-AV6T2PNJ.mjs";
17
17
  import "./chunk-CTG3GV2W.mjs";
18
18
  export {
19
19
  ViteSlidevPlugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.40.14",
3
+ "version": "0.41.0",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -47,9 +47,9 @@
47
47
  "@iconify-json/carbon": "^1.1.16",
48
48
  "@iconify-json/ph": "^1.1.5",
49
49
  "@lillallol/outline-pdf": "^4.0.0",
50
- "@vitejs/plugin-vue": "^4.1.0",
50
+ "@vitejs/plugin-vue": "^4.2.3",
51
51
  "@vitejs/plugin-vue-jsx": "^3.0.1",
52
- "@windicss/config": "^1.8.10",
52
+ "@windicss/config": "^1.9.0",
53
53
  "cli-progress": "^3.12.0",
54
54
  "codemirror": "^5.65.5",
55
55
  "connect": "^3.7.0",
@@ -62,8 +62,8 @@
62
62
  "is-installed-globally": "^0.4.0",
63
63
  "jiti": "^1.18.2",
64
64
  "js-base64": "^3.7.5",
65
- "katex": "^0.16.6",
66
- "kolorist": "^1.7.0",
65
+ "katex": "^0.16.7",
66
+ "kolorist": "^1.8.0",
67
67
  "localtunnel": "^2.0.2",
68
68
  "markdown-it": "^13.0.1",
69
69
  "markdown-it-footnote": "^3.0.3",
@@ -80,30 +80,30 @@
80
80
  "resolve": "^1.22.2",
81
81
  "resolve-from": "^5.0.0",
82
82
  "resolve-global": "^1.0.0",
83
- "shiki": "^0.14.1",
84
- "unocss": "^0.51.5",
83
+ "shiki": "^0.14.2",
84
+ "unocss": "^0.51.13",
85
85
  "unplugin-icons": "^0.16.1",
86
86
  "unplugin-vue-components": "^0.24.1",
87
- "vite": "^4.3.0",
88
- "vite-plugin-inspect": "^0.7.23",
87
+ "vite": "^4.3.7",
88
+ "vite-plugin-inspect": "^0.7.26",
89
89
  "vite-plugin-remote-assets": "^0.3.2",
90
- "vite-plugin-static-copy": "^0.14.0",
91
- "vite-plugin-vue-markdown": "^0.22.6",
90
+ "vite-plugin-static-copy": "^0.15.0",
91
+ "vite-plugin-vue-markdown": "^0.23.5",
92
92
  "vite-plugin-vue-server-ref": "^0.3.3",
93
- "vite-plugin-windicss": "^1.8.10",
94
- "vue": "^3.2.47",
93
+ "vite-plugin-windicss": "^1.9.0",
94
+ "vue": "^3.3.2",
95
95
  "windicss": "^3.5.6",
96
- "yargs": "^17.7.1",
97
- "@slidev/client": "0.40.14",
98
- "@slidev/parser": "0.40.14",
99
- "@slidev/types": "0.40.14"
96
+ "yargs": "^17.7.2",
97
+ "@slidev/client": "0.41.0",
98
+ "@slidev/parser": "0.41.0",
99
+ "@slidev/types": "0.41.0"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@types/plantuml-encoder": "^1.4.0",
103
103
  "fast-deep-equal": "^3.1.3",
104
104
  "local-pkg": "^0.4.3",
105
- "semver": "^7.5.0",
106
- "sirv": "^2.0.2"
105
+ "semver": "^7.5.1",
106
+ "sirv": "^2.0.3"
107
107
  },
108
108
  "scripts": {
109
109
  "build": "rimraf dist && tsup node/index.ts node/cli.ts",