Skip to content

Commit 94b126f

Browse files
committed
refactor: remove pinia, update libs
1 parent bebe49d commit 94b126f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2647
-3144
lines changed
Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
// @ts-check
21
import js from '@eslint/js';
32
import prettier from 'eslint-config-prettier';
43
import unusedImports from 'eslint-plugin-unused-imports';
54
import vue from 'eslint-plugin-vue';
65
import ts from 'typescript-eslint';
76
import autoImport from './.eslintrc-auto-import.json' with { type: 'json' };
7+
import globals from 'globals';
88

99
export default ts.config(
10-
js.configs.recommended,
11-
...ts.configs.recommended,
12-
// @ts-ignore
13-
...vue.configs['flat/essential'],
1410
prettier,
1511
{
16-
files: ['*.vue', '**/*.vue'],
12+
extends: [
13+
js.configs.recommended,
14+
...ts.configs.recommended,
15+
...vue.configs['flat/recommended'],
16+
],
17+
files: ['**/*.{ts,vue}'],
1718
languageOptions: {
1819
parserOptions: {
19-
parser: '@typescript-eslint/parser',
20+
parser: ts.parser,
2021
jsx: true,
2122
},
2223
},
@@ -27,8 +28,12 @@ export default ts.config(
2728
},
2829
},
2930
{
30-
// @ts-ignore
31-
languageOptions: autoImport,
31+
languageOptions: {
32+
globals: {
33+
...(autoImport.globals as Record<string, 'readonly'>),
34+
...globals.browser,
35+
},
36+
},
3237
},
3338
{
3439
rules: {
@@ -41,9 +46,10 @@ export default ts.config(
4146
'no-empty': 'off',
4247
'prefer-const': 'off',
4348
'unused-imports/no-unused-imports': 'error',
49+
'vue/require-default-prop': 'off',
4450
},
4551
},
4652
{
47-
ignores: ['*.d.ts', '*.cjs'],
53+
ignores: ['dist'],
4854
},
49-
);
55+
) as any;

