@slidev/cli 0.23.1 → 0.23.2
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-BN6MYL6E.mjs → build-IEU5WUDM.mjs} +2 -2
- package/dist/{build-2EHE6Y74.js → build-QDRV2UJ5.js} +4 -4
- package/dist/{chunk-HTXOBDVC.mjs → chunk-6LUF2SCB.mjs} +1 -1
- package/dist/{chunk-L7BPKVS3.js → chunk-M25N7CYC.js} +49 -6
- package/dist/{chunk-TIZT4QIJ.mjs → chunk-NHK2R4LN.mjs} +75 -32
- package/dist/{chunk-PXL53X45.js → chunk-S6F4YP7Z.js} +1 -1
- package/dist/{chunk-OPMIGNU7.js → chunk-UJKYYHMF.js} +2 -2
- package/dist/{chunk-BIPA3TM6.mjs → chunk-VWK3TRVU.mjs} +1 -1
- package/dist/cli.js +17 -17
- package/dist/cli.mjs +5 -5
- package/dist/{export-AXRF7ZXD.mjs → export-SNR56WLB.mjs} +1 -1
- package/dist/{export-H2GN5VOI.js → export-ZTTMEOKV.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NHK2R4LN.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__require,
|
|
@@ -369,7 +369,7 @@ async function build(options, viteConfig = {}) {
|
|
|
369
369
|
await fs.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
370
370
|
`, "utf-8");
|
|
371
371
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
372
|
-
const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-
|
|
372
|
+
const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-SNR56WLB.mjs")));
|
|
373
373
|
const port = 12445;
|
|
374
374
|
const app = connect();
|
|
375
375
|
const server = http.createServer(app);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkM25N7CYCjs = require('./chunk-M25N7CYC.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -314,12 +314,12 @@ async function build(options, viteConfig = {}) {
|
|
|
314
314
|
let originalIndexHTML;
|
|
315
315
|
if (_fsextra2.default.existsSync(indexPath))
|
|
316
316
|
originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
|
|
317
|
-
await _fsextra2.default.writeFile(indexPath, await
|
|
317
|
+
await _fsextra2.default.writeFile(indexPath, await _chunkM25N7CYCjs.getIndexHtml.call(void 0, options), "utf-8");
|
|
318
318
|
let config = void 0;
|
|
319
319
|
try {
|
|
320
320
|
const inlineConfig = _vite.mergeConfig.call(void 0, viteConfig, {
|
|
321
321
|
plugins: [
|
|
322
|
-
await
|
|
322
|
+
await _chunkM25N7CYCjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
|
|
323
323
|
{
|
|
324
324
|
name: "resolve-config",
|
|
325
325
|
configResolved(_config) {
|
|
@@ -369,7 +369,7 @@ async function build(options, viteConfig = {}) {
|
|
|
369
369
|
await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
370
370
|
`, "utf-8");
|
|
371
371
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
372
|
-
const { exportSlides } = await Promise.resolve().then(() => _chunkKRCSYS75js.__toModule.call(void 0, _chunkKRCSYS75js.__require.call(void 0, "./export-
|
|
372
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkKRCSYS75js.__toModule.call(void 0, _chunkKRCSYS75js.__require.call(void 0, "./export-ZTTMEOKV.js")));
|
|
373
373
|
const port = 12445;
|
|
374
374
|
const app = _connect2.default.call(void 0, );
|
|
375
375
|
const server = _http2.default.createServer(app);
|
|
@@ -10094,7 +10094,7 @@ var require_semver2 = __commonJS({
|
|
|
10094
10094
|
});
|
|
10095
10095
|
|
|
10096
10096
|
// package.json
|
|
10097
|
-
var version = "0.23.
|
|
10097
|
+
var version = "0.23.2";
|
|
10098
10098
|
|
|
10099
10099
|
// node/themes.ts
|
|
10100
10100
|
var import_ni = __toModule(require_dist());
|
|
@@ -56,7 +56,7 @@ var require_fast_deep_equal = _chunkKRCSYS75js.__commonJS.call(void 0, {
|
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
// node/common.ts
|
|
59
|
-
var _fs = require('fs');
|
|
59
|
+
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
60
60
|
var _path = require('path');
|
|
61
61
|
var _utils = require('@antfu/utils');
|
|
62
62
|
async function getIndexHtml({ clientRoot, themeRoots, data, userRoot }) {
|
|
@@ -227,6 +227,7 @@ var _vite5 = require('vite');
|
|
|
227
227
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
228
228
|
var _resolveglobal = require('resolve-global'); var _resolveglobal2 = _interopRequireDefault(_resolveglobal);
|
|
229
229
|
|
|
230
|
+
|
|
230
231
|
// ../client/package.json
|
|
231
232
|
var dependencies = {
|
|
232
233
|
"@antfu/utils": "^0.3.0",
|
|
@@ -253,6 +254,48 @@ var dependencies = {
|
|
|
253
254
|
windicss: "^3.1.7"
|
|
254
255
|
};
|
|
255
256
|
|
|
257
|
+
// node/vite/searchRoot.ts
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
var ROOT_FILES = [
|
|
261
|
+
"pnpm-workspace.yaml"
|
|
262
|
+
];
|
|
263
|
+
function hasWorkspacePackageJSON(root) {
|
|
264
|
+
const path = _path.join.call(void 0, root, "package.json");
|
|
265
|
+
try {
|
|
266
|
+
_fs2.default.accessSync(path, _fs2.default.constants.R_OK);
|
|
267
|
+
} catch (e2) {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
const content = JSON.parse(_fs2.default.readFileSync(path, "utf-8")) || {};
|
|
271
|
+
return !!content.workspaces;
|
|
272
|
+
}
|
|
273
|
+
function hasRootFile(root) {
|
|
274
|
+
return ROOT_FILES.some((file) => _fs2.default.existsSync(_path.join.call(void 0, root, file)));
|
|
275
|
+
}
|
|
276
|
+
function hasPackageJSON(root) {
|
|
277
|
+
const path = _path.join.call(void 0, root, "package.json");
|
|
278
|
+
return _fs2.default.existsSync(path);
|
|
279
|
+
}
|
|
280
|
+
function searchForPackageRoot(current, root = current) {
|
|
281
|
+
if (hasPackageJSON(current))
|
|
282
|
+
return current;
|
|
283
|
+
const dir = _path.dirname.call(void 0, current);
|
|
284
|
+
if (!dir || dir === current)
|
|
285
|
+
return root;
|
|
286
|
+
return searchForPackageRoot(dir, root);
|
|
287
|
+
}
|
|
288
|
+
function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
|
|
289
|
+
if (hasRootFile(current))
|
|
290
|
+
return current;
|
|
291
|
+
if (hasWorkspacePackageJSON(current))
|
|
292
|
+
return current;
|
|
293
|
+
const dir = _path.dirname.call(void 0, current);
|
|
294
|
+
if (!dir || dir === current)
|
|
295
|
+
return root;
|
|
296
|
+
return searchForWorkspaceRoot(dir, root);
|
|
297
|
+
}
|
|
298
|
+
|
|
256
299
|
// node/plugins/extendConfig.ts
|
|
257
300
|
var EXCLUDE = [
|
|
258
301
|
"@slidev/shared",
|
|
@@ -294,11 +337,11 @@ function createConfigPlugin(options) {
|
|
|
294
337
|
server: {
|
|
295
338
|
fs: {
|
|
296
339
|
strict: true,
|
|
297
|
-
allow: [
|
|
298
|
-
|
|
299
|
-
options.cliRoot,
|
|
340
|
+
allow: _utils.uniq.call(void 0, [
|
|
341
|
+
searchForWorkspaceRoot(options.userRoot),
|
|
342
|
+
searchForWorkspaceRoot(options.cliRoot),
|
|
300
343
|
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _resolveglobal2.default.call(void 0, "@slidev/client/package.json"))] : []
|
|
301
|
-
]
|
|
344
|
+
])
|
|
302
345
|
}
|
|
303
346
|
}
|
|
304
347
|
};
|
|
@@ -469,7 +512,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
469
512
|
return md2;
|
|
470
513
|
}
|
|
471
514
|
}));
|
|
472
|
-
} catch (
|
|
515
|
+
} catch (e3) {
|
|
473
516
|
}
|
|
474
517
|
}))).flatMap((i) => i || []);
|
|
475
518
|
hmrPages.clear();
|
|
@@ -222,10 +222,11 @@ ${value}
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
// node/plugins/extendConfig.ts
|
|
225
|
-
import { dirname as
|
|
225
|
+
import { dirname as dirname4, join as join4 } from "path";
|
|
226
226
|
import { mergeConfig } from "vite";
|
|
227
227
|
import isInstalledGlobally from "is-installed-globally";
|
|
228
228
|
import resolveGlobal from "resolve-global";
|
|
229
|
+
import { uniq as uniq3 } from "@antfu/utils";
|
|
229
230
|
|
|
230
231
|
// ../client/package.json
|
|
231
232
|
var dependencies = {
|
|
@@ -253,6 +254,48 @@ var dependencies = {
|
|
|
253
254
|
windicss: "^3.1.7"
|
|
254
255
|
};
|
|
255
256
|
|
|
257
|
+
// node/vite/searchRoot.ts
|
|
258
|
+
import fs3 from "fs";
|
|
259
|
+
import { dirname as dirname3, join as join3 } from "path";
|
|
260
|
+
var ROOT_FILES = [
|
|
261
|
+
"pnpm-workspace.yaml"
|
|
262
|
+
];
|
|
263
|
+
function hasWorkspacePackageJSON(root) {
|
|
264
|
+
const path = join3(root, "package.json");
|
|
265
|
+
try {
|
|
266
|
+
fs3.accessSync(path, fs3.constants.R_OK);
|
|
267
|
+
} catch {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
const content = JSON.parse(fs3.readFileSync(path, "utf-8")) || {};
|
|
271
|
+
return !!content.workspaces;
|
|
272
|
+
}
|
|
273
|
+
function hasRootFile(root) {
|
|
274
|
+
return ROOT_FILES.some((file) => fs3.existsSync(join3(root, file)));
|
|
275
|
+
}
|
|
276
|
+
function hasPackageJSON(root) {
|
|
277
|
+
const path = join3(root, "package.json");
|
|
278
|
+
return fs3.existsSync(path);
|
|
279
|
+
}
|
|
280
|
+
function searchForPackageRoot(current, root = current) {
|
|
281
|
+
if (hasPackageJSON(current))
|
|
282
|
+
return current;
|
|
283
|
+
const dir = dirname3(current);
|
|
284
|
+
if (!dir || dir === current)
|
|
285
|
+
return root;
|
|
286
|
+
return searchForPackageRoot(dir, root);
|
|
287
|
+
}
|
|
288
|
+
function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
|
|
289
|
+
if (hasRootFile(current))
|
|
290
|
+
return current;
|
|
291
|
+
if (hasWorkspacePackageJSON(current))
|
|
292
|
+
return current;
|
|
293
|
+
const dir = dirname3(current);
|
|
294
|
+
if (!dir || dir === current)
|
|
295
|
+
return root;
|
|
296
|
+
return searchForWorkspaceRoot(dir, root);
|
|
297
|
+
}
|
|
298
|
+
|
|
256
299
|
// node/plugins/extendConfig.ts
|
|
257
300
|
var EXCLUDE = [
|
|
258
301
|
"@slidev/shared",
|
|
@@ -294,16 +337,16 @@ function createConfigPlugin(options) {
|
|
|
294
337
|
server: {
|
|
295
338
|
fs: {
|
|
296
339
|
strict: true,
|
|
297
|
-
allow: [
|
|
298
|
-
|
|
299
|
-
options.cliRoot,
|
|
300
|
-
...isInstalledGlobally ? [
|
|
301
|
-
]
|
|
340
|
+
allow: uniq3([
|
|
341
|
+
searchForWorkspaceRoot(options.userRoot),
|
|
342
|
+
searchForWorkspaceRoot(options.cliRoot),
|
|
343
|
+
...isInstalledGlobally ? [dirname4(resolveGlobal("@slidev/client/package.json"))] : []
|
|
344
|
+
])
|
|
302
345
|
}
|
|
303
346
|
}
|
|
304
347
|
};
|
|
305
348
|
if (isInstalledGlobally) {
|
|
306
|
-
injection.cacheDir =
|
|
349
|
+
injection.cacheDir = join4(options.cliRoot, "node_modules/.vite");
|
|
307
350
|
injection.root = options.cliRoot;
|
|
308
351
|
injection.resolve.alias.vue = `${resolveImportPath("vue/dist/vue.esm-browser.js", true)}`;
|
|
309
352
|
}
|
|
@@ -336,10 +379,10 @@ function getDefine(options) {
|
|
|
336
379
|
|
|
337
380
|
// node/plugins/loaders.ts
|
|
338
381
|
var import_fast_deep_equal = __toModule(require_fast_deep_equal());
|
|
339
|
-
import { basename as basename2, join as
|
|
340
|
-
import { isString, notNullish, objectMap, range, slash as slash2, uniq as
|
|
382
|
+
import { basename as basename2, join as join5 } from "path";
|
|
383
|
+
import { isString, notNullish, objectMap, range, slash as slash2, uniq as uniq4 } from "@antfu/utils";
|
|
341
384
|
import fg2 from "fast-glob";
|
|
342
|
-
import
|
|
385
|
+
import fs4, { existsSync as existsSync4 } from "fs-extra";
|
|
343
386
|
import Markdown from "markdown-it";
|
|
344
387
|
import mila from "markdown-it-link-attributes";
|
|
345
388
|
import {
|
|
@@ -573,7 +616,7 @@ ${code.slice(injectB)}`;
|
|
|
573
616
|
if (now - _layouts_cache_time < 2e3)
|
|
574
617
|
return _layouts_cache;
|
|
575
618
|
const layouts = {};
|
|
576
|
-
const roots2 =
|
|
619
|
+
const roots2 = uniq4([
|
|
577
620
|
userRoot,
|
|
578
621
|
...themeRoots,
|
|
579
622
|
clientRoot
|
|
@@ -596,21 +639,21 @@ ${code.slice(injectB)}`;
|
|
|
596
639
|
}
|
|
597
640
|
async function generateUserStyles() {
|
|
598
641
|
const imports = [
|
|
599
|
-
`import "${toAtFS(
|
|
600
|
-
`import "${toAtFS(
|
|
601
|
-
`import "${toAtFS(
|
|
642
|
+
`import "${toAtFS(join5(clientRoot, "styles/vars.css"))}"`,
|
|
643
|
+
`import "${toAtFS(join5(clientRoot, "styles/index.css"))}"`,
|
|
644
|
+
`import "${toAtFS(join5(clientRoot, "styles/code.css"))}"`
|
|
602
645
|
];
|
|
603
|
-
const roots2 =
|
|
646
|
+
const roots2 = uniq4([
|
|
604
647
|
...themeRoots,
|
|
605
648
|
userRoot
|
|
606
649
|
]);
|
|
607
650
|
for (const root of roots2) {
|
|
608
651
|
const styles = [
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
652
|
+
join5(root, "styles", "index.ts"),
|
|
653
|
+
join5(root, "styles", "index.js"),
|
|
654
|
+
join5(root, "styles", "index.css"),
|
|
655
|
+
join5(root, "styles.css"),
|
|
656
|
+
join5(root, "style.css")
|
|
614
657
|
];
|
|
615
658
|
for (const style of styles) {
|
|
616
659
|
if (existsSync4(style)) {
|
|
@@ -688,17 +731,17 @@ ${routes.join(",\n")}
|
|
|
688
731
|
const components = roots.flatMap((root) => {
|
|
689
732
|
if (layer === "top") {
|
|
690
733
|
return [
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
734
|
+
join5(root, "global.vue"),
|
|
735
|
+
join5(root, "global-top.vue"),
|
|
736
|
+
join5(root, "GlobalTop.vue")
|
|
694
737
|
];
|
|
695
738
|
} else {
|
|
696
739
|
return [
|
|
697
|
-
|
|
698
|
-
|
|
740
|
+
join5(root, "global-bottom.vue"),
|
|
741
|
+
join5(root, "GlobalBottom.vue")
|
|
699
742
|
];
|
|
700
743
|
}
|
|
701
|
-
}).filter((i) =>
|
|
744
|
+
}).filter((i) => fs4.existsSync(i));
|
|
702
745
|
const imports = components.map((i, idx) => `import __n${idx} from '${toAtFS(i)}'`).join("\n");
|
|
703
746
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
704
747
|
return `
|
|
@@ -714,7 +757,7 @@ export default {
|
|
|
714
757
|
}
|
|
715
758
|
|
|
716
759
|
// node/plugins/monacoTransform.ts
|
|
717
|
-
import { join as
|
|
760
|
+
import { join as join6 } from "path";
|
|
718
761
|
import { slash as slash3 } from "@antfu/utils";
|
|
719
762
|
import { resolvePackageData } from "vite";
|
|
720
763
|
function createMonacoTypesLoader() {
|
|
@@ -737,7 +780,7 @@ function createMonacoTypesLoader() {
|
|
|
737
780
|
return "";
|
|
738
781
|
return [
|
|
739
782
|
"import * as monaco from 'monaco-editor'",
|
|
740
|
-
`import Type from "${slash3(
|
|
783
|
+
`import Type from "${slash3(join6(info.dir, typePath))}?raw"`,
|
|
741
784
|
...Object.keys(info.data.dependencies || {}).map((i) => `import "/@slidev-monaco-types/${i}"`),
|
|
742
785
|
`monaco.languages.typescript.typescriptDefaults.addExtraLib(\`declare module "${pkg}" { \${Type} }\`)`
|
|
743
786
|
].join("\n");
|
|
@@ -748,8 +791,8 @@ function createMonacoTypesLoader() {
|
|
|
748
791
|
|
|
749
792
|
// node/plugins/setupClient.ts
|
|
750
793
|
import { existsSync as existsSync5 } from "fs";
|
|
751
|
-
import { join as
|
|
752
|
-
import { slash as slash4, uniq as
|
|
794
|
+
import { join as join7, resolve as resolve4 } from "path";
|
|
795
|
+
import { slash as slash4, uniq as uniq5 } from "@antfu/utils";
|
|
753
796
|
function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
754
797
|
const setupEntry = slash4(resolve4(clientRoot, "setup"));
|
|
755
798
|
return {
|
|
@@ -761,10 +804,10 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
761
804
|
const imports = [];
|
|
762
805
|
const injections = [];
|
|
763
806
|
const asyncInjections = [];
|
|
764
|
-
const setups =
|
|
807
|
+
const setups = uniq5([
|
|
765
808
|
...themeRoots,
|
|
766
809
|
userRoot
|
|
767
|
-
]).map((i) =>
|
|
810
|
+
]).map((i) => join7(i, "setup", name));
|
|
768
811
|
setups.forEach((path, idx) => {
|
|
769
812
|
if (!existsSync5(path))
|
|
770
813
|
return;
|
|
@@ -10094,7 +10094,7 @@ var require_semver2 = _chunkKRCSYS75js.__commonJS.call(void 0, {
|
|
|
10094
10094
|
});
|
|
10095
10095
|
|
|
10096
10096
|
// package.json
|
|
10097
|
-
var version = "0.23.
|
|
10097
|
+
var version = "0.23.2";
|
|
10098
10098
|
|
|
10099
10099
|
// node/themes.ts
|
|
10100
10100
|
var import_ni = _chunkKRCSYS75js.__toModule.call(void 0, require_dist());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkM25N7CYCjs = require('./chunk-M25N7CYC.js');
|
|
4
4
|
|
|
5
5
|
// node/server.ts
|
|
6
6
|
var _vite = require('vite');
|
|
@@ -10,7 +10,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
10
10
|
process.env.EDITOR = process.env.EDITOR || "code";
|
|
11
11
|
const server = await _vite.createServer.call(void 0, _vite.mergeConfig.call(void 0, viteConfig, {
|
|
12
12
|
plugins: [
|
|
13
|
-
await
|
|
13
|
+
await _chunkM25N7CYCjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
|
|
14
14
|
]
|
|
15
15
|
}));
|
|
16
16
|
return server;
|
package/dist/cli.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUJKYYHMFjs = require('./chunk-UJKYYHMF.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkS6F4YP7Zjs = require('./chunk-S6F4YP7Z.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkM25N7CYCjs = require('./chunk-M25N7CYC.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
var _chunkKRCSYS75js = require('./chunk-KRCSYS75.js');
|
|
18
18
|
|
|
19
19
|
// node/cli.ts
|
|
20
|
-
var import_fast_deep_equal = _chunkKRCSYS75js.__toModule.call(void 0,
|
|
20
|
+
var import_fast_deep_equal = _chunkKRCSYS75js.__toModule.call(void 0, _chunkM25N7CYCjs.require_fast_deep_equal.call(void 0, ));
|
|
21
21
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
22
22
|
var _net = require('net'); var _net2 = _interopRequireDefault(_net);
|
|
23
23
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
@@ -40,7 +40,7 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
40
40
|
"routerMode",
|
|
41
41
|
"fonts"
|
|
42
42
|
];
|
|
43
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
43
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkS6F4YP7Zjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
44
44
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
45
45
|
alias: "p",
|
|
46
46
|
type: "number",
|
|
@@ -84,9 +84,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
84
84
|
async function initServer() {
|
|
85
85
|
if (server)
|
|
86
86
|
await server.close();
|
|
87
|
-
const options = await
|
|
87
|
+
const options = await _chunkS6F4YP7Zjs.resolveOptions.call(void 0, { entry, theme }, "dev");
|
|
88
88
|
port = userPort || await findFreePort(3030);
|
|
89
|
-
server = await
|
|
89
|
+
server = await _chunkUJKYYHMFjs.createServer.call(void 0, options, {
|
|
90
90
|
server: {
|
|
91
91
|
port,
|
|
92
92
|
strictPort: true,
|
|
@@ -97,7 +97,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
97
97
|
logLevel: log
|
|
98
98
|
}, {
|
|
99
99
|
onDataReload(newData, data) {
|
|
100
|
-
if (!theme &&
|
|
100
|
+
if (!theme && _chunkS6F4YP7Zjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkS6F4YP7Zjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
101
101
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
102
102
|
initServer();
|
|
103
103
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -167,8 +167,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
167
167
|
type: "boolean",
|
|
168
168
|
describe: "allow download as PDF"
|
|
169
169
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
170
|
-
const { build } = await Promise.resolve().then(() => _chunkKRCSYS75js.__toModule.call(void 0, _chunkKRCSYS75js.__require.call(void 0, "./build-
|
|
171
|
-
const options = await
|
|
170
|
+
const { build } = await Promise.resolve().then(() => _chunkKRCSYS75js.__toModule.call(void 0, _chunkKRCSYS75js.__require.call(void 0, "./build-QDRV2UJ5.js")));
|
|
171
|
+
const options = await _chunkS6F4YP7Zjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
172
172
|
if (download && !options.data.config.download)
|
|
173
173
|
options.data.config.download = download;
|
|
174
174
|
printInfo(options);
|
|
@@ -191,16 +191,16 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
191
191
|
default: "theme"
|
|
192
192
|
}), async ({ entry, dir, theme: themeInput }) => {
|
|
193
193
|
const data = await _fs.load.call(void 0, entry);
|
|
194
|
-
const theme =
|
|
194
|
+
const theme = _chunkS6F4YP7Zjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
195
195
|
if (theme === "none") {
|
|
196
196
|
console.error('Can not eject theme "none"');
|
|
197
197
|
process.exit(1);
|
|
198
198
|
}
|
|
199
|
-
if (
|
|
199
|
+
if (_chunkS6F4YP7Zjs.isPath.call(void 0, theme)) {
|
|
200
200
|
console.error("Theme is already ejected");
|
|
201
201
|
process.exit(1);
|
|
202
202
|
}
|
|
203
|
-
const roots =
|
|
203
|
+
const roots = _chunkS6F4YP7Zjs.getThemeRoots.call(void 0, theme, entry);
|
|
204
204
|
if (!roots.length) {
|
|
205
205
|
console.error(`Does not found theme "${theme}"`);
|
|
206
206
|
process.exit(1);
|
|
@@ -255,10 +255,10 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
255
255
|
}) => {
|
|
256
256
|
output = output || `${_path2.default.basename(entry, ".md")}-export`;
|
|
257
257
|
process.env.NODE_ENV = "production";
|
|
258
|
-
const { exportSlides } = await Promise.resolve().then(() => _chunkKRCSYS75js.__toModule.call(void 0, _chunkKRCSYS75js.__require.call(void 0, "./export-
|
|
258
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkKRCSYS75js.__toModule.call(void 0, _chunkKRCSYS75js.__require.call(void 0, "./export-ZTTMEOKV.js")));
|
|
259
259
|
const port = await findFreePort(12445);
|
|
260
|
-
const options = await
|
|
261
|
-
const server = await
|
|
260
|
+
const options = await _chunkS6F4YP7Zjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
261
|
+
const server = await _chunkUJKYYHMFjs.createServer.call(void 0, options, {
|
|
262
262
|
server: { port },
|
|
263
263
|
logLevel: "error",
|
|
264
264
|
clearScreen: false
|
|
@@ -302,7 +302,7 @@ function printInfo(options, port, remote) {
|
|
|
302
302
|
console.log();
|
|
303
303
|
console.log();
|
|
304
304
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
305
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
305
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkS6F4YP7Zjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
306
306
|
console.log();
|
|
307
307
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
308
308
|
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,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VWK3TRVU.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getThemeRoots,
|
|
6
6
|
isPath,
|
|
7
7
|
resolveOptions,
|
|
8
8
|
resolveThemeName,
|
|
9
9
|
version
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6LUF2SCB.mjs";
|
|
11
11
|
import {
|
|
12
12
|
require_fast_deep_equal
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NHK2R4LN.mjs";
|
|
14
14
|
import {
|
|
15
15
|
__require,
|
|
16
16
|
__toModule
|
|
@@ -167,7 +167,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
167
167
|
type: "boolean",
|
|
168
168
|
describe: "allow download as PDF"
|
|
169
169
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
170
|
-
const { build } = await Promise.resolve().then(() => __toModule(__require("./build-
|
|
170
|
+
const { build } = await Promise.resolve().then(() => __toModule(__require("./build-IEU5WUDM.mjs")));
|
|
171
171
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
172
172
|
if (download && !options.data.config.download)
|
|
173
173
|
options.data.config.download = download;
|
|
@@ -255,7 +255,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
255
255
|
}) => {
|
|
256
256
|
output = output || `${path.basename(entry, ".md")}-export`;
|
|
257
257
|
process.env.NODE_ENV = "production";
|
|
258
|
-
const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-
|
|
258
|
+
const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-SNR56WLB.mjs")));
|
|
259
259
|
const port = await findFreePort(12445);
|
|
260
260
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
261
261
|
const server = await createServer(options, {
|
|
@@ -1,6 +1,6 @@
|
|
|
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 _chunkS6F4YP7Zjs = require('./chunk-S6F4YP7Z.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -60,7 +60,7 @@ async function exportSlides({
|
|
|
60
60
|
height = 1080,
|
|
61
61
|
withClicks = false
|
|
62
62
|
}) {
|
|
63
|
-
if (!
|
|
63
|
+
if (!_chunkS6F4YP7Zjs.packageExists.call(void 0, "playwright-chromium"))
|
|
64
64
|
throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i playwright-chromium`");
|
|
65
65
|
const { chromium } = await Promise.resolve().then(() => _chunkKRCSYS75js.__toModule.call(void 0, _chunkKRCSYS75js.__require.call(void 0, "playwright-chromium")));
|
|
66
66
|
const browser = await chromium.launch();
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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; } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUJKYYHMFjs = require('./chunk-UJKYYHMF.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkS6F4YP7Zjs = require('./chunk-S6F4YP7Z.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkM25N7CYCjs = require('./chunk-M25N7CYC.js');
|
|
15
15
|
require('./chunk-KRCSYS75.js');
|
|
16
16
|
|
|
17
17
|
// node/index.ts
|
|
@@ -26,4 +26,4 @@ var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
exports.ViteSlidevPlugin =
|
|
29
|
+
exports.ViteSlidevPlugin = _chunkM25N7CYCjs.ViteSlidevPlugin; exports.createServer = _chunkUJKYYHMFjs.createServer; exports.createWindiCSSPlugin = _chunkM25N7CYCjs.createWindiCSSPlugin; exports.getCLIRoot = _chunkS6F4YP7Zjs.getCLIRoot; exports.getClientRoot = _chunkS6F4YP7Zjs.getClientRoot; exports.getThemeRoots = _chunkS6F4YP7Zjs.getThemeRoots; exports.isPath = _chunkS6F4YP7Zjs.isPath; exports.parser = parser; exports.resolveOptions = _chunkS6F4YP7Zjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VWK3TRVU.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getCLIRoot,
|
|
6
6
|
getClientRoot,
|
|
7
7
|
getThemeRoots,
|
|
8
8
|
isPath,
|
|
9
9
|
resolveOptions
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6LUF2SCB.mjs";
|
|
11
11
|
import {
|
|
12
12
|
ViteSlidevPlugin,
|
|
13
13
|
createWindiCSSPlugin
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NHK2R4LN.mjs";
|
|
15
15
|
import "./chunk-G3DZBNYL.mjs";
|
|
16
16
|
|
|
17
17
|
// node/index.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"homepage": "https://sli.dev",
|
|
6
6
|
"bugs": "https://github.com/slidevjs/slidev/issues",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@antfu/utils": "^0.3.0",
|
|
43
43
|
"@iconify/json": "^1.1.338",
|
|
44
|
-
"@slidev/client": "0.23.
|
|
45
|
-
"@slidev/parser": "0.23.
|
|
46
|
-
"@slidev/types": "0.23.
|
|
44
|
+
"@slidev/client": "0.23.2",
|
|
45
|
+
"@slidev/parser": "0.23.2",
|
|
46
|
+
"@slidev/types": "0.23.2",
|
|
47
47
|
"@vitejs/plugin-vue": "^1.6.2",
|
|
48
48
|
"@vue/compiler-sfc": "^3.2.11",
|
|
49
49
|
"cli-progress": "^3.9.0",
|