@slidev/cli 0.41.0 → 0.42.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-KUT3K5TN.mjs → build-2HNZGPOJ.mjs} +5 -3
- package/dist/{build-3GLTTQXV.js → build-FWNZEWR3.js} +9 -7
- package/dist/chunk-6XVZLT3I.mjs +35 -0
- package/dist/chunk-6ZL4B4HQ.js +76 -0
- package/dist/{chunk-ATJEPFM2.mjs → chunk-7S3GFZIX.mjs} +8 -6
- package/dist/{chunk-AV6T2PNJ.mjs → chunk-C5RFODBO.mjs} +63 -184
- package/dist/chunk-CIUEQ4TI.mjs +76 -0
- package/dist/{chunk-46ATDXDT.js → chunk-DZKW5SLI.js} +82 -80
- package/dist/{chunk-UJUM4LW4.js → chunk-F4LLVFU7.js} +56 -177
- package/dist/chunk-KKGXM3XL.js +35 -0
- package/dist/{chunk-CTG3GV2W.mjs → chunk-L5QH2WZE.mjs} +1 -71
- package/dist/chunk-MJQETB73.js +68 -0
- package/dist/chunk-X7P5WRYP.mjs +65 -0
- package/dist/chunk-YI4ZV27K.js +65 -0
- package/dist/cli.js +38 -36
- package/dist/cli.mjs +14 -12
- package/dist/{export-KPPDUO6Z.mjs → export-KRS4L4HC.mjs} +2 -1
- package/dist/{export-GTPZJWVE.js → export-PN4EOI4Z.js} +4 -3
- package/dist/index.js +8 -4
- package/dist/index.mjs +8 -4
- package/dist/unocss-2CJUFE63.js +46 -0
- package/dist/unocss-ZLGTDCD7.mjs +46 -0
- package/dist/windicss-OSTDR2Z6.mjs +9 -0
- package/dist/windicss-YNIIPANV.js +9 -0
- package/package.json +8 -8
- package/dist/chunk-GE7W2DBE.js +0 -138
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadSetups
|
|
3
|
+
} from "./chunk-6XVZLT3I.mjs";
|
|
4
|
+
import {
|
|
5
|
+
resolveImportPath
|
|
6
|
+
} from "./chunk-CIUEQ4TI.mjs";
|
|
7
|
+
|
|
8
|
+
// node/plugins/windicss.ts
|
|
9
|
+
import { dirname, resolve } from "path";
|
|
10
|
+
import { existsSync } from "fs";
|
|
11
|
+
import { slash, uniq } from "@antfu/utils";
|
|
12
|
+
import jiti from "jiti";
|
|
13
|
+
async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
14
|
+
const { default: WindiCSS } = await import("vite-plugin-windicss");
|
|
15
|
+
const { defaultConfigureFiles } = await import("@windicss/config");
|
|
16
|
+
const configFiles = uniq([
|
|
17
|
+
...defaultConfigureFiles.map((i) => resolve(userRoot, i)),
|
|
18
|
+
...themeRoots.map((i) => `${i}/windi.config.ts`),
|
|
19
|
+
...addonRoots.map((i) => `${i}/windi.config.ts`),
|
|
20
|
+
resolve(clientRoot, "windi.config.ts")
|
|
21
|
+
]);
|
|
22
|
+
const configFile = configFiles.find((i) => existsSync(i));
|
|
23
|
+
let config = jiti(__filename)(configFile);
|
|
24
|
+
if (config.default)
|
|
25
|
+
config = config.default;
|
|
26
|
+
config = await loadSetups(roots, "windicss.ts", {}, config, true);
|
|
27
|
+
return WindiCSS(
|
|
28
|
+
{
|
|
29
|
+
configFiles: [configFile],
|
|
30
|
+
config,
|
|
31
|
+
onConfigResolved(config2) {
|
|
32
|
+
if (!config2.theme)
|
|
33
|
+
config2.theme = {};
|
|
34
|
+
if (!config2.theme.extend)
|
|
35
|
+
config2.theme.extend = {};
|
|
36
|
+
if (!config2.theme.extend.fontFamily)
|
|
37
|
+
config2.theme.extend.fontFamily = {};
|
|
38
|
+
const fontFamily = config2.theme.extend.fontFamily;
|
|
39
|
+
fontFamily.sans || (fontFamily.sans = data.config.fonts.sans.join(","));
|
|
40
|
+
fontFamily.mono || (fontFamily.mono = data.config.fonts.mono.join(","));
|
|
41
|
+
fontFamily.serif || (fontFamily.serif = data.config.fonts.serif.join(","));
|
|
42
|
+
return config2;
|
|
43
|
+
},
|
|
44
|
+
onOptionsResolved(config2) {
|
|
45
|
+
themeRoots.forEach((i) => {
|
|
46
|
+
config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
|
|
47
|
+
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
48
|
+
});
|
|
49
|
+
addonRoots.forEach((i) => {
|
|
50
|
+
config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
|
|
51
|
+
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
52
|
+
});
|
|
53
|
+
config2.scanOptions.include.push(`!${slash(resolve(userRoot, "node_modules"))}`);
|
|
54
|
+
config2.scanOptions.exclude.push(dirname(resolveImportPath("monaco-editor/package.json", true)));
|
|
55
|
+
config2.scanOptions.exclude.push(dirname(resolveImportPath("katex/package.json", true)));
|
|
56
|
+
config2.scanOptions.exclude.push(dirname(resolveImportPath("prettier/package.json", true)));
|
|
57
|
+
},
|
|
58
|
+
...windiOptions
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
createWindiCSSPlugin
|
|
65
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
+
|
|
3
|
+
var _chunkKKGXM3XLjs = require('./chunk-KKGXM3XL.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk6ZL4B4HQjs = require('./chunk-6ZL4B4HQ.js');
|
|
7
|
+
|
|
8
|
+
// node/plugins/windicss.ts
|
|
9
|
+
var _path = require('path');
|
|
10
|
+
var _fs = require('fs');
|
|
11
|
+
var _utils = require('@antfu/utils');
|
|
12
|
+
var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
|
|
13
|
+
async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
14
|
+
const { default: WindiCSS } = await Promise.resolve().then(() => require("vite-plugin-windicss"));
|
|
15
|
+
const { defaultConfigureFiles } = await Promise.resolve().then(() => require("@windicss/config"));
|
|
16
|
+
const configFiles = _utils.uniq.call(void 0, [
|
|
17
|
+
...defaultConfigureFiles.map((i) => _path.resolve.call(void 0, userRoot, i)),
|
|
18
|
+
...themeRoots.map((i) => `${i}/windi.config.ts`),
|
|
19
|
+
...addonRoots.map((i) => `${i}/windi.config.ts`),
|
|
20
|
+
_path.resolve.call(void 0, clientRoot, "windi.config.ts")
|
|
21
|
+
]);
|
|
22
|
+
const configFile = configFiles.find((i) => _fs.existsSync.call(void 0, i));
|
|
23
|
+
let config = _jiti2.default.call(void 0, __filename)(configFile);
|
|
24
|
+
if (config.default)
|
|
25
|
+
config = config.default;
|
|
26
|
+
config = await _chunkKKGXM3XLjs.loadSetups.call(void 0, roots, "windicss.ts", {}, config, true);
|
|
27
|
+
return WindiCSS(
|
|
28
|
+
{
|
|
29
|
+
configFiles: [configFile],
|
|
30
|
+
config,
|
|
31
|
+
onConfigResolved(config2) {
|
|
32
|
+
if (!config2.theme)
|
|
33
|
+
config2.theme = {};
|
|
34
|
+
if (!config2.theme.extend)
|
|
35
|
+
config2.theme.extend = {};
|
|
36
|
+
if (!config2.theme.extend.fontFamily)
|
|
37
|
+
config2.theme.extend.fontFamily = {};
|
|
38
|
+
const fontFamily = config2.theme.extend.fontFamily;
|
|
39
|
+
fontFamily.sans || (fontFamily.sans = data.config.fonts.sans.join(","));
|
|
40
|
+
fontFamily.mono || (fontFamily.mono = data.config.fonts.mono.join(","));
|
|
41
|
+
fontFamily.serif || (fontFamily.serif = data.config.fonts.serif.join(","));
|
|
42
|
+
return config2;
|
|
43
|
+
},
|
|
44
|
+
onOptionsResolved(config2) {
|
|
45
|
+
themeRoots.forEach((i) => {
|
|
46
|
+
config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
|
|
47
|
+
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
48
|
+
});
|
|
49
|
+
addonRoots.forEach((i) => {
|
|
50
|
+
config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
|
|
51
|
+
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
52
|
+
});
|
|
53
|
+
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
54
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk6ZL4B4HQjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
55
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk6ZL4B4HQjs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
56
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk6ZL4B4HQjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
57
|
+
},
|
|
58
|
+
...windiOptions
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
exports.createWindiCSSPlugin = createWindiCSSPlugin;
|
package/dist/cli.js
CHANGED
|
@@ -9,17 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkDZKW5SLIjs = require('./chunk-DZKW5SLI.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
var _chunkF4LLVFU7js = require('./chunk-F4LLVFU7.js');
|
|
15
16
|
|
|
16
|
-
var _chunkUJUM4LW4js = require('./chunk-UJUM4LW4.js');
|
|
17
17
|
|
|
18
|
+
var _chunkKKGXM3XLjs = require('./chunk-KKGXM3XL.js');
|
|
19
|
+
require('./chunk-6ZL4B4HQ.js');
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
|
|
22
|
+
var _chunkMJQETB73js = require('./chunk-MJQETB73.js');
|
|
20
23
|
|
|
21
24
|
// node/cli.ts
|
|
22
|
-
var import_fast_deep_equal =
|
|
25
|
+
var import_fast_deep_equal = _chunkMJQETB73js.__toESM.call(void 0, _chunkF4LLVFU7js.require_fast_deep_equal.call(void 0, ));
|
|
23
26
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
24
27
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
25
28
|
var _child_process = require('child_process');
|
|
@@ -45,15 +48,15 @@ _fs.injectPreparserExtensionLoader.call(void 0, async (headmatter, filepath) =>
|
|
|
45
48
|
const roots = (
|
|
46
49
|
/* uniq */
|
|
47
50
|
[
|
|
48
|
-
|
|
49
|
-
...
|
|
50
|
-
|
|
51
|
+
_chunkDZKW5SLIjs.getUserRoot.call(void 0, {}).userRoot,
|
|
52
|
+
..._chunkDZKW5SLIjs.getAddonRoots.call(void 0, addons, ""),
|
|
53
|
+
_chunkDZKW5SLIjs.getClientRoot.call(void 0, )
|
|
51
54
|
]
|
|
52
55
|
);
|
|
53
56
|
const mergeArrays = (a, b) => a.concat(b);
|
|
54
|
-
return await
|
|
57
|
+
return await _chunkKKGXM3XLjs.loadSetups.call(void 0, roots, "preparser.ts", { filepath, headmatter }, [], false, mergeArrays);
|
|
55
58
|
});
|
|
56
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
59
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkDZKW5SLIjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
57
60
|
cli.command(
|
|
58
61
|
"* [entry]",
|
|
59
62
|
"Start a local server for Slidev",
|
|
@@ -109,9 +112,9 @@ cli.command(
|
|
|
109
112
|
async function initServer() {
|
|
110
113
|
if (server)
|
|
111
114
|
await server.close();
|
|
112
|
-
const options = await
|
|
115
|
+
const options = await _chunkDZKW5SLIjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
113
116
|
port = userPort || await findFreePort(3030);
|
|
114
|
-
server = await
|
|
117
|
+
server = await _chunkDZKW5SLIjs.createServer.call(void 0,
|
|
115
118
|
options,
|
|
116
119
|
{
|
|
117
120
|
server: {
|
|
@@ -125,7 +128,7 @@ cli.command(
|
|
|
125
128
|
},
|
|
126
129
|
{
|
|
127
130
|
onDataReload(newData, data) {
|
|
128
|
-
if (!theme &&
|
|
131
|
+
if (!theme && _chunkDZKW5SLIjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkDZKW5SLIjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
129
132
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
130
133
|
initServer();
|
|
131
134
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -243,9 +246,9 @@ cli.command(
|
|
|
243
246
|
}).strict().help(),
|
|
244
247
|
async (args) => {
|
|
245
248
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
246
|
-
const { build } = await Promise.resolve().then(() => require("./build-
|
|
249
|
+
const { build } = await Promise.resolve().then(() => require("./build-FWNZEWR3.js"));
|
|
247
250
|
for (const entryFile of entry) {
|
|
248
|
-
const options = await
|
|
251
|
+
const options = await _chunkDZKW5SLIjs.resolveOptions.call(void 0, { entry: entryFile, theme, inspect }, "build");
|
|
249
252
|
if (download && !options.data.config.download)
|
|
250
253
|
options.data.config.download = download;
|
|
251
254
|
printInfo(options);
|
|
@@ -265,9 +268,9 @@ cli.command(
|
|
|
265
268
|
(args) => commonOptions(args).strict().help(),
|
|
266
269
|
async ({ entry }) => {
|
|
267
270
|
for (const entryFile of entry) {
|
|
268
|
-
const data = await
|
|
269
|
-
|
|
270
|
-
await
|
|
271
|
+
const data = await _chunkDZKW5SLIjs.parser.load(entryFile);
|
|
272
|
+
_chunkDZKW5SLIjs.parser.prettify(data);
|
|
273
|
+
await _chunkDZKW5SLIjs.parser.save(data);
|
|
271
274
|
}
|
|
272
275
|
}
|
|
273
276
|
);
|
|
@@ -283,17 +286,17 @@ cli.command(
|
|
|
283
286
|
default: "theme"
|
|
284
287
|
}),
|
|
285
288
|
async ({ entry, dir, theme: themeInput }) => {
|
|
286
|
-
const data = await
|
|
287
|
-
const theme =
|
|
289
|
+
const data = await _chunkDZKW5SLIjs.parser.load(entry);
|
|
290
|
+
const theme = _chunkDZKW5SLIjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
288
291
|
if (theme === "none") {
|
|
289
292
|
console.error('Cannot eject theme "none"');
|
|
290
293
|
process.exit(1);
|
|
291
294
|
}
|
|
292
|
-
if (
|
|
295
|
+
if (_chunkDZKW5SLIjs.isPath.call(void 0, theme)) {
|
|
293
296
|
console.error("Theme is already ejected");
|
|
294
297
|
process.exit(1);
|
|
295
298
|
}
|
|
296
|
-
const roots =
|
|
299
|
+
const roots = _chunkDZKW5SLIjs.getThemeRoots.call(void 0, theme, entry);
|
|
297
300
|
if (!roots.length) {
|
|
298
301
|
console.error(`Could not find theme "${theme}"`);
|
|
299
302
|
process.exit(1);
|
|
@@ -305,7 +308,7 @@ cli.command(
|
|
|
305
308
|
const dirPath = `./${dir}`;
|
|
306
309
|
data.slides[0].frontmatter.theme = dirPath;
|
|
307
310
|
data.slides[0].raw = null;
|
|
308
|
-
await
|
|
311
|
+
await _chunkDZKW5SLIjs.parser.save(data);
|
|
309
312
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
310
313
|
}
|
|
311
314
|
);
|
|
@@ -322,11 +325,11 @@ cli.command(
|
|
|
322
325
|
async (args) => {
|
|
323
326
|
const { entry, theme } = args;
|
|
324
327
|
process.env.NODE_ENV = "production";
|
|
325
|
-
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-
|
|
328
|
+
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-PN4EOI4Z.js"));
|
|
326
329
|
const port = await findFreePort(12445);
|
|
327
330
|
for (const entryFile of entry) {
|
|
328
|
-
const options = await
|
|
329
|
-
const server = await
|
|
331
|
+
const options = await _chunkDZKW5SLIjs.resolveOptions.call(void 0, { entry: entryFile, theme }, "export");
|
|
332
|
+
const server = await _chunkDZKW5SLIjs.createServer.call(void 0,
|
|
330
333
|
options,
|
|
331
334
|
{
|
|
332
335
|
server: { port },
|
|
@@ -335,7 +338,7 @@ cli.command(
|
|
|
335
338
|
);
|
|
336
339
|
await server.listen(port);
|
|
337
340
|
printInfo(options);
|
|
338
|
-
|
|
341
|
+
_chunkDZKW5SLIjs.parser.filterDisabled(options.data);
|
|
339
342
|
const result = await exportSlides({
|
|
340
343
|
port,
|
|
341
344
|
...getExportOptions({ ...args, entry: entryFile }, options)
|
|
@@ -368,11 +371,11 @@ cli.command(
|
|
|
368
371
|
timeout
|
|
369
372
|
}) => {
|
|
370
373
|
process.env.NODE_ENV = "production";
|
|
371
|
-
const { exportNotes } = await Promise.resolve().then(() => require("./export-
|
|
374
|
+
const { exportNotes } = await Promise.resolve().then(() => require("./export-PN4EOI4Z.js"));
|
|
372
375
|
const port = await findFreePort(12445);
|
|
373
376
|
for (const entryFile of entry) {
|
|
374
|
-
const options = await
|
|
375
|
-
const server = await
|
|
377
|
+
const options = await _chunkDZKW5SLIjs.resolveOptions.call(void 0, { entry: entryFile }, "export");
|
|
378
|
+
const server = await _chunkDZKW5SLIjs.createServer.call(void 0,
|
|
376
379
|
options,
|
|
377
380
|
{
|
|
378
381
|
server: { port },
|
|
@@ -381,7 +384,7 @@ cli.command(
|
|
|
381
384
|
);
|
|
382
385
|
await server.listen(port);
|
|
383
386
|
printInfo(options);
|
|
384
|
-
|
|
387
|
+
_chunkDZKW5SLIjs.parser.filterDisabled(options.data);
|
|
385
388
|
const result = await exportNotes({
|
|
386
389
|
port,
|
|
387
390
|
output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${_path2.default.basename(entryFile, ".md")}-export-notes`),
|
|
@@ -442,10 +445,12 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
442
445
|
console.log();
|
|
443
446
|
console.log();
|
|
444
447
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
445
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
448
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkDZKW5SLIjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
446
449
|
console.log();
|
|
447
|
-
|
|
448
|
-
console.log(_kolorist.dim.call(void 0, "
|
|
450
|
+
_parser.verifyConfig.call(void 0, options.data.config, options.data.themeMeta, (v) => console.warn(_kolorist.yellow.call(void 0, ` ! ${v}`)));
|
|
451
|
+
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
452
|
+
console.log(_kolorist.dim.call(void 0, " css engine ") + (options.data.config.css ? _kolorist.blue.call(void 0, options.data.config.css) : _kolorist.gray.call(void 0, "none")));
|
|
453
|
+
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));
|
|
449
454
|
if (port) {
|
|
450
455
|
const query = remote ? `?password=${remote}` : "";
|
|
451
456
|
const presenterPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}presenter/${query}`;
|
|
@@ -475,9 +480,6 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
475
480
|
console.log(`${_kolorist.dim.call(void 0, " shortcuts ")} > ${_kolorist.underline.call(void 0, "r")}${_kolorist.dim.call(void 0, "estart | ")}${_kolorist.underline.call(void 0, "o")}${_kolorist.dim.call(void 0, "pen | ")}${_kolorist.underline.call(void 0, "e")}${_kolorist.dim.call(void 0, "dit")}${lastRemoteUrl ? ` | ${_kolorist.dim.call(void 0, "qr")}${_kolorist.underline.call(void 0, "c")}${_kolorist.dim.call(void 0, "ode")}` : ""}`);
|
|
476
481
|
return lastRemoteUrl;
|
|
477
482
|
}
|
|
478
|
-
console.log();
|
|
479
|
-
_parser.verifyConfig.call(void 0, options.data.config, options.data.themeMeta, (v) => console.warn(_kolorist.yellow.call(void 0, ` ! ${v}`)));
|
|
480
|
-
console.log();
|
|
481
483
|
}
|
|
482
484
|
async function findFreePort(start) {
|
|
483
485
|
if (await _getportplease.checkPort.call(void 0, start) !== false)
|
package/dist/cli.mjs
CHANGED
|
@@ -9,14 +9,17 @@ import {
|
|
|
9
9
|
resolveOptions,
|
|
10
10
|
resolveThemeName,
|
|
11
11
|
version
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7S3GFZIX.mjs";
|
|
13
13
|
import {
|
|
14
|
-
loadSetups,
|
|
15
14
|
require_fast_deep_equal
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-C5RFODBO.mjs";
|
|
16
|
+
import {
|
|
17
|
+
loadSetups
|
|
18
|
+
} from "./chunk-6XVZLT3I.mjs";
|
|
19
|
+
import "./chunk-CIUEQ4TI.mjs";
|
|
17
20
|
import {
|
|
18
21
|
__toESM
|
|
19
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-L5QH2WZE.mjs";
|
|
20
23
|
|
|
21
24
|
// node/cli.ts
|
|
22
25
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal());
|
|
@@ -243,7 +246,7 @@ cli.command(
|
|
|
243
246
|
}).strict().help(),
|
|
244
247
|
async (args) => {
|
|
245
248
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
246
|
-
const { build } = await import("./build-
|
|
249
|
+
const { build } = await import("./build-2HNZGPOJ.mjs");
|
|
247
250
|
for (const entryFile of entry) {
|
|
248
251
|
const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
|
|
249
252
|
if (download && !options.data.config.download)
|
|
@@ -322,7 +325,7 @@ cli.command(
|
|
|
322
325
|
async (args) => {
|
|
323
326
|
const { entry, theme } = args;
|
|
324
327
|
process.env.NODE_ENV = "production";
|
|
325
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
328
|
+
const { exportSlides, getExportOptions } = await import("./export-KRS4L4HC.mjs");
|
|
326
329
|
const port = await findFreePort(12445);
|
|
327
330
|
for (const entryFile of entry) {
|
|
328
331
|
const options = await resolveOptions({ entry: entryFile, theme }, "export");
|
|
@@ -368,7 +371,7 @@ cli.command(
|
|
|
368
371
|
timeout
|
|
369
372
|
}) => {
|
|
370
373
|
process.env.NODE_ENV = "production";
|
|
371
|
-
const { exportNotes } = await import("./export-
|
|
374
|
+
const { exportNotes } = await import("./export-KRS4L4HC.mjs");
|
|
372
375
|
const port = await findFreePort(12445);
|
|
373
376
|
for (const entryFile of entry) {
|
|
374
377
|
const options = await resolveOptions({ entry: entryFile }, "export");
|
|
@@ -444,8 +447,10 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
444
447
|
console.log(` ${cyan("\u25CF") + blue("\u25A0") + yellow("\u25B2")}`);
|
|
445
448
|
console.log(`${bold(" Slidev")} ${blue(`v${version}`)} ${isInstalledGlobally ? yellow("(global)") : ""}`);
|
|
446
449
|
console.log();
|
|
447
|
-
|
|
448
|
-
console.log(dim("
|
|
450
|
+
verifyConfig(options.data.config, options.data.themeMeta, (v) => console.warn(yellow(` ! ${v}`)));
|
|
451
|
+
console.log(dim(" theme ") + (options.theme ? green(options.theme) : gray("none")));
|
|
452
|
+
console.log(dim(" css engine ") + (options.data.config.css ? blue(options.data.config.css) : gray("none")));
|
|
453
|
+
console.log(dim(" entry ") + dim(path.dirname(options.entry) + path.sep) + path.basename(options.entry));
|
|
449
454
|
if (port) {
|
|
450
455
|
const query = remote ? `?password=${remote}` : "";
|
|
451
456
|
const presenterPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}presenter/${query}`;
|
|
@@ -475,9 +480,6 @@ function printInfo(options, port, remote, tunnelUrl) {
|
|
|
475
480
|
console.log(`${dim(" shortcuts ")} > ${underline("r")}${dim("estart | ")}${underline("o")}${dim("pen | ")}${underline("e")}${dim("dit")}${lastRemoteUrl ? ` | ${dim("qr")}${underline("c")}${dim("ode")}` : ""}`);
|
|
476
481
|
return lastRemoteUrl;
|
|
477
482
|
}
|
|
478
|
-
console.log();
|
|
479
|
-
verifyConfig(options.data.config, options.data.themeMeta, (v) => console.warn(yellow(` ! ${v}`)));
|
|
480
|
-
console.log();
|
|
481
483
|
}
|
|
482
484
|
async function findFreePort(start) {
|
|
483
485
|
if (await checkPort(start) !== false)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6ZL4B4HQjs = require('./chunk-6ZL4B4HQ.js');
|
|
4
|
+
require('./chunk-MJQETB73.js');
|
|
4
5
|
|
|
5
6
|
// node/export.ts
|
|
6
7
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -76,7 +77,7 @@ async function exportNotes({
|
|
|
76
77
|
output = "notes",
|
|
77
78
|
timeout = 3e4
|
|
78
79
|
}) {
|
|
79
|
-
if (!
|
|
80
|
+
if (!_chunk6ZL4B4HQjs.packageExists.call(void 0, "playwright-chromium"))
|
|
80
81
|
throw new Error("The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`");
|
|
81
82
|
const { chromium } = await Promise.resolve().then(() => require("playwright-chromium"));
|
|
82
83
|
const browser = await chromium.launch();
|
|
@@ -122,7 +123,7 @@ async function exportSlides({
|
|
|
122
123
|
withToc = false,
|
|
123
124
|
perSlide = false
|
|
124
125
|
}) {
|
|
125
|
-
if (!
|
|
126
|
+
if (!_chunk6ZL4B4HQjs.packageExists.call(void 0, "playwright-chromium"))
|
|
126
127
|
throw new Error("The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`");
|
|
127
128
|
const pages = _core.parseRangeString.call(void 0, total, range);
|
|
128
129
|
const { chromium } = await Promise.resolve().then(() => require("playwright-chromium"));
|
package/dist/index.js
CHANGED
|
@@ -9,13 +9,16 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkDZKW5SLIjs = require('./chunk-DZKW5SLI.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
var _chunkYI4ZV27Kjs = require('./chunk-YI4ZV27K.js');
|
|
15
16
|
|
|
16
|
-
var _chunkUJUM4LW4js = require('./chunk-UJUM4LW4.js');
|
|
17
|
-
require('./chunk-GE7W2DBE.js');
|
|
18
17
|
|
|
18
|
+
var _chunkF4LLVFU7js = require('./chunk-F4LLVFU7.js');
|
|
19
|
+
require('./chunk-KKGXM3XL.js');
|
|
20
|
+
require('./chunk-6ZL4B4HQ.js');
|
|
21
|
+
require('./chunk-MJQETB73.js');
|
|
19
22
|
|
|
20
23
|
|
|
21
24
|
|
|
@@ -28,4 +31,5 @@ require('./chunk-GE7W2DBE.js');
|
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
|
|
35
|
+
exports.ViteSlidevPlugin = _chunkF4LLVFU7js.ViteSlidevPlugin; exports.createServer = _chunkDZKW5SLIjs.createServer; exports.createWindiCSSPlugin = _chunkYI4ZV27Kjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkDZKW5SLIjs.getAddonRoots; exports.getCLIRoot = _chunkDZKW5SLIjs.getCLIRoot; exports.getClientRoot = _chunkDZKW5SLIjs.getClientRoot; exports.getRoot = _chunkDZKW5SLIjs.getRoot; exports.getThemeRoots = _chunkDZKW5SLIjs.getThemeRoots; exports.getUserRoot = _chunkDZKW5SLIjs.getUserRoot; exports.isPath = _chunkDZKW5SLIjs.isPath; exports.parser = _chunkDZKW5SLIjs.parser; exports.resolveOptions = _chunkDZKW5SLIjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -9,12 +9,16 @@ import {
|
|
|
9
9
|
isPath,
|
|
10
10
|
parser,
|
|
11
11
|
resolveOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7S3GFZIX.mjs";
|
|
13
13
|
import {
|
|
14
|
-
ViteSlidevPlugin,
|
|
15
14
|
createWindiCSSPlugin
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import
|
|
15
|
+
} from "./chunk-X7P5WRYP.mjs";
|
|
16
|
+
import {
|
|
17
|
+
ViteSlidevPlugin
|
|
18
|
+
} from "./chunk-C5RFODBO.mjs";
|
|
19
|
+
import "./chunk-6XVZLT3I.mjs";
|
|
20
|
+
import "./chunk-CIUEQ4TI.mjs";
|
|
21
|
+
import "./chunk-L5QH2WZE.mjs";
|
|
18
22
|
export {
|
|
19
23
|
ViteSlidevPlugin,
|
|
20
24
|
createServer,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
+
|
|
3
|
+
var _chunkKKGXM3XLjs = require('./chunk-KKGXM3XL.js');
|
|
4
|
+
require('./chunk-MJQETB73.js');
|
|
5
|
+
|
|
6
|
+
// node/plugins/unocss.ts
|
|
7
|
+
var _path = require('path');
|
|
8
|
+
var _fs = require('fs');
|
|
9
|
+
var _utils = require('@antfu/utils');
|
|
10
|
+
var _unocss = require('unocss');
|
|
11
|
+
var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
|
|
12
|
+
var _vite = require('unocss/vite'); var _vite2 = _interopRequireDefault(_vite);
|
|
13
|
+
async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, userRoot, data }, { unocss: unoOptions = {} }) {
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
|
+
const configFiles = _utils.uniq.call(void 0, [
|
|
16
|
+
_path.resolve.call(void 0, userRoot, "uno.config.ts"),
|
|
17
|
+
_path.resolve.call(void 0, userRoot, "unocss.config.ts"),
|
|
18
|
+
...themeRoots.map((i) => `${i}/uno.config.ts`),
|
|
19
|
+
...themeRoots.map((i) => `${i}/unocss.config.ts`),
|
|
20
|
+
...addonRoots.map((i) => `${i}/uno.config.ts`),
|
|
21
|
+
...addonRoots.map((i) => `${i}/unocss.config.ts`),
|
|
22
|
+
_path.resolve.call(void 0, clientRoot, "uno.config.ts"),
|
|
23
|
+
_path.resolve.call(void 0, clientRoot, "unocss.config.ts")
|
|
24
|
+
]).filter((i) => _fs.existsSync.call(void 0, i));
|
|
25
|
+
const configs = configFiles.map((i) => {
|
|
26
|
+
const loaded = _jiti2.default.call(void 0, __filename)(i);
|
|
27
|
+
const config2 = "default" in loaded ? loaded.default : loaded;
|
|
28
|
+
return config2;
|
|
29
|
+
}).filter(Boolean);
|
|
30
|
+
configs.reverse();
|
|
31
|
+
let config = _unocss.mergeConfigs.call(void 0, [...configs, unoOptions]);
|
|
32
|
+
config = await _chunkKKGXM3XLjs.loadSetups.call(void 0, roots, "unocss.ts", {}, config, true);
|
|
33
|
+
config.theme || (config.theme = {});
|
|
34
|
+
(_a = config.theme).fontFamily || (_a.fontFamily = {});
|
|
35
|
+
(_b = config.theme.fontFamily).sans || (_b.sans = data.config.fonts.sans.join(","));
|
|
36
|
+
(_c = config.theme.fontFamily).mono || (_c.mono = data.config.fonts.mono.join(","));
|
|
37
|
+
(_d = config.theme.fontFamily).serif || (_d.serif = data.config.fonts.serif.join(","));
|
|
38
|
+
return _vite2.default.call(void 0, {
|
|
39
|
+
configFile: false,
|
|
40
|
+
configDeps: configFiles,
|
|
41
|
+
...config
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
exports.createUnocssPlugin = createUnocssPlugin;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadSetups
|
|
3
|
+
} from "./chunk-6XVZLT3I.mjs";
|
|
4
|
+
import "./chunk-L5QH2WZE.mjs";
|
|
5
|
+
|
|
6
|
+
// node/plugins/unocss.ts
|
|
7
|
+
import { resolve } from "path";
|
|
8
|
+
import { existsSync } from "fs";
|
|
9
|
+
import { uniq } from "@antfu/utils";
|
|
10
|
+
import { mergeConfigs } from "unocss";
|
|
11
|
+
import jiti from "jiti";
|
|
12
|
+
import UnoCSS from "unocss/vite";
|
|
13
|
+
async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, userRoot, data }, { unocss: unoOptions = {} }) {
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
|
+
const configFiles = uniq([
|
|
16
|
+
resolve(userRoot, "uno.config.ts"),
|
|
17
|
+
resolve(userRoot, "unocss.config.ts"),
|
|
18
|
+
...themeRoots.map((i) => `${i}/uno.config.ts`),
|
|
19
|
+
...themeRoots.map((i) => `${i}/unocss.config.ts`),
|
|
20
|
+
...addonRoots.map((i) => `${i}/uno.config.ts`),
|
|
21
|
+
...addonRoots.map((i) => `${i}/unocss.config.ts`),
|
|
22
|
+
resolve(clientRoot, "uno.config.ts"),
|
|
23
|
+
resolve(clientRoot, "unocss.config.ts")
|
|
24
|
+
]).filter((i) => existsSync(i));
|
|
25
|
+
const configs = configFiles.map((i) => {
|
|
26
|
+
const loaded = jiti(__filename)(i);
|
|
27
|
+
const config2 = "default" in loaded ? loaded.default : loaded;
|
|
28
|
+
return config2;
|
|
29
|
+
}).filter(Boolean);
|
|
30
|
+
configs.reverse();
|
|
31
|
+
let config = mergeConfigs([...configs, unoOptions]);
|
|
32
|
+
config = await loadSetups(roots, "unocss.ts", {}, config, true);
|
|
33
|
+
config.theme || (config.theme = {});
|
|
34
|
+
(_a = config.theme).fontFamily || (_a.fontFamily = {});
|
|
35
|
+
(_b = config.theme.fontFamily).sans || (_b.sans = data.config.fonts.sans.join(","));
|
|
36
|
+
(_c = config.theme.fontFamily).mono || (_c.mono = data.config.fonts.mono.join(","));
|
|
37
|
+
(_d = config.theme.fontFamily).serif || (_d.serif = data.config.fonts.serif.join(","));
|
|
38
|
+
return UnoCSS({
|
|
39
|
+
configFile: false,
|
|
40
|
+
configDeps: configFiles,
|
|
41
|
+
...config
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
createUnocssPlugin
|
|
46
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkYI4ZV27Kjs = require('./chunk-YI4ZV27K.js');
|
|
4
|
+
require('./chunk-KKGXM3XL.js');
|
|
5
|
+
require('./chunk-6ZL4B4HQ.js');
|
|
6
|
+
require('./chunk-MJQETB73.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.createWindiCSSPlugin = _chunkYI4ZV27Kjs.createWindiCSSPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -81,22 +81,22 @@
|
|
|
81
81
|
"resolve-from": "^5.0.0",
|
|
82
82
|
"resolve-global": "^1.0.0",
|
|
83
83
|
"shiki": "^0.14.2",
|
|
84
|
-
"unocss": "^0.
|
|
84
|
+
"unocss": "^0.52.4",
|
|
85
85
|
"unplugin-icons": "^0.16.1",
|
|
86
86
|
"unplugin-vue-components": "^0.24.1",
|
|
87
|
-
"vite": "^4.3.
|
|
88
|
-
"vite-plugin-inspect": "^0.7.
|
|
87
|
+
"vite": "^4.3.9",
|
|
88
|
+
"vite-plugin-inspect": "^0.7.28",
|
|
89
89
|
"vite-plugin-remote-assets": "^0.3.2",
|
|
90
90
|
"vite-plugin-static-copy": "^0.15.0",
|
|
91
91
|
"vite-plugin-vue-markdown": "^0.23.5",
|
|
92
92
|
"vite-plugin-vue-server-ref": "^0.3.3",
|
|
93
93
|
"vite-plugin-windicss": "^1.9.0",
|
|
94
|
-
"vue": "^3.3.
|
|
94
|
+
"vue": "^3.3.4",
|
|
95
95
|
"windicss": "^3.5.6",
|
|
96
96
|
"yargs": "^17.7.2",
|
|
97
|
-
"@slidev/client": "0.
|
|
98
|
-
"@slidev/parser": "0.
|
|
99
|
-
"@slidev/types": "0.
|
|
97
|
+
"@slidev/client": "0.42.0",
|
|
98
|
+
"@slidev/parser": "0.42.0",
|
|
99
|
+
"@slidev/types": "0.42.0"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@types/plantuml-encoder": "^1.4.0",
|