@slidev/cli 0.27.20 → 0.28.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-LK5RLV7L.js → build-IHQEXPWU.js} +24 -25
- package/dist/{build-OT76Q4KA.mjs → build-MGE5AXXE.mjs} +15 -16
- package/dist/{chunk-FN2B33RM.mjs → chunk-2E3KKOOJ.mjs} +21 -19
- package/dist/{chunk-RUL3XRPS.js → chunk-BYTWGCY3.js} +9 -3
- package/dist/{chunk-XEDZVJCH.js → chunk-FHAYPMSG.js} +3468 -424
- package/dist/{chunk-3ND6GSCF.js → chunk-INYQJTKA.js} +71 -69
- package/dist/{chunk-JGWGLMRC.mjs → chunk-MP2CDYSZ.mjs} +3237 -193
- package/dist/{chunk-3LH2GTGU.mjs → chunk-OXQUV4ZP.mjs} +8 -2
- package/dist/{chunk-2TTM3NLX.mjs → chunk-RLNIZC66.mjs} +2 -2
- package/dist/{chunk-VN5XPBZO.js → chunk-Z64T7ZBU.js} +4 -4
- package/dist/cli.js +26 -26
- package/dist/cli.mjs +13 -13
- package/dist/{export-IU4RLVW7.mjs → export-7GHMNSMB.mjs} +2 -2
- package/dist/{export-FUMCNU5W.js → export-WXQSOLRA.js} +5 -5
- package/dist/index.d.ts +68 -4
- package/dist/index.js +9 -11
- package/dist/index.mjs +6 -8
- package/package.json +29 -28
|
@@ -35,6 +35,11 @@ var __esm = (fn, res) => function __init() {
|
|
|
35
35
|
var __commonJS = (cb, mod) => function __require2() {
|
|
36
36
|
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
37
37
|
};
|
|
38
|
+
var __export = (target, all) => {
|
|
39
|
+
__markAsModule(target);
|
|
40
|
+
for (var name in all)
|
|
41
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
42
|
+
};
|
|
38
43
|
var __reExport = (target, module, desc) => {
|
|
39
44
|
if (module && typeof module === "object" || typeof module === "function") {
|
|
40
45
|
for (let key of __getOwnPropNames(module))
|
|
@@ -47,12 +52,12 @@ var __toModule = (module) => {
|
|
|
47
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);
|
|
48
53
|
};
|
|
49
54
|
|
|
50
|
-
// ../../node_modules/.pnpm/tsup@5.11.
|
|
55
|
+
// ../../node_modules/.pnpm/tsup@5.11.11_typescript@4.5.4/node_modules/tsup/assets/esm_shims.js
|
|
51
56
|
import { fileURLToPath } from "url";
|
|
52
57
|
import path from "path";
|
|
53
58
|
var getFilename, getDirname, __dirname, __filename;
|
|
54
59
|
var init_esm_shims = __esm({
|
|
55
|
-
"../../node_modules/.pnpm/tsup@5.11.
|
|
60
|
+
"../../node_modules/.pnpm/tsup@5.11.11_typescript@4.5.4/node_modules/tsup/assets/esm_shims.js"() {
|
|
56
61
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
57
62
|
getDirname = () => path.dirname(getFilename());
|
|
58
63
|
__dirname = /* @__PURE__ */ getDirname();
|
|
@@ -123,6 +128,7 @@ export {
|
|
|
123
128
|
__spreadProps,
|
|
124
129
|
__require,
|
|
125
130
|
__commonJS,
|
|
131
|
+
__export,
|
|
126
132
|
__toModule,
|
|
127
133
|
__dirname,
|
|
128
134
|
__filename,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkINYQJTKAjs = require('./chunk-INYQJTKA.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.js');
|
|
7
7
|
|
|
8
8
|
// node/server.ts
|
|
9
|
-
|
|
9
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
10
10
|
var _path = require('path');
|
|
11
11
|
var _vite = require('vite');
|
|
12
12
|
async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
@@ -20,7 +20,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
plugins: [
|
|
23
|
-
await
|
|
23
|
+
await _chunkINYQJTKAjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
|
|
24
24
|
]
|
|
25
25
|
}));
|
|
26
26
|
return server;
|
package/dist/cli.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
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
|
|
3
|
+
var _chunkZ64T7ZBUjs = require('./chunk-Z64T7ZBU.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var _chunkXEDZVJCHjs = require('./chunk-XEDZVJCH.js');
|
|
11
10
|
|
|
11
|
+
var _chunkFHAYPMSGjs = require('./chunk-FHAYPMSG.js');
|
|
12
12
|
|
|
13
|
-
var _chunk3ND6GSCFjs = require('./chunk-3ND6GSCF.js');
|
|
14
13
|
|
|
14
|
+
var _chunkINYQJTKAjs = require('./chunk-INYQJTKA.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.js');
|
|
19
20
|
|
|
20
21
|
// node/cli.ts
|
|
21
|
-
|
|
22
|
-
var import_fast_deep_equal =
|
|
22
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
23
|
+
var import_fast_deep_equal = _chunkBYTWGCY3js.__toModule.call(void 0, _chunkINYQJTKAjs.require_fast_deep_equal.call(void 0, ));
|
|
23
24
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
24
25
|
var _net = require('net'); var _net2 = _interopRequireDefault(_net);
|
|
25
26
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
@@ -30,7 +31,6 @@ var _open = require('open'); var _open2 = _interopRequireDefault(_open);
|
|
|
30
31
|
var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);
|
|
31
32
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
32
33
|
var _kolorist = require('kolorist');
|
|
33
|
-
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
34
34
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
35
35
|
var CONFIG_RESTART_FIELDS = [
|
|
36
36
|
"highlighter",
|
|
@@ -38,7 +38,7 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
38
38
|
"routerMode",
|
|
39
39
|
"fonts"
|
|
40
40
|
];
|
|
41
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
41
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkFHAYPMSGjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
42
42
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
43
43
|
alias: "p",
|
|
44
44
|
type: "number",
|
|
@@ -82,9 +82,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
82
82
|
async function initServer() {
|
|
83
83
|
if (server)
|
|
84
84
|
await server.close();
|
|
85
|
-
const options = await
|
|
85
|
+
const options = await _chunkFHAYPMSGjs.resolveOptions.call(void 0, { entry, theme }, "dev");
|
|
86
86
|
port = userPort || await findFreePort(3030);
|
|
87
|
-
server = await
|
|
87
|
+
server = await _chunkZ64T7ZBUjs.createServer.call(void 0, options, {
|
|
88
88
|
server: {
|
|
89
89
|
port,
|
|
90
90
|
strictPort: true,
|
|
@@ -95,7 +95,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
95
95
|
logLevel: log
|
|
96
96
|
}, {
|
|
97
97
|
onDataReload(newData, data) {
|
|
98
|
-
if (!theme &&
|
|
98
|
+
if (!theme && _chunkFHAYPMSGjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkFHAYPMSGjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
99
99
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
100
100
|
initServer();
|
|
101
101
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -171,8 +171,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
171
171
|
type: "boolean",
|
|
172
172
|
describe: "allow download as PDF"
|
|
173
173
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
174
|
-
const { build } = await Promise.resolve().then(() =>
|
|
175
|
-
const options = await
|
|
174
|
+
const { build } = await Promise.resolve().then(() => _chunkBYTWGCY3js.__toModule.call(void 0, _chunkBYTWGCY3js.__require.call(void 0, "./build-IHQEXPWU.js")));
|
|
175
|
+
const options = await _chunkFHAYPMSGjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
176
176
|
if (download && !options.data.config.download)
|
|
177
177
|
options.data.config.download = download;
|
|
178
178
|
printInfo(options);
|
|
@@ -185,26 +185,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
185
185
|
});
|
|
186
186
|
});
|
|
187
187
|
cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
|
|
188
|
-
const data = await
|
|
189
|
-
|
|
190
|
-
await
|
|
188
|
+
const data = await _chunkFHAYPMSGjs.fs_exports.load(entry);
|
|
189
|
+
_chunkFHAYPMSGjs.fs_exports.prettify(data);
|
|
190
|
+
await _chunkFHAYPMSGjs.fs_exports.save(data);
|
|
191
191
|
});
|
|
192
192
|
cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
193
193
|
return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
|
|
194
194
|
type: "string",
|
|
195
195
|
default: "theme"
|
|
196
196
|
}), async ({ entry, dir, theme: themeInput }) => {
|
|
197
|
-
const data = await
|
|
198
|
-
const theme =
|
|
197
|
+
const data = await _chunkFHAYPMSGjs.fs_exports.load(entry);
|
|
198
|
+
const theme = _chunkFHAYPMSGjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
199
199
|
if (theme === "none") {
|
|
200
200
|
console.error('Can not eject theme "none"');
|
|
201
201
|
process.exit(1);
|
|
202
202
|
}
|
|
203
|
-
if (
|
|
203
|
+
if (_chunkFHAYPMSGjs.isPath.call(void 0, theme)) {
|
|
204
204
|
console.error("Theme is already ejected");
|
|
205
205
|
process.exit(1);
|
|
206
206
|
}
|
|
207
|
-
const roots =
|
|
207
|
+
const roots = _chunkFHAYPMSGjs.getThemeRoots.call(void 0, theme, entry);
|
|
208
208
|
if (!roots.length) {
|
|
209
209
|
console.error(`Does not found theme "${theme}"`);
|
|
210
210
|
process.exit(1);
|
|
@@ -216,7 +216,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
216
216
|
const dirPath = `./${dir}`;
|
|
217
217
|
data.slides[0].frontmatter.theme = dirPath;
|
|
218
218
|
data.slides[0].raw = null;
|
|
219
|
-
await
|
|
219
|
+
await _chunkFHAYPMSGjs.fs_exports.save(data);
|
|
220
220
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
221
221
|
});
|
|
222
222
|
}, () => {
|
|
@@ -259,16 +259,16 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
259
259
|
}) => {
|
|
260
260
|
output = output || `${_path2.default.basename(entry, ".md")}-export`;
|
|
261
261
|
process.env.NODE_ENV = "production";
|
|
262
|
-
const { exportSlides } = await Promise.resolve().then(() =>
|
|
262
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkBYTWGCY3js.__toModule.call(void 0, _chunkBYTWGCY3js.__require.call(void 0, "./export-WXQSOLRA.js")));
|
|
263
263
|
const port = await findFreePort(12445);
|
|
264
|
-
const options = await
|
|
265
|
-
const server = await
|
|
264
|
+
const options = await _chunkFHAYPMSGjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
265
|
+
const server = await _chunkZ64T7ZBUjs.createServer.call(void 0, options, {
|
|
266
266
|
server: { port },
|
|
267
267
|
clearScreen: false
|
|
268
268
|
});
|
|
269
269
|
await server.listen(port);
|
|
270
270
|
printInfo(options);
|
|
271
|
-
|
|
271
|
+
_chunkFHAYPMSGjs.fs_exports.filterDisabled(options.data);
|
|
272
272
|
const width = 1920;
|
|
273
273
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
274
274
|
output = await exportSlides({
|
|
@@ -305,7 +305,7 @@ function printInfo(options, port, remote) {
|
|
|
305
305
|
console.log();
|
|
306
306
|
console.log();
|
|
307
307
|
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${
|
|
308
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkFHAYPMSGjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
309
309
|
console.log();
|
|
310
310
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
311
311
|
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,22 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RLNIZC66.mjs";
|
|
4
4
|
import {
|
|
5
|
+
fs_exports,
|
|
5
6
|
getThemeRoots,
|
|
6
7
|
isPath,
|
|
7
8
|
resolveOptions,
|
|
8
9
|
resolveThemeName,
|
|
9
10
|
version
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MP2CDYSZ.mjs";
|
|
11
12
|
import {
|
|
12
13
|
require_fast_deep_equal
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2E3KKOOJ.mjs";
|
|
14
15
|
import {
|
|
15
16
|
__dirname,
|
|
16
17
|
__require,
|
|
17
18
|
__toModule,
|
|
18
19
|
init_esm_shims
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OXQUV4ZP.mjs";
|
|
20
21
|
|
|
21
22
|
// node/cli.ts
|
|
22
23
|
init_esm_shims();
|
|
@@ -31,7 +32,6 @@ import openBrowser from "open";
|
|
|
31
32
|
import yargs from "yargs";
|
|
32
33
|
import prompts from "prompts";
|
|
33
34
|
import { blue, bold, cyan, dim, gray, green, underline, yellow } from "kolorist";
|
|
34
|
-
import * as parser from "@slidev/parser/fs";
|
|
35
35
|
import isInstalledGlobally from "is-installed-globally";
|
|
36
36
|
var CONFIG_RESTART_FIELDS = [
|
|
37
37
|
"highlighter",
|
|
@@ -172,7 +172,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
172
172
|
type: "boolean",
|
|
173
173
|
describe: "allow download as PDF"
|
|
174
174
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
175
|
-
const { build } = await Promise.resolve().then(() => __toModule(__require("./build-
|
|
175
|
+
const { build } = await Promise.resolve().then(() => __toModule(__require("./build-MGE5AXXE.mjs")));
|
|
176
176
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
177
177
|
if (download && !options.data.config.download)
|
|
178
178
|
options.data.config.download = download;
|
|
@@ -186,16 +186,16 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
186
186
|
});
|
|
187
187
|
});
|
|
188
188
|
cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
|
|
189
|
-
const data = await
|
|
190
|
-
|
|
191
|
-
await
|
|
189
|
+
const data = await fs_exports.load(entry);
|
|
190
|
+
fs_exports.prettify(data);
|
|
191
|
+
await fs_exports.save(data);
|
|
192
192
|
});
|
|
193
193
|
cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
194
194
|
return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
|
|
195
195
|
type: "string",
|
|
196
196
|
default: "theme"
|
|
197
197
|
}), async ({ entry, dir, theme: themeInput }) => {
|
|
198
|
-
const data = await
|
|
198
|
+
const data = await fs_exports.load(entry);
|
|
199
199
|
const theme = resolveThemeName(themeInput || data.config.theme);
|
|
200
200
|
if (theme === "none") {
|
|
201
201
|
console.error('Can not eject theme "none"');
|
|
@@ -217,7 +217,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
217
217
|
const dirPath = `./${dir}`;
|
|
218
218
|
data.slides[0].frontmatter.theme = dirPath;
|
|
219
219
|
data.slides[0].raw = null;
|
|
220
|
-
await
|
|
220
|
+
await fs_exports.save(data);
|
|
221
221
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
222
222
|
});
|
|
223
223
|
}, () => {
|
|
@@ -260,7 +260,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
260
260
|
}) => {
|
|
261
261
|
output = output || `${path.basename(entry, ".md")}-export`;
|
|
262
262
|
process.env.NODE_ENV = "production";
|
|
263
|
-
const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-
|
|
263
|
+
const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-7GHMNSMB.mjs")));
|
|
264
264
|
const port = await findFreePort(12445);
|
|
265
265
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
266
266
|
const server = await createServer(options, {
|
|
@@ -269,7 +269,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
269
269
|
});
|
|
270
270
|
await server.listen(port);
|
|
271
271
|
printInfo(options);
|
|
272
|
-
|
|
272
|
+
fs_exports.filterDisabled(options.data);
|
|
273
273
|
const width = 1920;
|
|
274
274
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
275
275
|
output = await exportSlides({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
packageExists
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MP2CDYSZ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__require,
|
|
6
6
|
__toModule,
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OXQUV4ZP.mjs";
|
|
9
9
|
|
|
10
10
|
// node/export.ts
|
|
11
11
|
init_esm_shims();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFHAYPMSGjs = require('./chunk-FHAYPMSG.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.js');
|
|
9
9
|
|
|
10
10
|
// node/export.ts
|
|
11
|
-
|
|
11
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
12
12
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
13
13
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
14
14
|
var _pdflib = require('pdf-lib');
|
|
@@ -62,9 +62,9 @@ async function exportSlides({
|
|
|
62
62
|
height = 1080,
|
|
63
63
|
withClicks = false
|
|
64
64
|
}) {
|
|
65
|
-
if (!
|
|
65
|
+
if (!_chunkFHAYPMSGjs.packageExists.call(void 0, "playwright-chromium"))
|
|
66
66
|
throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i playwright-chromium`");
|
|
67
|
-
const { chromium } = await Promise.resolve().then(() =>
|
|
67
|
+
const { chromium } = await Promise.resolve().then(() => _chunkBYTWGCY3js.__toModule.call(void 0, _chunkBYTWGCY3js.__require.call(void 0, "playwright-chromium")));
|
|
68
68
|
const browser = await chromium.launch();
|
|
69
69
|
const context = await browser.newContext({
|
|
70
70
|
viewport: {
|
package/dist/index.d.ts
CHANGED
|
@@ -5,11 +5,9 @@ import Markdown from 'vite-plugin-md';
|
|
|
5
5
|
import WindiCSS from 'vite-plugin-windicss';
|
|
6
6
|
import RemoteAssets from 'vite-plugin-remote-assets';
|
|
7
7
|
import { ArgumentsType } from '@antfu/utils';
|
|
8
|
-
import { SlidevMarkdown } from '@slidev/types';
|
|
8
|
+
import { SlidevMarkdown, SlidevThemeMeta, SlidevConfig, FontOptions, ResolvedFontOptions, SlideInfoBase, SlidevFeatureFlags, SlideInfoWithPath } from '@slidev/types';
|
|
9
9
|
import * as vite from 'vite';
|
|
10
10
|
import { InlineConfig, Plugin } from 'vite';
|
|
11
|
-
import * as fs from '@slidev/parser/fs';
|
|
12
|
-
export { fs as parser };
|
|
13
11
|
|
|
14
12
|
interface SlidevEntryOptions {
|
|
15
13
|
/**
|
|
@@ -78,4 +76,70 @@ declare function ViteSlidevPlugin(options: ResolvedSlidevOptions, pluginOptions:
|
|
|
78
76
|
|
|
79
77
|
declare function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, data }: ResolvedSlidevOptions, { windicss: windiOptions }: SlidevPluginOptions): Promise<vite.Plugin[]>;
|
|
80
78
|
|
|
81
|
-
|
|
79
|
+
/**
|
|
80
|
+
* 1,3-5,8 => [1, 3, 4, 5, 8]
|
|
81
|
+
*/
|
|
82
|
+
declare function parseRangeString(total: number, rangeStr?: string): number[];
|
|
83
|
+
/**
|
|
84
|
+
* Accepts `16/9` `1:1` `3x4`
|
|
85
|
+
*/
|
|
86
|
+
declare function parseAspectRatio(str: string | number): number;
|
|
87
|
+
|
|
88
|
+
declare function resolveConfig(headmatter: any, themeMeta?: SlidevThemeMeta): SlidevConfig;
|
|
89
|
+
declare function resolveFonts(fonts?: FontOptions): ResolvedFontOptions;
|
|
90
|
+
|
|
91
|
+
declare function stringify(data: SlidevMarkdown): string;
|
|
92
|
+
declare function filterDisabled(data: SlidevMarkdown): SlidevMarkdown;
|
|
93
|
+
declare function stringifySlide(data: SlideInfoBase, idx?: number): string;
|
|
94
|
+
declare function prettifySlide(data: SlideInfoBase): SlideInfoBase;
|
|
95
|
+
declare function prettify(data: SlidevMarkdown): SlidevMarkdown;
|
|
96
|
+
declare function detectFeatures(code: string): SlidevFeatureFlags;
|
|
97
|
+
declare function parseSlide(raw: string): SlideInfoBase;
|
|
98
|
+
declare function parse(markdown: string, filepath?: string, themeMeta?: SlidevThemeMeta): SlidevMarkdown;
|
|
99
|
+
declare function mergeFeatureFlags(a: SlidevFeatureFlags, b: SlidevFeatureFlags): SlidevFeatureFlags;
|
|
100
|
+
declare function scanMonacoModules(md: string): string[];
|
|
101
|
+
|
|
102
|
+
declare function load(filepath: string, themeMeta?: SlidevThemeMeta, content?: string): Promise<SlidevMarkdown>;
|
|
103
|
+
declare function save(data: SlidevMarkdown, filepath?: string): Promise<void>;
|
|
104
|
+
declare function saveExternalSlide(slide: SlideInfoWithPath): Promise<void>;
|
|
105
|
+
|
|
106
|
+
declare const fs_load: typeof load;
|
|
107
|
+
declare const fs_save: typeof save;
|
|
108
|
+
declare const fs_saveExternalSlide: typeof saveExternalSlide;
|
|
109
|
+
declare const fs_parseRangeString: typeof parseRangeString;
|
|
110
|
+
declare const fs_parseAspectRatio: typeof parseAspectRatio;
|
|
111
|
+
declare const fs_resolveConfig: typeof resolveConfig;
|
|
112
|
+
declare const fs_resolveFonts: typeof resolveFonts;
|
|
113
|
+
declare const fs_stringify: typeof stringify;
|
|
114
|
+
declare const fs_filterDisabled: typeof filterDisabled;
|
|
115
|
+
declare const fs_stringifySlide: typeof stringifySlide;
|
|
116
|
+
declare const fs_prettifySlide: typeof prettifySlide;
|
|
117
|
+
declare const fs_prettify: typeof prettify;
|
|
118
|
+
declare const fs_detectFeatures: typeof detectFeatures;
|
|
119
|
+
declare const fs_parseSlide: typeof parseSlide;
|
|
120
|
+
declare const fs_parse: typeof parse;
|
|
121
|
+
declare const fs_mergeFeatureFlags: typeof mergeFeatureFlags;
|
|
122
|
+
declare const fs_scanMonacoModules: typeof scanMonacoModules;
|
|
123
|
+
declare namespace fs {
|
|
124
|
+
export {
|
|
125
|
+
fs_load as load,
|
|
126
|
+
fs_save as save,
|
|
127
|
+
fs_saveExternalSlide as saveExternalSlide,
|
|
128
|
+
fs_parseRangeString as parseRangeString,
|
|
129
|
+
fs_parseAspectRatio as parseAspectRatio,
|
|
130
|
+
fs_resolveConfig as resolveConfig,
|
|
131
|
+
fs_resolveFonts as resolveFonts,
|
|
132
|
+
fs_stringify as stringify,
|
|
133
|
+
fs_filterDisabled as filterDisabled,
|
|
134
|
+
fs_stringifySlide as stringifySlide,
|
|
135
|
+
fs_prettifySlide as prettifySlide,
|
|
136
|
+
fs_prettify as prettify,
|
|
137
|
+
fs_detectFeatures as detectFeatures,
|
|
138
|
+
fs_parseSlide as parseSlide,
|
|
139
|
+
fs_parse as parse,
|
|
140
|
+
fs_mergeFeatureFlags as mergeFeatureFlags,
|
|
141
|
+
fs_scanMonacoModules as scanMonacoModules,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { ResolvedSlidevOptions, SlidevEntryOptions, SlidevPluginOptions, SlidevServerOptions, ViteSlidevPlugin, createServer, createWindiCSSPlugin, getCLIRoot, getClientRoot, getThemeRoots, getUserRoot, isPath, fs as parser, resolveOptions };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZ64T7ZBUjs = require('./chunk-Z64T7ZBU.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,23 +8,21 @@ var _chunkVN5XPBZOjs = require('./chunk-VN5XPBZO.js');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var _chunkXEDZVJCHjs = require('./chunk-XEDZVJCH.js');
|
|
12
11
|
|
|
12
|
+
var _chunkFHAYPMSGjs = require('./chunk-FHAYPMSG.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var _chunk3ND6GSCFjs = require('./chunk-3ND6GSCF.js');
|
|
16
15
|
|
|
16
|
+
var _chunkINYQJTKAjs = require('./chunk-INYQJTKA.js');
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.js');
|
|
19
20
|
|
|
20
21
|
// node/index.ts
|
|
21
|
-
|
|
22
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
22
23
|
|
|
23
24
|
// node/declare.ts
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// node/index.ts
|
|
27
|
-
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
25
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
28
26
|
|
|
29
27
|
|
|
30
28
|
|
|
@@ -36,4 +34,4 @@ var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs
|
|
|
36
34
|
|
|
37
35
|
|
|
38
36
|
|
|
39
|
-
exports.ViteSlidevPlugin =
|
|
37
|
+
exports.ViteSlidevPlugin = _chunkINYQJTKAjs.ViteSlidevPlugin; exports.createServer = _chunkZ64T7ZBUjs.createServer; exports.createWindiCSSPlugin = _chunkINYQJTKAjs.createWindiCSSPlugin; exports.getCLIRoot = _chunkFHAYPMSGjs.getCLIRoot; exports.getClientRoot = _chunkFHAYPMSGjs.getClientRoot; exports.getThemeRoots = _chunkFHAYPMSGjs.getThemeRoots; exports.getUserRoot = _chunkFHAYPMSGjs.getUserRoot; exports.isPath = _chunkFHAYPMSGjs.isPath; exports.parser = _chunkFHAYPMSGjs.fs_exports; exports.resolveOptions = _chunkFHAYPMSGjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RLNIZC66.mjs";
|
|
4
4
|
import {
|
|
5
|
+
fs_exports,
|
|
5
6
|
getCLIRoot,
|
|
6
7
|
getClientRoot,
|
|
7
8
|
getThemeRoots,
|
|
8
9
|
getUserRoot,
|
|
9
10
|
isPath,
|
|
10
11
|
resolveOptions
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MP2CDYSZ.mjs";
|
|
12
13
|
import {
|
|
13
14
|
ViteSlidevPlugin,
|
|
14
15
|
createWindiCSSPlugin
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2E3KKOOJ.mjs";
|
|
16
17
|
import {
|
|
17
18
|
init_esm_shims
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OXQUV4ZP.mjs";
|
|
19
20
|
|
|
20
21
|
// node/index.ts
|
|
21
22
|
init_esm_shims();
|
|
22
23
|
|
|
23
24
|
// node/declare.ts
|
|
24
25
|
init_esm_shims();
|
|
25
|
-
|
|
26
|
-
// node/index.ts
|
|
27
|
-
import * as parser from "@slidev/parser/fs";
|
|
28
26
|
export {
|
|
29
27
|
ViteSlidevPlugin,
|
|
30
28
|
createServer,
|
|
@@ -34,6 +32,6 @@ export {
|
|
|
34
32
|
getThemeRoots,
|
|
35
33
|
getUserRoot,
|
|
36
34
|
isPath,
|
|
37
|
-
parser,
|
|
35
|
+
fs_exports as parser,
|
|
38
36
|
resolveOptions
|
|
39
37
|
};
|