@slidev/cli 0.41.1 → 0.42.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/README.md +2 -2
- package/dist/{build-3GLTTQXV.js → build-FNP2QTPG.js} +9 -7
- package/dist/{build-KUT3K5TN.mjs → build-KRDVURNJ.mjs} +5 -3
- package/dist/chunk-6XVZLT3I.mjs +35 -0
- package/dist/chunk-6ZL4B4HQ.js +76 -0
- package/dist/chunk-CIUEQ4TI.mjs +76 -0
- package/dist/{chunk-AV6T2PNJ.mjs → chunk-EQTZCSMP.mjs} +63 -184
- 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-5QG2FB7Y.mjs → chunk-PL2KGP4V.mjs} +8 -6
- package/dist/{chunk-UJUM4LW4.js → chunk-QL6EDWJQ.js} +56 -177
- package/dist/{chunk-OM6HSZVY.js → chunk-TRSAM62K.js} +82 -80
- 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 +9 -9
- package/dist/chunk-GE7W2DBE.js +0 -138
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EQTZCSMP.mjs";
|
|
5
|
+
import {
|
|
6
|
+
packageExists,
|
|
7
|
+
resolveImportPath
|
|
8
|
+
} from "./chunk-CIUEQ4TI.mjs";
|
|
5
9
|
import {
|
|
6
10
|
__commonJS,
|
|
7
11
|
__privateAdd,
|
|
8
12
|
__privateGet,
|
|
9
13
|
__privateSet,
|
|
10
14
|
__privateWrapper,
|
|
11
|
-
__toESM
|
|
12
|
-
|
|
13
|
-
resolveImportPath
|
|
14
|
-
} from "./chunk-CTG3GV2W.mjs";
|
|
15
|
+
__toESM
|
|
16
|
+
} from "./chunk-L5QH2WZE.mjs";
|
|
15
17
|
|
|
16
18
|
// ../../node_modules/.pnpm/semver@7.5.1/node_modules/semver/internal/constants.js
|
|
17
19
|
var require_constants = __commonJS({
|
|
@@ -2452,7 +2454,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2452
2454
|
import * as parser from "@slidev/parser/fs";
|
|
2453
2455
|
|
|
2454
2456
|
// package.json
|
|
2455
|
-
var version = "0.
|
|
2457
|
+
var version = "0.42.1";
|
|
2456
2458
|
|
|
2457
2459
|
// node/themes.ts
|
|
2458
2460
|
import prompts2 from "prompts";
|
|
@@ -1,16 +1,21 @@
|
|
|
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 _chunkKKGXM3XLjs = require('./chunk-KKGXM3XL.js');
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
10
|
+
var _chunk6ZL4B4HQjs = require('./chunk-6ZL4B4HQ.js');
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkMJQETB73js = require('./chunk-MJQETB73.js');
|
|
11
16
|
|
|
12
17
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
13
|
-
var require_fast_deep_equal =
|
|
18
|
+
var require_fast_deep_equal = _chunkMJQETB73js.__commonJS.call(void 0, {
|
|
14
19
|
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
15
20
|
"use strict";
|
|
16
21
|
module.exports = function equal2(a, b) {
|
|
@@ -84,8 +89,8 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
|
|
|
84
89
|
body += '\n<script async src="https://platform.twitter.com/widgets.js"></script>';
|
|
85
90
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
86
91
|
head += `
|
|
87
|
-
<link rel="stylesheet" href="${
|
|
88
|
-
main = main.replace("__ENTRY__",
|
|
92
|
+
<link rel="stylesheet" href="${_chunk6ZL4B4HQjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
93
|
+
main = main.replace("__ENTRY__", _chunk6ZL4B4HQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
89
94
|
return main;
|
|
90
95
|
}
|
|
91
96
|
async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config, command) {
|
|
@@ -108,93 +113,6 @@ async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config,
|
|
|
108
113
|
return _vite.mergeConfig.call(void 0, viteConfig, config);
|
|
109
114
|
}
|
|
110
115
|
|
|
111
|
-
// node/plugins/setupNode.ts
|
|
112
|
-
|
|
113
|
-
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
114
|
-
|
|
115
|
-
var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
|
|
116
|
-
function deepMerge(a, b, rootPath = "") {
|
|
117
|
-
a = { ...a };
|
|
118
|
-
Object.keys(b).forEach((key) => {
|
|
119
|
-
if (_utils.isObject.call(void 0, a[key]))
|
|
120
|
-
a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
|
|
121
|
-
else if (Array.isArray(a[key]))
|
|
122
|
-
a[key] = [...a[key], ...b[key]];
|
|
123
|
-
else
|
|
124
|
-
a[key] = b[key];
|
|
125
|
-
});
|
|
126
|
-
return a;
|
|
127
|
-
}
|
|
128
|
-
async function loadSetups(roots, name, arg, initial, merge = true, accumulate) {
|
|
129
|
-
let returns = initial;
|
|
130
|
-
for (const root of roots) {
|
|
131
|
-
const path = _path.resolve.call(void 0, root, "setup", name);
|
|
132
|
-
if (await _fsextra.pathExists.call(void 0, path)) {
|
|
133
|
-
const { default: setup } = _jiti2.default.call(void 0, __filename)(path);
|
|
134
|
-
const result = await setup(arg);
|
|
135
|
-
if (result !== null) {
|
|
136
|
-
returns = merge ? deepMerge(returns, result) : accumulate ? accumulate(returns, result) : result;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return returns;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// node/plugins/windicss.ts
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
149
|
-
const { default: WindiCSS } = await Promise.resolve().then(() => require("vite-plugin-windicss"));
|
|
150
|
-
const { defaultConfigureFiles } = await Promise.resolve().then(() => require("@windicss/config"));
|
|
151
|
-
const configFiles = _utils.uniq.call(void 0, [
|
|
152
|
-
...defaultConfigureFiles.map((i) => _path.resolve.call(void 0, userRoot, i)),
|
|
153
|
-
...themeRoots.map((i) => `${i}/windi.config.ts`),
|
|
154
|
-
...addonRoots.map((i) => `${i}/windi.config.ts`),
|
|
155
|
-
_path.resolve.call(void 0, clientRoot, "windi.config.ts")
|
|
156
|
-
]);
|
|
157
|
-
const configFile = configFiles.find((i) => _fs.existsSync.call(void 0, i));
|
|
158
|
-
let config = _jiti2.default.call(void 0, __filename)(configFile);
|
|
159
|
-
if (config.default)
|
|
160
|
-
config = config.default;
|
|
161
|
-
config = await loadSetups(roots, "windicss.ts", {}, config, true);
|
|
162
|
-
return WindiCSS(
|
|
163
|
-
{
|
|
164
|
-
configFiles: [configFile],
|
|
165
|
-
config,
|
|
166
|
-
onConfigResolved(config2) {
|
|
167
|
-
if (!config2.theme)
|
|
168
|
-
config2.theme = {};
|
|
169
|
-
if (!config2.theme.extend)
|
|
170
|
-
config2.theme.extend = {};
|
|
171
|
-
if (!config2.theme.extend.fontFamily)
|
|
172
|
-
config2.theme.extend.fontFamily = {};
|
|
173
|
-
const fontFamily = config2.theme.extend.fontFamily;
|
|
174
|
-
fontFamily.sans || (fontFamily.sans = data.config.fonts.sans.join(","));
|
|
175
|
-
fontFamily.mono || (fontFamily.mono = data.config.fonts.mono.join(","));
|
|
176
|
-
fontFamily.serif || (fontFamily.serif = data.config.fonts.serif.join(","));
|
|
177
|
-
return config2;
|
|
178
|
-
},
|
|
179
|
-
onOptionsResolved(config2) {
|
|
180
|
-
themeRoots.forEach((i) => {
|
|
181
|
-
config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
|
|
182
|
-
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
183
|
-
});
|
|
184
|
-
addonRoots.forEach((i) => {
|
|
185
|
-
config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
|
|
186
|
-
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
187
|
-
});
|
|
188
|
-
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
189
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
190
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
191
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
192
|
-
},
|
|
193
|
-
...windiOptions
|
|
194
|
-
}
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
116
|
// node/plugins/preset.ts
|
|
199
117
|
|
|
200
118
|
|
|
@@ -203,15 +121,12 @@ var _pluginvuejsx = require('@vitejs/plugin-vue-jsx'); var _pluginvuejsx2 = _int
|
|
|
203
121
|
var _vite3 = require('unplugin-icons/vite'); var _vite4 = _interopRequireDefault(_vite3);
|
|
204
122
|
var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
|
|
205
123
|
var _vite5 = require('unplugin-vue-components/vite'); var _vite6 = _interopRequireDefault(_vite5);
|
|
206
|
-
var _vitepluginremoteassets = require('vite-plugin-remote-assets'); var _vitepluginremoteassets2 = _interopRequireDefault(_vitepluginremoteassets);
|
|
207
124
|
var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepluginvueserverref2 = _interopRequireDefault(_vitepluginvueserverref);
|
|
208
125
|
|
|
209
|
-
var _viteplugininspect = require('vite-plugin-inspect'); var _viteplugininspect2 = _interopRequireDefault(_viteplugininspect);
|
|
210
|
-
var _vitepluginstaticcopy = require('vite-plugin-static-copy');
|
|
211
126
|
|
|
212
127
|
// node/drawings.ts
|
|
213
128
|
|
|
214
|
-
|
|
129
|
+
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
215
130
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
216
131
|
function resolveDrawingsDir(options) {
|
|
217
132
|
return options.data.config.drawings.persist ? _path.resolve.call(void 0,
|
|
@@ -271,11 +186,11 @@ var dependencies = {
|
|
|
271
186
|
"@antfu/utils": "^0.7.2",
|
|
272
187
|
"@slidev/parser": "workspace:*",
|
|
273
188
|
"@slidev/types": "workspace:*",
|
|
274
|
-
"@unocss/reset": "^0.
|
|
189
|
+
"@unocss/reset": "^0.52.4",
|
|
275
190
|
"@vueuse/core": "^10.1.2",
|
|
276
191
|
"@vueuse/head": "^1.1.26",
|
|
277
192
|
"@vueuse/math": "^10.1.2",
|
|
278
|
-
"@vueuse/motion": "^2.0.0
|
|
193
|
+
"@vueuse/motion": "^2.0.0",
|
|
279
194
|
codemirror: "^5.65.5",
|
|
280
195
|
defu: "^6.1.2",
|
|
281
196
|
drauu: "^0.3.2",
|
|
@@ -284,16 +199,16 @@ var dependencies = {
|
|
|
284
199
|
"js-base64": "^3.7.5",
|
|
285
200
|
"js-yaml": "^4.1.0",
|
|
286
201
|
katex: "^0.16.7",
|
|
287
|
-
mermaid: "^10.
|
|
202
|
+
mermaid: "^10.2.0",
|
|
288
203
|
"monaco-editor": "^0.37.1",
|
|
289
204
|
nanoid: "^4.0.2",
|
|
290
205
|
prettier: "^2.8.8",
|
|
291
206
|
recordrtc: "^5.6.2",
|
|
292
207
|
resolve: "^1.22.2",
|
|
293
|
-
unocss: "^0.
|
|
208
|
+
unocss: "^0.52.4",
|
|
294
209
|
"vite-plugin-windicss": "^1.9.0",
|
|
295
|
-
vue: "^3.3.
|
|
296
|
-
"vue-router": "^4.2.
|
|
210
|
+
vue: "^3.3.4",
|
|
211
|
+
"vue-router": "^4.2.2",
|
|
297
212
|
"vue-starport": "^0.3.0",
|
|
298
213
|
windicss: "^3.5.6"
|
|
299
214
|
};
|
|
@@ -371,7 +286,7 @@ function createConfigPlugin(options) {
|
|
|
371
286
|
define: getDefine(options),
|
|
372
287
|
resolve: {
|
|
373
288
|
alias: {
|
|
374
|
-
"@slidev/client/": `${
|
|
289
|
+
"@slidev/client/": `${_chunk6ZL4B4HQjs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
375
290
|
},
|
|
376
291
|
dedupe: ["vue"]
|
|
377
292
|
},
|
|
@@ -406,7 +321,7 @@ function createConfigPlugin(options) {
|
|
|
406
321
|
allow: _utils.uniq.call(void 0, [
|
|
407
322
|
searchForWorkspaceRoot(options.userRoot),
|
|
408
323
|
searchForWorkspaceRoot(options.cliRoot),
|
|
409
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
324
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunk6ZL4B4HQjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunk6ZL4B4HQjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
410
325
|
])
|
|
411
326
|
}
|
|
412
327
|
},
|
|
@@ -415,7 +330,7 @@ function createConfigPlugin(options) {
|
|
|
415
330
|
if (_isinstalledglobally2.default) {
|
|
416
331
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
417
332
|
injection.root = options.cliRoot;
|
|
418
|
-
injection.resolve.alias.vue = `${
|
|
333
|
+
injection.resolve.alias.vue = `${_chunk6ZL4B4HQjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
419
334
|
}
|
|
420
335
|
return _vite.mergeConfig.call(void 0, injection, config);
|
|
421
336
|
},
|
|
@@ -437,7 +352,7 @@ function createConfigPlugin(options) {
|
|
|
437
352
|
function getDefine(options) {
|
|
438
353
|
return {
|
|
439
354
|
__DEV__: options.mode === "dev" ? "true" : "false",
|
|
440
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
355
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunk6ZL4B4HQjs.toAtFS.call(void 0, options.clientRoot)),
|
|
441
356
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
442
357
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
443
358
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -448,7 +363,7 @@ function getDefine(options) {
|
|
|
448
363
|
}
|
|
449
364
|
|
|
450
365
|
// node/plugins/loaders.ts
|
|
451
|
-
var import_fast_deep_equal =
|
|
366
|
+
var import_fast_deep_equal = _chunkMJQETB73js.__toESM.call(void 0, require_fast_deep_equal());
|
|
452
367
|
|
|
453
368
|
|
|
454
369
|
|
|
@@ -459,13 +374,13 @@ var _fs3 = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_f
|
|
|
459
374
|
var regexId = /^\/\@slidev\/slide\/(\d+)\.(md|json)(?:\?import)?$/;
|
|
460
375
|
var regexIdQuery = /(\d+?)\.(md|json)$/;
|
|
461
376
|
function getBodyJson(req) {
|
|
462
|
-
return new Promise((
|
|
377
|
+
return new Promise((resolve3, reject) => {
|
|
463
378
|
let body = "";
|
|
464
379
|
req.on("data", (chunk) => body += chunk);
|
|
465
380
|
req.on("error", reject);
|
|
466
381
|
req.on("end", () => {
|
|
467
382
|
try {
|
|
468
|
-
|
|
383
|
+
resolve3(JSON.parse(body) || {});
|
|
469
384
|
} catch (e) {
|
|
470
385
|
reject(e);
|
|
471
386
|
}
|
|
@@ -717,7 +632,7 @@ ${title}
|
|
|
717
632
|
delete frontmatter.title;
|
|
718
633
|
const imports = [
|
|
719
634
|
'import { inject as vueInject } from "vue"',
|
|
720
|
-
`import InjectedLayout from "${
|
|
635
|
+
`import InjectedLayout from "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
721
636
|
'import { injectionSlidevContext } from "@slidev/client/constants.ts"',
|
|
722
637
|
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
723
638
|
"const $slidev = vueInject(injectionSlidevContext)"
|
|
@@ -822,10 +737,10 @@ defineProps<{ no: number | string }>()`);
|
|
|
822
737
|
}
|
|
823
738
|
async function generateUserStyles() {
|
|
824
739
|
const imports = [
|
|
825
|
-
`import "${
|
|
826
|
-
`import "${
|
|
827
|
-
`import "${
|
|
828
|
-
`import "${
|
|
740
|
+
`import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
741
|
+
`import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
742
|
+
`import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`,
|
|
743
|
+
`import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/transitions.css"))}"`
|
|
829
744
|
];
|
|
830
745
|
const roots2 = _utils.uniq.call(void 0, [
|
|
831
746
|
...themeRoots,
|
|
@@ -842,13 +757,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
842
757
|
];
|
|
843
758
|
for (const style of styles) {
|
|
844
759
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
845
|
-
imports.push(`import "${
|
|
760
|
+
imports.push(`import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, style)}"`);
|
|
846
761
|
continue;
|
|
847
762
|
}
|
|
848
763
|
}
|
|
849
764
|
}
|
|
850
765
|
if (data.features.katex)
|
|
851
|
-
imports.push(`import "${
|
|
766
|
+
imports.push(`import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, _chunk6ZL4B4HQjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
852
767
|
if (data.config.css === "unocss") {
|
|
853
768
|
imports.unshift(
|
|
854
769
|
'import "@unocss/reset/tailwind.css"',
|
|
@@ -876,7 +791,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
876
791
|
const layouts = _utils.objectMap.call(void 0,
|
|
877
792
|
await getLayouts(),
|
|
878
793
|
(k, v) => {
|
|
879
|
-
imports.push(`import __layout_${k} from "${
|
|
794
|
+
imports.push(`import __layout_${k} from "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, v)}"`);
|
|
880
795
|
return [k, `__layout_${k}`];
|
|
881
796
|
}
|
|
882
797
|
);
|
|
@@ -913,8 +828,7 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
|
|
|
913
828
|
const redirect = ((_c = i.frontmatter) == null ? void 0 : _c.routeAlias) ? `{ path: '${(_d = i.frontmatter) == null ? void 0 : _d.routeAlias}', redirect: { path: '${no}' } }` : null;
|
|
914
829
|
no += 1;
|
|
915
830
|
return [route, redirect];
|
|
916
|
-
}).flat().filter(_utils.notNullish)
|
|
917
|
-
`{ path: "${no}", component: __layout__end, meta: { layout: "end" } }`
|
|
831
|
+
}).flat().filter(_utils.notNullish)
|
|
918
832
|
];
|
|
919
833
|
const routesStr = `export default [
|
|
920
834
|
${routes.join(",\n")}
|
|
@@ -925,7 +839,7 @@ ${routes.join(",\n")}
|
|
|
925
839
|
const config = { ...data.config, remote };
|
|
926
840
|
if (_utils.isString.call(void 0, config.title)) {
|
|
927
841
|
const tokens = md.parseInline(config.title, {});
|
|
928
|
-
config.title =
|
|
842
|
+
config.title = _chunk6ZL4B4HQjs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
929
843
|
}
|
|
930
844
|
if (_utils.isString.call(void 0, config.info))
|
|
931
845
|
config.info = md.render(config.info);
|
|
@@ -946,7 +860,7 @@ ${routes.join(",\n")}
|
|
|
946
860
|
];
|
|
947
861
|
}
|
|
948
862
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
949
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
863
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunk6ZL4B4HQjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
950
864
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
951
865
|
return `
|
|
952
866
|
${imports}
|
|
@@ -965,7 +879,7 @@ export default {
|
|
|
965
879
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
966
880
|
];
|
|
967
881
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
968
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
882
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunk6ZL4B4HQjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
969
883
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
970
884
|
return `
|
|
971
885
|
${imports}
|
|
@@ -1045,7 +959,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
1045
959
|
setups.forEach((path, idx) => {
|
|
1046
960
|
if (!_fs.existsSync.call(void 0, path))
|
|
1047
961
|
return;
|
|
1048
|
-
imports.push(`import __n${idx} from '${
|
|
962
|
+
imports.push(`import __n${idx} from '${_chunk6ZL4B4HQjs.toAtFS.call(void 0, path)}'`);
|
|
1049
963
|
let fn = `:AWAIT:__n${idx}`;
|
|
1050
964
|
if (/\binjection_return\b/g.test(code))
|
|
1051
965
|
fn = `injection_return = ${fn}`;
|
|
@@ -1255,7 +1169,7 @@ function loadPrismLang(lang) {
|
|
|
1255
1169
|
}
|
|
1256
1170
|
function loadPrismPlugin(name) {
|
|
1257
1171
|
try {
|
|
1258
|
-
|
|
1172
|
+
_chunkMJQETB73js.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1259
1173
|
} catch (e) {
|
|
1260
1174
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1261
1175
|
}
|
|
@@ -1361,14 +1275,14 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1361
1275
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1362
1276
|
if (config.highlighter === "shiki") {
|
|
1363
1277
|
const { getHighlighter } = await Promise.resolve().then(() => require("shiki"));
|
|
1364
|
-
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1278
|
+
const shikiOptions = await _chunkKKGXM3XLjs.loadSetups.call(void 0, roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1365
1279
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1366
1280
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
1367
1281
|
setups.push((md2) => md2.use(markdown_it_shiki_default, shikiOptions));
|
|
1368
1282
|
} else {
|
|
1369
1283
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1370
1284
|
}
|
|
1371
|
-
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1285
|
+
const KatexOptions = await _chunkKKGXM3XLjs.loadSetups.call(void 0, roots, "katex.ts", {}, { strict: false }, false);
|
|
1372
1286
|
return _vitepluginvuemarkdown2.default.call(void 0, {
|
|
1373
1287
|
wrapperClasses: "",
|
|
1374
1288
|
headEnabled: false,
|
|
@@ -1542,40 +1456,6 @@ function createFixPlugins(options) {
|
|
|
1542
1456
|
];
|
|
1543
1457
|
}
|
|
1544
1458
|
|
|
1545
|
-
// node/plugins/unocss.ts
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, userRoot, data }, { unocss: unoOptions }) {
|
|
1551
|
-
var _a, _b, _c, _d;
|
|
1552
|
-
const UnoCSS = await Promise.resolve().then(() => require("unocss/vite")).then((r) => r.default);
|
|
1553
|
-
const configFiles = _utils.uniq.call(void 0, [
|
|
1554
|
-
_path.resolve.call(void 0, userRoot, "uno.config.ts"),
|
|
1555
|
-
_path.resolve.call(void 0, userRoot, "unocss.config.ts"),
|
|
1556
|
-
...themeRoots.map((i) => `${i}/uno.config.ts`),
|
|
1557
|
-
...themeRoots.map((i) => `${i}/unocss.config.ts`),
|
|
1558
|
-
...addonRoots.map((i) => `${i}/uno.config.ts`),
|
|
1559
|
-
...addonRoots.map((i) => `${i}/unocss.config.ts`),
|
|
1560
|
-
_path.resolve.call(void 0, clientRoot, "uno.config.ts"),
|
|
1561
|
-
_path.resolve.call(void 0, clientRoot, "unocss.config.ts")
|
|
1562
|
-
]);
|
|
1563
|
-
const configFile = configFiles.find((i) => _fs.existsSync.call(void 0, i));
|
|
1564
|
-
let config = _jiti2.default.call(void 0, __filename)(configFile);
|
|
1565
|
-
if ("default" in config)
|
|
1566
|
-
config = config.default;
|
|
1567
|
-
config = await loadSetups(roots, "unocss.ts", {}, config, true);
|
|
1568
|
-
config.theme || (config.theme = {});
|
|
1569
|
-
(_a = config.theme).fontFamily || (_a.fontFamily = {});
|
|
1570
|
-
(_b = config.theme.fontFamily).sans || (_b.sans = data.config.fonts.sans.join(","));
|
|
1571
|
-
(_c = config.theme.fontFamily).mono || (_c.mono = data.config.fonts.mono.join(","));
|
|
1572
|
-
(_d = config.theme.fontFamily).serif || (_d.serif = data.config.fonts.serif.join(","));
|
|
1573
|
-
return UnoCSS({
|
|
1574
|
-
configFile: false,
|
|
1575
|
-
..._utils.deepMerge.call(void 0, config, unoOptions || {})
|
|
1576
|
-
});
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
1459
|
// node/plugins/preset.ts
|
|
1580
1460
|
var customElements = /* @__PURE__ */ new Set([
|
|
1581
1461
|
// katex
|
|
@@ -1640,7 +1520,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1640
1520
|
const MarkdownPlugin = await createMarkdownPlugin(options, pluginOptions);
|
|
1641
1521
|
const drawingData = await loadDrawings(options);
|
|
1642
1522
|
const publicRoots = themeRoots.map((i) => _path.join.call(void 0, i, "public")).filter(_fs.existsSync);
|
|
1643
|
-
|
|
1523
|
+
const plugins = [
|
|
1644
1524
|
MarkdownPlugin,
|
|
1645
1525
|
VueJsxPlugin,
|
|
1646
1526
|
VuePlugin,
|
|
@@ -1671,9 +1551,9 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1671
1551
|
autoInstall: true,
|
|
1672
1552
|
...iconsOptions
|
|
1673
1553
|
}),
|
|
1674
|
-
config.remoteAssets === true || config.remoteAssets === mode ?
|
|
1554
|
+
config.remoteAssets === true || config.remoteAssets === mode ? Promise.resolve().then(() => require("vite-plugin-remote-assets")).then((r) => r.default({
|
|
1675
1555
|
rules: [
|
|
1676
|
-
...
|
|
1556
|
+
...r.DefaultRules,
|
|
1677
1557
|
{
|
|
1678
1558
|
match: /\b(https?:\/\/image.unsplash\.com.*?)(?=[`'")\]])/ig,
|
|
1679
1559
|
ext: ".png"
|
|
@@ -1682,7 +1562,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1682
1562
|
resolveMode: (id) => id.endsWith("index.html") ? "relative" : "@fs",
|
|
1683
1563
|
awaitDownload: mode === "build",
|
|
1684
1564
|
...remoteAssetsOptions
|
|
1685
|
-
}) : null,
|
|
1565
|
+
})) : null,
|
|
1686
1566
|
_vitepluginvueserverref2.default.call(void 0, {
|
|
1687
1567
|
debug: process.env.NODE_ENV === "development",
|
|
1688
1568
|
state: {
|
|
@@ -1702,23 +1582,24 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1702
1582
|
writeDrawings(options, _nullishCoalesce(patch, () => ( data)));
|
|
1703
1583
|
}
|
|
1704
1584
|
}),
|
|
1705
|
-
publicRoots.length ? _vitepluginstaticcopy.viteStaticCopy.call(void 0, {
|
|
1706
|
-
silent: true,
|
|
1707
|
-
targets: publicRoots.map((r) => ({
|
|
1708
|
-
src: `${r}/*`,
|
|
1709
|
-
dest: "theme"
|
|
1710
|
-
}))
|
|
1711
|
-
}) : null,
|
|
1712
1585
|
createConfigPlugin(options),
|
|
1713
1586
|
createClientSetupPlugin(options),
|
|
1714
1587
|
createMonacoTypesLoader(),
|
|
1715
1588
|
createFixPlugins(options),
|
|
1716
|
-
|
|
1589
|
+
publicRoots.length ? Promise.resolve().then(() => require("vite-plugin-static-copy")).then((r) => r.viteStaticCopy({
|
|
1590
|
+
silent: true,
|
|
1591
|
+
targets: publicRoots.map((r2) => ({
|
|
1592
|
+
src: `${r2}/*`,
|
|
1593
|
+
dest: "theme"
|
|
1594
|
+
}))
|
|
1595
|
+
})) : null,
|
|
1596
|
+
options.inspect ? Promise.resolve().then(() => require("vite-plugin-inspect")).then((r) => r.default({
|
|
1717
1597
|
dev: true,
|
|
1718
1598
|
build: true
|
|
1719
|
-
}) : null,
|
|
1720
|
-
config.css === "none" ? null : config.css === "
|
|
1721
|
-
]
|
|
1599
|
+
})) : null,
|
|
1600
|
+
config.css === "none" ? null : config.css === "windicss" ? Promise.resolve().then(() => require("./windicss-YNIIPANV.js")).then((r) => r.createWindiCSSPlugin(options, pluginOptions)) : Promise.resolve().then(() => require("./unocss-2CJUFE63.js")).then((r) => r.createUnocssPlugin(options, pluginOptions))
|
|
1601
|
+
];
|
|
1602
|
+
return (await Promise.all(plugins)).flat().filter(_utils.notNullish);
|
|
1722
1603
|
}
|
|
1723
1604
|
|
|
1724
1605
|
|
|
@@ -1726,6 +1607,4 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1726
1607
|
|
|
1727
1608
|
|
|
1728
1609
|
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
exports.getIndexHtml = getIndexHtml; exports.mergeViteConfigs = mergeViteConfigs; exports.require_fast_deep_equal = require_fast_deep_equal; exports.loadSetups = loadSetups; exports.createWindiCSSPlugin = createWindiCSSPlugin; exports.ViteSlidevPlugin = ViteSlidevPlugin;
|
|
1610
|
+
exports.getIndexHtml = getIndexHtml; exports.mergeViteConfigs = mergeViteConfigs; exports.require_fast_deep_equal = require_fast_deep_equal; exports.ViteSlidevPlugin = ViteSlidevPlugin;
|