@slidev/cli 0.28.2 → 0.28.6

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,48 +1,41 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml
4
- } from "./chunk-2E3KKOOJ.mjs";
4
+ } from "./chunk-GWFBEY26.mjs";
5
5
  import {
6
- __commonJS,
7
6
  __require,
8
7
  __spreadValues,
9
8
  __toModule,
10
9
  init_esm_shims
11
- } from "./chunk-OXQUV4ZP.mjs";
12
-
13
- // ../../node_modules/.pnpm/totalist@2.0.0/node_modules/totalist/sync/index.js
14
- var require_sync = __commonJS({
15
- "../../node_modules/.pnpm/totalist@2.0.0/node_modules/totalist/sync/index.js"(exports) {
16
- init_esm_shims();
17
- var { join: join3, resolve: resolve3 } = __require("path");
18
- var { readdirSync, statSync: statSync2 } = __require("fs");
19
- function totalist2(dir, callback, pre = "") {
20
- dir = resolve3(".", dir);
21
- let arr = readdirSync(dir);
22
- let i = 0, abs, stats;
23
- for (; i < arr.length; i++) {
24
- abs = join3(dir, arr[i]);
25
- stats = statSync2(abs);
26
- stats.isDirectory() ? totalist2(abs, callback, join3(pre, arr[i])) : callback(join3(pre, arr[i]), abs, stats);
27
- }
28
- }
29
- exports.totalist = totalist2;
30
- }
31
- });
10
+ } from "./chunk-4OPORETI.mjs";
32
11
 
33
12
  // node/build.ts
34
13
  init_esm_shims();
35
- import { join as join2, resolve as resolve2 } from "path";
14
+ import { join as join3, resolve as resolve3 } from "path";
36
15
  import http from "http";
37
16
  import fs2 from "fs-extra";
38
17
  import { mergeConfig, resolveConfig, build as viteBuild } from "vite";
39
18
  import connect from "connect";
40
19
 
41
- // ../../node_modules/.pnpm/sirv@2.0.0/node_modules/sirv/build.mjs
20
+ // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
42
21
  init_esm_shims();
43
- var import_sync = __toModule(require_sync());
44
22
  import * as fs from "fs";
45
- import { join, normalize, resolve } from "path";
23
+ import { join as join2, normalize, resolve as resolve2 } from "path";
24
+
25
+ // ../../node_modules/.pnpm/totalist@3.0.0/node_modules/totalist/sync/index.mjs
26
+ init_esm_shims();
27
+ import { join, resolve } from "path";
28
+ import { readdirSync, statSync } from "fs";
29
+ function totalist(dir, callback, pre = "") {
30
+ dir = resolve(".", dir);
31
+ let arr = readdirSync(dir);
32
+ let i = 0, abs, stats;
33
+ for (; i < arr.length; i++) {
34
+ abs = join(dir, arr[i]);
35
+ stats = statSync(abs);
36
+ stats.isDirectory() ? totalist(abs, callback, join(pre, arr[i])) : callback(join(pre, arr[i]), abs, stats);
37
+ }
38
+ }
46
39
 
47
40
  // ../../node_modules/.pnpm/@polka+url@1.0.0-next.20/node_modules/@polka/url/build.mjs
48
41
  init_esm_shims();
@@ -484,7 +477,7 @@ function lookup(extn) {
484
477
  return mimes[!~idx ? tmp : tmp.substring(++idx)];
485
478
  }
486
479
 
487
- // ../../node_modules/.pnpm/sirv@2.0.0/node_modules/sirv/build.mjs
480
+ // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
488
481
  var noop = () => {
489
482
  };