package.json

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"preview": "vite preview",
1010
"build-only": "vite build",
1111
"type-check": "vue-tsc --noEmit",
12-
"lint": "eslint --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx --fix --ignore-path .gitignore .",
12+
"lint": "eslint --cache --fix .",
1313
"format": "prettier --cache --write --ignore-unknown .",
1414
"postinstall": "simple-git-hooks",
1515
"postpublish": "curl -X PUT https://registry-direct.npmmirror.com/@gkd-kit/inspect/sync"
@@ -22,66 +22,67 @@
2222
"./dist"
2323
],
2424
"dependencies": {
25-
"@antv/g6": "5.0.43",
26-
"@eslint/js": "9.21.0",
27-
"@gkd-kit/api": "0.6.0",
25+
"@antv/g6": "5.0.49",
26+
"@eslint/js": "9.29.0",
27+
"@gkd-kit/api": "0.7.3",
2828
"@gkd-kit/selector": "0.5.22",
2929
"@gkd-kit/wasm_matches": "0.0.1",
30-
"@tsconfig/node20": "20.1.4",
30+
"@tsconfig/node20": "20.1.6",
3131
"@types/file-saver": "2.0.7",
3232
"@types/fs-extra": "11.0.4",
3333
"@types/lodash-es": "4.17.12",
34-
"@types/node": "22.13.5",
35-
"@vitejs/plugin-legacy": "6.0.1",
36-
"@vitejs/plugin-vue": "5.2.1",
37-
"@vitejs/plugin-vue-jsx": "4.1.1",
34+
"@types/node": "24.0.4",
35+
"@vitejs/plugin-legacy": "7.0.0",
36+
"@vitejs/plugin-vue": "6.0.0",
37+
"@vitejs/plugin-vue-jsx": "5.0.0",
3838
"@vue/eslint-config-prettier": "10.2.0",
39-
"@vue/eslint-config-typescript": "14.4.0",
39+
"@vue/eslint-config-typescript": "14.5.1",
4040
"@vue/tsconfig": "0.7.0",
41-
"@vueuse/components": "12.7.0",
42-
"@vueuse/core": "12.7.0",
43-
"browser-fs-access": "0.35.0",
41+
"@vueuse/components": "13.4.0",
42+
"@vueuse/core": "13.4.0",
43+
"browser-fs-access": "0.38.0",
4444
"compressorjs": "1.2.1",
4545
"cross-env": "7.0.3",
4646
"dayjs": "1.11.13",
47-
"eslint": "9.21.0",
48-
"eslint-config-prettier": "10.0.1",
47+
"eslint": "9.29.0",
48+
"eslint-config-prettier": "10.1.5",
4949
"eslint-define-config": "2.1.0",
5050
"eslint-plugin-unused-imports": "4.1.4",
51-
"eslint-plugin-vue": "9.32.0",
51+
"eslint-plugin-vue": "10.2.0",
5252
"file-saver": "2.0.5",
53+
"globals": "16.2.0",
5354
"json5": "2.2.3",
5455
"jszip": "3.10.1",
55-
"lint-staged": "15.4.3",
56+
"lint-staged": "16.1.2",
5657
"localforage": "1.10.0",
5758
"lodash-es": "4.17.21",
58-
"naive-ui": "2.41.0",
59+
"naive-ui": "2.42.0",
5960
"normalize.css": "8.0.1",
6061
"p-limit": "6.2.0",
61-
"pinia": "3.0.1",
62-
"prettier": "3.5.2",
63-
"sass": "1.85.0",
64-
"simple-git": "3.27.0",
65-
"simple-git-hooks": "2.11.1",
66-
"tsx": "4.19.3",
67-
"typescript": "5.7.3",
68-
"typescript-eslint": "8.24.1",
62+
"pkg-exports": "0.2.0",
63+
"prettier": "3.6.1",
64+
"sass": "1.89.2",
65+
"simple-git": "3.28.0",
66+
"simple-git-hooks": "2.13.0",
67+
"tsx": "4.20.3",
68+
"typescript": "5.8.3",
69+
"typescript-eslint": "8.35.0",
6970
"universal-base64url": "1.1.0",
70-
"unocss": "66.0.0",
71-
"unplugin-auto-import": "19.1.0",
71+
"unocss": "66.3.2",
72+
"unplugin-auto-import": "19.3.0",
7273
"unplugin-data": "0.1.1",
73-
"unplugin-vue-components": "28.4.0",
74+
"unplugin-vue-components": "28.7.0",
7475
"user-attachments": "2.0.2",
75-
"vite": "6.1.1",
76-
"vite-plugin-monkey": "5.0.8",
77-
"vue": "3.5.13",
78-
"vue-router": "4.5.0"
76+
"vite": "7.0.0",
77+
"vite-plugin-monkey": "5.0.9",
78+
"vue": "3.5.17",
79+
"vue-router": "4.5.1"
7980
},
8081
"volta": {
81-
"node": "22.10.0",
82-
"pnpm": "10.5.2"
82+
"node": "24.3.0",
83+
"pnpm": "10.12.3"
8384
},
84-
"packageManager": "pnpm@10.5.2",
85+
"packageManager": "pnpm@10.12.3",
8586
"simple-git-hooks": {
8687
"pre-commit": "pnpm exec lint-staged"
8788
},

plugins/naive-components.json

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

plugins/unAutoImport.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,21 @@ import autoImport from 'unplugin-auto-import/vite';
22
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers';
33
import components from 'unplugin-vue-components/vite';
44
import type { Plugin } from 'vite';
5-
import naiveComponents from './naive-components.json';
65
import process from 'node:process';
6+
import { getExportsStatic } from 'pkg-exports';
77

8-
export const unAutoImport = (): Plugin[] => {
8+
export const unAutoImport = async (): Promise<Plugin[]> => {
99
return [
1010
autoImport({
11-
dts: 'auto-import.d.ts',
11+
dts: process.cwd() + '/src/types/auto-import.d.ts',
1212
imports: [
1313
'vue',
1414
'vue-router',
1515
'@vueuse/core',
16-
'pinia',
1716
{
18-
'naive-ui': [
19-
'useDialog',
20-
'useMessage',
21-
'useNotification',
22-
'useLoadingBar',
23-
...naiveComponents,
24-
],
25-
json5: [['default', 'JSON5']],
17+
'naive-ui': (await getExportsStatic('naive-ui')).filter(
18+
(v) => v.startsWith('N') || v.startsWith('use'),
19+
),
2620
},
2721
],
2822
eslintrc: {
@@ -34,7 +28,7 @@ export const unAutoImport = (): Plugin[] => {
3428
}),
3529
components({
3630
include: [/\.[tj]sx?$/, /\.vue$/, /\.vue\?vue/],
37-
dts: 'auto-import-components.d.ts',
31+
dts: process.cwd() + '/src/types/auto-import-components.d.ts',
3832
resolvers: [NaiveUiResolver()],
3933
dirs: [],
4034
}),

0 commit comments

Comments
 (0)