@slidev/cli 0.27.15 → 0.27.20

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.
@@ -1,20 +1,23 @@
1
1
  import {
2
2
  __commonJS,
3
+ __filename,
3
4
  __require,
4
5
  __spreadProps,
5
6
  __spreadValues,
6
7
  __toModule,
7
8
  generateGoogleFontsUrl,
9
+ init_esm_shims,
8
10
  resolveGlobalImportPath,
9
11
  resolveImportPath,
10
12
  stringifyMarkdownTokens,
11
13
  toAtFS
12
- } from "./chunk-QQD2JVXL.mjs";
14
+ } from "./chunk-3LH2GTGU.mjs";
13
15
 
14
16
  // ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
15
17
  var require_fast_deep_equal = __commonJS({
16
18
  "../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
17
19
  "use strict";
20
+ init_esm_shims();
18
21
  module.exports = function equal2(a, b) {
19
22
  if (a === b)
20
23
  return true;
@@ -57,6 +60,7 @@ var require_fast_deep_equal = __commonJS({
57
60
  });
58
61
 
59
62
  // node/common.ts
63
+ init_esm_shims();
60
64
  import { promises as fs, existsSync } from "fs";
61
65
  import { join } from "path";
62
66
  import { uniq } from "@antfu/utils";
@@ -65,6 +69,7 @@ async function getIndexHtml({ clientRoot, themeRoots, data, userRoot }) {
65
69
  let main = await fs.readFile(join(clientRoot, "index.html"), "utf-8");
66
70
  let head = "";
67
71
  let body = "";
72
+ head += `<link rel="icon" href="${data.config.favicon}">`;
68
73
  const roots = uniq([
69
74
  ...themeRoots,
70
75
  userRoot
@@ -89,6 +94,7 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
89
94
  }
90
95
 
91
96
  // node/plugins/windicss.ts
97
+ init_esm_shims();
92
98
  import { resolve as resolve2, dirname } from "path";
93
99
  import { existsSync as existsSync3 } from "fs";
94
100
  import { slash, uniq as uniq2 } from "@antfu/utils";
@@ -96,6 +102,7 @@ import WindiCSS, { defaultConfigureFiles } from "vite-plugin-windicss";
96
102
  import jiti2 from "jiti";
97
103
 
98
104
  // node/plugins/setupNode.ts
105
+ init_esm_shims();
99
106
  import { resolve } from "path";
100
107
  import { existsSync as existsSync2 } from "fs-extra";
101
108
  import { isObject } from "@antfu/utils";
@@ -169,6 +176,7 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
169
176
  }
170
177
 
171
178
  // node/plugins/preset.ts
179
+ init_esm_shims();
172
180
  import Vue from "@vitejs/plugin-vue";
173
181
  import Icons from "unplugin-icons/vite";
174
182
  import IconsResolver from "unplugin-icons/resolver";
@@ -178,6 +186,7 @@ import ServerRef from "vite-plugin-vue-server-ref";
178
186
  import { notNullish as notNullish2 } from "@antfu/utils";
179
187
 
180
188
  // node/drawings.ts
189
+ init_esm_shims();
181
190
  import { dirname as dirname2, resolve as resolve3, join as join2, basename } from "path";
182
191
  import fs2 from "fs-extra";
183
192
  import fg from "fast-glob";
@@ -223,6 +232,7 @@ ${value}
223
232
  }
224
233
 
225
234
  // node/plugins/extendConfig.ts
235
+ init_esm_shims();
226
236
  import { dirname as dirname4, join as join4 } from "path";
227
237
  import { mergeConfig } from "vite";
228
238
  import isInstalledGlobally from "is-installed-globally";
@@ -233,28 +243,29 @@ var dependencies = {
233
243
  "@antfu/utils": "^0.3.0",
234
244
  "@slidev/parser": "workspace:*",
235
245
  "@slidev/types": "workspace:*",
236
- "@vueuse/core": "^6.6.2",
237
- "@vueuse/head": "^0.6.0",
246
+ "@vueuse/core": "^7.3.0",
247
+ "@vueuse/head": "^0.7.4",
238
248
  "@vueuse/motion": "^2.0.0-beta.4",
239
- codemirror: "^5.63.3",
249
+ codemirror: "^5.64.0",
240
250
  drauu: "^0.2.1",
241
251
  "file-saver": "^2.0.5",
242
252
  "js-base64": "^3.7.2",
243
253
  "js-yaml": "^4.1.0",
244
- katex: "^0.13.18",
254
+ katex: "^0.15.1",
245
255
  mermaid: "8.13.0",
246
- "monaco-editor": "^0.29.1",
256
+ "monaco-editor": "^0.31.0",
247
257
  nanoid: "^3.1.30",
248
- prettier: "^2.4.1",
258
+ prettier: "^2.5.1",
249
259
  recordrtc: "^5.6.2",
250
260
  resolve: "^1.20.0",
251
- "vite-plugin-windicss": "^1.4.12",
252
- vue: "^3.2.20",
261
+ "vite-plugin-windicss": "^1.5.4",
262
+ vue: "^3.2.26",
253
263
  "vue-router": "^4.0.12",
254
- windicss: "^3.1.9"
264
+ windicss: "^3.3.0"
255
265
  };
256
266
 
257
267
  // node/vite/searchRoot.ts
268
+ init_esm_shims();
258
269
  import fs3 from "fs";
259
270
  import { dirname as dirname3, join as join3 } from "path";
260
271
  var ROOT_FILES = [
@@ -379,6 +390,7 @@ function getDefine(options) {
379
390
  }
380
391
 
381
392
  // node/plugins/loaders.ts
393
+ init_esm_shims();
382
394
  var import_fast_deep_equal = __toModule(require_fast_deep_equal());
383
395
  import { basename as basename2, join as join5 } from "path";
384
396
  import { isString, notNullish, objectMap, range, slash as slash2, uniq as uniq4 } from "@antfu/utils";
@@ -386,12 +398,7 @@ import fg2 from "fast-glob";
386
398
  import fs4, { existsSync as existsSync4 } from "fs-extra";
387
399
  import Markdown from "markdown-it";
388
400
  import mila from "markdown-it-link-attributes";
389
- import {
390
- load,
391
- save,
392
- saveExternalSlide,
393
- scanMonacoModules
394
- } from "@slidev/parser/fs";
401
+ import * as parser from "@slidev/parser/fs";
395
402
  var regexId = /^\/\@slidev\/slide\/(\d+)\.(md|json)(?:\?import)?$/;
396
403
  var regexIdQuery = /(\d+?)\.(md|json)$/;
397
404
  function getBodyJson(req) {
@@ -422,7 +429,7 @@ function prepareSlideInfo(data) {
422
429
  }
423
430
  function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
424
431
  const slidePrefix = "/@slidev/slides/";
425
- const hmrPages = new Set();
432
+ const hmrPages = /* @__PURE__ */ new Set();
426
433
  let server;
427
434
  let _layouts_cache_time = 0;
428
435
  let _layouts_cache = {};
@@ -449,10 +456,10 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
449
456
  hmrPages.add(idx);
450
457
  if (slide.source) {
451
458
  Object.assign(slide.source, body);
452
- await saveExternalSlide(slide.source);
459
+ await parser.saveExternalSlide(slide.source);
453
460
  } else {
454
461
  Object.assign(slide, body);
455
- await save(data, entry);
462
+ await parser.save(data, entry);
456
463
  }
457
464
  res.statusCode = 200;
458
465
  res.write(JSON.stringify(prepareSlideInfo(slide)));
@@ -465,8 +472,8 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
465
472
  var _a;
466
473
  if (!data.entries.some((i) => slash2(i) === ctx.file))
467
474
  return;
468
- const newData = await load(entry, data.themeMeta);
469
- const moduleIds = new Set();
475
+ const newData = await parser.load(entry, data.themeMeta);
476
+ const moduleIds = /* @__PURE__ */ new Set();
470
477
  if (data.slides.length !== newData.slides.length) {
471
478
  moduleIds.add("/@slidev/routes");
472
479
  range(newData.slides.length).map((i) => hmrPages.add(i));
@@ -667,7 +674,7 @@ ${code.slice(injectB)}`;
667
674
  return imports.join("\n");
668
675
  }
669
676
  async function generateMonacoTypes() {
670
- return `void 0; ${scanMonacoModules(data.raw).map((i) => `import('/@slidev-monaco-types/${i}')`).join("\n")}`;
677
+ return `void 0; ${parser.scanMonacoModules(data.raw).map((i) => `import('/@slidev-monaco-types/${i}')`).join("\n")}`;
671
678
  }
672
679
  async function generateLayouts() {
673
680
  const imports = [];
@@ -757,6 +764,7 @@ export default {
757
764
  }
758
765
 
759
766
  // node/plugins/monacoTransform.ts
767
+ init_esm_shims();
760
768
  import { join as join6 } from "path";
761
769
  import { slash as slash3 } from "@antfu/utils";
762
770
  import { resolvePackageData } from "vite";
@@ -790,6 +798,7 @@ function createMonacoTypesLoader() {
790
798
  }
791
799
 
792
800
  // node/plugins/setupClient.ts
801
+ init_esm_shims();
793
802
  import { existsSync as existsSync5 } from "fs";
794
803
  import { join as join7, resolve as resolve4 } from "path";
795
804
  import { slash as slash4, uniq as uniq5 } from "@antfu/utils";
@@ -839,6 +848,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
839
848
  }
840
849
 
841
850
  // node/plugins/markdown.ts
851
+ init_esm_shims();
842
852
  import Markdown2 from "vite-plugin-md";
843
853
  import base64 from "js-base64";
844
854
  import { slash as slash5 } from "@antfu/utils";
@@ -848,6 +858,7 @@ import * as Shiki from "shiki";
848
858
  import { encode } from "plantuml-encoder";
849
859
 
850
860
  // node/plugins/markdown-it-katex.ts
861
+ init_esm_shims();
851
862
  import katex from "katex";
852
863
  function isValidDelim(state, pos) {
853
864
  const max = state.posMax;
@@ -994,6 +1005,7 @@ function math_plugin(md2, options) {
994
1005
  }
995
1006
 
996
1007
  // node/plugins/markdown-it-prism.ts
1008
+ init_esm_shims();
997
1009
  import Prism from "prismjs";
998
1010
  import loadLanguages from "prismjs/components/";
999
1011
  var DEFAULTS = {
@@ -1056,6 +1068,7 @@ function markdownItPrism(markdownit, useroptions) {
1056
1068
  }
1057
1069
 
1058
1070
  // node/plugins/markdown-it-shiki.ts
1071
+ init_esm_shims();
1059
1072
  function getThemeName(theme) {
1060
1073
  if (typeof theme === "string")
1061
1074
  return theme;
@@ -1123,7 +1136,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1123
1136
  } else {
1124
1137
  setups.push((md2) => md2.use(markdownItPrism));
1125
1138
  }
1126
- const KatexOptions2 = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
1139
+ const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
1127
1140
  return Markdown2(__spreadProps(__spreadValues({
1128
1141
  wrapperClasses: "",
1129
1142
  headEnabled: false,
@@ -1144,7 +1157,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1144
1157
  }
1145
1158
  });
1146
1159
  md2.use(mif);
1147
- md2.use(math_plugin, KatexOptions2);
1160
+ md2.use(math_plugin, KatexOptions);
1148
1161
  setups.forEach((i) => i(md2));
1149
1162
  (_a = mdOptions == null ? void 0 : mdOptions.markdownItSetup) == null ? void 0 : _a.call(mdOptions, md2);
1150
1163
  },
@@ -1265,6 +1278,7 @@ function escapeVueInCode(md2) {
1265
1278
  }
1266
1279
 
1267
1280
  // node/plugins/patchTransform.ts
1281
+ init_esm_shims();
1268
1282
  import { objectEntries } from "@antfu/utils";
1269
1283
  function createFixPlugins(options) {
1270
1284
  const define = objectEntries(getDefine(options));
@@ -1285,7 +1299,7 @@ function createFixPlugins(options) {
1285
1299
  }
1286
1300
 
1287
1301
  // node/plugins/preset.ts
1288
- var customElements = new Set([
1302
+ var customElements = /* @__PURE__ */ new Set([
1289
1303
  "annotation",
1290
1304
  "math",
1291
1305
  "mrow",