@slidev/cli 0.43.8 → 0.43.10

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.
@@ -1,71 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
- var _chunkYUG22S6Wjs = require('./chunk-YUG22S6W.js');
4
-
5
- // node/utils.ts
6
- var _path = require('path');
7
- var _utils = require('@antfu/utils');
8
- var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
9
- var _resolve = require('resolve');
10
- var _globaldirs = require('global-dirs'); var _globaldirs2 = _interopRequireDefault(_globaldirs);
11
- function toAtFS(path) {
12
- return `/@fs${_utils.ensurePrefix.call(void 0, "/", _utils.slash.call(void 0, path))}`;
13
- }
14
- function resolveImportPath(importName, ensure = false) {
15
- try {
16
- return _resolve.sync.call(void 0, importName, {
17
- preserveSymlinks: false
18
- });
19
- } catch (e) {
20
- }
21
- if (_isinstalledglobally2.default) {
22
- try {
23
- return _chunkYUG22S6Wjs.__require.resolve(_path.join.call(void 0, _globaldirs2.default.yarn.packages, importName));
24
- } catch (e2) {
25
- }
26
- try {
27
- return _chunkYUG22S6Wjs.__require.resolve(_path.join.call(void 0, _globaldirs2.default.npm.packages, importName));
28
- } catch (e3) {
29
- }
30
- }
31
- if (ensure)
32
- throw new Error(`Failed to resolve package "${importName}"`);
33
- return void 0;
34
- }
35
- function resolveGlobalImportPath(importName) {
36
- try {
37
- return _resolve.sync.call(void 0, importName, { preserveSymlinks: false, basedir: __dirname });
38
- } catch (e4) {
39
- }
40
- try {
41
- return _chunkYUG22S6Wjs.__require.resolve(_path.join.call(void 0, _globaldirs2.default.yarn.packages, importName));
42
- } catch (e5) {
43
- }
44
- try {
45
- return _chunkYUG22S6Wjs.__require.resolve(_path.join.call(void 0, _globaldirs2.default.npm.packages, importName));
46
- } catch (e6) {
47
- }
48
- throw new Error(`Failed to resolve global package "${importName}"`);
49
- }
50
- function stringifyMarkdownTokens(tokens) {
51
- return tokens.map((token) => _optionalChain([token, 'access', _ => _.children, 'optionalAccess', _2 => _2.filter, 'call', _3 => _3((t) => ["text", "code_inline"].includes(t.type) && !t.content.match(/^\s*$/)), 'access', _4 => _4.map, 'call', _5 => _5((t) => t.content.trim()), 'access', _6 => _6.join, 'call', _7 => _7(" ")])).filter(Boolean).join(" ");
52
- }
53
- function generateGoogleFontsUrl(options) {
54
- const weights = options.weights.flatMap((i) => options.italic ? [`0,${i}`, `1,${i}`] : [`${i}`]).sort().join(";");
55
- const fonts = options.webfonts.map((i) => `family=${i.replace(/^(['"])(.*)\1$/, "$1").replace(/\s+/g, "+")}:${options.italic ? "ital," : ""}wght@${weights}`).join("&");
56
- return `https://fonts.googleapis.com/css2?${fonts}&display=swap`;
57
- }
58
- function packageExists(name) {
59
- if (resolveImportPath(`${name}/package.json`))
60
- return true;
61
- return false;
62
- }
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
- exports.toAtFS = toAtFS; exports.resolveImportPath = resolveImportPath; exports.resolveGlobalImportPath = resolveGlobalImportPath; exports.stringifyMarkdownTokens = stringifyMarkdownTokens; exports.generateGoogleFontsUrl = generateGoogleFontsUrl; exports.packageExists = packageExists;
@@ -1,65 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
-
3
- var _chunkUWTQKD35js = require('./chunk-UWTQKD35.js');
4
-
5
-
6
- var _chunkCGJOXW6Ijs = require('./chunk-CGJOXW6I.js');
7
-
8
- // node/plugins/windicss.ts
9
- var _path = require('path');
10
- var _fs = require('fs');
11
- var _utils = require('@antfu/utils');
12
- var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
13
- async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
14
- const { default: WindiCSS } = await Promise.resolve().then(() => _interopRequireWildcard(require("vite-plugin-windicss")));
15
- const { defaultConfigureFiles } = await Promise.resolve().then(() => _interopRequireWildcard(require("@windicss/config")));
16
- const configFiles = _utils.uniq.call(void 0, [
17
- ...defaultConfigureFiles.map((i) => _path.resolve.call(void 0, userRoot, i)),
18
- ...themeRoots.map((i) => `${i}/windi.config.ts`),
19
- ...addonRoots.map((i) => `${i}/windi.config.ts`),
20
- _path.resolve.call(void 0, clientRoot, "windi.config.ts")
21
- ]);
22
- const configFile = configFiles.find((i) => _fs.existsSync.call(void 0, i));
23
- let config = _jiti2.default.call(void 0, __filename)(configFile);
24
- if (config.default)
25
- config = config.default;
26
- config = await _chunkUWTQKD35js.loadSetups.call(void 0, roots, "windicss.ts", {}, config, true);
27
- return WindiCSS(
28
- {
29
- configFiles: [configFile],
30
- config,
31
- onConfigResolved(config2) {
32
- if (!config2.theme)
33
- config2.theme = {};
34
- if (!config2.theme.extend)
35
- config2.theme.extend = {};
36
- if (!config2.theme.extend.fontFamily)
37
- config2.theme.extend.fontFamily = {};
38
- const fontFamily = config2.theme.extend.fontFamily;
39
- fontFamily.sans ||= data.config.fonts.sans.join(",");
40
- fontFamily.mono ||= data.config.fonts.mono.join(",");
41
- fontFamily.serif ||= data.config.fonts.serif.join(",");
42
- return config2;
43
- },
44
- onOptionsResolved(config2) {
45
- themeRoots.forEach((i) => {
46
- config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
47
- config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
48
- });
49
- addonRoots.forEach((i) => {
50
- config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
51
- config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
52
- });
53
- config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
54
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkCGJOXW6Ijs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
55
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkCGJOXW6Ijs.resolveImportPath.call(void 0, "katex/package.json", true)));
56
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkCGJOXW6Ijs.resolveImportPath.call(void 0, "prettier/package.json", true)));
57
- },
58
- ...windiOptions
59
- }
60
- );
61
- }
62
-
63
-
64
-
65
- exports.createWindiCSSPlugin = createWindiCSSPlugin;