@slidev/cli 0.35.6 → 0.36.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-JJPJN7L3.mjs → build-3YQL2K7P.mjs} +4 -4
- package/dist/{build-3OBKYP4E.js → build-DIGRXRLK.js} +13 -13
- package/dist/{chunk-AW7KQET4.js → chunk-74QPSS6T.js} +2 -2
- package/dist/{chunk-57E5R3IA.mjs → chunk-IAMILGBS.mjs} +2 -2
- package/dist/{chunk-3VPTNK23.mjs → chunk-MTVLPZ5A.mjs} +5 -5
- package/dist/{chunk-IY7QSYZ2.mjs → chunk-PIEUNXTX.mjs} +28 -34
- package/dist/{chunk-4UR3M5JD.js → chunk-S3XL4MK5.js} +136 -136
- package/dist/{chunk-YUXTNPKA.js → chunk-S74C6Q74.js} +72 -78
- package/dist/cli.js +24 -24
- package/dist/cli.mjs +5 -5
- package/dist/{export-I2KYMDHO.mjs → export-26FXNM7P.mjs} +1 -1
- package/dist/{export-3CTBMUMP.js → export-WKFHZNBT.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +14 -14
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk74QPSS6Tjs = require('./chunk-74QPSS6T.js');
|
|
12
12
|
|
|
13
13
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
14
|
-
var require_fast_deep_equal =
|
|
14
|
+
var require_fast_deep_equal = _chunk74QPSS6Tjs.__commonJS.call(void 0, {
|
|
15
15
|
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
16
16
|
"use strict";
|
|
17
|
-
|
|
17
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
18
18
|
module.exports = function equal2(a, b) {
|
|
19
19
|
if (a === b)
|
|
20
20
|
return true;
|
|
@@ -57,7 +57,7 @@ var require_fast_deep_equal = _chunkAW7KQET4js.__commonJS.call(void 0, {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
// node/common.ts
|
|
60
|
-
|
|
60
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
61
61
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
62
62
|
var _path = require('path');
|
|
63
63
|
var _utils = require('@antfu/utils');
|
|
@@ -86,8 +86,8 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
|
|
|
86
86
|
body += '\n<script async src="https://platform.twitter.com/widgets.js"><\/script>';
|
|
87
87
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
88
88
|
head += `
|
|
89
|
-
<link rel="stylesheet" href="${
|
|
90
|
-
main = main.replace("__ENTRY__",
|
|
89
|
+
<link rel="stylesheet" href="${_chunk74QPSS6Tjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
90
|
+
main = main.replace("__ENTRY__", _chunk74QPSS6Tjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
91
91
|
return main;
|
|
92
92
|
}
|
|
93
93
|
async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config, command) {
|
|
@@ -111,14 +111,14 @@ async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config,
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// node/plugins/windicss.ts
|
|
114
|
-
|
|
114
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
|
|
119
119
|
|
|
120
120
|
// node/plugins/setupNode.ts
|
|
121
|
-
|
|
121
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
122
122
|
|
|
123
123
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
124
124
|
|
|
@@ -152,7 +152,7 @@ async function loadSetups(roots, name, arg, initial, merge = true) {
|
|
|
152
152
|
|
|
153
153
|
// node/plugins/windicss.ts
|
|
154
154
|
async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
155
|
-
const { default: WindiCSS, defaultConfigureFiles } = await Promise.resolve().then(() =>
|
|
155
|
+
const { default: WindiCSS, defaultConfigureFiles } = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "vite-plugin-windicss")));
|
|
156
156
|
const configFiles = _utils.uniq.call(void 0, [
|
|
157
157
|
...defaultConfigureFiles.map((i) => _path.resolve.call(void 0, userRoot, i)),
|
|
158
158
|
...themeRoots.map((i) => `${i}/windi.config.ts`),
|
|
@@ -191,9 +191,9 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
|
|
|
191
191
|
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
192
192
|
});
|
|
193
193
|
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
194
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
195
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
196
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
194
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk74QPSS6Tjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
195
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk74QPSS6Tjs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
196
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk74QPSS6Tjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
197
197
|
},
|
|
198
198
|
...windiOptions
|
|
199
199
|
}
|
|
@@ -201,7 +201,7 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
// node/plugins/preset.ts
|
|
204
|
-
|
|
204
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
205
205
|
|
|
206
206
|
var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
|
|
207
207
|
var _vite3 = require('unplugin-icons/vite'); var _vite4 = _interopRequireDefault(_vite3);
|
|
@@ -212,12 +212,15 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
|
|
|
212
212
|
|
|
213
213
|
|
|
214
214
|
// node/drawings.ts
|
|
215
|
-
|
|
215
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
216
216
|
|
|
217
217
|
|
|
218
218
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
219
219
|
function resolveDrawingsDir(options) {
|
|
220
|
-
return options.data.config.drawings.persist ? _path.resolve.call(void 0,
|
|
220
|
+
return options.data.config.drawings.persist ? _path.resolve.call(void 0,
|
|
221
|
+
_path.dirname.call(void 0, options.entry),
|
|
222
|
+
options.data.config.drawings.persist
|
|
223
|
+
) : void 0;
|
|
221
224
|
}
|
|
222
225
|
async function loadDrawings(options) {
|
|
223
226
|
const dir = resolveDrawingsDir(options);
|
|
@@ -261,7 +264,7 @@ ${value}
|
|
|
261
264
|
}
|
|
262
265
|
|
|
263
266
|
// node/plugins/extendConfig.ts
|
|
264
|
-
|
|
267
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
265
268
|
|
|
266
269
|
|
|
267
270
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
@@ -272,11 +275,11 @@ var dependencies = {
|
|
|
272
275
|
"@antfu/utils": "^0.5.2",
|
|
273
276
|
"@slidev/parser": "workspace:*",
|
|
274
277
|
"@slidev/types": "workspace:*",
|
|
275
|
-
"@unocss/reset": "^0.45.
|
|
276
|
-
"@vueuse/core": "^9.
|
|
277
|
-
"@vueuse/head": "^0.7.
|
|
278
|
-
"@vueuse/math": "^9.
|
|
279
|
-
"@vueuse/motion": "^2.0.0-beta.
|
|
278
|
+
"@unocss/reset": "^0.45.20",
|
|
279
|
+
"@vueuse/core": "^9.2.0",
|
|
280
|
+
"@vueuse/head": "^0.7.10",
|
|
281
|
+
"@vueuse/math": "^9.2.0",
|
|
282
|
+
"@vueuse/motion": "^2.0.0-beta.22",
|
|
280
283
|
codemirror: "^5.65.5",
|
|
281
284
|
defu: "^6.1.0",
|
|
282
285
|
drauu: "^0.3.1",
|
|
@@ -290,16 +293,16 @@ var dependencies = {
|
|
|
290
293
|
prettier: "^2.7.1",
|
|
291
294
|
recordrtc: "^5.6.2",
|
|
292
295
|
resolve: "^1.22.1",
|
|
293
|
-
unocss: "^0.45.
|
|
294
|
-
"vite-plugin-windicss": "^1.8.
|
|
295
|
-
vue: "^3.2.
|
|
296
|
+
unocss: "^0.45.20",
|
|
297
|
+
"vite-plugin-windicss": "^1.8.8",
|
|
298
|
+
vue: "^3.2.39",
|
|
296
299
|
"vue-router": "^4.1.5",
|
|
297
300
|
"vue-starport": "^0.3.0",
|
|
298
301
|
windicss: "^3.5.6"
|
|
299
302
|
};
|
|
300
303
|
|
|
301
304
|
// node/vite/searchRoot.ts
|
|
302
|
-
|
|
305
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
303
306
|
|
|
304
307
|
|
|
305
308
|
var ROOT_FILES = [
|
|
@@ -364,7 +367,7 @@ function createConfigPlugin(options) {
|
|
|
364
367
|
define: getDefine(options),
|
|
365
368
|
resolve: {
|
|
366
369
|
alias: {
|
|
367
|
-
"@slidev/client/": `${
|
|
370
|
+
"@slidev/client/": `${_chunk74QPSS6Tjs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
368
371
|
}
|
|
369
372
|
},
|
|
370
373
|
optimizeDeps: {
|
|
@@ -388,7 +391,7 @@ function createConfigPlugin(options) {
|
|
|
388
391
|
css: options.data.config.css === "unocss" ? {
|
|
389
392
|
postcss: {
|
|
390
393
|
plugins: [
|
|
391
|
-
await Promise.resolve().then(() =>
|
|
394
|
+
await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "postcss-nested"))).then((r) => r.default())
|
|
392
395
|
]
|
|
393
396
|
}
|
|
394
397
|
} : {},
|
|
@@ -398,7 +401,7 @@ function createConfigPlugin(options) {
|
|
|
398
401
|
allow: _utils.uniq.call(void 0, [
|
|
399
402
|
searchForWorkspaceRoot(options.userRoot),
|
|
400
403
|
searchForWorkspaceRoot(options.cliRoot),
|
|
401
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
404
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunk74QPSS6Tjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunk74QPSS6Tjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
402
405
|
])
|
|
403
406
|
}
|
|
404
407
|
}
|
|
@@ -407,7 +410,7 @@ function createConfigPlugin(options) {
|
|
|
407
410
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
408
411
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
409
412
|
injection.root = options.cliRoot;
|
|
410
|
-
injection.resolve.alias.vue = `${
|
|
413
|
+
injection.resolve.alias.vue = `${_chunk74QPSS6Tjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
411
414
|
}
|
|
412
415
|
return _vite.mergeConfig.call(void 0, config, injection);
|
|
413
416
|
},
|
|
@@ -428,7 +431,7 @@ function createConfigPlugin(options) {
|
|
|
428
431
|
}
|
|
429
432
|
function getDefine(options) {
|
|
430
433
|
return {
|
|
431
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
434
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunk74QPSS6Tjs.toAtFS.call(void 0, options.clientRoot)),
|
|
432
435
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
433
436
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
434
437
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -438,8 +441,8 @@ function getDefine(options) {
|
|
|
438
441
|
}
|
|
439
442
|
|
|
440
443
|
// node/plugins/loaders.ts
|
|
441
|
-
|
|
442
|
-
var import_fast_deep_equal =
|
|
444
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
445
|
+
var import_fast_deep_equal = _chunk74QPSS6Tjs.__toESM.call(void 0, require_fast_deep_equal());
|
|
443
446
|
|
|
444
447
|
|
|
445
448
|
|
|
@@ -564,7 +567,8 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
564
567
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
565
568
|
try {
|
|
566
569
|
const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
567
|
-
|
|
570
|
+
const handleHotUpdate = "handler" in VuePlugin.handleHotUpdate ? VuePlugin.handleHotUpdate.handler : VuePlugin.handleHotUpdate;
|
|
571
|
+
return await handleHotUpdate({
|
|
568
572
|
...ctx,
|
|
569
573
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
570
574
|
file,
|
|
@@ -693,7 +697,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
693
697
|
delete frontmatter.title;
|
|
694
698
|
const imports = [
|
|
695
699
|
'import { inject as vueInject } from "vue"',
|
|
696
|
-
`import InjectedLayout from "${
|
|
700
|
+
`import InjectedLayout from "${_chunk74QPSS6Tjs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
697
701
|
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
698
702
|
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
699
703
|
"const $slidev = vueInject(injectionSlidevContext)"
|
|
@@ -798,9 +802,9 @@ defineProps<{ no: number | string }>()`);
|
|
|
798
802
|
}
|
|
799
803
|
async function generateUserStyles() {
|
|
800
804
|
const imports = [
|
|
801
|
-
`import "${
|
|
802
|
-
`import "${
|
|
803
|
-
`import "${
|
|
805
|
+
`import "${_chunk74QPSS6Tjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
806
|
+
`import "${_chunk74QPSS6Tjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
807
|
+
`import "${_chunk74QPSS6Tjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
804
808
|
];
|
|
805
809
|
const roots2 = _utils.uniq.call(void 0, [
|
|
806
810
|
...themeRoots,
|
|
@@ -817,13 +821,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
817
821
|
];
|
|
818
822
|
for (const style of styles) {
|
|
819
823
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
820
|
-
imports.push(`import "${
|
|
824
|
+
imports.push(`import "${_chunk74QPSS6Tjs.toAtFS.call(void 0, style)}"`);
|
|
821
825
|
continue;
|
|
822
826
|
}
|
|
823
827
|
}
|
|
824
828
|
}
|
|
825
829
|
if (data.features.katex)
|
|
826
|
-
imports.push(`import "${
|
|
830
|
+
imports.push(`import "${_chunk74QPSS6Tjs.toAtFS.call(void 0, _chunk74QPSS6Tjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
827
831
|
if (data.config.css === "unocss") {
|
|
828
832
|
imports.unshift(
|
|
829
833
|
'import "@unocss/reset/tailwind.css"',
|
|
@@ -852,7 +856,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
852
856
|
const layouts = _utils.objectMap.call(void 0,
|
|
853
857
|
await getLayouts(),
|
|
854
858
|
(k, v) => {
|
|
855
|
-
imports.push(`import __layout_${k} from "${
|
|
859
|
+
imports.push(`import __layout_${k} from "${_chunk74QPSS6Tjs.toAtFS.call(void 0, v)}"`);
|
|
856
860
|
return [k, `__layout_${k}`];
|
|
857
861
|
}
|
|
858
862
|
);
|
|
@@ -901,7 +905,7 @@ ${routes.join(",\n")}
|
|
|
901
905
|
const config = { ...data.config, remote };
|
|
902
906
|
if (_utils.isString.call(void 0, config.title)) {
|
|
903
907
|
const tokens = md.parseInline(config.title, {});
|
|
904
|
-
config.title =
|
|
908
|
+
config.title = _chunk74QPSS6Tjs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
905
909
|
}
|
|
906
910
|
if (_utils.isString.call(void 0, config.info))
|
|
907
911
|
config.info = md.render(config.info);
|
|
@@ -922,7 +926,7 @@ ${routes.join(",\n")}
|
|
|
922
926
|
];
|
|
923
927
|
}
|
|
924
928
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
925
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
929
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunk74QPSS6Tjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
926
930
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
927
931
|
return `
|
|
928
932
|
${imports}
|
|
@@ -941,7 +945,7 @@ export default {
|
|
|
941
945
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
942
946
|
];
|
|
943
947
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
944
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
948
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunk74QPSS6Tjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
945
949
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
946
950
|
return `
|
|
947
951
|
${imports}
|
|
@@ -956,7 +960,7 @@ export default {
|
|
|
956
960
|
}
|
|
957
961
|
|
|
958
962
|
// node/plugins/monacoTransform.ts
|
|
959
|
-
|
|
963
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
960
964
|
|
|
961
965
|
|
|
962
966
|
|
|
@@ -990,7 +994,7 @@ function createMonacoTypesLoader() {
|
|
|
990
994
|
}
|
|
991
995
|
|
|
992
996
|
// node/plugins/setupClient.ts
|
|
993
|
-
|
|
997
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
994
998
|
|
|
995
999
|
|
|
996
1000
|
|
|
@@ -1001,10 +1005,13 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
1001
1005
|
enforce: "pre",
|
|
1002
1006
|
async transform(code, id) {
|
|
1003
1007
|
if (id.startsWith(setupEntry)) {
|
|
1008
|
+
let getInjections2 = function(isAwait = false, isChained = false) {
|
|
1009
|
+
return injections.join("\n").replace(/:AWAIT:/g, isAwait ? "await " : "").replace(/(,\s*)?:LAST:/g, isChained ? "$1injection_return" : "");
|
|
1010
|
+
};
|
|
1011
|
+
var getInjections = getInjections2;
|
|
1004
1012
|
const name = id.slice(setupEntry.length + 1);
|
|
1005
1013
|
const imports = [];
|
|
1006
1014
|
const injections = [];
|
|
1007
|
-
const asyncInjections = [];
|
|
1008
1015
|
const setups = _utils.uniq.call(void 0, [
|
|
1009
1016
|
...themeRoots,
|
|
1010
1017
|
...addonRoots,
|
|
@@ -1013,42 +1020,29 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
1013
1020
|
setups.forEach((path, idx) => {
|
|
1014
1021
|
if (!_fs.existsSync.call(void 0, path))
|
|
1015
1022
|
return;
|
|
1016
|
-
imports.push(`import __n${idx} from '${
|
|
1017
|
-
let fn =
|
|
1018
|
-
|
|
1019
|
-
if (/\binjection_return\b/g.test(code)) {
|
|
1023
|
+
imports.push(`import __n${idx} from '${_chunk74QPSS6Tjs.toAtFS.call(void 0, path)}'`);
|
|
1024
|
+
let fn = `:AWAIT:__n${idx}`;
|
|
1025
|
+
if (/\binjection_return\b/g.test(code))
|
|
1020
1026
|
fn = `injection_return = ${fn}`;
|
|
1021
|
-
awaitFn = `injection_return = ${awaitFn}`;
|
|
1022
|
-
}
|
|
1023
1027
|
if (/\binjection_arg\b/g.test(code)) {
|
|
1024
1028
|
fn += "(";
|
|
1025
|
-
awaitFn += "(";
|
|
1026
1029
|
const matches = Array.from(code.matchAll(/\binjection_arg(_\d+)?\b/g));
|
|
1027
1030
|
const dedupedMatches = Array.from(new Set(matches.map((m) => m[0])));
|
|
1028
|
-
dedupedMatches.
|
|
1029
|
-
|
|
1030
|
-
const arg = key + (isLast ? "" : ",");
|
|
1031
|
-
fn += arg;
|
|
1032
|
-
awaitFn += arg;
|
|
1033
|
-
});
|
|
1034
|
-
fn += ")";
|
|
1035
|
-
awaitFn += ")";
|
|
1031
|
+
fn += dedupedMatches.join(", ");
|
|
1032
|
+
fn += ", :LAST:)";
|
|
1036
1033
|
} else {
|
|
1037
|
-
fn += "()";
|
|
1038
|
-
awaitFn += "()";
|
|
1034
|
+
fn += "(:LAST:)";
|
|
1039
1035
|
}
|
|
1040
1036
|
injections.push(
|
|
1041
1037
|
`// ${path}`,
|
|
1042
1038
|
fn
|
|
1043
1039
|
);
|
|
1044
|
-
asyncInjections.push(
|
|
1045
|
-
`// ${path}`,
|
|
1046
|
-
awaitFn
|
|
1047
|
-
);
|
|
1048
1040
|
});
|
|
1049
1041
|
code = code.replace("/* __imports__ */", imports.join("\n"));
|
|
1050
|
-
code = code.replace("/* __injections__ */",
|
|
1051
|
-
code = code.replace("/* __async_injections__ */",
|
|
1042
|
+
code = code.replace("/* __injections__ */", getInjections2());
|
|
1043
|
+
code = code.replace("/* __async_injections__ */", getInjections2(true));
|
|
1044
|
+
code = code.replace("/* __chained_injections__ */", getInjections2(false, true));
|
|
1045
|
+
code = code.replace("/* __chained_async_injections__ */", getInjections2(true, true));
|
|
1052
1046
|
return code;
|
|
1053
1047
|
}
|
|
1054
1048
|
return null;
|
|
@@ -1057,7 +1051,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
1057
1051
|
}
|
|
1058
1052
|
|
|
1059
1053
|
// node/plugins/markdown.ts
|
|
1060
|
-
|
|
1054
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
1061
1055
|
var _vitepluginvuemarkdown = require('vite-plugin-vue-markdown'); var _vitepluginvuemarkdown2 = _interopRequireDefault(_vitepluginvuemarkdown);
|
|
1062
1056
|
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
1063
1057
|
|
|
@@ -1068,7 +1062,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
1068
1062
|
var _plantumlencoder = require('plantuml-encoder');
|
|
1069
1063
|
|
|
1070
1064
|
// node/plugins/markdown-it-katex.ts
|
|
1071
|
-
|
|
1065
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
1072
1066
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
1073
1067
|
function isValidDelim(state, pos) {
|
|
1074
1068
|
const max = state.posMax;
|
|
@@ -1215,7 +1209,7 @@ function math_plugin(md2, options) {
|
|
|
1215
1209
|
}
|
|
1216
1210
|
|
|
1217
1211
|
// node/plugins/markdown-it-prism.ts
|
|
1218
|
-
|
|
1212
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
1219
1213
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1220
1214
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1221
1215
|
var DEFAULTS = {
|
|
@@ -1238,7 +1232,7 @@ function loadPrismLang(lang) {
|
|
|
1238
1232
|
}
|
|
1239
1233
|
function loadPrismPlugin(name) {
|
|
1240
1234
|
try {
|
|
1241
|
-
|
|
1235
|
+
_chunk74QPSS6Tjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1242
1236
|
} catch (e) {
|
|
1243
1237
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1244
1238
|
}
|
|
@@ -1278,7 +1272,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1278
1272
|
}
|
|
1279
1273
|
|
|
1280
1274
|
// node/plugins/markdown-it-shiki.ts
|
|
1281
|
-
|
|
1275
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
1282
1276
|
function getThemeName(theme) {
|
|
1283
1277
|
if (typeof theme === "string")
|
|
1284
1278
|
return theme;
|
|
@@ -1341,7 +1335,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1341
1335
|
const setups = [];
|
|
1342
1336
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1343
1337
|
if (config.highlighter === "shiki") {
|
|
1344
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1338
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "shiki")));
|
|
1345
1339
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1346
1340
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1347
1341
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1495,7 +1489,7 @@ function escapeVueInCode(md2) {
|
|
|
1495
1489
|
}
|
|
1496
1490
|
|
|
1497
1491
|
// node/plugins/patchTransform.ts
|
|
1498
|
-
|
|
1492
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
1499
1493
|
|
|
1500
1494
|
function createFixPlugins(options) {
|
|
1501
1495
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1516,14 +1510,14 @@ function createFixPlugins(options) {
|
|
|
1516
1510
|
}
|
|
1517
1511
|
|
|
1518
1512
|
// node/plugins/unocss.ts
|
|
1519
|
-
|
|
1513
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
1520
1514
|
|
|
1521
1515
|
|
|
1522
1516
|
|
|
1523
1517
|
|
|
1524
1518
|
async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, data }, { unocss: unoOptions }) {
|
|
1525
1519
|
var _a, _b, _c, _d;
|
|
1526
|
-
const UnoCSS = await Promise.resolve().then(() =>
|
|
1520
|
+
const UnoCSS = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "unocss/vite"))).then((r) => r.default);
|
|
1527
1521
|
const configFiles = _utils.uniq.call(void 0, [
|
|
1528
1522
|
...themeRoots.map((i) => `${i}/uno.config.ts`),
|
|
1529
1523
|
...addonRoots.map((i) => `${i}/uno.config.ts`),
|
package/dist/cli.js
CHANGED
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkS3XL4MK5js = require('./chunk-S3XL4MK5.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkS74C6Q74js = require('./chunk-S74C6Q74.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk74QPSS6Tjs = require('./chunk-74QPSS6T.js');
|
|
18
18
|
|
|
19
19
|
// node/cli.ts
|
|
20
|
-
|
|
21
|
-
var import_fast_deep_equal =
|
|
20
|
+
_chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
|
|
21
|
+
var import_fast_deep_equal = _chunk74QPSS6Tjs.__toESM.call(void 0, _chunkS74C6Q74js.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(_chunkS3XL4MK5js.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",
|
|
@@ -85,9 +85,9 @@ cli.command(
|
|
|
85
85
|
async function initServer() {
|
|
86
86
|
if (server)
|
|
87
87
|
await server.close();
|
|
88
|
-
const options = await
|
|
88
|
+
const options = await _chunkS3XL4MK5js.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
|
|
89
89
|
port = userPort || await findFreePort(3030);
|
|
90
|
-
server = await
|
|
90
|
+
server = await _chunkS3XL4MK5js.createServer.call(void 0,
|
|
91
91
|
options,
|
|
92
92
|
{
|
|
93
93
|
server: {
|
|
@@ -101,7 +101,7 @@ cli.command(
|
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
onDataReload(newData, data) {
|
|
104
|
-
if (!theme &&
|
|
104
|
+
if (!theme && _chunkS3XL4MK5js.resolveThemeName.call(void 0, newData.config.theme) !== _chunkS3XL4MK5js.resolveThemeName.call(void 0, data.config.theme)) {
|
|
105
105
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
106
106
|
initServer();
|
|
107
107
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -183,8 +183,8 @@ cli.command(
|
|
|
183
183
|
describe: "allow download as PDF"
|
|
184
184
|
}).strict().help(),
|
|
185
185
|
async ({ entry, theme, watch, base, download, out }) => {
|
|
186
|
-
const { build } = await Promise.resolve().then(() =>
|
|
187
|
-
const options = await
|
|
186
|
+
const { build } = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "./build-DIGRXRLK.js")));
|
|
187
|
+
const options = await _chunkS3XL4MK5js.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
188
188
|
if (download && !options.data.config.download)
|
|
189
189
|
options.data.config.download = download;
|
|
190
190
|
printInfo(options);
|
|
@@ -202,9 +202,9 @@ cli.command(
|
|
|
202
202
|
"Format the markdown file",
|
|
203
203
|
(args) => commonOptions(args).strict().help(),
|
|
204
204
|
async ({ entry }) => {
|
|
205
|
-
const data = await
|
|
206
|
-
|
|
207
|
-
await
|
|
205
|
+
const data = await _chunkS3XL4MK5js.parser.load(entry);
|
|
206
|
+
_chunkS3XL4MK5js.parser.prettify(data);
|
|
207
|
+
await _chunkS3XL4MK5js.parser.save(data);
|
|
208
208
|
}
|
|
209
209
|
);
|
|
210
210
|
cli.command(
|
|
@@ -219,17 +219,17 @@ cli.command(
|
|
|
219
219
|
default: "theme"
|
|
220
220
|
}),
|
|
221
221
|
async ({ entry, dir, theme: themeInput }) => {
|
|
222
|
-
const data = await
|
|
223
|
-
const theme =
|
|
222
|
+
const data = await _chunkS3XL4MK5js.parser.load(entry);
|
|
223
|
+
const theme = _chunkS3XL4MK5js.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
224
224
|
if (theme === "none") {
|
|
225
225
|
console.error('Can not eject theme "none"');
|
|
226
226
|
process.exit(1);
|
|
227
227
|
}
|
|
228
|
-
if (
|
|
228
|
+
if (_chunkS3XL4MK5js.isPath.call(void 0, theme)) {
|
|
229
229
|
console.error("Theme is already ejected");
|
|
230
230
|
process.exit(1);
|
|
231
231
|
}
|
|
232
|
-
const roots =
|
|
232
|
+
const roots = _chunkS3XL4MK5js.getThemeRoots.call(void 0, theme, entry);
|
|
233
233
|
if (!roots.length) {
|
|
234
234
|
console.error(`Does not found theme "${theme}"`);
|
|
235
235
|
process.exit(1);
|
|
@@ -241,7 +241,7 @@ cli.command(
|
|
|
241
241
|
const dirPath = `./${dir}`;
|
|
242
242
|
data.slides[0].frontmatter.theme = dirPath;
|
|
243
243
|
data.slides[0].raw = null;
|
|
244
|
-
await
|
|
244
|
+
await _chunkS3XL4MK5js.parser.save(data);
|
|
245
245
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
246
246
|
}
|
|
247
247
|
);
|
|
@@ -294,11 +294,11 @@ cli.command(
|
|
|
294
294
|
"executable-path": executablePath
|
|
295
295
|
}) => {
|
|
296
296
|
process.env.NODE_ENV = "production";
|
|
297
|
-
const { exportSlides } = await Promise.resolve().then(() =>
|
|
297
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "./export-WKFHZNBT.js")));
|
|
298
298
|
const port = await findFreePort(12445);
|
|
299
|
-
const options = await
|
|
299
|
+
const options = await _chunkS3XL4MK5js.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
300
300
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
301
|
-
const server = await
|
|
301
|
+
const server = await _chunkS3XL4MK5js.createServer.call(void 0,
|
|
302
302
|
options,
|
|
303
303
|
{
|
|
304
304
|
server: { port },
|
|
@@ -307,7 +307,7 @@ cli.command(
|
|
|
307
307
|
);
|
|
308
308
|
await server.listen(port);
|
|
309
309
|
printInfo(options);
|
|
310
|
-
|
|
310
|
+
_chunkS3XL4MK5js.parser.filterDisabled(options.data);
|
|
311
311
|
const width = options.data.config.canvasWidth;
|
|
312
312
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
313
313
|
output = await exportSlides({
|
|
@@ -347,7 +347,7 @@ function printInfo(options, port, remote) {
|
|
|
347
347
|
console.log();
|
|
348
348
|
console.log();
|
|
349
349
|
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${
|
|
350
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkS3XL4MK5js.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
351
351
|
console.log();
|
|
352
352
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
353
353
|
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
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
resolveOptions,
|
|
7
7
|
resolveThemeName,
|
|
8
8
|
version
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MTVLPZ5A.mjs";
|
|
10
10
|
import {
|
|
11
11
|
require_fast_deep_equal
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PIEUNXTX.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__dirname,
|
|
15
15
|
__require,
|
|
16
16
|
__toESM,
|
|
17
17
|
init_esm_shims
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IAMILGBS.mjs";
|
|
19
19
|
|
|
20
20
|
// node/cli.ts
|
|
21
21
|
init_esm_shims();
|
|
@@ -184,7 +184,7 @@ cli.command(
|
|
|
184
184
|
describe: "allow download as PDF"
|
|
185
185
|
}).strict().help(),
|
|
186
186
|
async ({ entry, theme, watch, base, download, out }) => {
|
|
187
|
-
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-
|
|
187
|
+
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-3YQL2K7P.mjs")));
|
|
188
188
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
189
189
|
if (download && !options.data.config.download)
|
|
190
190
|
options.data.config.download = download;
|
|
@@ -295,7 +295,7 @@ cli.command(
|
|
|
295
295
|
"executable-path": executablePath
|
|
296
296
|
}) => {
|
|
297
297
|
process.env.NODE_ENV = "production";
|
|
298
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
298
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-26FXNM7P.mjs")));
|
|
299
299
|
const port = await findFreePort(12445);
|
|
300
300
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
301
301
|
output = output || options.data.config.exportFilename || `${path.basename(entry, ".md")}-export`;
|