@slidev/cli 0.38.7 → 0.39.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.
@@ -2,15 +2,10 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-NOJBQ6MT.mjs";
6
- import {
7
- __require,
8
- __toESM,
9
- init_esm_shims
10
- } from "./chunk-T5WFA52O.mjs";
5
+ } from "./chunk-36C7XM4S.mjs";
6
+ import "./chunk-VLEV37KF.mjs";
11
7
 
12
8
  // node/build.ts
13
- init_esm_shims();
14
9
  import { join as join3, resolve as resolve3 } from "path";
15
10
  import http from "http";
16
11
  import fs2 from "fs-extra";
@@ -18,12 +13,10 @@ import { resolveConfig, build as viteBuild } from "vite";
18
13
  import connect from "connect";
19
14
 
20
15
  // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
21
- init_esm_shims();
22
16
  import * as fs from "fs";
23
17
  import { join as join2, normalize, resolve as resolve2 } from "path";
24
18
 
25
19
  // ../../node_modules/.pnpm/totalist@3.0.0/node_modules/totalist/sync/index.mjs
26
- init_esm_shims();
27
20
  import { join, resolve } from "path";
28
21
  import { readdirSync, statSync } from "fs";
29
22
  function totalist(dir, callback, pre = "") {
@@ -38,7 +31,6 @@ function totalist(dir, callback, pre = "") {
38
31
  }
39
32
 
40
33
  // ../../node_modules/.pnpm/@polka+url@1.0.0-next.21/node_modules/@polka/url/build.mjs
41
- init_esm_shims();
42
34
  import * as qs from "querystring";
43
35
  function parse2(req) {
44
36
  let raw = req.url;
@@ -62,7 +54,6 @@ function parse2(req) {
62
54
  }
63
55
 
64
56
  // ../../node_modules/.pnpm/mrmime@1.0.1/node_modules/mrmime/index.mjs
65
- init_esm_shims();
66
57
  var mimes = {
67
58
  "ez": "application/andrew-inset",
68
59
  "aw": "application/applixware",
@@ -724,7 +715,7 @@ async function build(options, viteConfig = {}, args) {
724
715
  await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
725
716
  `, "utf-8");
726
717
  if ([true, "true", "auto"].includes(options.data.config.download)) {
727
- const { exportSlides, getExportOptions } = await Promise.resolve().then(() => __toESM(__require("./export-LL3DLTJH.mjs")));
718
+ const { exportSlides, getExportOptions } = await import("./export-BAZ4BSV6.mjs");
728
719
  const port = 12445;
729
720
  const app = connect();
730
721
  const server = http.createServer(app);
@@ -2,15 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkHHR7Q56Zjs = require('./chunk-HHR7Q56Z.js');
6
-
7
-
8
-
9
-
10
- var _chunkOVFYMGU6js = require('./chunk-OVFYMGU6.js');
5
+ var _chunkDTAZRAWWjs = require('./chunk-DTAZRAWW.js');
6
+ require('./chunk-UJ5GHVII.js');
11
7
 
12
8
  // node/build.ts
13
- _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
14
9
  var _path = require('path');
15
10
  var _http = require('http'); var _http2 = _interopRequireDefault(_http);
16
11
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
@@ -18,12 +13,10 @@ var _vite = require('vite');
18
13
  var _connect = require('connect'); var _connect2 = _interopRequireDefault(_connect);
19
14
 
20
15
  // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
21
- _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
22
16
  var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
23
17
 
24
18
 
25
19
  // ../../node_modules/.pnpm/totalist@3.0.0/node_modules/totalist/sync/index.mjs
26
- _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
27
20
 
28
21
 
29
22
  function totalist(dir, callback, pre = "") {
@@ -38,7 +31,6 @@ function totalist(dir, callback, pre = "") {
38
31
  }
39
32
 
40
33
  // ../../node_modules/.pnpm/@polka+url@1.0.0-next.21/node_modules/@polka/url/build.mjs
41
- _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
42
34
  var _querystring = require('querystring'); var qs = _interopRequireWildcard(_querystring);
43
35
  function parse2(req) {
44
36
  let raw = req.url;
@@ -62,7 +54,6 @@ function parse2(req) {
62
54
  }
63
55
 
64
56
  // ../../node_modules/.pnpm/mrmime@1.0.1/node_modules/mrmime/index.mjs
65
- _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
66
57
  var mimes = {
67
58
  "ez": "application/andrew-inset",
68
59
  "aw": "application/applixware",
@@ -655,16 +646,16 @@ async function build(options, viteConfig = {}, args) {
655
646
  let originalIndexHTML;
656
647
  if (_fsextra2.default.existsSync(indexPath))
657
648
  originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
658
- await _fsextra2.default.writeFile(indexPath, await _chunkHHR7Q56Zjs.getIndexHtml.call(void 0, options), "utf-8");
649
+ await _fsextra2.default.writeFile(indexPath, await _chunkDTAZRAWWjs.getIndexHtml.call(void 0, options), "utf-8");
659
650
  let config = void 0;
660
651
  try {
661
- const inlineConfig = await _chunkHHR7Q56Zjs.mergeViteConfigs.call(void 0,
652
+ const inlineConfig = await _chunkDTAZRAWWjs.mergeViteConfigs.call(void 0,
662
653
  options,
663
654
  viteConfig,
664
655
  {
665
656
  root: options.userRoot,
666
657
  plugins: [
667
- await _chunkHHR7Q56Zjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
658
+ await _chunkDTAZRAWWjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
668
659
  {
669
660
  name: "resolve-config",
670
661
  configResolved(_config) {
@@ -685,7 +676,7 @@ async function build(options, viteConfig = {}, args) {
685
676
  } else {
686
677
  console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
687
678
  await _vite.build.call(void 0,
688
- await _chunkHHR7Q56Zjs.mergeViteConfigs.call(void 0,
679
+ await _chunkDTAZRAWWjs.mergeViteConfigs.call(void 0,
689
680
  options,
690
681
  inlineConfig,
691
682
  {
@@ -724,7 +715,7 @@ async function build(options, viteConfig = {}, args) {
724
715
  await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
725
716
  `, "utf-8");
726
717
  if ([true, "true", "auto"].includes(options.data.config.download)) {
727
- const { exportSlides, getExportOptions } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-BWNX2QVG.js")));
718
+ const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-BRPXINGP.js"));
728
719
  const port = 12445;
729
720
  const app = _connect2.default.call(void 0, );
730
721
  const server = _http2.default.createServer(app);
@@ -1,21 +1,18 @@
1
1
  import {
2
2
  __commonJS,
3
- __filename,
4
3
  __require,
5
4
  __toESM,
6
5
  generateGoogleFontsUrl,
7
- init_esm_shims,
8
6
  resolveGlobalImportPath,
9
7
  resolveImportPath,
10
8
  stringifyMarkdownTokens,
11
9
  toAtFS
12
- } from "./chunk-T5WFA52O.mjs";
10
+ } from "./chunk-VLEV37KF.mjs";
13
11
 
14
12
  // ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
15
13
  var require_fast_deep_equal = __commonJS({
16
14
  "../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
17
15
  "use strict";
18
- init_esm_shims();
19
16
  module.exports = function equal2(a, b) {
20
17
  if (a === b)
21
18
  return true;
@@ -58,7 +55,6 @@ var require_fast_deep_equal = __commonJS({
58
55
  });
59
56
 
60
57
  // node/common.ts
61
- init_esm_shims();
62
58
  import { existsSync, promises as fs } from "fs";
63
59
  import { join } from "path";
64
60
  import { uniq } from "@antfu/utils";
@@ -113,7 +109,6 @@ async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config,
113
109
  }
114
110
 
115
111
  // node/plugins/setupNode.ts
116
- init_esm_shims();
117
112
  import { resolve } from "path";
118
113
  import { pathExists } from "fs-extra";
119
114
  import { isObject } from "@antfu/utils";
@@ -146,14 +141,13 @@ async function loadSetups(roots, name, arg, initial, merge = true, accumulate) {
146
141
  }
147
142
 
148
143
  // node/plugins/windicss.ts
149
- init_esm_shims();
150
144
  import { dirname, resolve as resolve2 } from "path";
151
145
  import { existsSync as existsSync2 } from "fs";
152
146
  import { slash, uniq as uniq2 } from "@antfu/utils";
153
147
  import jiti2 from "jiti";
154
148
  async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
155
- const { default: WindiCSS } = await Promise.resolve().then(() => __toESM(__require("vite-plugin-windicss")));
156
- const { defaultConfigureFiles } = await Promise.resolve().then(() => __toESM(__require("@windicss/config")));
149
+ const { default: WindiCSS } = await import("vite-plugin-windicss");
150
+ const { defaultConfigureFiles } = await import("@windicss/config");
157
151
  const configFiles = uniq2([
158
152
  ...defaultConfigureFiles.map((i) => resolve2(userRoot, i)),
159
153
  ...themeRoots.map((i) => `${i}/windi.config.ts`),
@@ -202,7 +196,6 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
202
196
  }
203
197
 
204
198
  // node/plugins/preset.ts
205
- init_esm_shims();
206
199
  import { join as join8 } from "path";
207
200
  import Vue from "@vitejs/plugin-vue";
208
201
  import VueJsx from "@vitejs/plugin-vue-jsx";
@@ -215,7 +208,6 @@ import { notNullish as notNullish2 } from "@antfu/utils";
215
208
  import Inspect from "vite-plugin-inspect";
216
209
 
217
210
  // node/drawings.ts
218
- init_esm_shims();
219
211
  import { basename, dirname as dirname2, join as join2, resolve as resolve3 } from "path";
220
212
  import fs2 from "fs-extra";
221
213
  import fg from "fast-glob";
@@ -267,7 +259,6 @@ ${value}
267
259
  }
268
260
 
269
261
  // node/plugins/extendConfig.ts
270
- init_esm_shims();
271
262
  import { dirname as dirname4, join as join4 } from "path";
272
263
  import { mergeConfig as mergeConfig2 } from "vite";
273
264
  import isInstalledGlobally from "is-installed-globally";
@@ -278,11 +269,11 @@ var dependencies = {
278
269
  "@antfu/utils": "^0.7.2",
279
270
  "@slidev/parser": "workspace:*",
280
271
  "@slidev/types": "workspace:*",
281
- "@unocss/reset": "^0.48.4",
272
+ "@unocss/reset": "^0.49.1",
282
273
  "@vueuse/core": "^9.11.1",
283
274
  "@vueuse/head": "^1.0.23",
284
275
  "@vueuse/math": "^9.11.1",
285
- "@vueuse/motion": "^2.0.0-beta.26",
276
+ "@vueuse/motion": "^2.0.0-beta.27",
286
277
  codemirror: "^5.65.5",
287
278
  defu: "^6.1.2",
288
279
  drauu: "^0.3.2",
@@ -296,7 +287,7 @@ var dependencies = {
296
287
  prettier: "^2.8.3",
297
288
  recordrtc: "^5.6.2",
298
289
  resolve: "^1.22.1",
299
- unocss: "^0.48.4",
290
+ unocss: "^0.49.1",
300
291
  "vite-plugin-windicss": "^1.8.10",
301
292
  vue: "^3.2.45",
302
293
  "vue-router": "^4.1.6",
@@ -305,7 +296,6 @@ var dependencies = {
305
296
  };
306
297
 
307
298
  // node/vite/searchRoot.ts
308
- init_esm_shims();
309
299
  import fs3 from "fs";
310
300
  import { dirname as dirname3, join as join3 } from "path";
311
301
  var ROOT_FILES = [
@@ -396,7 +386,7 @@ function createConfigPlugin(options) {
396
386
  css: options.data.config.css === "unocss" ? {
397
387
  postcss: {
398
388
  plugins: [
399
- await Promise.resolve().then(() => __toESM(__require("postcss-nested"))).then((r) => r.default())
389
+ await import("postcss-nested").then((r) => (r.default || r)())
400
390
  ]
401
391
  }
402
392
  } : {},
@@ -448,7 +438,6 @@ function getDefine(options) {
448
438
  }
449
439
 
450
440
  // node/plugins/loaders.ts
451
- init_esm_shims();
452
441
  var import_fast_deep_equal = __toESM(require_fast_deep_equal());
453
442
  import { basename as basename2, join as join5 } from "path";
454
443
  import { isString, notNullish, objectMap, range, slash as slash2, uniq as uniq4 } from "@antfu/utils";
@@ -824,7 +813,8 @@ defineProps<{ no: number | string }>()`);
824
813
  const imports = [
825
814
  `import "${toAtFS(join5(clientRoot, "styles/vars.css"))}"`,
826
815
  `import "${toAtFS(join5(clientRoot, "styles/index.css"))}"`,
827
- `import "${toAtFS(join5(clientRoot, "styles/code.css"))}"`
816
+ `import "${toAtFS(join5(clientRoot, "styles/code.css"))}"`,
817
+ `import "${toAtFS(join5(clientRoot, "styles/transitions.css"))}"`
828
818
  ];
829
819
  const roots2 = uniq4([
830
820
  ...themeRoots,
@@ -980,7 +970,6 @@ export default {
980
970
  }
981
971
 
982
972
  // node/plugins/monacoTransform.ts
983
- init_esm_shims();
984
973
  import { join as join6 } from "path";
985
974
  import { slash as slash3 } from "@antfu/utils";
986
975
  function createMonacoTypesLoader() {
@@ -995,7 +984,7 @@ function createMonacoTypesLoader() {
995
984
  const match = id.match(/^\/\@slidev-monaco-types\/(.*)$/);
996
985
  if (match) {
997
986
  const pkg = match[1];
998
- const { resolvePackageData } = await Promise.resolve().then(() => __toESM(__require("vite")));
987
+ const { resolvePackageData } = await import("vite");
999
988
  const info = resolvePackageData(pkg, process.cwd());
1000
989
  if (!info)
1001
990
  return;
@@ -1014,7 +1003,6 @@ function createMonacoTypesLoader() {
1014
1003
  }
1015
1004
 
1016
1005
  // node/plugins/setupClient.ts
1017
- init_esm_shims();
1018
1006
  import { existsSync as existsSync4 } from "fs";
1019
1007
  import { join as join7, resolve as resolve4 } from "path";
1020
1008
  import { slash as slash4, uniq as uniq5 } from "@antfu/utils";
@@ -1071,7 +1059,6 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
1071
1059
  }
1072
1060
 
1073
1061
  // node/plugins/markdown.ts
1074
- init_esm_shims();
1075
1062
  import Markdown2 from "vite-plugin-vue-markdown";
1076
1063
  import * as base64 from "js-base64";
1077
1064
  import { slash as slash5 } from "@antfu/utils";
@@ -1082,7 +1069,6 @@ import * as Shiki from "shiki";
1082
1069
  import { encode as encode2 } from "plantuml-encoder";
1083
1070
 
1084
1071
  // node/plugins/markdown-it-katex.ts
1085
- init_esm_shims();
1086
1072
  import katex from "katex";
1087
1073
  function isValidDelim(state, pos) {
1088
1074
  const max = state.posMax;
@@ -1229,7 +1215,6 @@ function math_plugin(md2, options) {
1229
1215
  }
1230
1216
 
1231
1217
  // node/plugins/markdown-it-prism.ts
1232
- init_esm_shims();
1233
1218
  import Prism from "prismjs";
1234
1219
  import loadLanguages from "prismjs/components/";
1235
1220
  var DEFAULTS = {
@@ -1292,7 +1277,6 @@ function markdownItPrism(markdownit, useroptions) {
1292
1277
  }
1293
1278
 
1294
1279
  // node/plugins/markdown-it-shiki.ts
1295
- init_esm_shims();
1296
1280
  function getThemeName(theme) {
1297
1281
  if (typeof theme === "string")
1298
1282
  return theme;
@@ -1358,7 +1342,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1358
1342
  const setups = [];
1359
1343
  const entryPath = slash5(entry);
1360
1344
  if (config.highlighter === "shiki") {
1361
- const { getHighlighter } = await Promise.resolve().then(() => __toESM(__require("shiki")));
1345
+ const { getHighlighter } = await import("shiki");
1362
1346
  const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
1363
1347
  const { langs, themes } = resolveShikiOptions(shikiOptions);
1364
1348
  shikiOptions.highlighter = await getHighlighter({ themes, langs });
@@ -1512,7 +1496,6 @@ function escapeVueInCode(md2) {
1512
1496
  }
1513
1497
 
1514
1498
  // node/plugins/patchTransform.ts
1515
- init_esm_shims();
1516
1499
  import { objectEntries } from "@antfu/utils";
1517
1500
  function createFixPlugins(options) {
1518
1501
  const define = objectEntries(getDefine(options));
@@ -1535,18 +1518,22 @@ function createFixPlugins(options) {
1535
1518
  }
1536
1519
 
1537
1520
  // node/plugins/unocss.ts
1538
- init_esm_shims();
1539
1521
  import { resolve as resolve5 } from "path";
1540
1522
  import { existsSync as existsSync5 } from "fs";
1541
1523
  import { deepMerge as deepMerge2, uniq as uniq6 } from "@antfu/utils";
1542
1524
  import jiti3 from "jiti";
1543
- async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, data }, { unocss: unoOptions }) {
1525
+ async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, userRoot, data }, { unocss: unoOptions }) {
1544
1526
  var _a, _b, _c, _d;
1545
- const UnoCSS = await Promise.resolve().then(() => __toESM(__require("unocss/vite"))).then((r) => r.default);
1527
+ const UnoCSS = await import("unocss/vite").then((r) => r.default);
1546
1528
  const configFiles = uniq6([
1529
+ resolve5(userRoot, "uno.config.ts"),
1530
+ resolve5(userRoot, "unocss.config.ts"),
1547
1531
  ...themeRoots.map((i) => `${i}/uno.config.ts`),
1532
+ ...themeRoots.map((i) => `${i}/unocss.config.ts`),
1548
1533
  ...addonRoots.map((i) => `${i}/uno.config.ts`),
1549
- resolve5(clientRoot, "uno.config.ts")
1534
+ ...addonRoots.map((i) => `${i}/unocss.config.ts`),
1535
+ resolve5(clientRoot, "uno.config.ts"),
1536
+ resolve5(clientRoot, "unocss.config.ts")
1550
1537
  ]);
1551
1538
  const configFile = configFiles.find((i) => existsSync5(i));
1552
1539
  let config = jiti3(__filename)(configFile);
@@ -1685,7 +1672,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1685
1672
  if (!options.data.config.drawings.persist)
1686
1673
  return;
1687
1674
  if (key === "drawings")
1688
- writeDrawings(options, patch != null ? patch : data);
1675
+ writeDrawings(options, patch ?? data);
1689
1676
  }
1690
1677
  }),
1691
1678
  createConfigPlugin(options),