@slidev/cli 0.46.3 → 0.47.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.46.3",
3
+ "version": "0.47.0",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -44,14 +44,16 @@
44
44
  "dependencies": {
45
45
  "@antfu/utils": "^0.7.7",
46
46
  "@iconify-json/carbon": "^1.1.28",
47
- "@iconify-json/ph": "^1.1.10",
47
+ "@iconify-json/ph": "^1.1.11",
48
48
  "@lillallol/outline-pdf": "^4.0.0",
49
49
  "@mrdrogdrog/optional": "^1.2.1",
50
- "@unocss/extractor-mdc": "^0.58.3",
51
- "@unocss/reset": "^0.58.3",
50
+ "@shikijs/markdown-it": "^1.0.0-beta.3",
51
+ "@shikijs/twoslash": "^1.0.0-beta.3",
52
+ "@shikijs/vitepress-twoslash": "1.0.0-beta.3",
53
+ "@unocss/extractor-mdc": "^0.58.4",
54
+ "@unocss/reset": "^0.58.4",
52
55
  "@vitejs/plugin-vue": "^5.0.3",
53
56
  "@vitejs/plugin-vue-jsx": "^3.1.0",
54
- "@windicss/config": "^1.9.3",
55
57
  "cli-progress": "^3.12.0",
56
58
  "codemirror": "^5.65.5",
57
59
  "connect": "^3.7.0",
@@ -74,9 +76,8 @@
74
76
  "markdown-it-footnote": "^4.0.0",
75
77
  "markdown-it-link-attributes": "^4.0.1",
76
78
  "markdown-it-mdc": "^0.2.1",
77
- "markdown-it-shikiji": "^0.9.19",
78
79
  "monaco-editor": "^0.37.1",
79
- "nanoid": "^5.0.4",
80
+ "nanoid": "^5.0.5",
80
81
  "open": "^10.0.3",
81
82
  "pdf-lib": "^1.17.1",
82
83
  "plantuml-encoder": "^1.4.0",
@@ -87,28 +88,24 @@
87
88
  "resolve": "^1.22.8",
88
89
  "resolve-from": "^5.0.0",
89
90
  "resolve-global": "^2.0.0",
90
- "shikiji": "^0.9.19",
91
- "shiki": "npm:shikiji-compat@^0.9.19",
92
- "shikiji-twoslash": "^0.9.19",
91
+ "shiki": "^1.0.0-beta.3",
93
92
  "sirv": "^2.0.4",
94
- "unocss": "^0.58.3",
95
- "unplugin-icons": "^0.18.2",
93
+ "unocss": "^0.58.4",
94
+ "unplugin-icons": "^0.18.3",
96
95
  "unplugin-vue-components": "^0.26.0",
97
96
  "unplugin-vue-markdown": "^0.25.2",
98
97
  "uqr": "^0.1.2",
99
98
  "vite": "^5.0.12",
100
- "vite-plugin-inspect": "^0.8.1",
99
+ "vite-plugin-inspect": "^0.8.3",
101
100
  "vite-plugin-remote-assets": "^0.4.1",
102
- "vite-plugin-static-copy": "^1.0.0",
101
+ "vite-plugin-static-copy": "^1.0.1",
103
102
  "vite-plugin-vue-server-ref": "^0.4.0",
104
- "vite-plugin-windicss": "^1.9.3",
105
103
  "vitefu": "^0.2.5",
106
104
  "vue": "^3.4.15",
107
- "windicss": "^3.5.6",
108
105
  "yargs": "^17.7.2",
109
- "@slidev/client": "0.46.3",
110
- "@slidev/parser": "0.46.3",
111
- "@slidev/types": "0.46.3"
106
+ "@slidev/parser": "0.47.0",
107
+ "@slidev/types": "0.47.0",
108
+ "@slidev/client": "0.47.0"
112
109
  },
