Skip to content

Commit 7726b49

Browse files
committed
refactor: 移除 auto-import 依赖,改为显式导入
1 parent 9b879fc commit 7726b49

File tree

67 files changed

+303
-187
lines changed

Some content is hidden

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

67 files changed

+303
-187
lines changed

biome.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
}
1212
},
1313
"files": {
14-
"includes": [
15-
"**",
16-
"!package.json",
17-
"!.release-it.ts",
18-
"!**/auto-imports.d.ts"
19-
]
14+
"includes": ["**", "!package.json", "!.release-it.ts"]
2015
},
2116
"formatter": {
2217
"indentStyle": "space"
@@ -33,7 +28,8 @@
3328
},
3429
"correctness": {
3530
"noUnusedImports": "error",
36-
"noUnusedVariables": "error"
31+
"noUnusedVariables": "error",
32+
"useExhaustiveDependencies": "off"
3733
},
3834
"nursery": {
3935
"useSortedClasses": {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
"typescript": "^5.9.3",
9696
"typescript-plugin-css-modules": "^5.2.0",
9797
"unocss": "^0.63.6",
98-
"unplugin-auto-import": "^0.18.6",
9998
"vite": "^5.4.20"
10099
},
101100
"simple-git-hooks": {

pnpm-lock.yaml

Lines changed: 0 additions & 118 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@ import { HappyProvider } from "@ant-design/happy-work-theme";
22
import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
33
import { error } from "@tauri-apps/plugin-log";
44
import { openUrl } from "@tauri-apps/plugin-opener";
5+
import { useBoolean, useEventListener, useKeyPress, useMount } from "ahooks";
56
import { ConfigProvider, theme } from "antd";
67
import { isString } from "es-toolkit";
78
import { RouterProvider } from "react-router-dom";
89
import { useSnapshot } from "valtio";
10+
import { LISTEN_KEY, PRESET_SHORTCUT } from "./constants";
11+
import { destroyDatabase } from "./database";
12+
import { useImmediateKey } from "./hooks/useImmediateKey";
13+
import { useTauriListen } from "./hooks/useTauriListen";
14+
import { useWindowState } from "./hooks/useWindowState";
15+
import { getAntdLocale, i18n } from "./locales";
16+
import { hideWindow, showWindow } from "./plugins/window";
17+
import { router } from "./router";
18+
import { globalStore } from "./stores/global";
19+
import { generateColorVars } from "./utils/color";
20+
import { isURL } from "./utils/is";
21+
import { restoreStore } from "./utils/store";
922

1023
const { defaultAlgorithm, darkAlgorithm } = theme;
1124

src/components/AdaptiveSelect/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useCreation } from "ahooks";
12
import { Select, type SelectProps } from "antd";
23

34
const DEFAULT_WIDTH = 100;

src/components/Audio/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { forwardRef, useImperativeHandle, useRef } from "react";
12
import copyAudio from "@/assets/audio/copy.mp3";
23

34
export interface AudioRef {

src/components/ProShortcut/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { useFocusWithin, useHover, useReactive } from "ahooks";
12
import { Flex } from "antd";
23
import type { ListItemMetaProps } from "antd/es/list";
34
import { find, isEmpty, map, remove, some, split } from "es-toolkit/compat";
4-
import type { FC, KeyboardEvent, MouseEvent } from "react";
5+
import { type FC, type KeyboardEvent, type MouseEvent, useRef } from "react";
6+
import { useTranslation } from "react-i18next";
57
import ProListItem from "../ProListItem";
68
import UnoIcon from "../UnoIcon";
79
import { type Key, keys, modifierKeys, standardKeys } from "./keyboard";

src/components/ProShortcut/keyboard.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defaults } from "es-toolkit/compat";
2+
import { isMac } from "@/utils/is";
23

34
export interface Key {
45
eventKey: string;

src/components/SafeHtml/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import DOMPurify from "dompurify";
2-
import type { FC, MouseEvent } from "react";
2+
import { type FC, type MouseEvent, useContext } from "react";
33
import { Marker } from "react-mark.js";
44
import { MainContext } from "@/pages/Main";
55

src/components/Scrollbar/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { MacScrollbar, type MacScrollbarProps } from "mac-scrollbar";
2+
import { forwardRef, useImperativeHandle, useRef } from "react";
23
import { useSnapshot } from "valtio";
4+
import { globalStore } from "@/stores/global";
35

46
interface ScrollbarProps extends MacScrollbarProps {
57
thumbSize?: number;

0 commit comments

Comments
 (0)