@slidev/cli 0.36.0 → 0.36.1
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-3YQL2K7P.mjs → build-LS63HRWN.mjs} +1 -1
- package/dist/{build-DIGRXRLK.js → build-VLQNNPIA.js} +5 -5
- package/dist/{chunk-S3XL4MK5.js → chunk-CG3QPKUJ.js} +7 -6
- package/dist/{chunk-PIEUNXTX.mjs → chunk-DRWWOOWC.mjs} +10 -3
- package/dist/{chunk-S74C6Q74.js → chunk-L3B76JRZ.js} +10 -3
- package/dist/{chunk-MTVLPZ5A.mjs → chunk-S3HDHTBQ.mjs} +5 -4
- package/dist/cli.js +33 -23
- package/dist/cli.mjs +17 -7
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +5 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkL3B76JRZjs = require('./chunk-L3B76JRZ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -655,16 +655,16 @@ async function build(options, viteConfig = {}) {
|
|
|
655
655
|
let originalIndexHTML;
|
|
656
656
|
if (_fsextra2.default.existsSync(indexPath))
|
|
657
657
|
originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
|
|
658
|
-
await _fsextra2.default.writeFile(indexPath, await
|
|
658
|
+
await _fsextra2.default.writeFile(indexPath, await _chunkL3B76JRZjs.getIndexHtml.call(void 0, options), "utf-8");
|
|
659
659
|
let config = void 0;
|
|
660
660
|
try {
|
|
661
|
-
const inlineConfig = await
|
|
661
|
+
const inlineConfig = await _chunkL3B76JRZjs.mergeViteConfigs.call(void 0,
|
|
662
662
|
options,
|
|
663
663
|
viteConfig,
|
|
664
664
|
{
|
|
665
665
|
root: options.userRoot,
|
|
666
666
|
plugins: [
|
|
667
|
-
await
|
|
667
|
+
await _chunkL3B76JRZjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
|
|
668
668
|
{
|
|
669
669
|
name: "resolve-config",
|
|
670
670
|
configResolved(_config) {
|
|
@@ -685,7 +685,7 @@ async function build(options, viteConfig = {}) {
|
|
|
685
685
|
} else {
|
|
686
686
|
console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
|
|
687
687
|
await _vite.build.call(void 0,
|
|
688
|
-
await
|
|
688
|
+
await _chunkL3B76JRZjs.mergeViteConfigs.call(void 0,
|
|
689
689
|
options,
|
|
690
690
|
inlineConfig,
|
|
691
691
|
{
|
|
@@ -1,7 +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 }; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkL3B76JRZjs = require('./chunk-L3B76JRZ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -2386,7 +2386,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2386
2386
|
const pluginOptions = rawConfig.slidev || {};
|
|
2387
2387
|
process.env.EDITOR = process.env.EDITOR || "code";
|
|
2388
2388
|
const server = await _vite.createServer.call(void 0,
|
|
2389
|
-
await
|
|
2389
|
+
await _chunkL3B76JRZjs.mergeViteConfigs.call(void 0,
|
|
2390
2390
|
options,
|
|
2391
2391
|
viteConfig,
|
|
2392
2392
|
{
|
|
@@ -2396,7 +2396,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2396
2396
|
]
|
|
2397
2397
|
},
|
|
2398
2398
|
plugins: [
|
|
2399
|
-
await
|
|
2399
|
+
await _chunkL3B76JRZjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
|
|
2400
2400
|
]
|
|
2401
2401
|
},
|
|
2402
2402
|
"serve"
|
|
@@ -2410,7 +2410,7 @@ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
|
2410
2410
|
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
2411
2411
|
|
|
2412
2412
|
// package.json
|
|
2413
|
-
var version = "0.36.
|
|
2413
|
+
var version = "0.36.1";
|
|
2414
2414
|
|
|
2415
2415
|
// node/themes.ts
|
|
2416
2416
|
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
@@ -9642,7 +9642,7 @@ function getUserRoot(options) {
|
|
|
9642
9642
|
return { entry: fullEntry, userRoot: _path.dirname.call(void 0, fullEntry) };
|
|
9643
9643
|
}
|
|
9644
9644
|
async function resolveOptions(options, mode2, promptForInstallation = true) {
|
|
9645
|
-
const { remote } = options;
|
|
9645
|
+
const { remote, inspect } = options;
|
|
9646
9646
|
const {
|
|
9647
9647
|
entry,
|
|
9648
9648
|
userRoot
|
|
@@ -9694,7 +9694,8 @@ async function resolveOptions(options, mode2, promptForInstallation = true) {
|
|
|
9694
9694
|
themeRoots,
|
|
9695
9695
|
addonRoots,
|
|
9696
9696
|
roots,
|
|
9697
|
-
remote
|
|
9697
|
+
remote,
|
|
9698
|
+
inspect
|
|
9698
9699
|
};
|
|
9699
9700
|
}
|
|
9700
9701
|
|
|
@@ -211,6 +211,7 @@ import Components from "unplugin-vue-components/vite";
|
|
|
211
211
|
import RemoteAssets, { DefaultRules } from "vite-plugin-remote-assets";
|
|
212
212
|
import ServerRef from "vite-plugin-vue-server-ref";
|
|
213
213
|
import { notNullish as notNullish2 } from "@antfu/utils";
|
|
214
|
+
import Inspect from "vite-plugin-inspect";
|
|
214
215
|
|
|
215
216
|
// node/drawings.ts
|
|
216
217
|
init_esm_shims();
|
|
@@ -1499,11 +1500,13 @@ function createFixPlugins(options) {
|
|
|
1499
1500
|
name: "slidev:flags",
|
|
1500
1501
|
enforce: "pre",
|
|
1501
1502
|
transform(code, id) {
|
|
1502
|
-
if (id.
|
|
1503
|
+
if (id.match(/\.vue($|\?)/)) {
|
|
1504
|
+
const original = code;
|
|
1503
1505
|
define.forEach(([from, to]) => {
|
|
1504
1506
|
code = code.replace(new RegExp(from, "g"), to);
|
|
1505
1507
|
});
|
|
1506
|
-
|
|
1508
|
+
if (original !== code)
|
|
1509
|
+
return code;
|
|
1507
1510
|
}
|
|
1508
1511
|
}
|
|
1509
1512
|
}
|
|
@@ -1664,7 +1667,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1664
1667
|
createConfigPlugin(options),
|
|
1665
1668
|
createClientSetupPlugin(options),
|
|
1666
1669
|
createMonacoTypesLoader(),
|
|
1667
|
-
createFixPlugins(options)
|
|
1670
|
+
createFixPlugins(options),
|
|
1671
|
+
options.inspect ? Inspect({
|
|
1672
|
+
dev: true,
|
|
1673
|
+
build: true
|
|
1674
|
+
}) : null
|
|
1668
1675
|
].flat().filter(notNullish2);
|
|
1669
1676
|
}
|
|
1670
1677
|
|
|
@@ -210,6 +210,7 @@ var _vite5 = require('unplugin-vue-components/vite'); var _vite6 = _interopRequi
|
|
|
210
210
|
var _vitepluginremoteassets = require('vite-plugin-remote-assets'); var _vitepluginremoteassets2 = _interopRequireDefault(_vitepluginremoteassets);
|
|
211
211
|
var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepluginvueserverref2 = _interopRequireDefault(_vitepluginvueserverref);
|
|
212
212
|
|
|
213
|
+
var _viteplugininspect = require('vite-plugin-inspect'); var _viteplugininspect2 = _interopRequireDefault(_viteplugininspect);
|
|
213
214
|
|
|
214
215
|
// node/drawings.ts
|
|
215
216
|
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
@@ -1498,11 +1499,13 @@ function createFixPlugins(options) {
|
|
|
1498
1499
|
name: "slidev:flags",
|
|
1499
1500
|
enforce: "pre",
|
|
1500
1501
|
transform(code, id) {
|
|
1501
|
-
if (id.
|
|
1502
|
+
if (id.match(/\.vue($|\?)/)) {
|
|
1503
|
+
const original = code;
|
|
1502
1504
|
define.forEach(([from, to]) => {
|
|
1503
1505
|
code = code.replace(new RegExp(from, "g"), to);
|
|
1504
1506
|
});
|
|
1505
|
-
|
|
1507
|
+
if (original !== code)
|
|
1508
|
+
return code;
|
|
1506
1509
|
}
|
|
1507
1510
|
}
|
|
1508
1511
|
}
|
|
@@ -1663,7 +1666,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1663
1666
|
createConfigPlugin(options),
|
|
1664
1667
|
createClientSetupPlugin(options),
|
|
1665
1668
|
createMonacoTypesLoader(),
|
|
1666
|
-
createFixPlugins(options)
|
|
1669
|
+
createFixPlugins(options),
|
|
1670
|
+
options.inspect ? _viteplugininspect2.default.call(void 0, {
|
|
1671
|
+
dev: true,
|
|
1672
|
+
build: true
|
|
1673
|
+
}) : null
|
|
1667
1674
|
].flat().filter(_utils.notNullish);
|
|
1668
1675
|
}
|
|
1669
1676
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DRWWOOWC.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__dirname,
|
|
@@ -2411,7 +2411,7 @@ init_esm_shims();
|
|
|
2411
2411
|
import * as parser from "@slidev/parser/fs";
|
|
2412
2412
|
|
|
2413
2413
|
// package.json
|
|
2414
|
-
var version = "0.36.
|
|
2414
|
+
var version = "0.36.1";
|
|
2415
2415
|
|
|
2416
2416
|
// node/themes.ts
|
|
2417
2417
|
init_esm_shims();
|
|
@@ -9634,7 +9634,7 @@ function getUserRoot(options) {
|
|
|
9634
9634
|
return { entry: fullEntry, userRoot: dirname(fullEntry) };
|
|
9635
9635
|
}
|
|
9636
9636
|
async function resolveOptions(options, mode2, promptForInstallation = true) {
|
|
9637
|
-
const { remote } = options;
|
|
9637
|
+
const { remote, inspect } = options;
|
|
9638
9638
|
const {
|
|
9639
9639
|
entry,
|
|
9640
9640
|
userRoot
|
|
@@ -9686,7 +9686,8 @@ async function resolveOptions(options, mode2, promptForInstallation = true) {
|
|
|
9686
9686
|
themeRoots,
|
|
9687
9687
|
addonRoots,
|
|
9688
9688
|
roots,
|
|
9689
|
-
remote
|
|
9689
|
+
remote,
|
|
9690
|
+
inspect
|
|
9690
9691
|
};
|
|
9691
9692
|
}
|
|
9692
9693
|
|
package/dist/cli.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkCG3QPKUJjs = require('./chunk-CG3QPKUJ.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkL3B76JRZjs = require('./chunk-L3B76JRZ.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -18,7 +18,7 @@ var _chunk74QPSS6Tjs = require('./chunk-74QPSS6T.js');
|
|
|
18
18
|
|
|
19
19
|
// node/cli.ts
|
|
20
20
|
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
21
|
-
var import_fast_deep_equal = _chunk74QPSS6Tjs.__toESM.call(void 0,
|
|
21
|
+
var import_fast_deep_equal = _chunk74QPSS6Tjs.__toESM.call(void 0, _chunkL3B76JRZjs.require_fast_deep_equal.call(void 0, ));
|
|
22
22
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
23
23
|
var _net = require('net'); var _net2 = _interopRequireDefault(_net);
|
|
24
24
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
@@ -38,7 +38,7 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
38
38
|
"fonts",
|
|
39
39
|
"css"
|
|
40
40
|
];
|
|
41
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
41
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkCG3QPKUJjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
42
42
|
cli.command(
|
|
43
43
|
"* [entry]",
|
|
44
44
|
"Start a local server for Slidev",
|
|
@@ -59,13 +59,17 @@ cli.command(
|
|
|
59
59
|
type: "string",
|
|
60
60
|
choices: ["error", "warn", "info", "silent"],
|
|
61
61
|
describe: "log level"
|
|
62
|
+
}).option("inspect", {
|
|
63
|
+
default: false,
|
|
64
|
+
type: "boolean",
|
|
65
|
+
describe: "enable the inspect plugin for debugging"
|
|
62
66
|
}).option("force", {
|
|
63
67
|
alias: "f",
|
|
64
68
|
default: false,
|
|
65
69
|
type: "boolean",
|
|
66
70
|
describe: "force the optimizer to ignore the cache and re-bundle "
|
|
67
71
|
}).strict().help(),
|
|
68
|
-
async ({ entry, theme, port: userPort, open, log, remote, force }) => {
|
|
72
|
+
async ({ entry, theme, port: userPort, open, log, remote, force, inspect }) => {
|
|
69
73
|
if (!_fsextra2.default.existsSync(entry) && !entry.endsWith(".md"))
|
|
70
74
|
entry = `${entry}.md`;
|
|
71
75
|
if (!_fsextra2.default.existsSync(entry)) {
|
|
@@ -85,9 +89,9 @@ cli.command(
|
|
|
85
89
|
async function initServer() {
|
|
86
90
|
if (server)
|
|
87
91
|
await server.close();
|
|
88
|
-
const options = await
|
|
92
|
+
const options = await _chunkCG3QPKUJjs.resolveOptions.call(void 0, { entry, remote, theme, inspect }, "dev");
|
|
89
93
|
port = userPort || await findFreePort(3030);
|
|
90
|
-
server = await
|
|
94
|
+
server = await _chunkCG3QPKUJjs.createServer.call(void 0,
|
|
91
95
|
options,
|
|
92
96
|
{
|
|
93
97
|
server: {
|
|
@@ -101,7 +105,7 @@ cli.command(
|
|
|
101
105
|
},
|
|
102
106
|
{
|
|
103
107
|
onDataReload(newData, data) {
|
|
104
|
-
if (!theme &&
|
|
108
|
+
if (!theme && _chunkCG3QPKUJjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkCG3QPKUJjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
105
109
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
106
110
|
initServer();
|
|
107
111
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -181,10 +185,14 @@ cli.command(
|
|
|
181
185
|
alias: "d",
|
|
182
186
|
type: "boolean",
|
|
183
187
|
describe: "allow download as PDF"
|
|
188
|
+
}).option("inspect", {
|
|
189
|
+
default: false,
|
|
190
|
+
type: "boolean",
|
|
191
|
+
describe: "enable the inspect plugin for debugging"
|
|
184
192
|
}).strict().help(),
|
|
185
|
-
async ({ entry, theme, watch, base, download, out }) => {
|
|
186
|
-
const { build } = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "./build-
|
|
187
|
-
const options = await
|
|
193
|
+
async ({ entry, theme, watch, base, download, out, inspect }) => {
|
|
194
|
+
const { build } = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "./build-VLQNNPIA.js")));
|
|
195
|
+
const options = await _chunkCG3QPKUJjs.resolveOptions.call(void 0, { entry, theme, inspect }, "build");
|
|
188
196
|
if (download && !options.data.config.download)
|
|
189
197
|
options.data.config.download = download;
|
|
190
198
|
printInfo(options);
|
|
@@ -202,9 +210,9 @@ cli.command(
|
|
|
202
210
|
"Format the markdown file",
|
|
203
211
|
(args) => commonOptions(args).strict().help(),
|
|
204
212
|
async ({ entry }) => {
|
|
205
|
-
const data = await
|
|
206
|
-
|
|
207
|
-
await
|
|
213
|
+
const data = await _chunkCG3QPKUJjs.parser.load(entry);
|
|
214
|
+
_chunkCG3QPKUJjs.parser.prettify(data);
|
|
215
|
+
await _chunkCG3QPKUJjs.parser.save(data);
|
|
208
216
|
}
|
|
209
217
|
);
|
|
210
218
|
cli.command(
|
|
@@ -219,17 +227,17 @@ cli.command(
|
|
|
219
227
|
default: "theme"
|
|
220
228
|
}),
|
|
221
229
|
async ({ entry, dir, theme: themeInput }) => {
|
|
222
|
-
const data = await
|
|
223
|
-
const theme =
|
|
230
|
+
const data = await _chunkCG3QPKUJjs.parser.load(entry);
|
|
231
|
+
const theme = _chunkCG3QPKUJjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
224
232
|
if (theme === "none") {
|
|
225
233
|
console.error('Can not eject theme "none"');
|
|
226
234
|
process.exit(1);
|
|
227
235
|
}
|
|
228
|
-
if (
|
|
236
|
+
if (_chunkCG3QPKUJjs.isPath.call(void 0, theme)) {
|
|
229
237
|
console.error("Theme is already ejected");
|
|
230
238
|
process.exit(1);
|
|
231
239
|
}
|
|
232
|
-
const roots =
|
|
240
|
+
const roots = _chunkCG3QPKUJjs.getThemeRoots.call(void 0, theme, entry);
|
|
233
241
|
if (!roots.length) {
|
|
234
242
|
console.error(`Does not found theme "${theme}"`);
|
|
235
243
|
process.exit(1);
|
|
@@ -241,7 +249,7 @@ cli.command(
|
|
|
241
249
|
const dirPath = `./${dir}`;
|
|
242
250
|
data.slides[0].frontmatter.theme = dirPath;
|
|
243
251
|
data.slides[0].raw = null;
|
|
244
|
-
await
|
|
252
|
+
await _chunkCG3QPKUJjs.parser.save(data);
|
|
245
253
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
246
254
|
}
|
|
247
255
|
);
|
|
@@ -296,9 +304,9 @@ cli.command(
|
|
|
296
304
|
process.env.NODE_ENV = "production";
|
|
297
305
|
const { exportSlides } = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "./export-WKFHZNBT.js")));
|
|
298
306
|
const port = await findFreePort(12445);
|
|
299
|
-
const options = await
|
|
307
|
+
const options = await _chunkCG3QPKUJjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
300
308
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
301
|
-
const server = await
|
|
309
|
+
const server = await _chunkCG3QPKUJjs.createServer.call(void 0,
|
|
302
310
|
options,
|
|
303
311
|
{
|
|
304
312
|
server: { port },
|
|
@@ -307,7 +315,7 @@ cli.command(
|
|
|
307
315
|
);
|
|
308
316
|
await server.listen(port);
|
|
309
317
|
printInfo(options);
|
|
310
|
-
|
|
318
|
+
_chunkCG3QPKUJjs.parser.filterDisabled(options.data);
|
|
311
319
|
const width = options.data.config.canvasWidth;
|
|
312
320
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
313
321
|
output = await exportSlides({
|
|
@@ -347,7 +355,7 @@ function printInfo(options, port, remote) {
|
|
|
347
355
|
console.log();
|
|
348
356
|
console.log();
|
|
349
357
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
350
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
358
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkCG3QPKUJjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
351
359
|
console.log();
|
|
352
360
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
353
361
|
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));
|
|
@@ -359,6 +367,8 @@ function printInfo(options, port, remote) {
|
|
|
359
367
|
if (query)
|
|
360
368
|
console.log(`${_kolorist.dim.call(void 0, " private slide show ")} > ${_kolorist.cyan.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}/${query}`)}`);
|
|
361
369
|
console.log(`${_kolorist.dim.call(void 0, " presenter mode ")} > ${_kolorist.blue.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}${presenterPath}`)}`);
|
|
370
|
+
if (options.inspect)
|
|
371
|
+
console.log(`${_kolorist.dim.call(void 0, " inspector")} > ${_kolorist.yellow.call(void 0, `http://localhost:${_kolorist.bold.call(void 0, port)}/__inspect/`)}`);
|
|
362
372
|
if (remote !== void 0) {
|
|
363
373
|
Object.values(_os2.default.networkInterfaces()).forEach(
|
|
364
374
|
(v) => (v || []).filter((details) => String(details.family).slice(-1) === "4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
|
package/dist/cli.mjs
CHANGED
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
resolveOptions,
|
|
7
7
|
resolveThemeName,
|
|
8
8
|
version
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S3HDHTBQ.mjs";
|
|
10
10
|
import {
|
|
11
11
|
require_fast_deep_equal
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DRWWOOWC.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__dirname,
|
|
15
15
|
__require,
|
|
@@ -60,13 +60,17 @@ cli.command(
|
|
|
60
60
|
type: "string",
|
|
61
61
|
choices: ["error", "warn", "info", "silent"],
|
|
62
62
|
describe: "log level"
|
|
63
|
+
}).option("inspect", {
|
|
64
|
+
default: false,
|
|
65
|
+
type: "boolean",
|
|
66
|
+
describe: "enable the inspect plugin for debugging"
|
|
63
67
|
}).option("force", {
|
|
64
68
|
alias: "f",
|
|
65
69
|
default: false,
|
|
66
70
|
type: "boolean",
|
|
67
71
|
describe: "force the optimizer to ignore the cache and re-bundle "
|
|
68
72
|
}).strict().help(),
|
|
69
|
-
async ({ entry, theme, port: userPort, open, log, remote, force }) => {
|
|
73
|
+
async ({ entry, theme, port: userPort, open, log, remote, force, inspect }) => {
|
|
70
74
|
if (!fs.existsSync(entry) && !entry.endsWith(".md"))
|
|
71
75
|
entry = `${entry}.md`;
|
|
72
76
|
if (!fs.existsSync(entry)) {
|
|
@@ -86,7 +90,7 @@ cli.command(
|
|
|
86
90
|
async function initServer() {
|
|
87
91
|
if (server)
|
|
88
92
|
await server.close();
|
|
89
|
-
const options = await resolveOptions({ entry, remote, theme }, "dev");
|
|
93
|
+
const options = await resolveOptions({ entry, remote, theme, inspect }, "dev");
|
|
90
94
|
port = userPort || await findFreePort(3030);
|
|
91
95
|
server = await createServer(
|
|
92
96
|
options,
|
|
@@ -182,10 +186,14 @@ cli.command(
|
|
|
182
186
|
alias: "d",
|
|
183
187
|
type: "boolean",
|
|
184
188
|
describe: "allow download as PDF"
|
|
189
|
+
}).option("inspect", {
|
|
190
|
+
default: false,
|
|
191
|
+
type: "boolean",
|
|
192
|
+
describe: "enable the inspect plugin for debugging"
|
|
185
193
|
}).strict().help(),
|
|
186
|
-
async ({ entry, theme, watch, base, download, out }) => {
|
|
187
|
-
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-
|
|
188
|
-
const options = await resolveOptions({ entry, theme }, "build");
|
|
194
|
+
async ({ entry, theme, watch, base, download, out, inspect }) => {
|
|
195
|
+
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-LS63HRWN.mjs")));
|
|
196
|
+
const options = await resolveOptions({ entry, theme, inspect }, "build");
|
|
189
197
|
if (download && !options.data.config.download)
|
|
190
198
|
options.data.config.download = download;
|
|
191
199
|
printInfo(options);
|
|
@@ -360,6 +368,8 @@ function printInfo(options, port, remote) {
|
|
|
360
368
|
if (query)
|
|
361
369
|
console.log(`${dim(" private slide show ")} > ${cyan(`http://localhost:${bold(port)}/${query}`)}`);
|
|
362
370
|
console.log(`${dim(" presenter mode ")} > ${blue(`http://localhost:${bold(port)}${presenterPath}`)}`);
|
|
371
|
+
if (options.inspect)
|
|
372
|
+
console.log(`${dim(" inspector")} > ${yellow(`http://localhost:${bold(port)}/__inspect/`)}`);
|
|
363
373
|
if (remote !== void 0) {
|
|
364
374
|
Object.values(os.networkInterfaces()).forEach(
|
|
365
375
|
(v) => (v || []).filter((details) => String(details.family).slice(-1) === "4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,10 @@ interface SlidevEntryOptions {
|
|
|
34
34
|
* @default process.cwd()
|
|
35
35
|
*/
|
|
36
36
|
userRoot?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Enable inspect plugin
|
|
39
|
+
*/
|
|
40
|
+
inspect?: boolean;
|
|
37
41
|
}
|
|
38
42
|
interface ResolvedSlidevOptions {
|
|
39
43
|
data: SlidevMarkdown;
|
|
@@ -47,6 +51,7 @@ interface ResolvedSlidevOptions {
|
|
|
47
51
|
roots: string[];
|
|
48
52
|
mode: 'dev' | 'build';
|
|
49
53
|
remote?: string;
|
|
54
|
+
inspect?: boolean;
|
|
50
55
|
}
|
|
51
56
|
interface SlidevPluginOptions extends SlidevEntryOptions {
|
|
52
57
|
vue?: ArgumentsType<typeof Vue>[0];
|
package/dist/index.js
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkCG3QPKUJjs = require('./chunk-CG3QPKUJ.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkL3B76JRZjs = require('./chunk-L3B76JRZ.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _chunk74QPSS6Tjs = require('./chunk-74QPSS6T.js');
|
|
@@ -36,4 +36,4 @@ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
exports.ViteSlidevPlugin =
|
|
39
|
+
exports.ViteSlidevPlugin = _chunkL3B76JRZjs.ViteSlidevPlugin; exports.createServer = _chunkCG3QPKUJjs.createServer; exports.createWindiCSSPlugin = _chunkL3B76JRZjs.createWindiCSSPlugin; exports.getAddonRoots = _chunkCG3QPKUJjs.getAddonRoots; exports.getCLIRoot = _chunkCG3QPKUJjs.getCLIRoot; exports.getClientRoot = _chunkCG3QPKUJjs.getClientRoot; exports.getRoot = _chunkCG3QPKUJjs.getRoot; exports.getThemeRoots = _chunkCG3QPKUJjs.getThemeRoots; exports.getUserRoot = _chunkCG3QPKUJjs.getUserRoot; exports.isPath = _chunkCG3QPKUJjs.isPath; exports.parser = _chunkCG3QPKUJjs.parser; exports.resolveOptions = _chunkCG3QPKUJjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
isPath,
|
|
10
10
|
parser,
|
|
11
11
|
resolveOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-S3HDHTBQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ViteSlidevPlugin,
|
|
15
15
|
createWindiCSSPlugin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DRWWOOWC.mjs";
|
|
17
17
|
import {
|
|
18
18
|
init_esm_shims
|
|
19
19
|
} from "./chunk-IAMILGBS.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.1",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@hedgedoc/markdown-it-task-lists": "^1.0.5",
|
|
47
47
|
"@iconify-json/carbon": "^1.1.7",
|
|
48
48
|
"@iconify-json/ph": "^1.1.2",
|
|
49
|
-
"@slidev/client": "0.36.
|
|
50
|
-
"@slidev/parser": "0.36.
|
|
51
|
-
"@slidev/types": "0.36.
|
|
49
|
+
"@slidev/client": "0.36.1",
|
|
50
|
+
"@slidev/parser": "0.36.1",
|
|
51
|
+
"@slidev/types": "0.36.1",
|
|
52
52
|
"@vitejs/plugin-vue": "^3.1.0",
|
|
53
53
|
"@vue/compiler-sfc": "^3.2.39",
|
|
54
54
|
"cli-progress": "^3.11.2",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"unplugin-icons": "^0.14.9",
|
|
83
83
|
"unplugin-vue-components": "^0.22.6",
|
|
84
84
|
"vite": "^3.1.0",
|
|
85
|
+
"vite-plugin-inspect": "^0.7.1",
|
|
85
86
|
"vite-plugin-remote-assets": "^0.3.0",
|
|
86
87
|
"vite-plugin-vue-markdown": "~0.20.1",
|
|
87
88
|
"vite-plugin-vue-server-ref": "^0.3.0",
|