Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core): update folder structure #15

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/plugins/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { RouteKey } from '@elegant-router/types'

export function setupElegantRouter() {
return ElegantVueRouter({
dtsDir: 'src/types/elegant-router.d.ts',
layouts: {
base: 'src/layouts/base-layout/index.vue',
blank: 'src/layouts/blank-layout/index.vue',
Expand Down
4 changes: 2 additions & 2 deletions build/plugins/unplugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function setupUnplugin(viteEnv: Env.ImportMeta) {
defaultClass: 'inline-block',
}),
AutoImport({
dts: 'src/typings/auto-imports.d.ts',
dts: 'src/types/auto-imports.d.ts',
imports: [
'@vueuse/core',
'vue-router',
Expand All @@ -40,7 +40,7 @@ export function setupUnplugin(viteEnv: Env.ImportMeta) {
],
}),
Components({
dts: 'src/typings/components.d.ts',
dts: 'src/types/components.d.ts',
types: [{ from: 'vue-router', names: ['RouterLink', 'RouterView'] }],
resolvers: [
AntDesignVueResolver({
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*", "typings/**/*"],
"include": ["src/**/*", "types/**/*"],
"exclude": ["node_modules", "dist"]
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/store/modules/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useBoolean } from '@sa/hooks'
import { useRouteStore } from '../route'
import { useTabStore } from '../tab'
import { useThemeStore } from '../theme'
import { SetupStoreId } from '@/enum'
import { SetupStoreId } from '@/constants/enum'
import { router } from '@/router'
import { $t, setLocale } from '@/locales'
import { setDayjsLocale } from '@/locales/dayjs'
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useLoading } from '@sa/hooks'
import { useRouteStore } from '../route'
import { useTabStore } from '../tab'
import { clearAuthStorage, getToken } from './shared'
import { SetupStoreId } from '@/enum'
import { SetupStoreId } from '@/constants/enum'
import { useRouterPush } from '@/hooks/common/router'
import { fetchGetUserInfo, fetchLogin } from '@/service/api'
import { localStg } from '@/utils/storage'
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/route/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
transformMenuToSearchMenus,
updateLocaleOfGlobalMenus,
} from './shared'
import { SetupStoreId } from '@/enum'
import { SetupStoreId } from '@/constants/enum'
import { router } from '@/router'
import { createStaticRoutes, getAuthVueRoutes } from '@/router/routes'
import { ROOT_ROUTE } from '@/router/routes/builtin'
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/tab/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
updateTabsByI18nKey,
} from './shared'
import { router } from '@/router'
import { SetupStoreId } from '@/enum'
import { SetupStoreId } from '@/constants/enum'
import { useRouterPush } from '@/hooks/common/router'
import { localStg } from '@/utils/storage'
import { useRouteStore } from '@/store/modules/route'
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
toggleAuxiliaryColorModes,
toggleCssDarkMode,
} from './shared'
import { SetupStoreId } from '@/enum'
import { SetupStoreId } from '@/constants/enum'
import { localStg } from '@/utils/storage'

/** Theme store */
Expand Down
2 changes: 1 addition & 1 deletion src/store/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { PiniaPluginContext } from 'pinia'
import { jsonClone } from '@sa/utils'
import { SetupStoreId } from '@/enum'
import { SetupStoreId } from '@/constants/enum'

/**
* The plugin reset the state of the store which is written by setup syntax
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions src/types/typed-router.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-router. ‼️ DO NOT MODIFY THIS FILE ‼️
// It's recommended to commit this file.
// Make sure to add this file to your tsconfig.json file as an "includes" or "files" entry.

declare module 'vue-router/auto-routes' {
import type {
RouteRecordInfo,
ParamValue,
ParamValueOneOrMore,
ParamValueZeroOrMore,
ParamValueZeroOrOne,
} from 'vue-router'

/**
* Route name map generated by unplugin-vue-router
*/
export interface RouteNamedMap {
'/[...all]/': RouteRecordInfo<'/[...all]/', '/:all(.*)', { all: ParamValue<true> }, { all: ParamValue<false> }>,
'/403/': RouteRecordInfo<'/403/', '/403', Record<never, never>, Record<never, never>>,
'/500/': RouteRecordInfo<'/500/', '/500', Record<never, never>, Record<never, never>>,
'/home/': RouteRecordInfo<'/home/', '/home', Record<never, never>, Record<never, never>>,
'/iframe-page/[url]': RouteRecordInfo<'/iframe-page/[url]', '/iframe-page/:url', { url: ParamValue<true> }, { url: ParamValue<false> }>,
'/login/': RouteRecordInfo<'/login/', '/login', Record<never, never>, Record<never, never>>,
}
}
File renamed without changes.
Loading