490
483
  function isMatch(uri, arr) {
@@ -518,7 +511,7 @@ function viaLocal(dir, isEtag, uri, extns) {
518
511
  let i = 0, arr = toAssume(uri, extns);
519
512
  let abs, stats, name, headers;
520
513
  for (; i < arr.length; i++) {
521
- abs = normalize(join(dir, name = arr[i]));
514
+ abs = normalize(join2(dir, name = arr[i]));
522
515
  if (abs.startsWith(dir) && fs.existsSync(abs)) {
523
516
  stats = fs.statSync(abs);
524
517
  if (stats.isDirectory())
@@ -581,7 +574,7 @@ function toHeaders(name, stats, isEtag) {
581
574
  return headers;
582
575
  }
583
576
  function build_default(dir, opts = {}) {
584
- dir = resolve(dir || ".");
577
+ dir = resolve2(dir || ".");
585
578
  let isNotFound = opts.onNoMatch || is404;
586
579
  let setHeaders = opts.setHeaders || noop;
587
580
  let extensions = opts.extensions || ["html", "htm"];
@@ -612,7 +605,7 @@ function build_default(dir, opts = {}) {
612
605
  else if (cc && opts.maxAge === 0)
613
606
  cc += ",must-revalidate";
614
607
  if (!opts.dev) {
615
- (0, import_sync.totalist)(dir, (name, abs, stats) => {
608
+ totalist(dir, (name, abs, stats) => {
616
609
  if (/\.well-known[\\+\/]/.test(name)) {
617
610
  } else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name))
618
611
  return;
@@ -656,7 +649,7 @@ function build_default(dir, opts = {}) {
656
649
  // node/build.ts
657
650
  import { blue, yellow } from "kolorist";
658
651
  async function build(options, viteConfig = {}) {
659
- const indexPath = resolve2(options.userRoot, "index.html");
652
+ const indexPath = resolve3(options.userRoot, "index.html");
660
653
  const rawConfig = await resolveConfig({}, "build");
661
654
  const pluginOptions = rawConfig.slidev || {};
662
655
  let originalIndexHTML;
@@ -686,10 +679,10 @@ async function build(options, viteConfig = {}) {
686
679
  } else {
687
680
  console.log(blue(" building for Monaco...\n"));
688
681
  await viteBuild(mergeConfig(inlineConfig, {
689
- root: join2(options.clientRoot, "iframes/monaco"),
682
+ root: join3(options.clientRoot, "iframes/monaco"),
690
683
  base: `${config.base}iframes/monaco/`,
691
684
  build: {
692
- outDir: resolve2(config.build.outDir, "iframes/monaco"),
685
+ outDir: resolve3(config.build.outDir, "iframes/monaco"),
693
686
  rollupOptions: {
694
687
  output: {
695
688
  manualChunks: {
@@ -711,13 +704,13 @@ async function build(options, viteConfig = {}) {
711
704
  else
712
705
  await fs2.unlink(indexPath);
713
706
  }
714
- await fs2.copyFile(resolve2(config.build.outDir, "index.html"), resolve2(config.build.outDir, "404.html"));
715
- const redirectsPath = resolve2(config.build.outDir, "_redirects");
707
+ await fs2.copyFile(resolve3(config.build.outDir, "index.html"), resolve3(config.build.outDir, "404.html"));
708
+ const redirectsPath = resolve3(config.build.outDir, "_redirects");
716
709
  if (!fs2.existsSync(redirectsPath))
717
710
  await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
718
711
  `, "utf-8");
719
712
  if ([true, "true", "auto"].includes(options.data.config.download)) {
720
- const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-33JV3JOZ.mjs")));
713
+ const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-AHT4YYMT.mjs")));
721
714
  const port = 12445;
722
715
  const app = connect();
723
716
  const server = http.createServer(app);
@@ -731,7 +724,7 @@ async function build(options, viteConfig = {}) {
731
724
  port,
732
725
  total: options.data.slides.length,
733
726
  format: "pdf",
734
- output: join2(config.build.outDir, "slidev-exported.pdf"),
727
+ output: join3(config.build.outDir, "slidev-exported.pdf"),
735
728
  base: config.base,
736
729
  dark: options.data.config.colorSchema === "dark",
737
730
  width: 1920,
@@ -1,51 +1,44 @@
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 _chunkINYQJTKAjs = require('./chunk-INYQJTKA.js');
4
+ var _chunkMFCJMLB5js = require('./chunk-MFCJMLB5.js');
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
-
11
- var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.js');
12
-
13
- // ../../node_modules/.pnpm/totalist@2.0.0/node_modules/totalist/sync/index.js
14
- var require_sync = _chunkBYTWGCY3js.__commonJS.call(void 0, {
15
- "../../node_modules/.pnpm/totalist@2.0.0/node_modules/totalist/sync/index.js"(exports) {
16
- _chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
17
- var { join: join3, resolve: resolve3 } = _chunkBYTWGCY3js.__require.call(void 0, "path");
18
- var { readdirSync, statSync: statSync2 } = _chunkBYTWGCY3js.__require.call(void 0, "fs");
19
- function totalist2(dir, callback, pre = "") {
20
- dir = resolve3(".", dir);
21
- let arr = readdirSync(dir);
22
- let i = 0, abs, stats;
23
- for (; i < arr.length; i++) {
24
- abs = join3(dir, arr[i]);
25
- stats = statSync2(abs);
26
- stats.isDirectory() ? totalist2(abs, callback, join3(pre, arr[i])) : callback(join3(pre, arr[i]), abs, stats);
27
- }
28
- }
29
- exports.totalist = totalist2;
30
- }
31
- });
10
+ var _chunkQT3EQ43Ajs = require('./chunk-QT3EQ43A.js');
32
11
 
33
12
  // node/build.ts
34
- _chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
13
+ _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
35
14
  var _path = require('path');
36
15
  var _http = require('http'); var _http2 = _interopRequireDefault(_http);
37
16
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
38
17
  var _vite = require('vite');
39
18
  var _connect = require('connect'); var _connect2 = _interopRequireDefault(_connect);
40
19
 
41
- // ../../node_modules/.pnpm/sirv@2.0.0/node_modules/sirv/build.mjs
42
- _chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
43
- var import_sync = _chunkBYTWGCY3js.__toModule.call(void 0, require_sync());
20
+ // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
21
+ _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
44
22
  var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
45
23
 
46
24
 
25
+ // ../../node_modules/.pnpm/totalist@3.0.0/node_modules/totalist/sync/index.mjs
26
+ _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
27
+
28
+
29
+ function totalist(dir, callback, pre = "") {
30
+ dir = _path.resolve.call(void 0, ".", dir);
31
+ let arr = _fs.readdirSync.call(void 0, dir);
32
+ let i = 0, abs, stats;
33
+ for (; i < arr.length; i++) {
34
+ abs = _path.join.call(void 0, dir, arr[i]);
35
+ stats = _fs.statSync.call(void 0, abs);
36
+ stats.isDirectory() ? totalist(abs, callback, _path.join.call(void 0, pre, arr[i])) : callback(_path.join.call(void 0, pre, arr[i]), abs, stats);
37
+ }
38
+ }
39
+
47
40
  // ../../node_modules/.pnpm/@polka+url@1.0.0-next.20/node_modules/@polka/url/build.mjs
48
- _chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
41
+ _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
49
42
  var _querystring = require('querystring'); var qs = _interopRequireWildcard(_querystring);
50
43
  function parse2(req) {
51
44
  let raw = req.url;
@@ -69,7 +62,7 @@ function parse2(req) {
69
62
  }
70
63
 
71
64
  // ../../node_modules/.pnpm/mrmime@1.0.0/node_modules/mrmime/index.mjs
72
- _chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
65
+ _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
73
66
  var mimes = {
74
67
  "ez": "application/andrew-inset",
75
68
  "aw": "application/applixware",
@@ -484,7 +477,7 @@ function lookup(extn) {
484
477
  return mimes[!~idx ? tmp : tmp.substring(++idx)];
485
478
  }
486
479
 
487
- // ../../node_modules/.pnpm/sirv@2.0.0/node_modules/sirv/build.mjs
480
+ // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
488
481
  var noop = () => {
489
482
  };
490
483
  function isMatch(uri, arr) {
@@ -534,7 +527,7 @@ function is404(req, res) {
534
527
  }
535
528
  function send(req, res, file, stats, headers) {
536
529
  let code = 200, tmp, opts = {};
537
- headers = _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, headers);
530
+ headers = _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, headers);
538
531
  for (let key in headers) {
539
532
  tmp = res.getHeader(key);
540
533
  if (tmp)
@@ -612,7 +605,7 @@ function build_default(dir, opts = {}) {
612
605
  else if (cc && opts.maxAge === 0)
613
606
  cc += ",must-revalidate";
614
607
  if (!opts.dev) {
615
- (0, import_sync.totalist)(dir, (name, abs, stats) => {
608
+ totalist(dir, (name, abs, stats) => {
616
609
  if (/\.well-known[\\+\/]/.test(name)) {
617
610
  } else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name))
618
611
  return;
@@ -662,12 +655,12 @@ async function build(options, viteConfig = {}) {
662
655
  let originalIndexHTML;
663
656
  if (_fsextra2.default.existsSync(indexPath))
664
657
  originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
665
- await _fsextra2.default.writeFile(indexPath, await _chunkINYQJTKAjs.getIndexHtml.call(void 0, options), "utf-8");
658
+ await _fsextra2.default.writeFile(indexPath, await _chunkMFCJMLB5js.getIndexHtml.call(void 0, options), "utf-8");
666
659
  let config = void 0;
667
660
  try {
668
661
  const inlineConfig = _vite.mergeConfig.call(void 0, viteConfig, {
669
662
  plugins: [
670
- await _chunkINYQJTKAjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
663
+ await _chunkMFCJMLB5js.ViteSlidevPlugin.call(void 0, options, pluginOptions),
671
664
  {
672
665
  name: "resolve-config",
673
666
  configResolved(_config) {
@@ -717,7 +710,7 @@ async function build(options, viteConfig = {}) {
717
710
  await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
718
711
  `, "utf-8");
719
712
  if ([true, "true", "auto"].includes(options.data.config.download)) {
720
- const { exportSlides } = await Promise.resolve().then(() => _chunkBYTWGCY3js.__toModule.call(void 0, _chunkBYTWGCY3js.__require.call(void 0, "./export-MW3OOGZI.js")));
713
+ const { exportSlides } = await Promise.resolve().then(() => _chunkQT3EQ43Ajs.__toModule.call(void 0, _chunkQT3EQ43Ajs.__require.call(void 0, "./export-UYHWHX2I.js")));
721
714
  const port = 12445;
722
715
  const app = _connect2.default.call(void 0, );
723
716
  const server = _http2.default.createServer(app);
@@ -52,12 +52,12 @@ var __toModule = (module) => {
52
52
  return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
53
53
  };
54
54
 
55
- // ../../node_modules/.pnpm/tsup@5.11.11_typescript@4.5.4/node_modules/tsup/assets/esm_shims.js
55
+ // ../../node_modules/.pnpm/tsup@5.11.13_typescript@4.5.5/node_modules/tsup/assets/esm_shims.js
56
56
  import { fileURLToPath } from "url";
57
57
  import path from "path";
58
58
  var getFilename, getDirname, __dirname, __filename;
59
59
  var init_esm_shims = __esm({
60
- "../../node_modules/.pnpm/tsup@5.11.11_typescript@4.5.4/node_modules/tsup/assets/esm_shims.js"() {
60
+ "../../node_modules/.pnpm/tsup@5.11.13_typescript@4.5.5/node_modules/tsup/assets/esm_shims.js"() {
61
61
  getFilename = () => fileURLToPath(import.meta.url);
62
62
  getDirname = () => path.dirname(getFilename());
63
63
  __dirname = /* @__PURE__ */ getDirname();