@slidev/cli 0.35.5 → 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-RBCFVFDG.mjs → build-LS63HRWN.mjs} +53 -38
- package/dist/{build-PO2PXBSF.js → build-VLQNNPIA.js} +59 -44
- package/dist/{chunk-SQLX75IO.js → chunk-74QPSS6T.js} +12 -7
- package/dist/{chunk-AHXRM5NG.js → chunk-CG3QPKUJ.js} +199 -161
- package/dist/{chunk-QPGEWKWZ.mjs → chunk-DRWWOOWC.mjs} +141 -109
- package/dist/{chunk-GVA336JI.mjs → chunk-IAMILGBS.mjs} +12 -7
- package/dist/{chunk-ZJSOFQBR.js → chunk-L3B76JRZ.js} +181 -149
- package/dist/{chunk-SWNG6UPD.mjs → chunk-S3HDHTBQ.mjs} +69 -31
- package/dist/cli.js +301 -252
- package/dist/cli.mjs +296 -247
- package/dist/{export-U7F6XGP6.mjs → export-26FXNM7P.mjs} +1 -1
- package/dist/{export-JXFGVO7B.js → export-WKFHZNBT.js} +4 -4
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +19 -18
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveImportPath,
|
|
10
10
|
stringifyMarkdownTokens,
|
|
11
11
|
toAtFS
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IAMILGBS.mjs";
|
|
13
13
|
|
|
14
14
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
15
15
|
var require_fast_deep_equal = __commonJS({
|
|
@@ -165,38 +165,40 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
|
|
|
165
165
|
if (config.default)
|
|
166
166
|
config = config.default;
|
|
167
167
|
config = await loadSetups(roots, "windicss.ts", {}, config, true);
|
|
168
|
-
return WindiCSS(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
config2.theme
|
|
174
|
-
|
|
175
|
-
config2.theme.extend
|
|
176
|
-
|
|
177
|
-
config2.theme.extend.fontFamily
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
168
|
+
return WindiCSS(
|
|
169
|
+
{
|
|
170
|
+
configFiles: [configFile],
|
|
171
|
+
config,
|
|
172
|
+
onConfigResolved(config2) {
|
|
173
|
+
if (!config2.theme)
|
|
174
|
+
config2.theme = {};
|
|
175
|
+
if (!config2.theme.extend)
|
|
176
|
+
config2.theme.extend = {};
|
|
177
|
+
if (!config2.theme.extend.fontFamily)
|
|
178
|
+
config2.theme.extend.fontFamily = {};
|
|
179
|
+
const fontFamily = config2.theme.extend.fontFamily;
|
|
180
|
+
fontFamily.sans || (fontFamily.sans = data.config.fonts.sans.join(","));
|
|
181
|
+
fontFamily.mono || (fontFamily.mono = data.config.fonts.mono.join(","));
|
|
182
|
+
fontFamily.serif || (fontFamily.serif = data.config.fonts.serif.join(","));
|
|
183
|
+
return config2;
|
|
184
|
+
},
|
|
185
|
+
onOptionsResolved(config2) {
|
|
186
|
+
themeRoots.forEach((i) => {
|
|
187
|
+
config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
|
|
188
|
+
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
189
|
+
});
|
|
190
|
+
addonRoots.forEach((i) => {
|
|
191
|
+
config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
|
|
192
|
+
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
193
|
+
});
|
|
194
|
+
config2.scanOptions.include.push(`!${slash(resolve2(userRoot, "node_modules"))}`);
|
|
195
|
+
config2.scanOptions.exclude.push(dirname(resolveImportPath("monaco-editor/package.json", true)));
|
|
196
|
+
config2.scanOptions.exclude.push(dirname(resolveImportPath("katex/package.json", true)));
|
|
197
|
+
config2.scanOptions.exclude.push(dirname(resolveImportPath("prettier/package.json", true)));
|
|
198
|
+
},
|
|
199
|
+
...windiOptions
|
|
200
|
+
}
|
|
201
|
+
);
|
|
200
202
|
}
|
|
201
203
|
|
|
202
204
|
// node/plugins/preset.ts
|
|
@@ -209,6 +211,7 @@ import Components from "unplugin-vue-components/vite";
|
|
|
209
211
|
import RemoteAssets, { DefaultRules } from "vite-plugin-remote-assets";
|
|
210
212
|
import ServerRef from "vite-plugin-vue-server-ref";
|
|
211
213
|
import { notNullish as notNullish2 } from "@antfu/utils";
|
|
214
|
+
import Inspect from "vite-plugin-inspect";
|
|
212
215
|
|
|
213
216
|
// node/drawings.ts
|
|
214
217
|
init_esm_shims();
|
|
@@ -216,7 +219,10 @@ import { basename, dirname as dirname2, join as join2, resolve as resolve3 } fro
|
|
|
216
219
|
import fs2 from "fs-extra";
|
|
217
220
|
import fg from "fast-glob";
|
|
218
221
|
function resolveDrawingsDir(options) {
|
|
219
|
-
return options.data.config.drawings.persist ? resolve3(
|
|
222
|
+
return options.data.config.drawings.persist ? resolve3(
|
|
223
|
+
dirname2(options.entry),
|
|
224
|
+
options.data.config.drawings.persist
|
|
225
|
+
) : void 0;
|
|
220
226
|
}
|
|
221
227
|
async function loadDrawings(options) {
|
|
222
228
|
const dir = resolveDrawingsDir(options);
|
|
@@ -247,14 +253,16 @@ async function writeDrawings(options, drawing) {
|
|
|
247
253
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
248
254
|
const SVG_HEAD = `<svg width="${width}" height="${height}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">`;
|
|
249
255
|
await fs2.ensureDir(dir);
|
|
250
|
-
return Promise.all(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
256
|
+
return Promise.all(
|
|
257
|
+
Object.entries(drawing).map(async ([key, value]) => {
|
|
258
|
+
if (!value)
|
|
259
|
+
return;
|
|
260
|
+
const svg = `${SVG_HEAD}
|
|
254
261
|
${value}
|
|
255
262
|
</svg>`;
|
|
256
|
-
|
|
257
|
-
|
|
263
|
+
await fs2.writeFile(join2(dir, `${key}.svg`), svg, "utf-8");
|
|
264
|
+
})
|
|
265
|
+
);
|
|
258
266
|
}
|
|
259
267
|
|
|
260
268
|
// node/plugins/extendConfig.ts
|
|
@@ -269,28 +277,28 @@ var dependencies = {
|
|
|
269
277
|
"@antfu/utils": "^0.5.2",
|
|
270
278
|
"@slidev/parser": "workspace:*",
|
|
271
279
|
"@slidev/types": "workspace:*",
|
|
272
|
-
"@unocss/reset": "^0.45.
|
|
273
|
-
"@vueuse/core": "^9.
|
|
274
|
-
"@vueuse/head": "^0.7.
|
|
275
|
-
"@vueuse/math": "^9.
|
|
276
|
-
"@vueuse/motion": "^2.0.0-beta.
|
|
280
|
+
"@unocss/reset": "^0.45.20",
|
|
281
|
+
"@vueuse/core": "^9.2.0",
|
|
282
|
+
"@vueuse/head": "^0.7.10",
|
|
283
|
+
"@vueuse/math": "^9.2.0",
|
|
284
|
+
"@vueuse/motion": "^2.0.0-beta.22",
|
|
277
285
|
codemirror: "^5.65.5",
|
|
278
|
-
defu: "^6.
|
|
279
|
-
drauu: "^0.3.
|
|
286
|
+
defu: "^6.1.0",
|
|
287
|
+
drauu: "^0.3.1",
|
|
280
288
|
"file-saver": "^2.0.5",
|
|
281
289
|
"js-base64": "^3.7.2",
|
|
282
290
|
"js-yaml": "^4.1.0",
|
|
283
|
-
katex: "^0.16.
|
|
284
|
-
mermaid: "^9.1.
|
|
285
|
-
"monaco-editor": "^0.
|
|
291
|
+
katex: "^0.16.2",
|
|
292
|
+
mermaid: "^9.1.6",
|
|
293
|
+
"monaco-editor": "^0.33.0",
|
|
286
294
|
nanoid: "^4.0.0",
|
|
287
295
|
prettier: "^2.7.1",
|
|
288
296
|
recordrtc: "^5.6.2",
|
|
289
297
|
resolve: "^1.22.1",
|
|
290
|
-
unocss: "^0.45.
|
|
291
|
-
"vite-plugin-windicss": "^1.8.
|
|
292
|
-
vue: "^3.2.
|
|
293
|
-
"vue-router": "^4.1.
|
|
298
|
+
unocss: "^0.45.20",
|
|
299
|
+
"vite-plugin-windicss": "^1.8.8",
|
|
300
|
+
vue: "^3.2.39",
|
|
301
|
+
"vue-router": "^4.1.5",
|
|
294
302
|
"vue-starport": "^0.3.0",
|
|
295
303
|
windicss: "^3.5.6"
|
|
296
304
|
};
|
|
@@ -555,22 +563,25 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
555
563
|
Object.assign(data, newData);
|
|
556
564
|
if (hmrPages.size > 0)
|
|
557
565
|
moduleIds.add("/@slidev/titles.md");
|
|
558
|
-
const vueModules = (await Promise.all(
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
566
|
+
const vueModules = (await Promise.all(
|
|
567
|
+
Array.from(hmrPages).map(async (i) => {
|
|
568
|
+
var _a2;
|
|
569
|
+
const file = `${slidePrefix}${i + 1}.md`;
|
|
570
|
+
try {
|
|
571
|
+
const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
572
|
+
const handleHotUpdate = "handler" in VuePlugin.handleHotUpdate ? VuePlugin.handleHotUpdate.handler : VuePlugin.handleHotUpdate;
|
|
573
|
+
return await handleHotUpdate({
|
|
574
|
+
...ctx,
|
|
575
|
+
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
576
|
+
file,
|
|
577
|
+
read() {
|
|
578
|
+
return md2;
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
} catch {
|
|
582
|
+
}
|
|
583
|
+
})
|
|
584
|
+
)).flatMap((i) => i || []);
|
|
574
585
|
hmrPages.clear();
|
|
575
586
|
const moduleEntries = [
|
|
576
587
|
...vueModules,
|
|
@@ -820,11 +831,22 @@ defineProps<{ no: number | string }>()`);
|
|
|
820
831
|
if (data.features.katex)
|
|
821
832
|
imports.push(`import "${toAtFS(resolveImportPath("katex/dist/katex.min.css", true))}"`);
|
|
822
833
|
if (data.config.css === "unocss") {
|
|
823
|
-
imports.unshift(
|
|
834
|
+
imports.unshift(
|
|
835
|
+
'import "@unocss/reset/tailwind.css"',
|
|
836
|
+
'import "uno:preflights.css"',
|
|
837
|
+
'import "uno:typography.css"',
|
|
838
|
+
'import "uno:shortcuts.css"'
|
|
839
|
+
);
|
|
824
840
|
imports.push('import "uno.css"');
|
|
825
841
|
} else {
|
|
826
|
-
imports.unshift(
|
|
827
|
-
|
|
842
|
+
imports.unshift(
|
|
843
|
+
'import "virtual:windi-components.css"',
|
|
844
|
+
'import "virtual:windi-base.css"'
|
|
845
|
+
);
|
|
846
|
+
imports.push(
|
|
847
|
+
'import "virtual:windi-utilities.css"',
|
|
848
|
+
'import "virtual:windi-devtools"'
|
|
849
|
+
);
|
|
828
850
|
}
|
|
829
851
|
return imports.join("\n");
|
|
830
852
|
}
|
|
@@ -833,10 +855,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
833
855
|
}
|
|
834
856
|
async function generateLayouts() {
|
|
835
857
|
const imports = [];
|
|
836
|
-
const layouts = objectMap(
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
858
|
+
const layouts = objectMap(
|
|
859
|
+
await getLayouts(),
|
|
860
|
+
(k, v) => {
|
|
861
|
+
imports.push(`import __layout_${k} from "${toAtFS(v)}"`);
|
|
862
|
+
return [k, `__layout_${k}`];
|
|
863
|
+
}
|
|
864
|
+
);
|
|
840
865
|
return [
|
|
841
866
|
imports.join("\n"),
|
|
842
867
|
`export default {
|
|
@@ -982,10 +1007,13 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
982
1007
|
enforce: "pre",
|
|
983
1008
|
async transform(code, id) {
|
|
984
1009
|
if (id.startsWith(setupEntry)) {
|
|
1010
|
+
let getInjections2 = function(isAwait = false, isChained = false) {
|
|
1011
|
+
return injections.join("\n").replace(/:AWAIT:/g, isAwait ? "await " : "").replace(/(,\s*)?:LAST:/g, isChained ? "$1injection_return" : "");
|
|
1012
|
+
};
|
|
1013
|
+
var getInjections = getInjections2;
|
|
985
1014
|
const name = id.slice(setupEntry.length + 1);
|
|
986
1015
|
const imports = [];
|
|
987
1016
|
const injections = [];
|
|
988
|
-
const asyncInjections = [];
|
|
989
1017
|
const setups = uniq5([
|
|
990
1018
|
...themeRoots,
|
|
991
1019
|
...addonRoots,
|
|
@@ -995,35 +1023,28 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
995
1023
|
if (!existsSync5(path))
|
|
996
1024
|
return;
|
|
997
1025
|
imports.push(`import __n${idx} from '${toAtFS(path)}'`);
|
|
998
|
-
let fn =
|
|
999
|
-
|
|
1000
|
-
if (/\binjection_return\b/g.test(code)) {
|
|
1026
|
+
let fn = `:AWAIT:__n${idx}`;
|
|
1027
|
+
if (/\binjection_return\b/g.test(code))
|
|
1001
1028
|
fn = `injection_return = ${fn}`;
|
|
1002
|
-
awaitFn = `injection_return = ${awaitFn}`;
|
|
1003
|
-
}
|
|
1004
1029
|
if (/\binjection_arg\b/g.test(code)) {
|
|
1005
1030
|
fn += "(";
|
|
1006
|
-
awaitFn += "(";
|
|
1007
1031
|
const matches = Array.from(code.matchAll(/\binjection_arg(_\d+)?\b/g));
|
|
1008
1032
|
const dedupedMatches = Array.from(new Set(matches.map((m) => m[0])));
|
|
1009
|
-
dedupedMatches.
|
|
1010
|
-
|
|
1011
|
-
const arg = key + (isLast ? "" : ",");
|
|
1012
|
-
fn += arg;
|
|
1013
|
-
awaitFn += arg;
|
|
1014
|
-
});
|
|
1015
|
-
fn += ")";
|
|
1016
|
-
awaitFn += ")";
|
|
1033
|
+
fn += dedupedMatches.join(", ");
|
|
1034
|
+
fn += ", :LAST:)";
|
|
1017
1035
|
} else {
|
|
1018
|
-
fn += "()";
|
|
1019
|
-
awaitFn += "()";
|
|
1036
|
+
fn += "(:LAST:)";
|
|
1020
1037
|
}
|
|
1021
|
-
injections.push(
|
|
1022
|
-
|
|
1038
|
+
injections.push(
|
|
1039
|
+
`// ${path}`,
|
|
1040
|
+
fn
|
|
1041
|
+
);
|
|
1023
1042
|
});
|
|
1024
1043
|
code = code.replace("/* __imports__ */", imports.join("\n"));
|
|
1025
|
-
code = code.replace("/* __injections__ */",
|
|
1026
|
-
code = code.replace("/* __async_injections__ */",
|
|
1044
|
+
code = code.replace("/* __injections__ */", getInjections2());
|
|
1045
|
+
code = code.replace("/* __async_injections__ */", getInjections2(true));
|
|
1046
|
+
code = code.replace("/* __chained_injections__ */", getInjections2(false, true));
|
|
1047
|
+
code = code.replace("/* __chained_async_injections__ */", getInjections2(true, true));
|
|
1027
1048
|
return code;
|
|
1028
1049
|
}
|
|
1029
1050
|
return null;
|
|
@@ -1297,7 +1318,9 @@ var MarkdownItShiki = (markdownit, options = {}) => {
|
|
|
1297
1318
|
const light = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.light }).replace('<pre class="shiki"', '<pre class="slidev-code shiki shiki-light"');
|
|
1298
1319
|
return escapeVueInCode(`<pre class="shiki-container">${dark}${light}</pre>`);
|
|
1299
1320
|
} else {
|
|
1300
|
-
return escapeVueInCode(
|
|
1321
|
+
return escapeVueInCode(
|
|
1322
|
+
_highlighter.codeToHtml(code, { lang: lang || "text" }).replace('<pre class="shiki"', '<pre class="slidev-code shiki"')
|
|
1323
|
+
);
|
|
1301
1324
|
}
|
|
1302
1325
|
};
|
|
1303
1326
|
};
|
|
@@ -1435,14 +1458,17 @@ function transformPageCSS(md2, id) {
|
|
|
1435
1458
|
if (!page)
|
|
1436
1459
|
return md2;
|
|
1437
1460
|
const { isInsideCodeblocks } = getCodeBlocks(md2);
|
|
1438
|
-
const result = md2.replace(
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1461
|
+
const result = md2.replace(
|
|
1462
|
+
/(\n<style[^>]*?>)([\s\S]+?)(<\/style>)/g,
|
|
1463
|
+
(full, start, css, end, index) => {
|
|
1464
|
+
if (index < 0 || isInsideCodeblocks(index))
|
|
1465
|
+
return full;
|
|
1466
|
+
if (!start.includes("scoped"))
|
|
1467
|
+
start = start.replace("<style", "<style scoped");
|
|
1468
|
+
return `${start}
|
|
1444
1469
|
${css}${end}`;
|
|
1445
|
-
|
|
1470
|
+
}
|
|
1471
|
+
);
|
|
1446
1472
|
return result;
|
|
1447
1473
|
}
|
|
1448
1474
|
function transformMermaid(md2) {
|
|
@@ -1474,11 +1500,13 @@ function createFixPlugins(options) {
|
|
|
1474
1500
|
name: "slidev:flags",
|
|
1475
1501
|
enforce: "pre",
|
|
1476
1502
|
transform(code, id) {
|
|
1477
|
-
if (id.
|
|
1503
|
+
if (id.match(/\.vue($|\?)/)) {
|
|
1504
|
+
const original = code;
|
|
1478
1505
|
define.forEach(([from, to]) => {
|
|
1479
1506
|
code = code.replace(new RegExp(from, "g"), to);
|
|
1480
1507
|
});
|
|
1481
|
-
|
|
1508
|
+
if (original !== code)
|
|
1509
|
+
return code;
|
|
1482
1510
|
}
|
|
1483
1511
|
}
|
|
1484
1512
|
}
|
|
@@ -1639,7 +1667,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1639
1667
|
createConfigPlugin(options),
|
|
1640
1668
|
createClientSetupPlugin(options),
|
|
1641
1669
|
createMonacoTypesLoader(),
|
|
1642
|
-
createFixPlugins(options)
|
|
1670
|
+
createFixPlugins(options),
|
|
1671
|
+
options.inspect ? Inspect({
|
|
1672
|
+
dev: true,
|
|
1673
|
+
build: true
|
|
1674
|
+
}) : null
|
|
1643
1675
|
].flat().filter(notNullish2);
|
|
1644
1676
|
}
|
|
1645
1677
|
|
|
@@ -25,7 +25,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
25
25
|
}
|
|
26
26
|
return to;
|
|
27
27
|
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
29
32
|
var __accessCheck = (obj, member, msg) => {
|
|
30
33
|
if (!member.has(obj))
|
|
31
34
|
throw TypeError("Cannot " + msg);
|
|
@@ -55,12 +58,12 @@ var __privateWrapper = (obj, member, setter, getter) => {
|
|
|
55
58
|
};
|
|
56
59
|
};
|
|
57
60
|
|
|
58
|
-
// ../../node_modules/.pnpm/tsup@5.12.9_typescript@4.
|
|
61
|
+
// ../../node_modules/.pnpm/tsup@5.12.9_typescript@4.8.3/node_modules/tsup/assets/esm_shims.js
|
|
59
62
|
import { fileURLToPath } from "url";
|
|
60
63
|
import path from "path";
|
|
61
64
|
var getFilename, getDirname, __dirname, __filename;
|
|
62
65
|
var init_esm_shims = __esm({
|
|
63
|
-
"../../node_modules/.pnpm/tsup@5.12.9_typescript@4.
|
|
66
|
+
"../../node_modules/.pnpm/tsup@5.12.9_typescript@4.8.3/node_modules/tsup/assets/esm_shims.js"() {
|
|
64
67
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
65
68
|
getDirname = () => path.dirname(getFilename());
|
|
66
69
|
__dirname = /* @__PURE__ */ getDirname();
|
|
@@ -115,10 +118,12 @@ function resolveGlobalImportPath(importName) {
|
|
|
115
118
|
throw new Error(`Failed to resolve global package "${importName}"`);
|
|
116
119
|
}
|
|
117
120
|
function stringifyMarkdownTokens(tokens) {
|
|
118
|
-
return tokens.map(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
return tokens.map(
|
|
122
|
+
(token) => {
|
|
123
|
+
var _a;
|
|
124
|
+
return (_a = token.children) == null ? void 0 : _a.filter((t) => ["text", "code_inline"].includes(t.type) && !t.content.match(/^\s*$/)).map((t) => t.content.trim()).join(" ");
|
|
125
|
+
}
|
|
126
|
+
).filter(Boolean).join(" ");
|
|
122
127
|
}
|
|
123
128
|
function generateGoogleFontsUrl(options) {
|
|
124
129
|
const weights = options.weights.flatMap((i) => options.italic ? [`0,${i}`, `1,${i}`] : [`${i}`]).sort().join(";");
|