@slidev/cli 0.48.0-beta.8 → 0.48.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.
- package/dist/{build-E73DC6MR.mjs → build-KHRRQKZT.mjs} +6 -42
- package/dist/chunk-AQQIBD5X.mjs +187 -0
- package/dist/chunk-EAVFHD5X.mjs +2216 -0
- package/dist/{chunk-O6TYYGU6.mjs → chunk-LOUKLO2C.mjs} +1 -1
- package/dist/{chunk-GYAJEPQA.mjs → chunk-RNSSCHDN.mjs} +20 -20
- package/dist/cli.mjs +70 -19
- package/dist/{export-SM2ZATWB.mjs → export-P7ZNLPWH.mjs} +40 -12
- package/dist/index.d.mts +5 -84
- package/dist/index.mjs +4 -5
- package/dist/{unocss-XALM635U.mjs → unocss-AGKZGMYO.mjs} +2 -3
- package/package.json +17 -16
- package/template.md +2 -2
- package/dist/chunk-7HOZGSL4.mjs +0 -5552
- package/dist/chunk-BXO7ZPPU.mjs +0 -30
- package/dist/chunk-H6RR7TOW.mjs +0 -4320
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require_semver,
|
|
6
|
-
version
|
|
7
|
-
} from "./chunk-H6RR7TOW.mjs";
|
|
3
|
+
mergeViteConfigs
|
|
4
|
+
} from "./chunk-EAVFHD5X.mjs";
|
|
8
5
|
import {
|
|
9
6
|
createResolver,
|
|
10
7
|
getRoots,
|
|
11
8
|
resolveEntry
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
__toESM
|
|
15
|
-
} from "./chunk-BXO7ZPPU.mjs";
|
|
9
|
+
} from "./chunk-AQQIBD5X.mjs";
|
|
16
10
|
|
|
17
|
-
// node/server.ts
|
|
11
|
+
// node/commands/server.ts
|
|
18
12
|
import { join } from "node:path";
|
|
19
13
|
import process from "node:process";
|
|
20
14
|
import { createServer as createViteServer, mergeConfig } from "vite";
|
|
@@ -53,10 +47,13 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
53
47
|
// node/parser.ts
|
|
54
48
|
import * as parser from "@slidev/parser/fs";
|
|
55
49
|
|
|
56
|
-
//
|
|
57
|
-
var
|
|
50
|
+
// package.json
|
|
51
|
+
var version = "0.48.0";
|
|
52
|
+
|
|
53
|
+
// node/integrations/themes.ts
|
|
58
54
|
import { join as join2 } from "node:path";
|
|
59
55
|
import fs from "fs-extra";
|
|
56
|
+
import { satisfies } from "semver";
|
|
60
57
|
var officialThemes = {
|
|
61
58
|
"none": "",
|
|
62
59
|
"default": "@slidev/theme-default",
|
|
@@ -71,14 +68,15 @@ async function getThemeMeta(name, root) {
|
|
|
71
68
|
if (!fs.existsSync(path))
|
|
72
69
|
return {};
|
|
73
70
|
const { slidev = {}, engines = {} } = await fs.readJSON(path);
|
|
74
|
-
if (engines.slidev && !
|
|
71
|
+
if (engines.slidev && !satisfies(version, engines.slidev, { includePrerelease: true }))
|
|
75
72
|
throw new Error(`[slidev] theme "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
76
73
|
return slidev;
|
|
77
74
|
}
|
|
78
75
|
|
|
79
|
-
// node/addons.ts
|
|
76
|
+
// node/integrations/addons.ts
|
|
80
77
|
import { resolve } from "node:path";
|
|
81
78
|
import fs2 from "fs-extra";
|
|
79
|
+
import { satisfies as satisfies2 } from "semver";
|
|
82
80
|
async function resolveAddons(addonsInConfig) {
|
|
83
81
|
const { userRoot, userPkgJson } = await getRoots();
|
|
84
82
|
const resolved = [];
|
|
@@ -89,7 +87,8 @@ async function resolveAddons(addonsInConfig) {
|
|
|
89
87
|
return;
|
|
90
88
|
resolved.push(pkgRoot);
|
|
91
89
|
const { slidev, engines } = await fs2.readJSON(resolve(pkgRoot, "package.json"));
|
|
92
|
-
|
|
90
|
+
if (engines.slidev && !satisfies2(version, engines.slidev, { includePrerelease: true }))
|
|
91
|
+
throw new Error(`[slidev] addon "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
93
92
|
if (Array.isArray(slidev?.addons))
|
|
94
93
|
await Promise.all(slidev.addons.map((addon) => resolveAddon(addon, pkgRoot)));
|
|
95
94
|
}
|
|
@@ -102,12 +101,12 @@ async function resolveAddons(addonsInConfig) {
|
|
|
102
101
|
|
|
103
102
|
// node/options.ts
|
|
104
103
|
import { uniq } from "@antfu/utils";
|
|
105
|
-
import
|
|
106
|
-
var debug =
|
|
104
|
+
import Debug from "debug";
|
|
105
|
+
var debug = Debug("slidev:options");
|
|
107
106
|
async function resolveOptions(options, mode) {
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
const loaded = await parser.load(rootsInfo.userRoot, entry);
|
|
107
|
+
const entry = await resolveEntry(options.entry);
|
|
108
|
+
const rootsInfo = await getRoots(entry);
|
|
109
|
+
const loaded = await parser.load(rootsInfo.userRoot, entry, void 0, mode);
|
|
111
110
|
const themeRaw = options.theme || loaded.headmatter.theme || "default";
|
|
112
111
|
const [theme, themeRoot] = await resolveTheme(themeRaw, entry);
|
|
113
112
|
const themeRoots = themeRoot ? [themeRoot] : [];
|
|
@@ -148,6 +147,7 @@ async function resolveOptions(options, mode) {
|
|
|
148
147
|
export {
|
|
149
148
|
createServer,
|
|
150
149
|
parser,
|
|
150
|
+
version,
|
|
151
151
|
resolveTheme,
|
|
152
152
|
getThemeMeta,
|
|
153
153
|
resolveAddons,
|
package/dist/cli.mjs
CHANGED
|
@@ -4,18 +4,17 @@ import {
|
|
|
4
4
|
parser,
|
|
5
5
|
resolveAddons,
|
|
6
6
|
resolveOptions,
|
|
7
|
-
resolveTheme
|
|
8
|
-
} from "./chunk-GYAJEPQA.mjs";
|
|
9
|
-
import {
|
|
7
|
+
resolveTheme,
|
|
10
8
|
version
|
|
11
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RNSSCHDN.mjs";
|
|
10
|
+
import "./chunk-EAVFHD5X.mjs";
|
|
12
11
|
import {
|
|
13
12
|
loadSetups
|
|
14
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LOUKLO2C.mjs";
|
|
15
14
|
import {
|
|
16
|
-
getRoots
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
getRoots,
|
|
16
|
+
resolveEntry
|
|
17
|
+
} from "./chunk-AQQIBD5X.mjs";
|
|
19
18
|
|
|
20
19
|
// node/cli.ts
|
|
21
20
|
import path from "node:path";
|
|
@@ -43,7 +42,20 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
43
42
|
"editor",
|
|
44
43
|
"theme"
|
|
45
44
|
];
|
|
46
|
-
|
|
45
|
+
var FILES_CREATE_RESTART_GLOBS = [
|
|
46
|
+
"global-bottom.vue",
|
|
47
|
+
"global-top.vue",
|
|
48
|
+
"uno.config.js",
|
|
49
|
+
"uno.config.ts",
|
|
50
|
+
"unocss.config.js",
|
|
51
|
+
"unocss.config.ts"
|
|
52
|
+
];
|
|
53
|
+
var FILES_CHANGE_RESTART_GLOBS = [
|
|
54
|
+
"setup/shiki.ts",
|
|
55
|
+
"setup/katex.ts",
|
|
56
|
+
"setup/preparser.ts"
|
|
57
|
+
];
|
|
58
|
+
injectPreparserExtensionLoader(async (headmatter, filepath, mode) => {
|
|
47
59
|
const addons = headmatter?.addons ?? [];
|
|
48
60
|
const { clientRoot, userRoot } = await getRoots();
|
|
49
61
|
const roots = uniq([
|
|
@@ -52,7 +64,7 @@ injectPreparserExtensionLoader(async (headmatter, filepath) => {
|
|
|
52
64
|
...await resolveAddons(addons)
|
|
53
65
|
]);
|
|
54
66
|
const mergeArrays = (a, b) => a.concat(b);
|
|
55
|
-
return await loadSetups(clientRoot, roots, "preparser.ts", { filepath, headmatter }, [], mergeArrays);
|
|
67
|
+
return await loadSetups(clientRoot, roots, "preparser.ts", { filepath, headmatter, mode }, [], mergeArrays);
|
|
56
68
|
});
|
|
57
69
|
var cli = yargs(process.argv.slice(2)).scriptName("slidev").usage("$0 [args]").version(version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
58
70
|
cli.command(
|
|
@@ -97,6 +109,14 @@ cli.command(
|
|
|
97
109
|
let server;
|
|
98
110
|
let port = 3030;
|
|
99
111
|
let lastRemoteUrl;
|
|
112
|
+
let restartTimer;
|
|
113
|
+
function restartServer() {
|
|
114
|
+
clearTimeout(restartTimer);
|
|
115
|
+
restartTimer = setTimeout(() => {
|
|
116
|
+
console.log(yellow("\n restarting...\n"));
|
|
117
|
+
initServer();
|
|
118
|
+
}, 500);
|
|
119
|
+
}
|
|
100
120
|
async function initServer() {
|
|
101
121
|
if (server)
|
|
102
122
|
await server.close();
|
|
@@ -128,11 +148,11 @@ cli.command(
|
|
|
128
148
|
{
|
|
129
149
|
async loadData() {
|
|
130
150
|
const { data: oldData, entry: entry2 } = options;
|
|
131
|
-
const loaded = await parser.load(options.userRoot, entry2);
|
|
151
|
+
const loaded = await parser.load(options.userRoot, entry2, void 0, "dev");
|
|
132
152
|
const themeRaw = theme || loaded.headmatter.theme || "default";
|
|
133
153
|
if (options.themeRaw !== themeRaw) {
|
|
134
154
|
console.log(yellow("\n restarting on theme change\n"));
|
|
135
|
-
|
|
155
|
+
restartServer();
|
|
136
156
|
return false;
|
|
137
157
|
}
|
|
138
158
|
const themeMeta = options.themeRoots[0] ? await getThemeMeta(themeRaw, options.themeRoots[0]) : void 0;
|
|
@@ -143,7 +163,7 @@ cli.command(
|
|
|
143
163
|
};
|
|
144
164
|
if (CONFIG_RESTART_FIELDS.some((i) => !equal(newData.config[i], oldData.config[i]))) {
|
|
145
165
|
console.log(yellow("\n restarting on config change\n"));
|
|
146
|
-
|
|
166
|
+
restartServer();
|
|
147
167
|
return false;
|
|
148
168
|
}
|
|
149
169
|
return newData;
|
|
@@ -249,6 +269,34 @@ ${dim(" Public IP: ")} ${blue(publicIp)}
|
|
|
249
269
|
}
|
|
250
270
|
initServer();
|
|
251
271
|
bindShortcut();
|
|
272
|
+
const { watch } = await import("chokidar");
|
|
273
|
+
const watcher = watch([
|
|
274
|
+
...FILES_CREATE_RESTART_GLOBS,
|
|
275
|
+
...FILES_CHANGE_RESTART_GLOBS
|
|
276
|
+
], {
|
|
277
|
+
ignored: ["node_modules", ".git"],
|
|
278
|
+
ignoreInitial: true
|
|
279
|
+
});
|
|
280
|
+
watcher.on("unlink", (file) => {
|
|
281
|
+
console.log(yellow(`
|
|
282
|
+
file ${file} removed, restarting...
|
|
283
|
+
`));
|
|
284
|
+
restartServer();
|
|
285
|
+
});
|
|
286
|
+
watcher.on("add", (file) => {
|
|
287
|
+
console.log(yellow(`
|
|
288
|
+
file ${file} added, restarting...
|
|
289
|
+
`));
|
|
290
|
+
restartServer();
|
|
291
|
+
});
|
|
292
|
+
watcher.on("change", (file) => {
|
|
293
|
+
if (FILES_CREATE_RESTART_GLOBS.includes(file))
|
|
294
|
+
return;
|
|
295
|
+
console.log(yellow(`
|
|
296
|
+
file ${file} changed, restarting...
|
|
297
|
+
`));
|
|
298
|
+
restartServer();
|
|
299
|
+
});
|
|
252
300
|
}
|
|
253
301
|
);
|
|
254
302
|
cli.command(
|
|
@@ -277,7 +325,7 @@ cli.command(
|
|
|
277
325
|
}).strict().help(),
|
|
278
326
|
async (args) => {
|
|
279
327
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
280
|
-
const { build } = await import("./build-
|
|
328
|
+
const { build } = await import("./build-KHRRQKZT.mjs");
|
|
281
329
|
for (const entryFile of entry) {
|
|
282
330
|
const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
|
|
283
331
|
if (download && !options.data.config.download)
|
|
@@ -316,8 +364,9 @@ cli.command(
|
|
|
316
364
|
type: "string",
|
|
317
365
|
default: "theme"
|
|
318
366
|
}),
|
|
319
|
-
async ({ entry, dir, theme: themeInput }) => {
|
|
320
|
-
const
|
|
367
|
+
async ({ entry: entryRaw, dir, theme: themeInput }) => {
|
|
368
|
+
const entry = await resolveEntry(entryRaw);
|
|
369
|
+
const roots = await getRoots(entry);
|
|
321
370
|
const data = await parser.load(roots.userRoot, entry);
|
|
322
371
|
const themeRaw = themeInput || data.headmatter.theme || "default";
|
|
323
372
|
if (themeRaw === "none") {
|
|
@@ -352,7 +401,7 @@ cli.command(
|
|
|
352
401
|
(args) => exportOptions(commonOptions(args)).strict().help(),
|
|
353
402
|
async (args) => {
|
|
354
403
|
const { entry, theme } = args;
|
|
355
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
404
|
+
const { exportSlides, getExportOptions } = await import("./export-P7ZNLPWH.mjs");
|
|
356
405
|
const port = await getPort(12445);
|
|
357
406
|
for (const entryFile of entry) {
|
|
358
407
|
const options = await resolveOptions({ entry: entryFile, theme }, "export");
|
|
@@ -396,7 +445,7 @@ cli.command(
|
|
|
396
445
|
output,
|
|
397
446
|
timeout
|
|
398
447
|
}) => {
|
|
399
|
-
const { exportNotes } = await import("./export-
|
|
448
|
+
const { exportNotes } = await import("./export-P7ZNLPWH.mjs");
|
|
400
449
|
const port = await getPort(12445);
|
|
401
450
|
for (const entryFile of entry) {
|
|
402
451
|
const options = await resolveOptions({ entry: entryFile }, "export");
|
|
@@ -482,13 +531,15 @@ function printInfo(options, port, remote, tunnelUrl, publicIp) {
|
|
|
482
531
|
const query = remote ? `?password=${remote}` : "";
|
|
483
532
|
const presenterPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}presenter/${query}`;
|
|
484
533
|
const entryPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}entry${query}/`;
|
|
534
|
+
const overviewPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}overview${query}/`;
|
|
485
535
|
console.log();
|
|
486
536
|
console.log(`${dim(" public slide show ")} > ${cyan(`http://localhost:${bold(port)}/`)}`);
|
|
487
537
|
if (query)
|
|
488
538
|
console.log(`${dim(" private slide show ")} > ${cyan(`http://localhost:${bold(port)}/${query}`)}`);
|
|
489
539
|
console.log(`${dim(" presenter mode ")} > ${blue(`http://localhost:${bold(port)}${presenterPath}`)}`);
|
|
540
|
+
console.log(`${dim(" slides overview ")} > ${blue(`http://localhost:${bold(port)}${overviewPath}`)}`);
|
|
490
541
|
if (options.inspect)
|
|
491
|
-
console.log(`${dim(" inspector")}
|
|
542
|
+
console.log(`${dim(" vite inspector")} > ${yellow(`http://localhost:${bold(port)}/__inspect/`)}`);
|
|
492
543
|
let lastRemoteUrl = "";
|
|
493
544
|
if (remote !== void 0) {
|
|
494
545
|
Object.values(os.networkInterfaces()).forEach((v) => (v || []).filter((details) => String(details.family).slice(-1) === "4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRoots
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-BXO7ZPPU.mjs";
|
|
3
|
+
} from "./chunk-AQQIBD5X.mjs";
|
|
5
4
|
|
|
6
|
-
// node/export.ts
|
|
5
|
+
// node/commands/export.ts
|
|
7
6
|
import path from "node:path";
|
|
8
7
|
import { Buffer } from "node:buffer";
|
|
9
8
|
import fs from "fs-extra";
|
|
@@ -20,6 +19,7 @@ function addToTree(tree, info, slideIndexes, level = 1) {
|
|
|
20
19
|
addToTree(tree[tree.length - 1].children, info, slideIndexes, level + 1);
|
|
21
20
|
} else {
|
|
22
21
|
tree.push({
|
|
22
|
+
no: info.index,
|
|
23
23
|
children: [],
|
|
24
24
|
level,
|
|
25
25
|
path: String(slideIndexes[info.index + 1]),
|
|
@@ -144,16 +144,44 @@ async function exportSlides({
|
|
|
144
144
|
});
|
|
145
145
|
await page.waitForLoadState("networkidle");
|
|
146
146
|
await page.emulateMedia({ colorScheme: dark ? "dark" : "light", media: "screen" });
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
147
|
+
{
|
|
148
|
+
const elements = page.locator(".slidev-slide-loading");
|
|
149
|
+
const count = await elements.count();
|
|
150
|
+
for (let index = 0; index < count; index++)
|
|
151
|
+
await elements.nth(index).waitFor({ state: "detached" });
|
|
152
|
+
}
|
|
153
|
+
{
|
|
154
|
+
const elements = page.locator("[data-waitfor]");
|
|
155
|
+
const count = await elements.count();
|
|
156
|
+
for (let index = 0; index < count; index++) {
|
|
157
|
+
const element = elements.nth(index);
|
|
158
|
+
const attribute = await element.getAttribute("data-waitfor");
|
|
159
|
+
if (attribute)
|
|
160
|
+
await element.locator(attribute).waitFor();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
{
|
|
164
|
+
const frames = page.frames();
|
|
165
|
+
await Promise.all(frames.map((frame) => frame.waitForLoadState()));
|
|
166
|
+
}
|
|
167
|
+
{
|
|
168
|
+
const container = page.locator("#mermaid-rendering-container");
|
|
169
|
+
while (true) {
|
|
170
|
+
const element = container.locator("div").first();
|
|
171
|
+
if (await element.count() === 0)
|
|
172
|
+
break;
|
|
173
|
+
await element.waitFor({ state: "detached" });
|
|
174
|
+
}
|
|
175
|
+
await container.evaluate((node) => node.style.display = "none");
|
|
176
|
+
}
|
|
177
|
+
{
|
|
178
|
+
const elements = page.locator(".monaco-aria-container");
|
|
179
|
+
const count = await elements.count();
|
|
180
|
+
for (let index = 0; index < count; index++) {
|
|
181
|
+
const element = elements.nth(index);
|
|
182
|
+
await element.evaluate((node) => node.style.display = "none");
|
|
183
|
+
}
|
|
154
184
|
}
|
|
155
|
-
const frames = page.frames();
|
|
156
|
-
await Promise.all(frames.map((frame) => frame.waitForLoadState()));
|
|
157
185
|
}
|
|
158
186
|
async function getSlidesIndex() {
|
|
159
187
|
const clicksBySlide = {};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,92 +1,13 @@
|
|
|
1
|
-
import Vue from '@vitejs/plugin-vue';
|
|
2
|
-
import VueJsx from '@vitejs/plugin-vue-jsx';
|
|
3
|
-
import Icons from 'unplugin-icons/vite';
|
|
4
|
-
import Components from 'unplugin-vue-components/vite';
|
|
5
|
-
import Markdown from 'unplugin-vue-markdown/vite';
|
|
6
|
-
import { VitePluginConfig } from 'unocss/vite';
|
|
7
|
-
import RemoteAssets from 'vite-plugin-remote-assets';
|
|
8
|
-
import ServerRef from 'vite-plugin-vue-server-ref';
|
|
9
|
-
import { ArgumentsType } from '@antfu/utils';
|
|
10
|
-
import { SlidevData } from '@slidev/types';
|
|
11
1
|
import * as vite from 'vite';
|
|
12
|
-
import {
|
|
2
|
+
import { Plugin, InlineConfig } from 'vite';
|
|
3
|
+
import { ResolvedSlidevOptions, SlidevPluginOptions, SlidevServerOptions, SlidevEntryOptions } from '@slidev/types';
|
|
13
4
|
import * as fs from '@slidev/parser/fs';
|
|
14
5
|
export { fs as parser };
|
|
15
6
|
|
|
16
|
-
|
|
17
|
-
cliRoot: string;
|
|
18
|
-
clientRoot: string;
|
|
19
|
-
userRoot: string;
|
|
20
|
-
userPkgJson: Record<string, any>;
|
|
21
|
-
userWorkspaceRoot: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface SlidevEntryOptions {
|
|
25
|
-
/**
|
|
26
|
-
* Markdown entry
|
|
27
|
-
*
|
|
28
|
-
* @default 'slides.md'
|
|
29
|
-
*/
|
|
30
|
-
entry?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Theme id
|
|
33
|
-
*/
|
|
34
|
-
theme?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Remote password
|
|
37
|
-
*/
|
|
38
|
-
remote?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Enable inspect plugin
|
|
41
|
-
*/
|
|
42
|
-
inspect?: boolean;
|
|
43
|
-
}
|
|
44
|
-
interface ResolvedSlidevOptions extends RootsInfo {
|
|
45
|
-
data: SlidevData;
|
|
46
|
-
entry: string;
|
|
47
|
-
themeRaw: string;
|
|
48
|
-
theme: string;
|
|
49
|
-
themeRoots: string[];
|
|
50
|
-
addonRoots: string[];
|
|
51
|
-
/**
|
|
52
|
-
* =`[...themeRoots, ...addonRoots, userRoot]` (`clientRoot` excluded)
|
|
53
|
-
*/
|
|
54
|
-
roots: string[];
|
|
55
|
-
mode: 'dev' | 'build' | 'export';
|
|
56
|
-
remote?: string;
|
|
57
|
-
inspect?: boolean;
|
|
58
|
-
}
|
|
59
|
-
interface SlidevPluginOptions extends SlidevEntryOptions {
|
|
60
|
-
vue?: ArgumentsType<typeof Vue>[0];
|
|
61
|
-
vuejsx?: ArgumentsType<typeof VueJsx>[0];
|
|
62
|
-
markdown?: ArgumentsType<typeof Markdown>[0];
|
|
63
|
-
components?: ArgumentsType<typeof Components>[0];
|
|
64
|
-
icons?: ArgumentsType<typeof Icons>[0];
|
|
65
|
-
remoteAssets?: ArgumentsType<typeof RemoteAssets>[0];
|
|
66
|
-
serverRef?: ArgumentsType<typeof ServerRef>[0];
|
|
67
|
-
unocss?: VitePluginConfig;
|
|
68
|
-
}
|
|
69
|
-
interface SlidevServerOptions {
|
|
70
|
-
/**
|
|
71
|
-
* @returns `false` if server should be restarted
|
|
72
|
-
*/
|
|
73
|
-
loadData?: () => Promise<SlidevData | false>;
|
|
74
|
-
}
|
|
75
|
-
declare function resolveOptions(options: SlidevEntryOptions, mode: ResolvedSlidevOptions['mode']): Promise<ResolvedSlidevOptions>;
|
|
76
|
-
|
|
77
|
-
declare module 'vite' {
|
|
78
|
-
interface UserConfig {
|
|
79
|
-
/**
|
|
80
|
-
* Custom internal plugin options for Slidev (advanced)
|
|
81
|
-
*
|
|
82
|
-
* @see https://github.com/slidevjs/slidev/blob/main/packages/slidev/node/options.ts#L50
|
|
83
|
-
*/
|
|
84
|
-
slidev?: SlidevPluginOptions;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
7
|
+
declare function ViteSlidevPlugin(options: ResolvedSlidevOptions, pluginOptions: SlidevPluginOptions, serverOptions?: SlidevServerOptions): Promise<Plugin[]>;
|
|
87
8
|
|
|
88
9
|
declare function createServer(options: ResolvedSlidevOptions, viteConfig?: InlineConfig, serverOptions?: SlidevServerOptions): Promise<vite.ViteDevServer>;
|
|
89
10
|
|
|
90
|
-
declare function
|
|
11
|
+
declare function resolveOptions(options: SlidevEntryOptions, mode: ResolvedSlidevOptions['mode']): Promise<ResolvedSlidevOptions>;
|
|
91
12
|
|
|
92
|
-
export {
|
|
13
|
+
export { ViteSlidevPlugin, createServer, resolveOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -2,13 +2,12 @@ import {
|
|
|
2
2
|
createServer,
|
|
3
3
|
parser,
|
|
4
4
|
resolveOptions
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RNSSCHDN.mjs";
|
|
6
6
|
import {
|
|
7
7
|
ViteSlidevPlugin
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-BXO7ZPPU.mjs";
|
|
8
|
+
} from "./chunk-EAVFHD5X.mjs";
|
|
9
|
+
import "./chunk-LOUKLO2C.mjs";
|
|
10
|
+
import "./chunk-AQQIBD5X.mjs";
|
|
12
11
|
export {
|
|
13
12
|
ViteSlidevPlugin,
|
|
14
13
|
createServer,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadSetups
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-BXO7ZPPU.mjs";
|
|
3
|
+
} from "./chunk-LOUKLO2C.mjs";
|
|
5
4
|
|
|
6
|
-
// node/
|
|
5
|
+
// node/vite/unocss.ts
|
|
7
6
|
import { resolve } from "node:path";
|
|
8
7
|
import { existsSync } from "node:fs";
|
|
9
8
|
import { fileURLToPath } from "node:url";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.48.0
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,11 +42,12 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
+
"@antfu/ni": "^0.21.12",
|
|
45
46
|
"@antfu/utils": "^0.7.7",
|
|
46
|
-
"@iconify-json/carbon": "^1.1.
|
|
47
|
+
"@iconify-json/carbon": "^1.1.31",
|
|
47
48
|
"@iconify-json/ph": "^1.1.11",
|
|
49
|
+
"@iconify-json/svg-spinners": "^1.1.2",
|
|
48
50
|
"@lillallol/outline-pdf": "^4.0.0",
|
|
49
|
-
"@mrdrogdrog/optional": "^1.2.1",
|
|
50
51
|
"@shikijs/markdown-it": "^1.1.7",
|
|
51
52
|
"@shikijs/twoslash": "^1.1.7",
|
|
52
53
|
"@shikijs/vitepress-twoslash": "^1.1.7",
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"@unocss/reset": "^0.58.5",
|
|
55
56
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
56
57
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
58
|
+
"chokidar": "^3.6.0",
|
|
57
59
|
"cli-progress": "^3.12.0",
|
|
58
60
|
"codemirror": "^5.65.16",
|
|
59
61
|
"connect": "^3.7.0",
|
|
@@ -66,52 +68,51 @@
|
|
|
66
68
|
"htmlparser2": "^9.1.0",
|
|
67
69
|
"is-installed-globally": "^1.0.0",
|
|
68
70
|
"jiti": "^1.21.0",
|
|
69
|
-
"js-base64": "^3.7.7",
|
|
70
71
|
"katex": "^0.16.9",
|
|
71
72
|
"kolorist": "^1.8.0",
|
|
72
73
|
"local-pkg": "^0.5.0",
|
|
74
|
+
"lz-string": "^1.5.0",
|
|
73
75
|
"markdown-it": "^14.0.0",
|
|
74
76
|
"markdown-it-footnote": "^4.0.0",
|
|
75
77
|
"markdown-it-link-attributes": "^4.0.1",
|
|
76
78
|
"markdown-it-mdc": "^0.2.3",
|
|
77
79
|
"mlly": "^1.6.1",
|
|
78
|
-
"monaco-editor": "^0.
|
|
79
|
-
"
|
|
80
|
-
"open": "^10.0.3",
|
|
80
|
+
"monaco-editor": "^0.46.0",
|
|
81
|
+
"open": "^10.0.4",
|
|
81
82
|
"pdf-lib": "^1.17.1",
|
|
82
83
|
"plantuml-encoder": "^1.4.0",
|
|
83
84
|
"postcss-nested": "^6.0.1",
|
|
84
85
|
"prismjs": "^1.29.0",
|
|
85
86
|
"prompts": "^2.4.2",
|
|
86
87
|
"public-ip": "^6.0.1",
|
|
87
|
-
"resolve": "^1.22.8",
|
|
88
88
|
"resolve-from": "^5.0.0",
|
|
89
89
|
"resolve-global": "^2.0.0",
|
|
90
|
+
"semver": "^7.6.0",
|
|
90
91
|
"shiki": "^1.1.7",
|
|
92
|
+
"shiki-magic-move": "^0.3.4",
|
|
91
93
|
"sirv": "^2.0.4",
|
|
92
|
-
"typescript": "^5.
|
|
94
|
+
"typescript": "^5.4.2",
|
|
93
95
|
"unocss": "^0.58.5",
|
|
94
96
|
"unplugin-icons": "^0.18.5",
|
|
95
97
|
"unplugin-vue-components": "^0.26.0",
|
|
96
98
|
"unplugin-vue-markdown": "^0.26.0",
|
|
97
99
|
"untun": "^0.1.3",
|
|
98
100
|
"uqr": "^0.1.2",
|
|
99
|
-
"vite": "^5.1.
|
|
101
|
+
"vite": "^5.1.5",
|
|
100
102
|
"vite-plugin-inspect": "^0.8.3",
|
|
101
103
|
"vite-plugin-remote-assets": "^0.4.1",
|
|
102
104
|
"vite-plugin-static-copy": "^1.0.1",
|
|
103
105
|
"vite-plugin-vue-server-ref": "^0.4.2",
|
|
104
106
|
"vitefu": "^0.2.5",
|
|
105
|
-
"vue": "^3.4.
|
|
107
|
+
"vue": "^3.4.21",
|
|
106
108
|
"yargs": "^17.7.2",
|
|
107
|
-
"@slidev/client": "0.48.0
|
|
108
|
-
"@slidev/
|
|
109
|
-
"@slidev/
|
|
109
|
+
"@slidev/client": "0.48.0",
|
|
110
|
+
"@slidev/parser": "0.48.0",
|
|
111
|
+
"@slidev/types": "0.48.0"
|
|
110
112
|
},
|
|
111
113
|
"devDependencies": {
|
|
112
114
|
"@hedgedoc/markdown-it-plugins": "^2.1.4",
|
|
113
|
-
"@types/plantuml-encoder": "^1.4.2"
|
|
114
|
-
"semver": "^7.6.0"
|
|
115
|
+
"@types/plantuml-encoder": "^1.4.2"
|
|
115
116
|
},
|
|
116
117
|
"scripts": {
|
|
117
118
|
"build": "rimraf dist && tsup node/index.ts node/cli.ts",
|
package/template.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
theme: seriph
|
|
4
4
|
# random image from a curated Unsplash collection by Anthony
|
|
5
5
|
# like them? see https://unsplash.com/collections/94734566/slidev
|
|
6
|
-
background: https://
|
|
6
|
+
background: https://cover.sli.dev
|
|
7
7
|
# apply any unocss classes to the current slide
|
|
8
8
|
class: 'text-center'
|
|
9
9
|
# https://sli.dev/custom/highlighters.html
|
|
@@ -126,7 +126,7 @@ Hover on the bottom-left corner to see the navigation's controls panel, [learn m
|
|
|
126
126
|
|
|
127
127
|
---
|
|
128
128
|
layout: image-right
|
|
129
|
-
image: https://
|
|
129
|
+
image: https://cover.sli.dev
|
|
130
130
|
---
|
|
131
131
|
|
|
132
132
|
# Code
|