@slidev/cli 0.30.2 → 0.31.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.
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
3
 
4
- var _chunkRSHUQSN4js = require('./chunk-RSHUQSN4.js');
4
+ var _chunkN6ENRMDMjs = require('./chunk-N6ENRMDM.js');
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunkIXNT7VMKjs = require('./chunk-IXNT7VMK.js');
10
+ var _chunkOVW2G2MHjs = require('./chunk-OVW2G2MH.js');
11
11
 
12
12
  // node/build.ts
13
- _chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
13
+ _chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
14
14
  var _path = require('path');
15
15
  var _http = require('http'); var _http2 = _interopRequireDefault(_http);
16
16
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
@@ -18,12 +18,12 @@ var _vite = require('vite');
18
18
  var _connect = require('connect'); var _connect2 = _interopRequireDefault(_connect);
19
19
 
20
20
  // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
21
- _chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
21
+ _chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
22
22
  var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
23
23
 
24
24
 
25
25
  // ../../node_modules/.pnpm/totalist@3.0.0/node_modules/totalist/sync/index.mjs
26
- _chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
26
+ _chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
27
27
 
28
28
 
29
29
  function totalist(dir, callback, pre = "") {
@@ -38,7 +38,7 @@ function totalist(dir, callback, pre = "") {
38
38
  }
39
39
 
40
40
  // ../../node_modules/.pnpm/@polka+url@1.0.0-next.21/node_modules/@polka/url/build.mjs
41
- _chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
41
+ _chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
42
42
  var _querystring = require('querystring'); var qs = _interopRequireWildcard(_querystring);
43
43
  function parse2(req) {
44
44
  let raw = req.url;
@@ -62,7 +62,7 @@ function parse2(req) {
62
62
  }
63
63
 
64
64
  // ../../node_modules/.pnpm/mrmime@1.0.0/node_modules/mrmime/index.mjs
65
- _chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
65
+ _chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
66
66
  var mimes = {
67
67
  "ez": "application/andrew-inset",
68
68
  "aw": "application/applixware",
@@ -527,7 +527,7 @@ function is404(req, res) {
527
527
  }
528
528
  function send(req, res, file, stats, headers) {
529
529
  let code = 200, tmp, opts = {};
530
- headers = _chunkIXNT7VMKjs.__spreadValues.call(void 0, {}, headers);
530
+ headers = _chunkOVW2G2MHjs.__spreadValues.call(void 0, {}, headers);
531
531
  for (let key in headers) {
532
532
  tmp = res.getHeader(key);
533
533
  if (tmp)
@@ -655,13 +655,13 @@ async function build(options, viteConfig = {}) {
655
655
  let originalIndexHTML;
656
656
  if (_fsextra2.default.existsSync(indexPath))
657
657
  originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
658
- await _fsextra2.default.writeFile(indexPath, await _chunkRSHUQSN4js.getIndexHtml.call(void 0, options), "utf-8");
658
+ await _fsextra2.default.writeFile(indexPath, await _chunkN6ENRMDMjs.getIndexHtml.call(void 0, options), "utf-8");
659
659
  let config = void 0;
660
660
  try {
661
661
  const inlineConfig = _vite.mergeConfig.call(void 0, viteConfig, {
662
662
  root: options.userRoot,
663
663
  plugins: [
664
- await _chunkRSHUQSN4js.ViteSlidevPlugin.call(void 0, options, pluginOptions),
664
+ await _chunkN6ENRMDMjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
665
665
  {
666
666
  name: "resolve-config",
667
667
  configResolved(_config) {
@@ -713,7 +713,7 @@ async function build(options, viteConfig = {}) {
713
713
  await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
714
714
  `, "utf-8");
715
715
  if ([true, "true", "auto"].includes(options.data.config.download)) {
716
- const { exportSlides } = await Promise.resolve().then(() => _chunkIXNT7VMKjs.__toESM.call(void 0, _chunkIXNT7VMKjs.__require.call(void 0, "./export-AKEY52VC.js")));
716
+ const { exportSlides } = await Promise.resolve().then(() => _chunkOVW2G2MHjs.__toESM.call(void 0, _chunkOVW2G2MHjs.__require.call(void 0, "./export-JHHUB6BA.js")));
717
717
  const port = 12445;
718
718
  const app = _connect2.default.call(void 0, );
719
719
  const server = _http2.default.createServer(app);
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml
4
- } from "./chunk-MBZTOLHN.mjs";
4
+ } from "./chunk-55JD2XFU.mjs";
5
5
  import {
6
6
  __require,
7
7
  __spreadValues,
8
8
  __toESM,
9
9
  init_esm_shims
10
- } from "./chunk-XMETW2MS.mjs";
10
+ } from "./chunk-D6ZT4BYV.mjs";
11
11
 
12
12
  // node/build.ts
13
13
  init_esm_shims();
@@ -713,7 +713,7 @@ async function build(options, viteConfig = {}) {
713
713
  await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
714
714
  `, "utf-8");
715
715
  if ([true, "true", "auto"].includes(options.data.config.download)) {
716
- const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-RFCVIBYE.mjs")));
716
+ const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-HA4VXV3M.mjs")));
717
717
  const port = 12445;
718
718
  const app = connect();
719
719
  const server = http.createServer(app);
@@ -11,7 +11,7 @@ import {
11
11
  resolveImportPath,
12
12
  stringifyMarkdownTokens,
13
13
  toAtFS
14
- } from "./chunk-XMETW2MS.mjs";
14
+ } from "./chunk-D6ZT4BYV.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({
@@ -243,26 +243,26 @@ var dependencies = {
243
243
  "@antfu/utils": "^0.5.1",
244
244
  "@slidev/parser": "workspace:*",
245
245
  "@slidev/types": "workspace:*",
246
- "@vueuse/core": "^8.2.5",
247
- "@vueuse/head": "^0.7.5",
246
+ "@vueuse/core": "^8.4.2",
247
+ "@vueuse/head": "^0.7.6",
248
248
  "@vueuse/motion": "^2.0.0-beta.18",
249
- codemirror: "^5.65.2",
249
+ codemirror: "^5.65.3",
250
250
  defu: "^6.0.0",
251
251
  drauu: "^0.3.0",
252
252
  "file-saver": "^2.0.5",
253
253
  "js-base64": "^3.7.2",
254
254
  "js-yaml": "^4.1.0",
255
255
  katex: "^0.15.3",
256
- mermaid: "^9.0.0",
256
+ mermaid: "^9.0.1",
257
257
  "monaco-editor": "^0.33.0",
258
- nanoid: "^3.3.2",
258
+ nanoid: "^3.3.4",
259
259
  prettier: "^2.6.2",
260
260
  recordrtc: "^5.6.2",
261
261
  resolve: "^1.22.0",
262
262
  "vite-plugin-windicss": "^1.8.4",
263
- vue: "^3.2.32",
264
- "vue-router": "^4.0.14",
265
- "vue-starport": "^0.2.4",
263
+ vue: "^3.2.33",
264
+ "vue-router": "^4.0.15",
265
+ "vue-starport": "^0.2.10",
266
266
  windicss: "^3.5.1"
267
267
  };
268
268
 
@@ -388,6 +388,7 @@ function getDefine(options) {
388
388
  __SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
389
389
  __SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
390
390
  __SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
391
+ __SLIDEV_FEATURE_RECORD__: JSON.stringify(options.data.config.record === true || options.data.config.record === options.mode),
391
392
  __DEV__: options.mode === "dev" ? "true" : "false"
392
393
  };
393
394
  }
@@ -796,7 +797,7 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
796
797
  let no = 1;
797
798
  const routes = [
798
799
  ...data.slides.map((i, idx) => {
799
- var _a, _b;
800
+ var _a, _b, _c, _d;
800
801
  if ((_a = i.frontmatter) == null ? void 0 : _a.disabled)
801
802
  return void 0;
802
803
  imports.push(`import n${no} from '${slidePrefix}${idx + 1}.md'`);
@@ -816,9 +817,10 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
816
817
  };
817
818
  const meta = Object.assign({}, i.frontmatter, additions);
818
819
  const route = `{ path: '${no}', name: 'page-${no}', component: n${no}, meta: ${JSON.stringify(meta)} }`;
820
+ const redirect = ((_c = i.frontmatter) == null ? void 0 : _c.routeAlias) ? `{ path: '${(_d = i.frontmatter) == null ? void 0 : _d.routeAlias}', redirect: { path: '${no}' } }` : null;
819
821
  no += 1;
820
- return route;
821
- }).filter(notNullish),
822
+ return [route, redirect];
823
+ }).flat().filter(notNullish),
822
824
  `{ path: "${no}", component: __layout__end, meta: { layout: "end" } }`
823
825
  ];
824
826
  const routesStr = `export default [
@@ -28,6 +28,18 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
28
28
  return require.apply(this, arguments);
29
29
  throw new Error('Dynamic require of "' + x + '" is not supported');
30
30
  });
31
+ var __objRest = (source, exclude) => {
32
+ var target = {};
33
+ for (var prop in source)
34
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
35
+ target[prop] = source[prop];
36
+ if (source != null && __getOwnPropSymbols)
37
+ for (var prop of __getOwnPropSymbols(source)) {
38
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
39
+ target[prop] = source[prop];
40
+ }
41
+ return target;
42
+ };
31
43
  var __esm = (fn, res) => function __init() {
32
44
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
33
45
  };
@@ -47,13 +59,41 @@ var __copyProps = (to, from, except, desc) => {
47
59
  return to;
48
60
  };
49
61
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
62
+ var __accessCheck = (obj, member, msg) => {
63
+ if (!member.has(obj))
64
+ throw TypeError("Cannot " + msg);
65
+ };
66
+ var __privateGet = (obj, member, getter) => {
67
+ __accessCheck(obj, member, "read from private field");
68
+ return getter ? getter.call(obj) : member.get(obj);
69
+ };
70
+ var __privateAdd = (obj, member, value) => {
71
+ if (member.has(obj))
72
+ throw TypeError("Cannot add the same private member more than once");
73
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
74
+ };
75
+ var __privateSet = (obj, member, value, setter) => {
76
+ __accessCheck(obj, member, "write to private field");
77
+ setter ? setter.call(obj, value) : member.set(obj, value);
78
+ return value;
79
+ };
80
+ var __privateWrapper = (obj, member, setter, getter) => {
81
+ return {
82
+ set _(value) {
83
+ __privateSet(obj, member, value, setter);
84
+ },
85
+ get _() {
86
+ return __privateGet(obj, member, getter);
87
+ }
88
+ };
89
+ };
50
90
 
51
- // ../../node_modules/.pnpm/tsup@5.12.5_typescript@4.6.3/node_modules/tsup/assets/esm_shims.js
91
+ // ../../node_modules/.pnpm/tsup@5.12.5_typescript@4.6.4/node_modules/tsup/assets/esm_shims.js
52
92
  import { fileURLToPath } from "url";
53
93
  import path from "path";
54
94
  var getFilename, getDirname, __dirname, __filename;
55
95
  var init_esm_shims = __esm({
56
- "../../node_modules/.pnpm/tsup@5.12.5_typescript@4.6.3/node_modules/tsup/assets/esm_shims.js"() {
96
+ "../../node_modules/.pnpm/tsup@5.12.5_typescript@4.6.4/node_modules/tsup/assets/esm_shims.js"() {
57
97
  getFilename = () => fileURLToPath(import.meta.url);
58
98
  getDirname = () => path.dirname(getFilename());
59
99
  __dirname = /* @__PURE__ */ getDirname();
@@ -123,9 +163,14 @@ export {
123
163
  __spreadValues,
124
164
  __spreadProps,
125
165
  __require,
166
+ __objRest,
126
167
  __commonJS,
127
168
  __export,
128
169
  __toESM,
170
+ __privateGet,
171
+ __privateAdd,
172
+ __privateSet,
173
+ __privateWrapper,
129
174
  __dirname,
130
175
  __filename,
131
176
  init_esm_shims,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ViteSlidevPlugin
3
- } from "./chunk-MBZTOLHN.mjs";
3
+ } from "./chunk-55JD2XFU.mjs";
4
4
  import {
5
5
  init_esm_shims
6
- } from "./chunk-XMETW2MS.mjs";
6
+ } from "./chunk-D6ZT4BYV.mjs";
7
7
 
8
8
  // node/server.ts
9
9
  init_esm_shims();