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