113
110
  "devDependencies": {
114
111
  "@hedgedoc/markdown-it-plugins": "^2.1.4",
package/template.md CHANGED
@@ -4,7 +4,7 @@ theme: seriph
4
4
  # random image from a curated Unsplash collection by Anthony
5
5
  # like them? see https://unsplash.com/collections/94734566/slidev
6
6
  background: https://source.unsplash.com/collection/94734566/1920x1080
7
- # apply any windi css classes to the current slide
7
+ # apply any unocss classes to the current slide
8
8
  class: 'text-center'
9
9
  # https://sli.dev/custom/highlighters.html
10
10
  highlighter: shiki
@@ -1,75 +0,0 @@
1
- // node/utils.ts
2
- import { dirname, join } from "node:path";
3
- import { createRequire } from "node:module";
4
- import { fileURLToPath } from "node:url";
5
- import { ensurePrefix, slash } from "@antfu/utils";
6
- import isInstalledGlobally from "is-installed-globally";
7
- import resolve from "resolve";
8
- import globalDirs from "global-directory";
9
- var require2 = createRequire(import.meta.url);
10
- var __dirname = dirname(fileURLToPath(import.meta.url));
11
- function toAtFS(path) {
12
- return `/@fs${ensurePrefix("/", slash(path))}`;
13
- }
14
- function resolveImportPath(importName, ensure = false) {
15
- try {
16
- return resolve.sync(importName, {
17
- preserveSymlinks: false,
18
- basedir: __dirname
19
- });
20
- } catch {
21
- }
22
- if (isInstalledGlobally) {
23
- try {
24
- return require2.resolve(join(globalDirs.yarn.packages, importName));
25
- } catch {
26
- }
27
- try {
28
- return require2.resolve(join(globalDirs.npm.packages, importName));
29
- } catch {
30
- }
31
- }
32
- if (ensure)
33
- throw new Error(`Failed to resolve package "${importName}"`);
34
- return void 0;
35
- }
36
- function resolveGlobalImportPath(importName) {
37
- try {
38
- return resolve.sync(importName, {
39
- preserveSymlinks: false,
40
- basedir: __dirname
41
- });
42
- } catch {
43
- }
44
- try {
45
- return require2.resolve(join(globalDirs.yarn.packages, importName));
46
- } catch {
47
- }
48
- try {
49
- return require2.resolve(join(globalDirs.npm.packages, importName));
50
- } catch {
51
- }
52
- throw new Error(`Failed to resolve global package "${importName}"`);
53
- }
54
- function stringifyMarkdownTokens(tokens) {
55
- return tokens.map((token) => token.children?.filter((t) => ["text", "code_inline"].includes(t.type) && !t.content.match(/^\s*$/)).map((t) => t.content.trim()).join(" ")).filter(Boolean).join(" ");
56
- }
57
- function generateGoogleFontsUrl(options) {
58
- const weights = options.weights.flatMap((i) => options.italic ? [`0,${i}`, `1,${i}`] : [`${i}`]).sort().join(";");
59
- const fonts = options.webfonts.map((i) => `family=${i.replace(/^(['"])(.*)\1$/, "$1").replace(/\s+/g, "+")}:${options.italic ? "ital," : ""}wght@${weights}`).join("&");
60
- return `https://fonts.googleapis.com/css2?${fonts}&display=swap`;
61
- }
62
- function packageExists(name) {
63
- if (resolveImportPath(`${name}/package.json`))
64
- return true;
65
- return false;
66
- }
67
-
68
- export {
69
- toAtFS,
70
- resolveImportPath,
71
- resolveGlobalImportPath,
72
- stringifyMarkdownTokens,
73
- generateGoogleFontsUrl,
74
- packageExists
75
- };
@@ -1,66 +0,0 @@
1
- import {
2
- loadSetups
3
- } from "./chunk-CTBVOVLQ.mjs";
4
- import {
5
- resolveImportPath
6
- } from "./chunk-5L3XKTHL.mjs";
7
-
8
- // node/plugins/windicss.ts
9
- import { dirname, resolve } from "node:path";
10
- import { existsSync } from "node:fs";
11
- import { fileURLToPath } from "node:url";
12
- import { slash, uniq } from "@antfu/utils";
13
- import jiti from "jiti";
14
- async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
15
- const { default: WindiCSS } = await import("vite-plugin-windicss");
16
- const { defaultConfigureFiles } = await import("@windicss/config");
17
- const configFiles = uniq([
18
- ...defaultConfigureFiles.map((i) => resolve(userRoot, i)),
19
- ...themeRoots.map((i) => `${i}/windi.config.ts`),
20
- ...addonRoots.map((i) => `${i}/windi.config.ts`),
21
- resolve(clientRoot, "windi.config.ts")
22
- ]);
23
- const configFile = configFiles.find((i) => existsSync(i));
24
- let config = jiti(fileURLToPath(import.meta.url))(configFile);
25
- if (config.default)
26
- config = config.default;
27
- config = await loadSetups(roots, "windicss.ts", {}, config, true);
28
- return WindiCSS(
29
- {
30
- configFiles: [configFile],
31
- config,
32
- onConfigResolved(config2) {
33
- if (!config2.theme)
34
- config2.theme = {};
35
- if (!config2.theme.extend)
36
- config2.theme.extend = {};
37
- if (!config2.theme.extend.fontFamily)
38
- config2.theme.extend.fontFamily = {};
39
- const fontFamily = config2.theme.extend.fontFamily;
40
- fontFamily.sans ||= data.config.fonts.sans.join(",");
41
- fontFamily.mono ||= data.config.fonts.mono.join(",");
42
- fontFamily.serif ||= data.config.fonts.serif.join(",");
43
- return config2;
44
- },
45
- onOptionsResolved(config2) {
46
- themeRoots.forEach((i) => {
47
- config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
48
- config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
49
- });
50
- addonRoots.forEach((i) => {
51
- config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
52
- config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
53
- });
54
- config2.scanOptions.include.push(`!${slash(resolve(userRoot, "node_modules"))}`);
55
- config2.scanOptions.exclude.push(dirname(resolveImportPath("monaco-editor/package.json", true)));
56
- config2.scanOptions.exclude.push(dirname(resolveImportPath("katex/package.json", true)));
57
- config2.scanOptions.exclude.push(dirname(resolveImportPath("prettier/package.json", true)));
58
- },
59
- ...windiOptions
60
- }
61
- );
62
- }
63
-
64
- export {
65
- createWindiCSSPlugin
66
- };
@@ -1,9 +0,0 @@
1
- import {
2
- createWindiCSSPlugin
3
- } from "./chunk-GLZC72RJ.mjs";
4
- import "./chunk-CTBVOVLQ.mjs";
5
- import "./chunk-5L3XKTHL.mjs";
6
- import "./chunk-BXO7ZPPU.mjs";
7
- export {
8
- createWindiCSSPlugin
9
- };