@slidev/cli 0.48.0-beta.13 → 0.48.0-beta.15
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.
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
mergeViteConfigs,
|
|
5
5
|
require_semver,
|
|
6
6
|
version
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HHZ7SVZP.mjs";
|
|
8
8
|
import {
|
|
9
9
|
createResolver,
|
|
10
10
|
getRoots,
|
|
@@ -107,7 +107,7 @@ var debug = _debug("slidev:options");
|
|
|
107
107
|
async function resolveOptions(options, mode) {
|
|
108
108
|
const rootsInfo = await getRoots();
|
|
109
109
|
const entry = await resolveEntry(options.entry || "slides.md", rootsInfo);
|
|
110
|
-
const loaded = await parser.load(rootsInfo.userRoot, entry);
|
|
110
|
+
const loaded = await parser.load(rootsInfo.userRoot, entry, void 0, mode);
|
|
111
111
|
const themeRaw = options.theme || loaded.headmatter.theme || "default";
|
|
112
112
|
const [theme, themeRoot] = await resolveTheme(themeRaw, entry);
|
|
113
113
|
const themeRoots = themeRoot ? [themeRoot] : [];
|
|
@@ -2496,7 +2496,7 @@ var require_semver2 = __commonJS({
|
|
|
2496
2496
|
});
|
|
2497
2497
|
|
|
2498
2498
|
// package.json
|
|
2499
|
-
var version = "0.48.0-beta.
|
|
2499
|
+
var version = "0.48.0-beta.15";
|
|
2500
2500
|
|
|
2501
2501
|
// node/common.ts
|
|
2502
2502
|
import { existsSync, promises as fs } from "node:fs";
|
|
@@ -3446,11 +3446,7 @@ function createClientSetupPlugin({ themeRoots, addonRoots, userRoot, clientRoot
|
|
|
3446
3446
|
// node/plugins/markdown.ts
|
|
3447
3447
|
import fs6 from "node:fs/promises";
|
|
3448
3448
|
import Markdown2 from "unplugin-vue-markdown/vite";
|
|
3449
|
-
import * as base64 from "js-base64";
|
|
3450
3449
|
import { slash as slash3 } from "@antfu/utils";
|
|
3451
|
-
import { hash as getHash } from "ohash";
|
|
3452
|
-
import mila2 from "markdown-it-link-attributes";
|
|
3453
|
-
import mif from "markdown-it-footnote";
|
|
3454
3450
|
|
|
3455
3451
|
// ../../node_modules/.pnpm/@hedgedoc+markdown-it-plugins@2.1.4_patch_hash=tuyuxytl56b2vxulpkzt2wf4o4_markdown-it@14.0.0/node_modules/@hedgedoc/markdown-it-plugins/dist/esm/image-size/specialCharacters.js
|
|
3456
3452
|
var SpecialCharacters;
|
|
@@ -3581,9 +3577,12 @@ function startsWithTodoMarkdown(token) {
|
|
|
3581
3577
|
import { Optional } from "@mrdrogdrog/optional";
|
|
3582
3578
|
|
|
3583
3579
|
// node/plugins/markdown.ts
|
|
3584
|
-
import { encode as
|
|
3580
|
+
import { encode as encodePlantUml } from "plantuml-encoder";
|
|
3585
3581
|
import Mdc from "markdown-it-mdc";
|
|
3586
3582
|
import { codeToKeyedTokens, createMagicMoveMachine } from "shiki-magic-move/core";
|
|
3583
|
+
import mila2 from "markdown-it-link-attributes";
|
|
3584
|
+
import mif from "markdown-it-footnote";
|
|
3585
|
+
import lz from "lz-string";
|
|
3587
3586
|
|
|
3588
3587
|
// node/plugins/markdown-it-katex.ts
|
|
3589
3588
|
import katex from "katex";
|
|
@@ -4044,15 +4043,15 @@ function transformMarkdownMonaco(md2) {
|
|
|
4044
4043
|
md2 = md2.replace(/^```(\w+?)\s*{monaco-diff}\s*?({.*?})?\s*?\n([\s\S]+?)^~~~\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code, diff) => {
|
|
4045
4044
|
lang = lang.trim();
|
|
4046
4045
|
options = options.trim() || "{}";
|
|
4047
|
-
const encoded =
|
|
4048
|
-
const encodedDiff =
|
|
4049
|
-
return `<Monaco
|
|
4046
|
+
const encoded = lz.compressToBase64(code);
|
|
4047
|
+
const encodedDiff = lz.compressToBase64(diff);
|
|
4048
|
+
return `<Monaco code-lz="${encoded}" diff-lz="${encodedDiff}" lang="${lang}" v-bind="${options}" />`;
|
|
4050
4049
|
});
|
|
4051
4050
|
md2 = md2.replace(/^```(\w+?)\s*{monaco}\s*?({.*?})?\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code) => {
|
|
4052
4051
|
lang = lang.trim();
|
|
4053
4052
|
options = options.trim() || "{}";
|
|
4054
|
-
const encoded =
|
|
4055
|
-
return `<Monaco
|
|
4053
|
+
const encoded = lz.compressToBase64(code);
|
|
4054
|
+
return `<Monaco code-lz="${encoded}" lang="${lang}" v-bind="${options}" />`;
|
|
4056
4055
|
});
|
|
4057
4056
|
return md2;
|
|
4058
4057
|
}
|
|
@@ -4080,9 +4079,7 @@ function transformSlotSugar(md2) {
|
|
|
4080
4079
|
var reMagicMoveBlock = /^````(?:md|markdown) magic-move(?:[ ]*?({.*?})?([^\n]*?))?\n([\s\S]+?)^````$/mg;
|
|
4081
4080
|
var reCodeBlock = /^```(\w+?)(?:\s*{([\d\w*,\|-]+)}\s*?({.*?})?(.*?))?\n([\s\S]+?)^```$/mg;
|
|
4082
4081
|
function transformMagicMove(md2, shiki2, shikiOptions2) {
|
|
4083
|
-
|
|
4084
|
-
let count = 0;
|
|
4085
|
-
md2 = md2.replace(
|
|
4082
|
+
return md2.replace(
|
|
4086
4083
|
reMagicMoveBlock,
|
|
4087
4084
|
(full, _options = "", _attrs = "", body) => {
|
|
4088
4085
|
if (!shiki2 || !shikiOptions2)
|
|
@@ -4101,17 +4098,10 @@ function transformMagicMove(md2, shiki2, shikiOptions2) {
|
|
|
4101
4098
|
})
|
|
4102
4099
|
);
|
|
4103
4100
|
const steps = matches.map((i) => magicMove.commit((i[5] || "").trimEnd()));
|
|
4104
|
-
const
|
|
4105
|
-
|
|
4106
|
-
return `<ShikiMagicMove :steps='${id}' />`;
|
|
4101
|
+
const compressed = lz.compressToBase64(JSON.stringify(steps));
|
|
4102
|
+
return `<ShikiMagicMove steps-lz="${compressed}" />`;
|
|
4107
4103
|
}
|
|
4108
4104
|
);
|
|
4109
|
-
if (scripts.length)
|
|
4110
|
-
md2 = `<script setup>
|
|
4111
|
-
${scripts.join("\n")}</script>
|
|
4112
|
-
|
|
4113
|
-
${md2}`;
|
|
4114
|
-
return md2;
|
|
4115
4105
|
}
|
|
4116
4106
|
function transformHighlighter(md2) {
|
|
4117
4107
|
return md2.replace(
|
|
@@ -4171,13 +4161,13 @@ function transformMermaid(md2) {
|
|
|
4171
4161
|
return md2.replace(/^```mermaid\s*?({.*?})?\n([\s\S]+?)\n```/mg, (full, options = "", code = "") => {
|
|
4172
4162
|
code = code.trim();
|
|
4173
4163
|
options = options.trim() || "{}";
|
|
4174
|
-
const encoded =
|
|
4175
|
-
return `<Mermaid
|
|
4164
|
+
const encoded = lz.compressToBase64(code);
|
|
4165
|
+
return `<Mermaid code-lz="${encoded}" v-bind="${options}" />`;
|
|
4176
4166
|
});
|
|
4177
4167
|
}
|
|
4178
4168
|
function transformPlantUml(md2, server) {
|
|
4179
4169
|
return md2.replace(/^```plantuml\s*?({.*?})?\n([\s\S]+?)\n```/mg, (full, options = "", content = "") => {
|
|
4180
|
-
const code =
|
|
4170
|
+
const code = encodePlantUml(content.trim());
|
|
4181
4171
|
options = options.trim() || "{}";
|
|
4182
4172
|
return `<PlantUml :code="'${code}'" :server="'${server}'" v-bind="${options}" />`;
|
|
4183
4173
|
});
|
package/dist/cli.mjs
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
resolveAddons,
|
|
6
6
|
resolveOptions,
|
|
7
7
|
resolveTheme
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ESDR4XPY.mjs";
|
|
9
9
|
import {
|
|
10
10
|
version
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HHZ7SVZP.mjs";
|
|
12
12
|
import {
|
|
13
13
|
loadSetups
|
|
14
14
|
} from "./chunk-O6TYYGU6.mjs";
|
|
@@ -43,7 +43,7 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
43
43
|
"editor",
|
|
44
44
|
"theme"
|
|
45
45
|
];
|
|
46
|
-
injectPreparserExtensionLoader(async (headmatter, filepath) => {
|
|
46
|
+
injectPreparserExtensionLoader(async (headmatter, filepath, mode) => {
|
|
47
47
|
const addons = headmatter?.addons ?? [];
|
|
48
48
|
const { clientRoot, userRoot } = await getRoots();
|
|
49
49
|
const roots = uniq([
|
|
@@ -52,7 +52,7 @@ injectPreparserExtensionLoader(async (headmatter, filepath) => {
|
|
|
52
52
|
...await resolveAddons(addons)
|
|
53
53
|
]);
|
|
54
54
|
const mergeArrays = (a, b) => a.concat(b);
|
|
55
|
-
return await loadSetups(clientRoot, roots, "preparser.ts", { filepath, headmatter }, [], mergeArrays);
|
|
55
|
+
return await loadSetups(clientRoot, roots, "preparser.ts", { filepath, headmatter, mode }, [], mergeArrays);
|
|
56
56
|
});
|
|
57
57
|
var cli = yargs(process.argv.slice(2)).scriptName("slidev").usage("$0 [args]").version(version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
58
58
|
cli.command(
|
|
@@ -128,7 +128,7 @@ cli.command(
|
|
|
128
128
|
{
|
|
129
129
|
async loadData() {
|
|
130
130
|
const { data: oldData, entry: entry2 } = options;
|
|
131
|
-
const loaded = await parser.load(options.userRoot, entry2);
|
|
131
|
+
const loaded = await parser.load(options.userRoot, entry2, void 0, "dev");
|
|
132
132
|
const themeRaw = theme || loaded.headmatter.theme || "default";
|
|
133
133
|
if (options.themeRaw !== themeRaw) {
|
|
134
134
|
console.log(yellow("\n restarting on theme change\n"));
|
|
@@ -277,7 +277,7 @@ cli.command(
|
|
|
277
277
|
}).strict().help(),
|
|
278
278
|
async (args) => {
|
|
279
279
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
280
|
-
const { build } = await import("./build-
|
|
280
|
+
const { build } = await import("./build-TYMPDPHA.mjs");
|
|
281
281
|
for (const entryFile of entry) {
|
|
282
282
|
const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
|
|
283
283
|
if (download && !options.data.config.download)
|
package/dist/index.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
createServer,
|
|
3
3
|
parser,
|
|
4
4
|
resolveOptions
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ESDR4XPY.mjs";
|
|
6
6
|
import {
|
|
7
7
|
ViteSlidevPlugin
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HHZ7SVZP.mjs";
|
|
9
9
|
import "./chunk-O6TYYGU6.mjs";
|
|
10
10
|
import "./chunk-7HOZGSL4.mjs";
|
|
11
11
|
import "./chunk-BXO7ZPPU.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.48.0-beta.
|
|
3
|
+
"version": "0.48.0-beta.15",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,18 +66,16 @@
|
|
|
66
66
|
"htmlparser2": "^9.1.0",
|
|
67
67
|
"is-installed-globally": "^1.0.0",
|
|
68
68
|
"jiti": "^1.21.0",
|
|
69
|
-
"js-base64": "^3.7.7",
|
|
70
69
|
"katex": "^0.16.9",
|
|
71
70
|
"kolorist": "^1.8.0",
|
|
72
71
|
"local-pkg": "^0.5.0",
|
|
72
|
+
"lz-string": "^1.5.0",
|
|
73
73
|
"markdown-it": "^14.0.0",
|
|
74
74
|
"markdown-it-footnote": "^4.0.0",
|
|
75
75
|
"markdown-it-link-attributes": "^4.0.1",
|
|
76
76
|
"markdown-it-mdc": "^0.2.3",
|
|
77
77
|
"mlly": "^1.6.1",
|
|
78
78
|
"monaco-editor": "^0.37.1",
|
|
79
|
-
"nanoid": "^5.0.6",
|
|
80
|
-
"ohash": "^1.1.3",
|
|
81
79
|
"open": "^10.0.4",
|
|
82
80
|
"pdf-lib": "^1.17.1",
|
|
83
81
|
"plantuml-encoder": "^1.4.0",
|
|
@@ -106,9 +104,9 @@
|
|
|
106
104
|
"vitefu": "^0.2.5",
|
|
107
105
|
"vue": "^3.4.20",
|
|
108
106
|
"yargs": "^17.7.2",
|
|
109
|
-
"@slidev/
|
|
110
|
-
"@slidev/
|
|
111
|
-
"@slidev/
|
|
107
|
+
"@slidev/client": "0.48.0-beta.15",
|
|
108
|
+
"@slidev/parser": "0.48.0-beta.15",
|
|
109
|
+
"@slidev/types": "0.48.0-beta.15"
|
|
112
110
|
},
|
|
113
111
|
"devDependencies": {
|
|
114
112
|
"@hedgedoc/markdown-it-plugins": "^2.1.4",
|