Skip to content

Commit ed34c7e

Browse files
authored
feat: migrate to vite-plus (#35)
* feat: migrate to vite-plus * chore: remove typecheck step from CI and update dependencies for vitest * feat: add typeAware and typeCheck options to lint configuration
1 parent 6b9b67c commit ed34c7e

File tree

13 files changed

+1030
-2209
lines changed

13 files changed

+1030
-2209
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
- run: pnpm i -g @antfu/ni
2626
- run: nci
2727
- run: nr lint
28-
- run: nr typecheck
2928

3029
test:
3130
runs-on: ${{ matrix.os }}

.vite-hooks/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vp staged

.vscode/settings.json

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,7 @@
11
{
2-
// Disable the default formatter, use eslint instead
3-
"prettier.enable": false,
4-
"editor.formatOnSave": false,
5-
6-
// Auto fix
7-
"editor.codeActionsOnSave": {
8-
"source.fixAll.eslint": "explicit",
9-
"source.organizeImports": "never"
10-
},
11-
12-
// Silent the stylistic rules in you IDE, but still auto fix them
13-
"eslint.rules.customizations": [
14-
{ "rule": "style/*", "severity": "off" },
15-
{ "rule": "*-indent", "severity": "off" },
16-
{ "rule": "*-spacing", "severity": "off" },
17-
{ "rule": "*-spaces", "severity": "off" },
18-
{ "rule": "*-order", "severity": "off" },
19-
{ "rule": "*-dangle", "severity": "off" },
20-
{ "rule": "*-newline", "severity": "off" },
21-
{ "rule": "*quotes", "severity": "off" },
22-
{ "rule": "*semi", "severity": "off" }
23-
],
24-
25-
// Enable eslint for all supported languages
26-
"eslint.validate": [
27-
"javascript",
28-
"javascriptreact",
29-
"typescript",
30-
"typescriptreact",
31-
"vue",
32-
"html",
33-
"markdown",
34-
"json",
35-
"jsonc",
36-
"yaml"
37-
]
2+
"editor.defaultFormatter": "oxc.oxc-vscode",
3+
"editor.formatOnSave": true,
4+
"[typescript]": {
5+
"editor.defaultFormatter": "oxc.oxc-vscode"
6+
}
387
}

docs/.vitepress/config.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
22
import Inspect from 'vite-plugin-inspect'
33
import { defineConfig } from 'vitepress'
4-
import { groupIconMdPlugin, groupIconVitePlugin, localIconLoader } from 'vitepress-plugin-group-icons'
4+
import {
5+
groupIconMdPlugin,
6+
groupIconVitePlugin,
7+
localIconLoader,
8+
} from 'vitepress-plugin-group-icons'
59

610
// https://vitepress.dev/reference/site-config
711
export default defineConfig({
@@ -28,7 +32,6 @@ export default defineConfig({
2832
link: '/showcase',
2933
},
3034
],
31-
3235
},
3336
markdown: {
3437
config(md) {
@@ -38,13 +41,17 @@ export default defineConfig({
3841
},
3942
})
4043
},
41-
codeTransformers: [
42-
transformerTwoslash(),
43-
],
44+
codeTransformers: [transformerTwoslash()],
4445
},
4546
head: [
4647
['meta', { property: 'og:title', content: 'Vitepress Plugin Group Icons' }],
47-
['meta', { property: 'og:description', content: 'Automatically fill the missing product icon for code groups.' }],
48+
[
49+
'meta',
50+
{
51+
property: 'og:description',
52+
content: 'Automatically fill the missing product icon for code groups.',
53+
},
54+
],
4855
['meta', { property: 'og:image', content: `https://vpgi.vercel.app//og.png` }],
4956
['meta', { property: 'og:type', content: 'website' }],
5057
['meta', { property: 'og:url', content: 'https://vpgi.vercel.app/' }],

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "docs",
3-
"type": "module",
43
"version": "1.0.0",
54
"private": true,
65
"description": "",
7-
"author": "",
8-
"license": "ISC",
96
"keywords": [],
7+
"license": "ISC",
8+
"author": "",
9+
"type": "module",
1010
"main": "index.js",
1111
"scripts": {
1212
"test": "echo \"Error: no test specified\" && exit 1"

eslint.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

package.json

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
{
22
"name": "vitepress-plugin-group-icons",
3-
"type": "module",
43
"version": "1.7.2",
5-
"packageManager": "pnpm@10.33.0",
6-
"author": "Leo <https://github.com/yuyinws>",
7-
"license": "MIT",
4+
"keywords": [],
85
"homepage": "https://github.com/yuyinws/vitepress-plugin-group-icons#readme",
6+
"bugs": "https://github.com/yuyinws/vitepress-plugin-group-icons/issues",
7+
"license": "MIT",
8+
"author": "Leo <https://github.com/yuyinws>",
99
"repository": {
1010
"type": "git",
1111
"url": "git+https://github.com/yuyinws/vitepress-plugin-group-icons.git"
1212
},
13-
"bugs": "https://github.com/yuyinws/vitepress-plugin-group-icons/issues",
14-
"keywords": [],
13+
"files": [
14+
"dist"
15+
],
16+
"type": "module",
1517
"sideEffects": false,
16-
"exports": {
17-
".": {
18-
"types": "./dist/index.d.mts",
19-
"import": "./dist/index.mjs"
20-
}
21-
},
2218
"main": "./dist/index.mjs",
2319
"module": "./dist/index.mjs",
2420
"types": "./dist/index.d.mts",
@@ -30,55 +26,51 @@
3026
]
3127
}
3228
},
33-
"files": [
34-
"dist"
35-
],
29+
"exports": {
30+
".": {
31+
"types": "./dist/index.d.mts",
32+
"import": "./dist/index.mjs"
33+
}
34+
},
3635
"scripts": {
3736
"build": "tsdown",
3837
"dev": "tsdown --watch",
39-
"lint": "eslint .",
38+
"lint:fix": "vp lint --fix && vp fmt",
39+
"lint": "vp lint",
4040
"release": "bumpp",
41-
"test": "vitest",
41+
"test": "vp test",
4242
"prepublishOnly": "pnpm build",
43-
"typecheck": "tsc --noEmit",
4443
"prepare": "simple-git-hooks",
4544
"docs:dev": "vitepress dev docs",
4645
"docs:build": "vitepress build docs",
4746
"docs:preview": "vitepress preview docs"
4847
},
49-
"peerDependencies": {
50-
"vite": ">=3"
51-
},
52-
"peerDependenciesMeta": {
53-
"vite": {
54-
"optional": true
55-
}
56-
},
5748
"dependencies": {
5849
"@iconify-json/logos": "^1.2.10",
5950
"@iconify-json/vscode-icons": "^1.2.45",
6051
"@iconify/utils": "^3.1.0"
6152
},
6253
"devDependencies": {
63-
"@antfu/eslint-config": "^7.7.3",
6454
"@antfu/ni": "^30.0.0",
6555
"@types/markdown-it": "^14.1.2",
6656
"@types/node": "^25.5.0",
6757
"bumpp": "^11.0.1",
68-
"eslint": "^10.1.0",
69-
"esno": "^4.8.0",
7058
"lint-staged": "^16.4.0",
7159
"simple-git-hooks": "^2.13.1",
7260
"tsdown": "^0.21.5",
7361
"typescript": "^6.0.2",
7462
"vite": "^8.0.2",
63+
"vite-plus": "^0.1.14",
7564
"vitepress": "^1.6.4",
7665
"vitest": "^4.1.1"
7766
},
78-
"simple-git-hooks": {
79-
"pre-commit": "pnpm lint-staged"
67+
"peerDependencies": {
68+
"vite": ">=3"
69+
},
70+
"peerDependenciesMeta": {
71+
"vite": {
72+
"optional": true
73+
}
8074
},
81-
"lint-staged": {
82-
"*": "eslint --fix"
83-
}
75+
"packageManager": "pnpm@10.33.0"
8476
}

0 commit comments

Comments
 (0)