create-packer 1.39.4 → 1.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/web-app/react-rsbuild/index.html +0 -1
- package/template/web-app/react-rsbuild/rsbuild.config.ts +9 -8
- package/template/web-app/vue/router/index.ts +2 -2
- package/template/web-app/vue-rsbuild/.env +2 -0
- package/template/web-app/vue-rsbuild/.env.development +2 -0
- package/template/web-app/{react-webpack → vue-rsbuild}/.gitignore +1 -1
- package/template/web-app/{react-webpack → vue-rsbuild}/.stylelintrc +9 -4
- package/template/web-app/{react-webpack → vue-rsbuild}/.vscode/extensions.json +3 -2
- package/template/web-app/vue-rsbuild/README.md +14 -0
- package/template/web-app/{react-webpack/commitlint.config.js → vue-rsbuild/commitlint.config.cjs} +1 -1
- package/template/web-app/vue-rsbuild/domain/app/app.ts +4 -0
- package/template/web-app/vue-rsbuild/domain/app/components/app.vue +18 -0
- package/template/web-app/vue-rsbuild/domain/app/components/index.ts +1 -0
- package/template/web-app/vue-rsbuild/domain/app/createComponentInstance.ts +44 -0
- package/template/web-app/vue-rsbuild/domain/app/index.ts +3 -0
- package/template/web-app/vue-rsbuild/env.d.ts +17 -0
- package/template/web-app/{react-webpack → vue-rsbuild}/eslint.config.js +25 -20
- package/template/web-app/{react-webpack → vue-rsbuild}/index.html +3 -3
- package/template/web-app/vue-rsbuild/main.ts +7 -0
- package/template/web-app/vue-rsbuild/package.json +73 -0
- package/template/web-app/vue-rsbuild/pages/home/index.ts +1 -0
- package/template/web-app/vue-rsbuild/pages/home/view.vue +16 -0
- package/template/web-app/vue-rsbuild/pages/index.ts +1 -0
- package/template/web-app/vue-rsbuild/pages/index.vue +3 -0
- package/template/web-app/vue-rsbuild/pages/not-found.vue +3 -0
- package/template/web-app/{react-webpack/postcss.config.js → vue-rsbuild/postcss.config.cjs} +9 -7
- package/template/web-app/vue-rsbuild/public/vite.svg +1 -0
- package/template/web-app/{react-webpack/domain → vue-rsbuild}/router/home/index.ts +1 -1
- package/template/web-app/vue-rsbuild/router/home/routes.ts +8 -0
- package/template/web-app/vue-rsbuild/router/index.ts +26 -0
- package/template/web-app/vue-rsbuild/router/names.ts +5 -0
- package/template/web-app/vue-rsbuild/rsbuild.config.ts +74 -0
- package/template/web-app/vue-rsbuild/scripts/createChunks.ts +26 -0
- package/template/web-app/vue-rsbuild/scripts/index.ts +1 -0
- package/template/web-app/vue-rsbuild/shared/assets/vue.svg +1 -0
- package/template/web-app/vue-rsbuild/shared/hooks/index.ts +2 -0
- package/template/web-app/vue-rsbuild/shared/hooks/useList.ts +104 -0
- package/template/web-app/{react-webpack → vue-rsbuild}/shared/hooks/useVisible.ts +4 -4
- package/template/web-app/vue-rsbuild/shared/service/api.ts +1 -0
- package/template/web-app/vue-rsbuild/shared/service/home.ts +10 -0
- package/template/web-app/{react-webpack → vue-rsbuild}/shared/service/index.ts +1 -0
- package/template/web-app/vue-rsbuild/shared/service/request.ts +5 -0
- package/template/web-app/vue-rsbuild/shared/tools/index.ts +0 -0
- package/template/web-app/vue-rsbuild/tailwind.config.cjs +18 -0
- package/template/web-app/{react-webpack → vue-rsbuild}/tsconfig.json +10 -13
- package/template/web-app/vue-rsbuild/tsconfig.node.json +10 -0
- package/template/web-app/react-webpack/.env +0 -2
- package/template/web-app/react-webpack/.env.dev +0 -2
- package/template/web-app/react-webpack/.vscode/settings.json +0 -4
- package/template/web-app/react-webpack/README.md +0 -13
- package/template/web-app/react-webpack/domain/app/app.model.ts +0 -7
- package/template/web-app/react-webpack/domain/app/app.styled.ts +0 -3
- package/template/web-app/react-webpack/domain/app/components/app-context.tsx +0 -17
- package/template/web-app/react-webpack/domain/app/components/app.tsx +0 -24
- package/template/web-app/react-webpack/domain/app/components/index.ts +0 -1
- package/template/web-app/react-webpack/domain/app/index.ts +0 -2
- package/template/web-app/react-webpack/domain/router/components/index.ts +0 -2
- package/template/web-app/react-webpack/domain/router/components/route-layout.tsx +0 -19
- package/template/web-app/react-webpack/domain/router/components/sub-route-outlet.tsx +0 -22
- package/template/web-app/react-webpack/domain/router/home/routes.tsx +0 -13
- package/template/web-app/react-webpack/domain/router/ids.ts +0 -6
- package/template/web-app/react-webpack/domain/router/index.ts +0 -4
- package/template/web-app/react-webpack/domain/router/router.tsx +0 -28
- package/template/web-app/react-webpack/domain/router/router.types.ts +0 -3
- package/template/web-app/react-webpack/global.d.ts +0 -26
- package/template/web-app/react-webpack/main.tsx +0 -4
- package/template/web-app/react-webpack/package.json +0 -84
- package/template/web-app/react-webpack/pages/home/index.ts +0 -1
- package/template/web-app/react-webpack/pages/home/view.styled.ts +0 -7
- package/template/web-app/react-webpack/pages/home/view.tsx +0 -10
- package/template/web-app/react-webpack/pages/index.tsx +0 -18
- package/template/web-app/react-webpack/pages/not-found.tsx +0 -3
- package/template/web-app/react-webpack/public/react.svg +0 -1
- package/template/web-app/react-webpack/shared/assets/react.svg +0 -1
- package/template/web-app/react-webpack/shared/components/componentInstance.tsx +0 -78
- package/template/web-app/react-webpack/shared/components/index.ts +0 -1
- package/template/web-app/react-webpack/shared/hooks/defineRouter/defineRouter.types.ts +0 -33
- package/template/web-app/react-webpack/shared/hooks/defineRouter/deineRouter.tsx +0 -160
- package/template/web-app/react-webpack/shared/hooks/defineRouter/index.ts +0 -2
- package/template/web-app/react-webpack/shared/hooks/index.ts +0 -6
- package/template/web-app/react-webpack/shared/hooks/useInterval.ts +0 -26
- package/template/web-app/react-webpack/shared/hooks/useLoadingAction.ts +0 -27
- package/template/web-app/react-webpack/shared/hooks/useLowPriorityState.ts +0 -26
- package/template/web-app/react-webpack/shared/hooks/useSyncState.ts +0 -15
- package/template/web-app/react-webpack/shared/service/home.ts +0 -8
- package/template/web-app/react-webpack/shared/service/request.ts +0 -5
- package/template/web-app/react-webpack/shared/theme/index.ts +0 -1
- package/template/web-app/react-webpack/shared/theme/theme.styled.ts +0 -56
- package/template/web-app/react-webpack/shared/types/index.ts +0 -1
- package/template/web-app/react-webpack/shared/types/utils.ts +0 -2
- package/template/web-app/react-webpack/tsconfig.node.json +0 -9
- package/template/web-app/react-webpack/webpack.config.mjs +0 -161
- package/template/web-app/react-webpack/webpack_config/constant.mjs +0 -5
- package/template/web-app/react-webpack/webpack_config/index.mjs +0 -2
- package/template/web-app/react-webpack/webpack_config/styles.mjs +0 -22
- /package/template/web-app/{react-webpack → vue-rsbuild}/.editorconfig +0 -0
- /package/template/web-app/{react-webpack → vue-rsbuild}/.husky/commit-msg +0 -0
- /package/template/web-app/{react-webpack → vue-rsbuild}/.husky/pre-commit +0 -0
- /package/template/web-app/{react-webpack → vue-rsbuild}/.prettierignore +0 -0
- /package/template/web-app/{react-webpack → vue-rsbuild}/.prettierrc +0 -0
- /package/template/web-app/{react-webpack → vue-rsbuild}/.stylelintignore +0 -0
- /package/template/web-app/{react-webpack/domain/router/home/ids.ts → vue-rsbuild/router/home/names.ts} +0 -0
- /package/template/web-app/{react-webpack/shared/constant → vue-rsbuild/shared/components}/index.ts +0 -0
- /package/template/web-app/{react-webpack/shared/tools → vue-rsbuild/shared/constant}/index.ts +0 -0
- /package/template/web-app/{react-webpack/index.css → vue-rsbuild/style.css} +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ref, reactive, computed, unref } from 'vue'
|
|
2
|
+
import { cloneDeep, concat, assign, pick, isNil, size, max } from 'lodash-es'
|
|
3
|
+
|
|
4
|
+
export interface stateType<ListItem, P> {
|
|
5
|
+
loading: boolean
|
|
6
|
+
total: number
|
|
7
|
+
params: P
|
|
8
|
+
list: ListItem[]
|
|
9
|
+
sum: Record<string, any>
|
|
10
|
+
selected: ListItem[]
|
|
11
|
+
selectedKeys: (string | number)[]
|
|
12
|
+
pagination: {
|
|
13
|
+
current: number
|
|
14
|
+
pageSize: number
|
|
15
|
+
total: number
|
|
16
|
+
}
|
|
17
|
+
selectedLen: number
|
|
18
|
+
}
|
|
19
|
+
export interface createListStorePropsType<ListItem, P> {
|
|
20
|
+
/**
|
|
21
|
+
* @description 默认请求参数
|
|
22
|
+
*/
|
|
23
|
+
defaultParams: P
|
|
24
|
+
/** 列表请求 */
|
|
25
|
+
fetch: (
|
|
26
|
+
state: Pick<stateType<ListItem, P>, 'pagination' | 'selected' | 'total' | 'params'>
|
|
27
|
+
) => Promise<{
|
|
28
|
+
list: any[]
|
|
29
|
+
page?: number
|
|
30
|
+
pageSize?: number
|
|
31
|
+
total?: number
|
|
32
|
+
sum?: Record<string, any>
|
|
33
|
+
}>
|
|
34
|
+
/** 初始化列表时的配置 */
|
|
35
|
+
initConfig?: {
|
|
36
|
+
/** 初始化的时候需要保留值的字段 */
|
|
37
|
+
keepParamsKeys?: Array<keyof P>
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default function createListStore<
|
|
42
|
+
ListItem extends Record<string, any>,
|
|
43
|
+
P extends { page?: number; pageSize?: number; [key: string]: any }
|
|
44
|
+
>(config: createListStorePropsType<ListItem, P>) {
|
|
45
|
+
const loading = ref<stateType<ListItem, P>['loading']>(true)
|
|
46
|
+
const total = ref<stateType<ListItem, P>['total']>(0)
|
|
47
|
+
const params = reactive<stateType<ListItem, P>['params']>(cloneDeep(config.defaultParams))
|
|
48
|
+
const list = ref<stateType<ListItem, P>['list']>([])
|
|
49
|
+
const sum = reactive<stateType<ListItem, P>['sum']>({})
|
|
50
|
+
const selected = ref<stateType<ListItem, P>['selected']>([])
|
|
51
|
+
const selectedKeys = ref<stateType<ListItem, P>['selectedKeys']>([])
|
|
52
|
+
const pagination = computed<stateType<ListItem, P>['pagination']>(() => ({
|
|
53
|
+
current: params.page || 0,
|
|
54
|
+
pageSize: params.pageSize || 0,
|
|
55
|
+
total: total.value
|
|
56
|
+
}))
|
|
57
|
+
const selectedLen = computed<stateType<ListItem, P>['selectedLen']>(() => {
|
|
58
|
+
return max([size(selected.value), size(selectedKeys.value)]) || 0
|
|
59
|
+
})
|
|
60
|
+
function resetParams() {
|
|
61
|
+
assign(params, cloneDeep(config.defaultParams))
|
|
62
|
+
}
|
|
63
|
+
async function fetchList(arg?: { params?: Partial<P>; isConcat?: boolean; isInit?: boolean }) {
|
|
64
|
+
loading.value = true
|
|
65
|
+
try {
|
|
66
|
+
if (arg?.isInit) {
|
|
67
|
+
assign(
|
|
68
|
+
params,
|
|
69
|
+
cloneDeep(config.defaultParams),
|
|
70
|
+
pick(params, config?.initConfig?.keepParamsKeys || [])
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
assign(params, arg?.params)
|
|
74
|
+
const result = await config.fetch({
|
|
75
|
+
pagination: unref(pagination),
|
|
76
|
+
selected: unref(selected) as ListItem[],
|
|
77
|
+
total: unref(total),
|
|
78
|
+
params: params as P
|
|
79
|
+
})
|
|
80
|
+
list.value =
|
|
81
|
+
!isNil(result.page) && arg?.isConcat ? concat(list.value, result.list) : result.list
|
|
82
|
+
sum.value = result.sum || {}
|
|
83
|
+
total.value = result.total || total.value
|
|
84
|
+
params.page = result.page || params.page
|
|
85
|
+
params.pageSize = result.pageSize || params.pageSize
|
|
86
|
+
} finally {
|
|
87
|
+
loading.value = false
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
loading,
|
|
93
|
+
total,
|
|
94
|
+
params,
|
|
95
|
+
list,
|
|
96
|
+
sum,
|
|
97
|
+
selected,
|
|
98
|
+
selectedKeys,
|
|
99
|
+
pagination,
|
|
100
|
+
selectedLen,
|
|
101
|
+
resetParams,
|
|
102
|
+
fetchList
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ref } from 'vue'
|
|
2
2
|
import { isFunction } from 'lodash-es'
|
|
3
3
|
|
|
4
4
|
export interface useVisibleConfigType {
|
|
@@ -7,20 +7,20 @@ export interface useVisibleConfigType {
|
|
|
7
7
|
onBeforeHide?: () => Promise<boolean | void>
|
|
8
8
|
}
|
|
9
9
|
export default function useVisible(config?: useVisibleConfigType) {
|
|
10
|
-
const
|
|
10
|
+
const visible = ref(config?.defaultVisible ?? false)
|
|
11
11
|
const onShow = async () => {
|
|
12
12
|
let isShow: boolean | void = true
|
|
13
13
|
if (isFunction(config?.onBeforeShow)) {
|
|
14
14
|
isShow = await config?.onBeforeShow?.()
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
visible.value = isShow !== false
|
|
17
17
|
}
|
|
18
18
|
const onClose = async () => {
|
|
19
19
|
let isHide: boolean | void = true
|
|
20
20
|
if (isFunction(config?.onBeforeHide)) {
|
|
21
21
|
isHide = await config?.onBeforeHide?.()
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
visible.value = isHide === false
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
return { visible, onShow, onClose }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const HOME_DATA = '/homeData'
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
content: [
|
|
4
|
+
'./index.html',
|
|
5
|
+
'./app.vue',
|
|
6
|
+
'./main.ts',
|
|
7
|
+
'./pages/**/*.{vue,ts,tsx,js,jsx}',
|
|
8
|
+
'./domain/**/*.{vue,ts,tsx,js,jsx}',
|
|
9
|
+
'./shared/**/*.{vue,ts,tsx,js,jsx}'
|
|
10
|
+
],
|
|
11
|
+
theme: {
|
|
12
|
+
extend: {}
|
|
13
|
+
},
|
|
14
|
+
plugins: [],
|
|
15
|
+
corePlugins: {
|
|
16
|
+
preflight: false
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -3,25 +3,22 @@
|
|
|
3
3
|
"baseUrl": ".",
|
|
4
4
|
"target": "ESNext",
|
|
5
5
|
"useDefineForClassFields": true,
|
|
6
|
-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
7
|
-
"allowJs": true,
|
|
8
|
-
"strictNullChecks": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"esModuleInterop": false,
|
|
11
|
-
"allowSyntheticDefaultImports": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"strictPropertyInitialization": false,
|
|
15
6
|
"module": "ESNext",
|
|
16
7
|
"moduleResolution": "Node",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"jsx": "preserve",
|
|
10
|
+
"sourceMap": true,
|
|
17
11
|
"resolveJsonModule": true,
|
|
18
12
|
"isolatedModules": true,
|
|
19
|
-
"
|
|
20
|
-
"
|
|
13
|
+
"strictPropertyInitialization": false,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"lib": ["ESNext", "DOM"],
|
|
16
|
+
"skipLibCheck": true,
|
|
21
17
|
"paths": {
|
|
22
18
|
"@/*": ["./*"]
|
|
23
19
|
}
|
|
24
20
|
},
|
|
25
|
-
"include": ["**/*.tsx", "**/*.ts"],
|
|
26
|
-
"exclude": ["scripts"]
|
|
21
|
+
"include": ["**/*.tsx", "**/*.ts", "**/*.vue"],
|
|
22
|
+
"exclude": ["scripts", "rsbuild.config.ts"],
|
|
23
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
27
24
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# react-app-webpack
|
|
2
|
-
|
|
3
|
-
- dev: pnpm run dev -> use ".env.dev"
|
|
4
|
-
- build: pnpm run build -> use ".env"
|
|
5
|
-
|
|
6
|
-
# svg
|
|
7
|
-
|
|
8
|
-
- import IconReact from '@/assets/react.svg' -> ReactComponent
|
|
9
|
-
- import iconReact from '@/assets/react.svg?url' -> svg url
|
|
10
|
-
|
|
11
|
-
# style
|
|
12
|
-
|
|
13
|
-
- index.module.css -> css module
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react'
|
|
2
|
-
import { ThemeProvider } from 'styled-components'
|
|
3
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
4
|
-
import { theme } from '@/shared/theme'
|
|
5
|
-
|
|
6
|
-
const queryClient = new QueryClient()
|
|
7
|
-
|
|
8
|
-
export interface propsType {
|
|
9
|
-
children: React.ReactNode
|
|
10
|
-
}
|
|
11
|
-
export const Root: FunctionComponent<propsType> = props => {
|
|
12
|
-
return (
|
|
13
|
-
<QueryClientProvider client={queryClient}>
|
|
14
|
-
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
|
|
15
|
-
</QueryClientProvider>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useLayoutEffect } from 'react'
|
|
2
|
-
import { RouterProvider } from 'react-router-dom'
|
|
3
|
-
import { request } from '@/shared/service'
|
|
4
|
-
import { routerInstance } from '@/domain/router'
|
|
5
|
-
import { GlobalStyle } from '../app.styled'
|
|
6
|
-
import * as AppContext from './app-context'
|
|
7
|
-
|
|
8
|
-
export const Root = () => {
|
|
9
|
-
useLayoutEffect(() => {
|
|
10
|
-
request.interceptors.response.use(
|
|
11
|
-
res => res,
|
|
12
|
-
error => {
|
|
13
|
-
console.log(error)
|
|
14
|
-
}
|
|
15
|
-
)
|
|
16
|
-
}, [])
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<AppContext.Root>
|
|
20
|
-
<GlobalStyle />
|
|
21
|
-
<RouterProvider router={routerInstance} fallbackElement={<>loading...</>} />
|
|
22
|
-
</AppContext.Root>
|
|
23
|
-
)
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as App from './app'
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react'
|
|
2
|
-
import { Outlet } from 'react-router-dom'
|
|
3
|
-
import { last } from 'lodash-es'
|
|
4
|
-
import { routeType, useMatchRoutes } from '@/domain/router'
|
|
5
|
-
|
|
6
|
-
export interface propsType {
|
|
7
|
-
Index: FunctionComponent
|
|
8
|
-
rootId: routeType['id']
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Root: FunctionComponent<propsType> = ({ Index, rootId }) => {
|
|
12
|
-
const matchRoutes = useMatchRoutes()
|
|
13
|
-
|
|
14
|
-
if (last(matchRoutes)?.id === rootId) {
|
|
15
|
-
return <Index />
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return <Outlet />
|
|
19
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react'
|
|
2
|
-
import { Outlet } from 'react-router-dom'
|
|
3
|
-
import { useMount } from 'react-use'
|
|
4
|
-
import { last } from 'lodash-es'
|
|
5
|
-
import { useMatchRoutes, useRouter, routeType } from '@/domain/router'
|
|
6
|
-
|
|
7
|
-
export interface propsType {
|
|
8
|
-
rootId: routeType['id']
|
|
9
|
-
homeId: routeType['id']
|
|
10
|
-
}
|
|
11
|
-
export const Root: FunctionComponent<propsType> = props => {
|
|
12
|
-
const matchRoutes = useMatchRoutes()
|
|
13
|
-
const navigate = useRouter(state => state.navigate)
|
|
14
|
-
|
|
15
|
-
useMount(() => {
|
|
16
|
-
if (last(matchRoutes)?.id === props.rootId) {
|
|
17
|
-
navigate({ id: props.homeId })
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
return <Outlet />
|
|
22
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { lazy } from 'react'
|
|
2
|
-
import ids from './ids'
|
|
3
|
-
import type { routeType } from '../router.types'
|
|
4
|
-
|
|
5
|
-
const routes: routeType[] = [
|
|
6
|
-
{
|
|
7
|
-
path: 'home',
|
|
8
|
-
id: ids.home,
|
|
9
|
-
Component: lazy(() => import('@/pages/home'))
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
export default routes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { lazy } from 'react'
|
|
2
|
-
import { createBrowserRouter } from 'react-router-dom'
|
|
3
|
-
import { defineRouter, routeType } from '@/shared/hooks'
|
|
4
|
-
import ids from './ids'
|
|
5
|
-
import * as home from './home'
|
|
6
|
-
|
|
7
|
-
const routes: routeType[] = [
|
|
8
|
-
{
|
|
9
|
-
path: '/',
|
|
10
|
-
id: ids.root,
|
|
11
|
-
Component: lazy(() => import('@/pages')),
|
|
12
|
-
children: [
|
|
13
|
-
...home.routes,
|
|
14
|
-
{
|
|
15
|
-
path: '*',
|
|
16
|
-
id: ids.notFound,
|
|
17
|
-
Component: lazy(() => import('@/pages/not-found'))
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
export const routerInstance = createBrowserRouter(routes as never, {
|
|
24
|
-
basename: ENV_BASE_URL
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
export const { useMatchRoutes, useQuery, useRouter, useRoutePermission } =
|
|
28
|
-
defineRouter(routerInstance)
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import 'styled-components'
|
|
2
|
-
import { themeType } from './shared/theme'
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
const ENV_BASE_URL: string
|
|
6
|
-
const ENV_API_HOST: string
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare module '*.css'
|
|
10
|
-
declare module '*.less'
|
|
11
|
-
declare module '*.scss'
|
|
12
|
-
declare module '*.png'
|
|
13
|
-
declare module '*.webp'
|
|
14
|
-
declare module '*.svg?url' {
|
|
15
|
-
const url: string
|
|
16
|
-
export default url
|
|
17
|
-
}
|
|
18
|
-
declare module '*.svg' {
|
|
19
|
-
import * as React from 'react'
|
|
20
|
-
function ReactComponent(props: React.SVGProps<SVGSVGElement>): React.ReactElement
|
|
21
|
-
export default ReactComponent
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare module 'styled-components' {
|
|
25
|
-
export interface DefaultTheme extends themeType {}
|
|
26
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-app-webpack",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"main": "./dist/index",
|
|
5
|
-
"module": "./dist/index.esm.js",
|
|
6
|
-
"private": true,
|
|
7
|
-
"author": "1K",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"prepare": "husky install",
|
|
10
|
-
"dev": "webpack serve --env mode=dev",
|
|
11
|
-
"build": "webpack --env mode=prod",
|
|
12
|
-
"build:analyzer": "webpack --env mode=analyzer",
|
|
13
|
-
"up:webpack": "pnpm up webpackbar webpack webpack-* -L",
|
|
14
|
-
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
15
|
-
"lint": "tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
|
|
16
|
-
"lint:fix": "eslint --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
|
|
17
|
-
"cz": "cz",
|
|
18
|
-
"push": "npm run commit && git push",
|
|
19
|
-
"commit": "git add . && npm run cz"
|
|
20
|
-
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@tanstack/react-query": "5.51.15",
|
|
23
|
-
"axios": "1.7.9",
|
|
24
|
-
"define-zustand": "3.1.1",
|
|
25
|
-
"immer": "10.0.3",
|
|
26
|
-
"lodash-es": "4.17.21",
|
|
27
|
-
"qs": "6.11.2",
|
|
28
|
-
"react": "18.3.1",
|
|
29
|
-
"react-dom": "18.3.1",
|
|
30
|
-
"react-router-dom": "6.14.0",
|
|
31
|
-
"react-use": "17.5.0",
|
|
32
|
-
"styled-components": "6.1.11",
|
|
33
|
-
"zustand": "4.4.1"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@commitlint/cli": "18.6.1",
|
|
37
|
-
"@commitlint/config-conventional": "18.6.2",
|
|
38
|
-
"@commitlint/cz-commitlint": "18.6.1",
|
|
39
|
-
"@svgr/webpack": "8.1.0",
|
|
40
|
-
"@types/lodash-es": "4.17.12",
|
|
41
|
-
"@types/qs": "6.9.11",
|
|
42
|
-
"@types/react": "18.3.3",
|
|
43
|
-
"@types/react-dom": "18.3.0",
|
|
44
|
-
"autoprefixer": "10.4.17",
|
|
45
|
-
"commitizen": "4.3.0",
|
|
46
|
-
"css-loader": "6.10.0",
|
|
47
|
-
"cssnano": "6.0.3",
|
|
48
|
-
"dotenv": "16.4.5",
|
|
49
|
-
"esbuild-loader": "4.2.2",
|
|
50
|
-
"eslint": "9.17.0",
|
|
51
|
-
"eslint-import-resolver-typescript": "3.7.0",
|
|
52
|
-
"eslint-plugin-import": "2.31.0",
|
|
53
|
-
"eslint-plugin-react": "7.37.2",
|
|
54
|
-
"eslint-plugin-react-hooks": "5.1.0",
|
|
55
|
-
"eslint-webpack-plugin": "4.2.0",
|
|
56
|
-
"fork-ts-checker-webpack-plugin": "9.0.2",
|
|
57
|
-
"globals": "15.12.0",
|
|
58
|
-
"html-webpack-plugin": "5.6.0",
|
|
59
|
-
"husky": "9.1.6",
|
|
60
|
-
"mini-css-extract-plugin": "2.8.0",
|
|
61
|
-
"postcss-import": "16.0.1",
|
|
62
|
-
"postcss-loader": "8.1.0",
|
|
63
|
-
"postcss-nesting": "12.0.3",
|
|
64
|
-
"postcss-styled-syntax": "0.6.4",
|
|
65
|
-
"prettier": "3.2.5",
|
|
66
|
-
"rimraf": "5.0.5",
|
|
67
|
-
"style-loader": "3.3.4",
|
|
68
|
-
"stylelint": "16.10.0",
|
|
69
|
-
"stylelint-config-standard": "36.0.1",
|
|
70
|
-
"stylelint-webpack-plugin": "5.0.0",
|
|
71
|
-
"typescript": "5.7.2",
|
|
72
|
-
"typescript-eslint": "8.15.0",
|
|
73
|
-
"webpack": "5.97.1",
|
|
74
|
-
"webpack-bundle-analyzer": "4.10.2",
|
|
75
|
-
"webpack-cli": "6.0.1",
|
|
76
|
-
"webpack-dev-server": "5.2.0",
|
|
77
|
-
"webpackbar": "7.0.0"
|
|
78
|
-
},
|
|
79
|
-
"config": {
|
|
80
|
-
"commitizen": {
|
|
81
|
-
"path": "@commitlint/cz-commitlint"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './view'
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react'
|
|
2
|
-
import { Outlet, useLocation } from 'react-router-dom'
|
|
3
|
-
import { useRouter, routerIds } from '@/domain/router'
|
|
4
|
-
|
|
5
|
-
const Layout = () => {
|
|
6
|
-
const location = useLocation()
|
|
7
|
-
const navigate = useRouter(state => state.navigate)
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (location.pathname === '/') {
|
|
11
|
-
navigate({ id: routerIds.home })
|
|
12
|
-
}
|
|
13
|
-
}, [location])
|
|
14
|
-
|
|
15
|
-
return <Outlet />
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default Layout
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|