@slidev/cli 0.49.17 → 0.49.19

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.
package/bin/slidev.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict'
3
- import ('../dist/cli.mjs')
3
+ import ('../dist/cli.js')
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  getIndexHtml,
3
3
  resolveViteConfigs
4
- } from "./chunk-T42M3I2X.mjs";
5
- import "./chunk-27Q2X57X.mjs";
4
+ } from "./chunk-RLIDKN2L.js";
5
+ import "./chunk-6DS3IPOB.js";
6
+ import "./chunk-2BABGNMX.js";
7
+ import "./chunk-JSBRDJBE.js";
6
8
 
7
9
  // node/commands/build.ts
8
10
  import { resolve } from "node:path";
@@ -51,7 +53,7 @@ async function build(options, viteConfig = {}, args) {
51
53
  await fs.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
52
54
  `, "utf-8");
53
55
  if ([true, "true", "auto"].includes(options.data.config.download)) {
54
- const { exportSlides, getExportOptions } = await import("./export-ZRMOIVNM.mjs");
56
+ const { exportSlides, getExportOptions } = await import("./export-TPYQNCSS.js");
55
57
  const port = 12445;
56
58
  const app = connect();
57
59
  const server = http.createServer(app);
@@ -1,29 +1,3 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
- // If the importer is in node compatibility mode or this is not an ESM
20
- // file that has been converted to a CommonJS file using a Babel-
21
- // compatible transform (i.e. "__esModule" has not been set), then set
22
- // "default" to the CommonJS "module.exports" for node compatibility.
23
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
- mod
25
- ));
26
-
27
1
  // node/resolver.ts
28
2
  import { dirname, join, relative, resolve } from "node:path";
29
3
  import * as fs from "node:fs";
@@ -94,7 +68,7 @@ async function resolveEntry(entryRaw) {
94
68
  else
95
69
  process.exit(0);
96
70
  }
97
- return entry;
71
+ return slash(entry);
98
72
  }
99
73
  function createResolver(type, officials) {
100
74
  async function promptForInstallation(pkgName) {
@@ -206,8 +180,6 @@ async function getRoots(entry) {
206
180
  }
207
181
 
208
182
  export {
209
- __commonJS,
210
- __toESM,
211
183
  isInstalledGlobally,
212
184
  resolveImportUrl,
213
185
  toAtFS,
@@ -0,0 +1,31 @@
1
+ // node/syntax/transform/utils.ts
2
+ function normalizeRangeStr(rangeStr = "") {
3
+ return !rangeStr.trim() ? [] : rangeStr.trim().split(/\|/g).map((i) => i.trim());
4
+ }
5
+ function getCodeBlocks(md) {
6
+ const codeblocks = Array.from(md.matchAll(/^```[\s\S]*?^```/gm)).map((m) => {
7
+ const start = m.index;
8
+ const end = m.index + m[0].length;
9
+ const startLine = md.slice(0, start).match(/\n/g)?.length || 0;
10
+ const endLine = md.slice(0, end).match(/\n/g)?.length || 0;
11
+ return [start, end, startLine, endLine];
12
+ });
13
+ return {
14
+ codeblocks,
15
+ isInsideCodeblocks(idx) {
16
+ return codeblocks.some(([s, e]) => s <= idx && idx <= e);
17
+ },
18
+ isLineInsideCodeblocks(line) {
19
+ return codeblocks.some(([, , s, e]) => s <= line && line <= e);
20
+ }
21
+ };
22
+ }
23
+ function escapeVueInCode(md) {
24
+ return md.replace(/\{\{/g, "&lbrace;&lbrace;");
25
+ }
26
+
27
+ export {
28
+ normalizeRangeStr,
29
+ getCodeBlocks,
30
+ escapeVueInCode
31
+ };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  resolveViteConfigs
3
- } from "./chunk-T42M3I2X.mjs";
3
+ } from "./chunk-RLIDKN2L.js";
4
4
 
5
- // node/commands/server.ts
5
+ // node/commands/serve.ts
6
6
  import { join } from "node:path";
7
7
  import process from "node:process";
8
8
  import { createServer as createViteServer } from "vite";
@@ -0,0 +1,30 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ export {
28
+ __commonJS,
29
+ __toESM
30
+ };