@slidev/cli 0.31.4 → 0.32.3
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-5QYEFLVL.js → build-M2QTEV63.js} +11 -11
- package/dist/{build-QLCAUS73.mjs → build-YVXTTUTD.mjs} +3 -3
- package/dist/{chunk-RQ7QDWD6.js → chunk-IW3TSLZF.js} +74 -64
- package/dist/{chunk-OYCSUJS7.js → chunk-JWGORJY6.js} +7 -1
- package/dist/{chunk-7HNXF4RI.mjs → chunk-M2TT7ZMD.mjs} +107 -36
- package/dist/{chunk-VNV7XQUU.js → chunk-N7XL66RP.js} +244 -173
- package/dist/{chunk-25USV2L5.mjs → chunk-NOFZO6W4.mjs} +7 -1
- package/dist/{chunk-NKDK3BW7.mjs → chunk-WZ6OPJJF.mjs} +19 -9
- package/dist/cli.js +25 -27
- package/dist/cli.mjs +7 -9
- package/dist/{export-RFA6N32W.mjs → export-GIPHUNUX.mjs} +3 -5
- package/dist/{export-W52T2VBO.js → export-M6HJUIFY.js} +4 -6
- package/dist/index.d.ts +5 -2
- package/dist/index.js +9 -7
- package/dist/index.mjs +8 -6
- package/package.json +12 -12
- package/dist/chunk-6FP4S4BJ.js +0 -31
- package/dist/chunk-A6EFYWHQ.mjs +0 -31
|
@@ -154,6 +154,11 @@ function generateGoogleFontsUrl(options) {
|
|
|
154
154
|
const fonts = options.webfonts.map((i) => `family=${i.replace(/^(['"])(.*)\1$/, "$1").replace(/\s+/g, "+")}:${options.italic ? "ital," : ""}wght@${weights}`).join("&");
|
|
155
155
|
return `https://fonts.googleapis.com/css2?${fonts}&display=swap`;
|
|
156
156
|
}
|
|
157
|
+
function packageExists(name) {
|
|
158
|
+
if (resolveImportPath(`${name}/package.json`))
|
|
159
|
+
return true;
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
157
162
|
|
|
158
163
|
export {
|
|
159
164
|
__spreadValues,
|
|
@@ -173,5 +178,6 @@ export {
|
|
|
173
178
|
resolveImportPath,
|
|
174
179
|
resolveGlobalImportPath,
|
|
175
180
|
stringifyMarkdownTokens,
|
|
176
|
-
generateGoogleFontsUrl
|
|
181
|
+
generateGoogleFontsUrl,
|
|
182
|
+
packageExists
|
|
177
183
|
};
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
resolveImportPath,
|
|
12
12
|
stringifyMarkdownTokens,
|
|
13
13
|
toAtFS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NOFZO6W4.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({
|
|
@@ -135,10 +135,11 @@ async function loadSetups(roots, name, arg, initial, merge = true) {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
// node/plugins/windicss.ts
|
|
138
|
-
async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
138
|
+
async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
139
139
|
const configFiles = uniq2([
|
|
140
140
|
...defaultConfigureFiles.map((i) => resolve2(userRoot, i)),
|
|
141
141
|
...themeRoots.map((i) => `${i}/windi.config.ts`),
|
|
142
|
+
...addonRoots.map((i) => `${i}/windi.config.ts`),
|
|
142
143
|
resolve2(clientRoot, "windi.config.ts")
|
|
143
144
|
]);
|
|
144
145
|
const configFile = configFiles.find((i) => existsSync3(i));
|
|
@@ -167,6 +168,10 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
167
168
|
config2.scanOptions.include.push(`${i}/components/*.{vue,ts}`);
|
|
168
169
|
config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
|
|
169
170
|
});
|
|
171
|
+
addonRoots.forEach((i) => {
|
|
172
|
+
config2.scanOptions.include.push(`${i}/components/*.{vue,ts}`);
|
|
173
|
+
config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
|
|
174
|
+
});
|
|
170
175
|
config2.scanOptions.include.push(`!${slash(resolve2(userRoot, "node_modules"))}`);
|
|
171
176
|
config2.scanOptions.exclude.push(dirname(resolveImportPath("monaco-editor/package.json", true)));
|
|
172
177
|
config2.scanOptions.exclude.push(dirname(resolveImportPath("katex/package.json", true)));
|
|
@@ -243,16 +248,16 @@ var dependencies = {
|
|
|
243
248
|
"@antfu/utils": "^0.5.2",
|
|
244
249
|
"@slidev/parser": "workspace:*",
|
|
245
250
|
"@slidev/types": "workspace:*",
|
|
246
|
-
"@vueuse/core": "^8.
|
|
251
|
+
"@vueuse/core": "^8.5.0",
|
|
247
252
|
"@vueuse/head": "^0.7.6",
|
|
248
253
|
"@vueuse/motion": "^2.0.0-beta.18",
|
|
249
|
-
codemirror: "^5.65.
|
|
254
|
+
codemirror: "^5.65.4",
|
|
250
255
|
defu: "^6.0.0",
|
|
251
256
|
drauu: "^0.3.0",
|
|
252
257
|
"file-saver": "^2.0.5",
|
|
253
258
|
"js-base64": "^3.7.2",
|
|
254
259
|
"js-yaml": "^4.1.0",
|
|
255
|
-
katex: "^0.15.
|
|
260
|
+
katex: "^0.15.6",
|
|
256
261
|
mermaid: "^9.1.1",
|
|
257
262
|
"monaco-editor": "^0.33.0",
|
|
258
263
|
nanoid: "^3.3.4",
|
|
@@ -260,10 +265,10 @@ var dependencies = {
|
|
|
260
265
|
recordrtc: "^5.6.2",
|
|
261
266
|
resolve: "^1.22.0",
|
|
262
267
|
"vite-plugin-windicss": "^1.8.4",
|
|
263
|
-
vue: "^3.2.
|
|
268
|
+
vue: "^3.2.35",
|
|
264
269
|
"vue-router": "^4.0.15",
|
|
265
270
|
"vue-starport": "^0.2.10",
|
|
266
|
-
windicss: "^3.5.
|
|
271
|
+
windicss: "^3.5.4"
|
|
267
272
|
};
|
|
268
273
|
|
|
269
274
|
// node/vite/searchRoot.ts
|
|
@@ -431,7 +436,7 @@ function prepareSlideInfo(data) {
|
|
|
431
436
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
432
437
|
});
|
|
433
438
|
}
|
|
434
|
-
function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots, remote }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
439
|
+
function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, userRoot, roots, remote }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
435
440
|
const slidePrefix = "/@slidev/slides/";
|
|
436
441
|
const hmrPages = /* @__PURE__ */ new Set();
|
|
437
442
|
let server;
|
|
@@ -725,6 +730,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
725
730
|
const roots2 = uniq4([
|
|
726
731
|
userRoot,
|
|
727
732
|
...themeRoots,
|
|
733
|
+
...addonRoots,
|
|
728
734
|
clientRoot
|
|
729
735
|
]);
|
|
730
736
|
for (const root of roots2) {
|
|
@@ -751,6 +757,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
751
757
|
];
|
|
752
758
|
const roots2 = uniq4([
|
|
753
759
|
...themeRoots,
|
|
760
|
+
...addonRoots,
|
|
754
761
|
userRoot
|
|
755
762
|
]);
|
|
756
763
|
for (const root of roots2) {
|
|
@@ -923,7 +930,7 @@ init_esm_shims();
|
|
|
923
930
|
import { existsSync as existsSync5 } from "fs";
|
|
924
931
|
import { join as join7, resolve as resolve4 } from "path";
|
|
925
932
|
import { slash as slash4, uniq as uniq5 } from "@antfu/utils";
|
|
926
|
-
function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
933
|
+
function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot }) {
|
|
927
934
|
const setupEntry = slash4(resolve4(clientRoot, "setup"));
|
|
928
935
|
return {
|
|
929
936
|
name: "slidev:setup",
|
|
@@ -936,6 +943,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
936
943
|
const asyncInjections = [];
|
|
937
944
|
const setups = uniq5([
|
|
938
945
|
...themeRoots,
|
|
946
|
+
...addonRoots,
|
|
939
947
|
userRoot
|
|
940
948
|
]).map((i) => join7(i, "setup", name));
|
|
941
949
|
setups.forEach((path, idx) => {
|
|
@@ -1459,6 +1467,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1459
1467
|
const {
|
|
1460
1468
|
mode,
|
|
1461
1469
|
themeRoots,
|
|
1470
|
+
addonRoots,
|
|
1462
1471
|
clientRoot,
|
|
1463
1472
|
data: { config }
|
|
1464
1473
|
} = options;
|
|
@@ -1486,6 +1495,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1486
1495
|
`${clientRoot}/builtin`,
|
|
1487
1496
|
`${clientRoot}/components`,
|
|
1488
1497
|
...themeRoots.map((i) => `${i}/components`),
|
|
1498
|
+
...addonRoots.map((i) => `${i}/components`),
|
|
1489
1499
|
"src/components",
|
|
1490
1500
|
"components"
|
|
1491
1501
|
],
|
package/dist/cli.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use strict"; 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
|
-
var _chunk6FP4S4BJjs = require('./chunk-6FP4S4BJ.js');
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
9
|
+
var _chunkN7XL66RPjs = require('./chunk-N7XL66RP.js');
|
|
10
10
|
|
|
11
|
-
var _chunkVNV7XQUUjs = require('./chunk-VNV7XQUU.js');
|
|
12
11
|
|
|
12
|
+
var _chunkIW3TSLZFjs = require('./chunk-IW3TSLZF.js');
|
|
13
13
|
|
|
14
|
-
var _chunkRQ7QDWD6js = require('./chunk-RQ7QDWD6.js');
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
var _chunkOYCSUJS7js = require('./chunk-OYCSUJS7.js');
|
|
17
|
+
var _chunkJWGORJY6js = require('./chunk-JWGORJY6.js');
|
|
20
18
|
|
|
21
19
|
// node/cli.ts
|
|
22
|
-
|
|
23
|
-
var import_fast_deep_equal =
|
|
20
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
21
|
+
var import_fast_deep_equal = _chunkJWGORJY6js.__toESM.call(void 0, _chunkIW3TSLZFjs.require_fast_deep_equal.call(void 0, ));
|
|
24
22
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
25
23
|
var _net = require('net'); var _net2 = _interopRequireDefault(_net);
|
|
26
24
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
@@ -38,7 +36,7 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
38
36
|
"routerMode",
|
|
39
37
|
"fonts"
|
|
40
38
|
];
|
|
41
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
39
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkN7XL66RPjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
42
40
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
43
41
|
alias: "p",
|
|
44
42
|
type: "number",
|
|
@@ -81,9 +79,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
81
79
|
async function initServer() {
|
|
82
80
|
if (server)
|
|
83
81
|
await server.close();
|
|
84
|
-
const options = await
|
|
82
|
+
const options = await _chunkN7XL66RPjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
|
|
85
83
|
port = userPort || await findFreePort(3030);
|
|
86
|
-
server = await
|
|
84
|
+
server = await _chunkN7XL66RPjs.createServer.call(void 0, options, {
|
|
87
85
|
server: {
|
|
88
86
|
port,
|
|
89
87
|
strictPort: true,
|
|
@@ -94,7 +92,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
94
92
|
logLevel: log
|
|
95
93
|
}, {
|
|
96
94
|
onDataReload(newData, data) {
|
|
97
|
-
if (!theme &&
|
|
95
|
+
if (!theme && _chunkN7XL66RPjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkN7XL66RPjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
98
96
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
99
97
|
initServer();
|
|
100
98
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -170,8 +168,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
170
168
|
type: "boolean",
|
|
171
169
|
describe: "allow download as PDF"
|
|
172
170
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
173
|
-
const { build } = await Promise.resolve().then(() =>
|
|
174
|
-
const options = await
|
|
171
|
+
const { build } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "./build-M2QTEV63.js")));
|
|
172
|
+
const options = await _chunkN7XL66RPjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
175
173
|
if (download && !options.data.config.download)
|
|
176
174
|
options.data.config.download = download;
|
|
177
175
|
printInfo(options);
|
|
@@ -184,26 +182,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
184
182
|
});
|
|
185
183
|
});
|
|
186
184
|
cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
|
|
187
|
-
const data = await
|
|
188
|
-
|
|
189
|
-
await
|
|
185
|
+
const data = await _chunkN7XL66RPjs.parser.load(entry);
|
|
186
|
+
_chunkN7XL66RPjs.parser.prettify(data);
|
|
187
|
+
await _chunkN7XL66RPjs.parser.save(data);
|
|
190
188
|
});
|
|
191
189
|
cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
192
190
|
return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
|
|
193
191
|
type: "string",
|
|
194
192
|
default: "theme"
|
|
195
193
|
}), async ({ entry, dir, theme: themeInput }) => {
|
|
196
|
-
const data = await
|
|
197
|
-
const theme =
|
|
194
|
+
const data = await _chunkN7XL66RPjs.parser.load(entry);
|
|
195
|
+
const theme = _chunkN7XL66RPjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
198
196
|
if (theme === "none") {
|
|
199
197
|
console.error('Can not eject theme "none"');
|
|
200
198
|
process.exit(1);
|
|
201
199
|
}
|
|
202
|
-
if (
|
|
200
|
+
if (_chunkN7XL66RPjs.isPath.call(void 0, theme)) {
|
|
203
201
|
console.error("Theme is already ejected");
|
|
204
202
|
process.exit(1);
|
|
205
203
|
}
|
|
206
|
-
const roots =
|
|
204
|
+
const roots = _chunkN7XL66RPjs.getThemeRoots.call(void 0, theme, entry);
|
|
207
205
|
if (!roots.length) {
|
|
208
206
|
console.error(`Does not found theme "${theme}"`);
|
|
209
207
|
process.exit(1);
|
|
@@ -215,7 +213,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
215
213
|
const dirPath = `./${dir}`;
|
|
216
214
|
data.slides[0].frontmatter.theme = dirPath;
|
|
217
215
|
data.slides[0].raw = null;
|
|
218
|
-
await
|
|
216
|
+
await _chunkN7XL66RPjs.parser.save(data);
|
|
219
217
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
220
218
|
});
|
|
221
219
|
}, () => {
|
|
@@ -224,7 +222,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
224
222
|
});
|
|
225
223
|
cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(args).option("output", {
|
|
226
224
|
type: "string",
|
|
227
|
-
describe: "path to the
|
|
225
|
+
describe: "path to the output"
|
|
228
226
|
}).option("format", {
|
|
229
227
|
default: "pdf",
|
|
230
228
|
type: "string",
|
|
@@ -257,17 +255,17 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
257
255
|
"with-clicks": withClicks
|
|
258
256
|
}) => {
|
|
259
257
|
process.env.NODE_ENV = "production";
|
|
260
|
-
const { exportSlides } = await Promise.resolve().then(() =>
|
|
258
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "./export-M6HJUIFY.js")));
|
|
261
259
|
const port = await findFreePort(12445);
|
|
262
|
-
const options = await
|
|
260
|
+
const options = await _chunkN7XL66RPjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
263
261
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
264
|
-
const server = await
|
|
262
|
+
const server = await _chunkN7XL66RPjs.createServer.call(void 0, options, {
|
|
265
263
|
server: { port },
|
|
266
264
|
clearScreen: false
|
|
267
265
|
});
|
|
268
266
|
await server.listen(port);
|
|
269
267
|
printInfo(options);
|
|
270
|
-
|
|
268
|
+
_chunkN7XL66RPjs.parser.filterDisabled(options.data);
|
|
271
269
|
const width = options.data.config.canvasWidth;
|
|
272
270
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
273
271
|
output = await exportSlides({
|
|
@@ -305,7 +303,7 @@ function printInfo(options, port, remote) {
|
|
|
305
303
|
console.log();
|
|
306
304
|
console.log();
|
|
307
305
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
308
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
306
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkN7XL66RPjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
309
307
|
console.log();
|
|
310
308
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
311
309
|
console.log(_kolorist.dim.call(void 0, " entry ") + _kolorist.dim.call(void 0, _path2.default.dirname(options.entry) + _path2.default.sep) + _path2.default.basename(options.entry));
|
package/dist/cli.mjs
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createServer
|
|
3
|
-
} from "./chunk-A6EFYWHQ.mjs";
|
|
4
|
-
import {
|
|
2
|
+
createServer,
|
|
5
3
|
getThemeRoots,
|
|
6
4
|
isPath,
|
|
7
5
|
parser,
|
|
8
6
|
resolveOptions,
|
|
9
7
|
resolveThemeName,
|
|
10
8
|
version
|
|
11
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-M2TT7ZMD.mjs";
|
|
12
10
|
import {
|
|
13
11
|
require_fast_deep_equal
|
|
14
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WZ6OPJJF.mjs";
|
|
15
13
|
import {
|
|
16
14
|
__dirname,
|
|
17
15
|
__require,
|
|
18
16
|
__toESM,
|
|
19
17
|
init_esm_shims
|
|
20
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NOFZO6W4.mjs";
|
|
21
19
|
|
|
22
20
|
// node/cli.ts
|
|
23
21
|
init_esm_shims();
|
|
@@ -171,7 +169,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
171
169
|
type: "boolean",
|
|
172
170
|
describe: "allow download as PDF"
|
|
173
171
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
174
|
-
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-
|
|
172
|
+
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-YVXTTUTD.mjs")));
|
|
175
173
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
176
174
|
if (download && !options.data.config.download)
|
|
177
175
|
options.data.config.download = download;
|
|
@@ -225,7 +223,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
225
223
|
});
|
|
226
224
|
cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(args).option("output", {
|
|
227
225
|
type: "string",
|
|
228
|
-
describe: "path to the
|
|
226
|
+
describe: "path to the output"
|
|
229
227
|
}).option("format", {
|
|
230
228
|
default: "pdf",
|
|
231
229
|
type: "string",
|
|
@@ -258,7 +256,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
258
256
|
"with-clicks": withClicks
|
|
259
257
|
}) => {
|
|
260
258
|
process.env.NODE_ENV = "production";
|
|
261
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
259
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-GIPHUNUX.mjs")));
|
|
262
260
|
const port = await findFreePort(12445);
|
|
263
261
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
264
262
|
output = output || options.data.config.exportFilename || `${path.basename(entry, ".md")}-export`;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
packageExists
|
|
3
|
-
} from "./chunk-7HNXF4RI.mjs";
|
|
4
1
|
import {
|
|
5
2
|
__require,
|
|
6
3
|
__toESM,
|
|
7
|
-
init_esm_shims
|
|
8
|
-
|
|
4
|
+
init_esm_shims,
|
|
5
|
+
packageExists
|
|
6
|
+
} from "./chunk-NOFZO6W4.mjs";
|
|
9
7
|
|
|
10
8
|
// node/export.ts
|
|
11
9
|
init_esm_shims();
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var _chunkVNV7XQUUjs = require('./chunk-VNV7XQUU.js');
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
var _chunkOYCSUJS7js = require('./chunk-OYCSUJS7.js');
|
|
6
|
+
var _chunkJWGORJY6js = require('./chunk-JWGORJY6.js');
|
|
9
7
|
|
|
10
8
|
// node/export.ts
|
|
11
|
-
|
|
9
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
12
10
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
13
11
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
14
12
|
var _kolorist = require('kolorist');
|
|
@@ -62,10 +60,10 @@ async function exportSlides({
|
|
|
62
60
|
height = 1080,
|
|
63
61
|
withClicks = false
|
|
64
62
|
}) {
|
|
65
|
-
if (!
|
|
63
|
+
if (!_chunkJWGORJY6js.packageExists.call(void 0, "playwright-chromium"))
|
|
66
64
|
throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D playwright-chromium`");
|
|
67
65
|
const pages = _core.parseRangeString.call(void 0, total, range);
|
|
68
|
-
const { chromium } = await Promise.resolve().then(() =>
|
|
66
|
+
const { chromium } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "playwright-chromium")));
|
|
69
67
|
const browser = await chromium.launch();
|
|
70
68
|
const context = await browser.newContext({
|
|
71
69
|
viewport: {
|
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ interface ResolvedSlidevOptions {
|
|
|
42
42
|
clientRoot: string;
|
|
43
43
|
theme: string;
|
|
44
44
|
themeRoots: string[];
|
|
45
|
+
addonRoots: string[];
|
|
45
46
|
roots: string[];
|
|
46
47
|
mode: 'dev' | 'build';
|
|
47
48
|
remote?: string;
|
|
@@ -62,6 +63,8 @@ declare function getClientRoot(): string;
|
|
|
62
63
|
declare function getCLIRoot(): string;
|
|
63
64
|
declare function isPath(name: string): boolean;
|
|
64
65
|
declare function getThemeRoots(name: string, entry: string): string[];
|
|
66
|
+
declare function getAddonRoots(addons: string[], entry: string): string[];
|
|
67
|
+
declare function getRoot(name: string, entry: string): string;
|
|
65
68
|
declare function getUserRoot(options: SlidevEntryOptions): {
|
|
66
69
|
entry: string;
|
|
67
70
|
userRoot: string;
|
|
@@ -83,6 +86,6 @@ declare function createServer(options: ResolvedSlidevOptions, viteConfig?: Inlin
|
|
|
83
86
|
|
|
84
87
|
declare function ViteSlidevPlugin(options: ResolvedSlidevOptions, pluginOptions: SlidevPluginOptions, serverOptions?: SlidevServerOptions): Promise<Plugin[]>;
|
|
85
88
|
|
|
86
|
-
declare function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, data }: ResolvedSlidevOptions, { windicss: windiOptions }: SlidevPluginOptions): Promise<vite.Plugin[]>;
|
|
89
|
+
declare function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }: ResolvedSlidevOptions, { windicss: windiOptions }: SlidevPluginOptions): Promise<vite.Plugin[]>;
|
|
87
90
|
|
|
88
|
-
export { ResolvedSlidevOptions, SlidevEntryOptions, SlidevPluginOptions, SlidevServerOptions, ViteSlidevPlugin, createServer, createWindiCSSPlugin, getCLIRoot, getClientRoot, getThemeRoots, getUserRoot, isPath, resolveOptions };
|
|
91
|
+
export { ResolvedSlidevOptions, SlidevEntryOptions, SlidevPluginOptions, SlidevServerOptions, ViteSlidevPlugin, createServer, createWindiCSSPlugin, getAddonRoots, getCLIRoot, getClientRoot, getRoot, getThemeRoots, getUserRoot, isPath, resolveOptions };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _chunk6FP4S4BJjs = require('./chunk-6FP4S4BJ.js');
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
|
|
@@ -9,20 +8,23 @@ var _chunk6FP4S4BJjs = require('./chunk-6FP4S4BJ.js');
|
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
var _chunkVNV7XQUUjs = require('./chunk-VNV7XQUU.js');
|
|
13
11
|
|
|
12
|
+
var _chunkN7XL66RPjs = require('./chunk-N7XL66RP.js');
|
|
14
13
|
|
|
15
14
|
|
|
16
|
-
var _chunkRQ7QDWD6js = require('./chunk-RQ7QDWD6.js');
|
|
17
15
|
|
|
16
|
+
var _chunkIW3TSLZFjs = require('./chunk-IW3TSLZF.js');
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
|
|
19
|
+
var _chunkJWGORJY6js = require('./chunk-JWGORJY6.js');
|
|
20
20
|
|
|
21
21
|
// node/index.ts
|
|
22
|
-
|
|
22
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
23
23
|
|
|
24
24
|
// node/declare.ts
|
|
25
|
-
|
|
25
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
26
|
+
|
|
27
|
+
|
|
26
28
|
|
|
27
29
|
|
|
28
30
|
|
|
@@ -34,4 +36,4 @@ _chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
|
34
36
|
|
|
35
37
|
|
|
36
38
|
|
|
37
|
-
exports.ViteSlidevPlugin =
|
|
39
|
+
exports.ViteSlidevPlugin = _chunkIW3TSLZFjs.ViteSlidevPlugin; exports.createServer = _chunkN7XL66RPjs.createServer; exports.createWindiCSSPlugin = _chunkIW3TSLZFjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkN7XL66RPjs.getAddonRoots; exports.getCLIRoot = _chunkN7XL66RPjs.getCLIRoot; exports.getClientRoot = _chunkN7XL66RPjs.getClientRoot; exports.getRoot = _chunkN7XL66RPjs.getRoot; exports.getThemeRoots = _chunkN7XL66RPjs.getThemeRoots; exports.getUserRoot = _chunkN7XL66RPjs.getUserRoot; exports.isPath = _chunkN7XL66RPjs.isPath; exports.parser = _chunkN7XL66RPjs.parser; exports.resolveOptions = _chunkN7XL66RPjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createServer
|
|
3
|
-
|
|
4
|
-
import {
|
|
2
|
+
createServer,
|
|
3
|
+
getAddonRoots,
|
|
5
4
|
getCLIRoot,
|
|
6
5
|
getClientRoot,
|
|
6
|
+
getRoot,
|
|
7
7
|
getThemeRoots,
|
|
8
8
|
getUserRoot,
|
|
9
9
|
isPath,
|
|
10
10
|
parser,
|
|
11
11
|
resolveOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M2TT7ZMD.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ViteSlidevPlugin,
|
|
15
15
|
createWindiCSSPlugin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WZ6OPJJF.mjs";
|
|
17
17
|
import {
|
|
18
18
|
init_esm_shims
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NOFZO6W4.mjs";
|
|
20
20
|
|
|
21
21
|
// node/index.ts
|
|
22
22
|
init_esm_shims();
|
|
@@ -27,8 +27,10 @@ export {
|
|
|
27
27
|
ViteSlidevPlugin,
|
|
28
28
|
createServer,
|
|
29
29
|
createWindiCSSPlugin,
|
|
30
|
+
getAddonRoots,
|
|
30
31
|
getCLIRoot,
|
|
31
32
|
getClientRoot,
|
|
33
|
+
getRoot,
|
|
32
34
|
getThemeRoots,
|
|
33
35
|
getUserRoot,
|
|
34
36
|
isPath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.3",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"homepage": "https://sli.dev",
|
|
6
6
|
"bugs": "https://github.com/slidevjs/slidev/issues",
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@antfu/utils": "^0.5.2",
|
|
43
|
-
"@iconify-json/carbon": "^1.1.
|
|
43
|
+
"@iconify-json/carbon": "^1.1.5",
|
|
44
44
|
"@iconify-json/ph": "^1.1.1",
|
|
45
|
-
"@slidev/client": "0.
|
|
46
|
-
"@slidev/parser": "0.
|
|
47
|
-
"@slidev/types": "0.
|
|
45
|
+
"@slidev/client": "0.32.3",
|
|
46
|
+
"@slidev/parser": "0.32.3",
|
|
47
|
+
"@slidev/types": "0.32.3",
|
|
48
48
|
"@vitejs/plugin-vue": "^2.3.3",
|
|
49
|
-
"@vue/compiler-sfc": "^3.2.
|
|
50
|
-
"cli-progress": "^3.11.
|
|
51
|
-
"codemirror": "^5.65.
|
|
49
|
+
"@vue/compiler-sfc": "^3.2.35",
|
|
50
|
+
"cli-progress": "^3.11.1",
|
|
51
|
+
"codemirror": "^5.65.4",
|
|
52
52
|
"connect": "^3.7.0",
|
|
53
53
|
"debug": "^4.3.4",
|
|
54
54
|
"fast-glob": "^3.2.11",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"is-installed-globally": "^0.4.0",
|
|
59
59
|
"jiti": "^1.13.0",
|
|
60
60
|
"js-base64": "^3.7.2",
|
|
61
|
-
"katex": "^0.15.
|
|
61
|
+
"katex": "^0.15.6",
|
|
62
62
|
"kolorist": "^1.5.1",
|
|
63
63
|
"markdown-it": "^13.0.1",
|
|
64
64
|
"markdown-it-footnote": "^3.0.3",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"vite-plugin-remote-assets": "^0.2.2",
|
|
81
81
|
"vite-plugin-vue-server-ref": "^0.2.4",
|
|
82
82
|
"vite-plugin-windicss": "^1.8.4",
|
|
83
|
-
"vue": "^3.2.
|
|
84
|
-
"windicss": "^3.5.
|
|
85
|
-
"yargs": "^17.5.
|
|
83
|
+
"vue": "^3.2.35",
|
|
84
|
+
"windicss": "^3.5.4",
|
|
85
|
+
"yargs": "^17.5.1"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@types/plantuml-encoder": "^1.4.0",
|
package/dist/chunk-6FP4S4BJ.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkRQ7QDWD6js = require('./chunk-RQ7QDWD6.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkOYCSUJS7js = require('./chunk-OYCSUJS7.js');
|
|
7
|
-
|
|
8
|
-
// node/server.ts
|
|
9
|
-
_chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
10
|
-
var _path = require('path');
|
|
11
|
-
var _vite = require('vite');
|
|
12
|
-
async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
13
|
-
const rawConfig = await _vite.resolveConfig.call(void 0, {}, "serve");
|
|
14
|
-
const pluginOptions = rawConfig.slidev || {};
|
|
15
|
-
process.env.EDITOR = process.env.EDITOR || "code";
|
|
16
|
-
const server = await _vite.createServer.call(void 0, _vite.mergeConfig.call(void 0, viteConfig, {
|
|
17
|
-
optimizeDeps: {
|
|
18
|
-
entries: [
|
|
19
|
-
_path.join.call(void 0, options.clientRoot, "main.ts")
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
plugins: [
|
|
23
|
-
await _chunkRQ7QDWD6js.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
|
|
24
|
-
]
|
|
25
|
-
}));
|
|
26
|
-
return server;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
exports.createServer = createServer;
|
package/dist/chunk-A6EFYWHQ.mjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ViteSlidevPlugin
|
|
3
|
-
} from "./chunk-NKDK3BW7.mjs";
|
|
4
|
-
import {
|
|
5
|
-
init_esm_shims
|
|
6
|
-
} from "./chunk-25USV2L5.mjs";
|
|
7
|
-
|
|
8
|
-
// node/server.ts
|
|
9
|
-
init_esm_shims();
|
|
10
|
-
import { join } from "path";
|
|
11
|
-
import { createServer as createViteServer, mergeConfig, resolveConfig } from "vite";
|
|
12
|
-
async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
13
|
-
const rawConfig = await resolveConfig({}, "serve");
|
|
14
|
-
const pluginOptions = rawConfig.slidev || {};
|
|
15
|
-
process.env.EDITOR = process.env.EDITOR || "code";
|
|
16
|
-
const server = await createViteServer(mergeConfig(viteConfig, {
|
|
17
|
-
optimizeDeps: {
|
|
18
|
-
entries: [
|
|
19
|
-
join(options.clientRoot, "main.ts")
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
plugins: [
|
|
23
|
-
await ViteSlidevPlugin(options, pluginOptions, serverOptions)
|
|
24
|
-
]
|
|
25
|
-
}));
|
|
26
|
-
return server;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
createServer
|
|
31
|
-
};
|