@slidev/cli 0.31.3 → 0.32.2

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.
@@ -46,10 +46,6 @@ var __esm = (fn, res) => function __init() {
46
46
  var __commonJS = (cb, mod) => function __require2() {
47
47
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
48
48
  };
49
- var __export = (target, all) => {
50
- for (var name in all)
51
- __defProp(target, name, { get: all[name], enumerable: true });
52
- };
53
49
  var __copyProps = (to, from, except, desc) => {
54
50
  if (from && typeof from === "object" || typeof from === "function") {
55
51
  for (let key of __getOwnPropNames(from))
@@ -158,6 +154,11 @@ function generateGoogleFontsUrl(options) {
158
154
  const fonts = options.webfonts.map((i) => `family=${i.replace(/^(['"])(.*)\1$/, "$1").replace(/\s+/g, "+")}:${options.italic ? "ital," : ""}wght@${weights}`).join("&");
159
155
  return `https://fonts.googleapis.com/css2?${fonts}&display=swap`;
160
156
  }
157
+ function packageExists(name) {
158
+ if (resolveImportPath(`${name}/package.json`))
159
+ return true;
160
+ return false;
161
+ }
161
162
 
162
163
  export {
163
164
  __spreadValues,
@@ -165,7 +166,6 @@ export {
165
166
  __require,
166
167
  __objRest,
167
168
  __commonJS,
168
- __export,
169
169
  __toESM,
170
170
  __privateGet,
171
171
  __privateAdd,
@@ -178,5 +178,6 @@ export {
178
178
  resolveImportPath,
179
179
  resolveGlobalImportPath,
180
180
  stringifyMarkdownTokens,
181
- generateGoogleFontsUrl
181
+ generateGoogleFontsUrl,
182
+ packageExists
182
183
  };
@@ -11,7 +11,7 @@ import {
11
11
  resolveImportPath,
12
12
  stringifyMarkdownTokens,
13
13
  toAtFS
14
- } from "./chunk-D6ZT4BYV.mjs";
14
+ } from "./chunk-NOFZO6W4.mjs";
15
15
 
16
16
  // ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
17
17
  var require_fast_deep_equal = __commonJS({
@@ -135,10 +135,11 @@ async function loadSetups(roots, name, arg, initial, merge = true) {
135
135
  }
136
136
 
137
137
  // node/plugins/windicss.ts
138
- async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
138
+ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
139
139
  const configFiles = uniq2([
140
140
  ...defaultConfigureFiles.map((i) => resolve2(userRoot, i)),
141
141
  ...themeRoots.map((i) => `${i}/windi.config.ts`),
142
+ ...addonRoots.map((i) => `${i}/windi.config.ts`),
142
143
  resolve2(clientRoot, "windi.config.ts")
143
144
  ]);
144
145
  const configFile = configFiles.find((i) => existsSync3(i));
@@ -167,6 +168,10 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
167
168
  config2.scanOptions.include.push(`${i}/components/*.{vue,ts}`);
168
169
  config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
169
170
  });
171
+ addonRoots.forEach((i) => {
172
+ config2.scanOptions.include.push(`${i}/components/*.{vue,ts}`);
173
+ config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
174
+ });
170
175
  config2.scanOptions.include.push(`!${slash(resolve2(userRoot, "node_modules"))}`);
171
176
  config2.scanOptions.exclude.push(dirname(resolveImportPath("monaco-editor/package.json", true)));
172
177
  config2.scanOptions.exclude.push(dirname(resolveImportPath("katex/package.json", true)));
@@ -240,30 +245,30 @@ import { uniq as uniq3 } from "@antfu/utils";
240
245
 
241
246
  // ../client/package.json
242
247
  var dependencies = {
243
- "@antfu/utils": "^0.5.1",
248
+ "@antfu/utils": "^0.5.2",
244
249
  "@slidev/parser": "workspace:*",
245
250
  "@slidev/types": "workspace:*",
246
- "@vueuse/core": "^8.4.2",
251
+ "@vueuse/core": "^8.5.0",
247
252
  "@vueuse/head": "^0.7.6",
248
253
  "@vueuse/motion": "^2.0.0-beta.18",
249
- codemirror: "^5.65.3",
254
+ codemirror: "^5.65.4",
250
255
  defu: "^6.0.0",
251
256
  drauu: "^0.3.0",
252
257
  "file-saver": "^2.0.5",
253
258
  "js-base64": "^3.7.2",
254
259
  "js-yaml": "^4.1.0",
255
- katex: "^0.15.3",
256
- mermaid: "^9.0.1",
260
+ katex: "^0.15.6",
261
+ mermaid: "^9.1.1",
257
262
  "monaco-editor": "^0.33.0",
258
263
  nanoid: "^3.3.4",
259
264
  prettier: "^2.6.2",
260
265
  recordrtc: "^5.6.2",
261
266
  resolve: "^1.22.0",
262
267
  "vite-plugin-windicss": "^1.8.4",
263
- vue: "^3.2.33",
268
+ vue: "^3.2.35",
264
269
  "vue-router": "^4.0.15",
265
270
  "vue-starport": "^0.2.10",
266
- windicss: "^3.5.1"
271
+ windicss: "^3.5.4"
267
272
  };
268
273
 
269
274
  // node/vite/searchRoot.ts
@@ -431,7 +436,7 @@ function prepareSlideInfo(data) {
431
436
  notesHTML: md.render((data == null ? void 0 : data.note) || "")
432
437
  });
433
438
  }
434
- function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
439
+ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, userRoot, roots, remote }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
435
440
  const slidePrefix = "/@slidev/slides/";
436
441
  const hmrPages = /* @__PURE__ */ new Set();
437
442
  let server;
@@ -676,7 +681,7 @@ ${code.slice(injectB)}`;
676
681
  ${imports.join("\n")}
677
682
  `);
