Skip to content

Commit

Permalink
refactor: ♻️ use types in feature dir
Browse files Browse the repository at this point in the history
  • Loading branch information
recallwei committed Feb 17, 2024
1 parent 1de82f2 commit 857bb1b
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 47 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@
"unplugin-icons": "^0.18.3",
"unplugin-info": "^1.0.2",
"vite": "5.0.12",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-progress": "^0.0.7"
"vite-plugin-compression": "^0.5.1"
},
"config": {
"commitizen": {
Expand Down
30 changes: 0 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/constants/menu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MenuItem } from '@/types'
import type { MenuItem } from '@/features/menu'

const t = i18n.getFixedT(null, 'MENU')

Expand Down
2 changes: 1 addition & 1 deletion src/constants/page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Nullable } from '@dolphin-admin/utils'

import type { Sorter } from '@/types'
import type { Sorter } from '@/api/axios.type'

export const DEFAULT_PAGE_SIZE = 10

Expand Down
4 changes: 2 additions & 2 deletions src/features/dictionaries/components/ModalContent.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type FormInstance } from 'antd'

import type { Dictionary } from '@/api/dictionary.type'
import { ModalType } from '@/enums'
import type { DetailItems } from '@/types'
import type { DetailItems } from '@/features/detail'
import { ModalType } from '@/features/modal'

import { formInitialValue } from '../constants'

Expand Down
2 changes: 1 addition & 1 deletion src/features/dictionaries/hooks/useCrud.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Dictionary } from '@/api/dictionary.type'
import type { DetailItems } from '@/types'
import type { DetailItems } from '@/features/detail'

import { detailFields } from '../constants'
import type { EnableMutationParams } from '../types'
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useRouteMeta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RouteMetadata } from '@/features/router'
import { getRouteMetadata, routes } from '@/router'
import type { RouteMetadata } from '@/types'

interface RouteMetaAction {
getTitle: () => string | undefined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getMenuTree } from '@/constants'
import type { MenuItem } from '@/types'
import type { MenuItem } from '@/features/menu'

export default function Menu() {
const { siderBg } = ATheme.useToken().token.Layout!
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/DpTableLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RenderModal } from '@/types'
import type { RenderModal } from '@/features/layout'

interface Props {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pages/code-templates/table/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ColumnsType } from 'antd/es/table'

import type { Setting } from '@/types'
import type { Setting } from '@/api/settings.type'

export function Component() {
const { t } = useTranslation('COMMON')
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LoginModel, Tokens } from '@/types'
import type { LoginModel, Tokens } from '@/api/auth.type'

import { Header, ThirdPartyLogin } from './components'
import { UserNameLoginType } from './enum'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LoginModel } from '@/types'
import type { LoginModel } from '@/api/auth.type'

export interface LoginFormData extends LoginModel {
rememberPassword: boolean
Expand Down
3 changes: 1 addition & 2 deletions src/pages/system/dictionaries/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import type { Dictionary } from '@/api/dictionary.type'
import { ModalType } from '@/enums'
import {
ModalContent,
useColumns,
useCrud,
useDictionariesQuery,
useDictionaryListParams
} from '@/features/dictionaries'
import { useModal } from '@/features/modal'
import { ModalType, useModal } from '@/features/modal'
import { usePagination } from '@/features/pagination'

export function Component() {
Expand Down
2 changes: 0 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import Info from 'unplugin-info/vite'
import type { ProxyOptions } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import ViteCompression from 'vite-plugin-compression'
import progress from 'vite-plugin-progress'

export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd())
Expand Down Expand Up @@ -117,7 +116,6 @@ export default defineConfig(({ mode }) => {
}),
visualizer({ open: false, gzipSize: true }),
BootstrapAnimation(),
progress(),
Info()
],
resolve: {
Expand Down

0 comments on commit 857bb1b

Please sign in to comment.