Skip to content

Commit d263506

Browse files
authored
refactor!: remove windicss support (#1267)
1 parent b14be81 commit d263506

16 files changed

+6
-247
lines changed

.gitpod.yml

-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ vscode:
1818
- Vue.volar
1919
- antfu.iconify
2020
- dbaeumer.vscode-eslint
21-
- voorjaar.windicss-intellisense
2221
- csstools.postcss

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"tsup": "^8.0.1",
6565
"typescript": "^5.3.3",
6666
"vite": "^5.0.12",
67-
"vite-plugin-windicss": "^1.9.3",
6867
"vitest": "^1.2.2",
6968
"vue-tsc": "^1.8.27",
7069
"zx": "^7.2.3"

packages/client/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@
4444
"recordrtc": "^5.6.2",
4545
"resolve": "^1.22.8",
4646
"unocss": "^0.58.4",
47-
"vite-plugin-windicss": "^1.9.3",
4847
"vue": "^3.4.15",
49-
"vue-router": "^4.2.5",
50-
"windicss": "^3.5.6"
48+
"vue-router": "^4.2.5"
5149
},
5250
"devDependencies": {
5351
"vite": "^5.0.12"

packages/client/windi.config.ts

-86
This file was deleted.

packages/parser/src/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function verifyConfig(
103103
if (themeHightlighter && config.highlighter !== themeHightlighter)
104104
warn(`Syntax highlighter "${config.highlighter}" does not supported by the theme`)
105105

106-
if (!['windicss', 'unocss', undefined].includes(config.css)) {
106+
if (!['unocss', undefined].includes(config.css)) {
107107
warn(`Unsupported Atomic CSS engine "${config.css}", fallback to UnoCSS`)
108108
config.css = 'unocss'
109109
}

packages/slidev/node/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ import './declare'
33
export * from './server'
44
export * from './plugins/preset'
55
export * from './options'
6-
export * from './plugins/windicss'
76
export { parser } from './parser'

packages/slidev/node/options.ts

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import type VueJsx from '@vitejs/plugin-vue-jsx'
66
import type Icons from 'unplugin-icons/vite'
77
import type Components from 'unplugin-vue-components/vite'
88
import type Markdown from 'unplugin-vue-markdown/vite'
9-
import type WindiCSS from 'vite-plugin-windicss'
109
import type { VitePluginConfig as UnoCSSConfig } from 'unocss/vite'
1110
import type RemoteAssets from 'vite-plugin-remote-assets'
1211
import type ServerRef from 'vite-plugin-vue-server-ref'
@@ -73,7 +72,6 @@ export interface SlidevPluginOptions extends SlidevEntryOptions {
7372
vuejsx?: ArgumentsType<typeof VueJsx>[0]
7473
markdown?: ArgumentsType<typeof Markdown>[0]
7574
components?: ArgumentsType<typeof Components>[0]
76-
windicss?: ArgumentsType<typeof WindiCSS>[0]
7775
icons?: ArgumentsType<typeof Icons>[0]
7876
remoteAssets?: ArgumentsType<typeof RemoteAssets>[0]
7977
serverRef?: ArgumentsType<typeof ServerRef>[0]

packages/slidev/node/plugins/extendConfig.ts

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const EXCLUDE = [
2020
'@unocss/reset',
2121
'unocss',
2222
'mermaid',
23-
'vite-plugin-windicss',
2423
'vue-demi',
2524
'vue',
2625
]

packages/slidev/node/plugins/loaders.ts

-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { basename, join } from 'node:path'
2-
import process from 'node:process'
32
import type { Connect, ModuleNode, Plugin, Update, ViteDevServer } from 'vite'
43
import { isString, notNullish, objectMap, range, slash, uniq } from '@antfu/utils'
54
import fg from 'fast-glob'
@@ -579,15 +578,6 @@ defineProps<{ no: number | string }>()`)
579578
)
580579
imports.push('import "uno.css"')
581580
}
582-
else {
583-
imports.unshift(
584-
'import "virtual:windi-components.css"',
585-
'import "virtual:windi-base.css"',
586-
)
587-
imports.push('import "virtual:windi-utilities.css"')
588-
if (process.env.NODE_ENV !== 'production')
589-
imports.push('import "virtual:windi-devtools"')
590-
}
591581

592582
return imports.join('\n')
593583
}

packages/slidev/node/plugins/preset.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,7 @@ export async function ViteSlidevPlugin(
192192

193193
config.css === 'none'
194194
? null
195-
: config.css === 'windicss'
196-
? import('./windicss').then(r => r.createWindiCSSPlugin(options, pluginOptions))
197-
: import('./unocss').then(r => r.createUnocssPlugin(options, pluginOptions)),
195+
: import('./unocss').then(r => r.createUnocssPlugin(options, pluginOptions)),
198196
]
199197

200198
return (await Promise.all(plugins))

packages/slidev/node/plugins/windicss.ts

-68
This file was deleted.

packages/slidev/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"@unocss/reset": "^0.58.4",
6464
"@vitejs/plugin-vue": "^5.0.3",
6565
"@vitejs/plugin-vue-jsx": "^3.1.0",
66-
"@windicss/config": "^1.9.3",
6766
"cli-progress": "^3.12.0",
6867
"codemirror": "^5.65.5",
6968
"connect": "^3.7.0",
@@ -110,10 +109,8 @@
110109
"vite-plugin-remote-assets": "^0.4.1",
111110
"vite-plugin-static-copy": "^1.0.1",
112111
"vite-plugin-vue-server-ref": "^0.4.0",
113-
"vite-plugin-windicss": "^1.9.3",
114112
"vitefu": "^0.2.5",
115113
"vue": "^3.4.15",
116-
"windicss": "^3.5.6",
117114
"yargs": "^17.7.2"
118115
},
119116
"devDependencies": {

packages/slidev/template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ theme: seriph
44
# random image from a curated Unsplash collection by Anthony
55
# like them? see https://unsplash.com/collections/94734566/slidev
66
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
88
class: 'text-center'
99
# https://sli.dev/custom/highlighters.html
1010
highlighter: shiki

packages/types/src/config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,9 @@ export interface SlidevConfig {
167167
* Engine for Atomic CSS
168168
*
169169
* @see https://unocss.dev/
170-
* @see https://windicss.org/
171170
* @default 'unocss'
172171
*/
173-
css: 'unocss' | 'windicss' | 'none'
172+
css: 'unocss' | 'none'
174173
/**
175174
* Enable presenter mode
176175
*

packages/types/src/setups.ts

-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { Router } from 'vue-router'
55
import type mermaid from 'mermaid'
66
import type { KatexOptions } from 'katex'
77
import type { CodeToHastOptions, Highlighter } from 'shiki'
8-
import type { WindiCssOptions } from 'vite-plugin-windicss'
98
import type { VitePluginConfig as UnoCssConfig } from 'unocss/vite'
109
import type { SlidevPreparserExtension } from './types'
1110

@@ -62,7 +61,6 @@ export type ShikiSetupReturn = Partial<CodeToHastOptions> & {
6261
// node side
6362
export type ShikiSetup = (shiki: ShikiContext) => Awaitable<ShikiSetupReturn | void>
6463
export type KatexSetup = () => Awaitable<Partial<KatexOptions> | void>
65-
export type WindiSetup = () => Awaitable<Partial<WindiCssOptions> | void>
6664
export type UnoSetup = () => Awaitable<Partial<UnoCssConfig> | void>
6765
export type PreparserSetup = (filepath: string) => SlidevPreparserExtension
6866

@@ -76,10 +74,6 @@ export function defineShikiSetup(fn: ShikiSetup) {
7674
return fn
7775
}
7876

79-
export function defineWindiSetup(fn: WindiSetup) {
80-
return fn
81-
}
82-
8377
export function defineUnoSetup(fn: UnoSetup) {
8478
return fn
8579
}

0 commit comments

Comments
 (0)