678
683
  } else if (matchScript && !matchScript[2]) {
679
- const matchExport = code.match(/export\s+default\s+[^{]*{/);
684
+ const matchExport = code.match(/export\s+default\s+{/);
680
685
  if (matchExport) {
681
686
  const exportIndex = (matchExport.index || 0) + matchExport[0].length;
682
687
  let component = code.slice(exportIndex);
@@ -725,6 +730,7 @@ defineProps<{ no: number | string }>()`);
725
730
  const roots2 = uniq4([
726
731
  userRoot,
727
732
  ...themeRoots,
733
+ ...addonRoots,
728
734
  clientRoot
729
735
  ]);
730
736
  for (const root of roots2) {
@@ -751,6 +757,7 @@ defineProps<{ no: number | string }>()`);
751
757
  ];
752
758
  const roots2 = uniq4([
753
759
  ...themeRoots,
760
+ ...addonRoots,
754
761
  userRoot
755
762
  ]);
756
763
  for (const root of roots2) {
@@ -827,7 +834,7 @@ ${routes.join(",\n")}
827
834
  return [...imports, routesStr].join("\n");
828
835
  }
829
836
  function generateConfigs() {
830
- const config = __spreadValues({}, data.config);
837
+ const config = __spreadProps(__spreadValues({}, data.config), { remote });
831
838
  if (isString(config.title)) {
832
839
  const tokens = md.parseInline(config.title, {});
833
840
  config.title = stringifyMarkdownTokens(tokens);
@@ -923,7 +930,7 @@ init_esm_shims();
923
930
  import { existsSync as existsSync5 } from "fs";
924
931
  import { join as join7, resolve as resolve4 } from "path";
925
932
  import { slash as slash4, uniq as uniq5 } from "@antfu/utils";
926
- function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
933
+ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot }) {
927
934
  const setupEntry = slash4(resolve4(clientRoot, "setup"));
928
935
  return {
929
936
  name: "slidev:setup",
@@ -936,6 +943,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
936
943
  const asyncInjections = [];
937
944
  const setups = uniq5([
938
945
  ...themeRoots,
946
+ ...addonRoots,
939
947
  userRoot
940
948
  ]).map((i) => join7(i, "setup", name));
941
949
  setups.forEach((path, idx) => {
@@ -1459,6 +1467,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1459
1467
  const {
1460
1468
  mode,
1461
1469
  themeRoots,
1470
+ addonRoots,
1462
1471
  clientRoot,
1463
1472
  data: { config }
1464
1473
  } = options;
@@ -1486,6 +1495,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1486
1495
  `${clientRoot}/builtin`,
1487
1496
  `${clientRoot}/components`,
1488
1497
  ...themeRoots.map((i) => `${i}/components`),
1498
+ ...addonRoots.map((i) => `${i}/components`),
1489
1499
  "src/components",
1490
1500
  "components"
1491
1501
  ],