create-packer 1.37.2 → 1.38.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 +3 -2
- package/template/cli/.prettierignore +6 -0
- package/template/cli/.prettierrc +18 -0
- package/template/cli/bin/createTemp.d.ts +1 -0
- package/template/cli/bin/createTemp.js +54 -0
- package/template/cli/bin/index.d.ts +2 -0
- package/template/cli/bin/index.js +4 -0
- package/template/cli/bin/utils/index.d.ts +10 -0
- package/template/cli/bin/utils/index.js +44 -0
- package/template/cli/package.json +54 -47
- package/template/docusaurus/.prettierignore +2 -0
- package/template/docusaurus/src/components/HomepageFeatures/index.tsx +70 -70
- package/template/docusaurus/src/components/HomepageFeatures/styles.module.css +11 -11
- package/template/docusaurus/src/css/custom.css +30 -30
- package/template/docusaurus/src/pages/index.module.css +23 -23
- package/template/docusaurus/src/pages/index.tsx +40 -40
- package/template/lib/workspace/.prettierignore +6 -0
- package/template/lib/workspace/.prettierrc +18 -0
- package/template/lib/workspace/package.json +73 -72
- package/template/lib/workspace/packages/react/package.json +41 -40
- package/template/lib/workspace/packages/ts/package.json +29 -28
- package/template/nest/package.json +84 -84
- package/template/nest/src/app.controller.spec.ts +22 -22
- package/template/nest/src/app.controller.ts +12 -12
- package/template/nest/src/app.module.ts +10 -10
- package/template/nest/src/app.service.ts +8 -8
- package/template/nest/src/main.ts +10 -10
- package/template/nest/src/utils/transform.interceptor.ts +26 -26
- package/template/nest/test/app.e2e-spec.ts +24 -24
- package/template/web-app/next/app/globals.css +22 -22
- package/template/web-app/next/app/layout.tsx +18 -18
- package/template/web-app/next/app/page.tsx +113 -113
- package/template/web-app/next/package.json +47 -47
- package/template/web-app/react-rsbuild/.prettierignore +6 -0
- package/template/web-app/react-rsbuild/.prettierrc +18 -0
- package/template/web-app/react-rsbuild/.vscode/extensions.json +8 -8
- package/template/web-app/react-rsbuild/.vscode/settings.json +4 -18
- package/template/web-app/react-rsbuild/domain/app/app.model.ts +7 -7
- package/template/web-app/react-rsbuild/domain/app/app.styled.ts +3 -3
- package/template/web-app/react-rsbuild/domain/app/components/app-context.tsx +17 -17
- package/template/web-app/react-rsbuild/domain/app/components/app.tsx +24 -24
- package/template/web-app/react-rsbuild/domain/app/components/index.ts +1 -1
- package/template/web-app/react-rsbuild/domain/app/index.ts +2 -2
- package/template/web-app/react-rsbuild/domain/router/home/ids.ts +3 -3
- package/template/web-app/react-rsbuild/domain/router/home/index.ts +2 -2
- package/template/web-app/react-rsbuild/domain/router/home/routes.tsx +13 -13
- package/template/web-app/react-rsbuild/domain/router/ids.ts +6 -6
- package/template/web-app/react-rsbuild/domain/router/index.ts +3 -3
- package/template/web-app/react-rsbuild/domain/router/router.tsx +28 -28
- package/template/web-app/react-rsbuild/domain/router/router.types.ts +3 -3
- package/template/web-app/react-rsbuild/env.d.ts +28 -28
- package/template/web-app/react-rsbuild/main.tsx +4 -4
- package/template/web-app/react-rsbuild/package.json +10 -11
- package/template/web-app/react-rsbuild/pages/home/home.styled.ts +7 -7
- package/template/web-app/react-rsbuild/pages/home/home.tsx +10 -10
- package/template/web-app/react-rsbuild/pages/home/index.ts +1 -1
- package/template/web-app/react-rsbuild/pages/index.tsx +18 -18
- package/template/web-app/react-rsbuild/pages/not-found.tsx +3 -3
- package/template/web-app/react-rsbuild/rsbuild.config.ts +78 -85
- package/template/web-app/react-rsbuild/scripts/createChunks.ts +26 -26
- package/template/web-app/react-rsbuild/scripts/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/hooks/defineRouter/defineRouter.types.ts +33 -33
- package/template/web-app/react-rsbuild/shared/hooks/defineRouter/index.ts +2 -2
- package/template/web-app/react-rsbuild/shared/hooks/index.ts +6 -6
- package/template/web-app/react-rsbuild/shared/hooks/useInterval.ts +26 -26
- package/template/web-app/react-rsbuild/shared/hooks/useLoadingAction.ts +27 -27
- package/template/web-app/react-rsbuild/shared/hooks/useLowPriorityState.ts +26 -26
- package/template/web-app/react-rsbuild/shared/hooks/useSyncState.ts +15 -15
- package/template/web-app/react-rsbuild/shared/hooks/useVisible.ts +27 -27
- package/template/web-app/react-rsbuild/shared/service/api.ts +1 -1
- package/template/web-app/react-rsbuild/shared/service/home.ts +8 -8
- package/template/web-app/react-rsbuild/shared/service/index.ts +3 -3
- package/template/web-app/react-rsbuild/shared/service/request.ts +5 -5
- package/template/web-app/react-rsbuild/shared/theme/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/theme/theme.styled.ts +56 -56
- package/template/web-app/react-rsbuild/shared/tools/componentInstance.tsx +80 -80
- package/template/web-app/react-rsbuild/shared/tools/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/types/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/types/utils.ts +2 -2
- package/template/web-app/react-rsbuild/tsconfig.json +32 -44
- package/template/web-app/react-rsbuild/tsconfig.node.json +10 -14
- package/template/web-app/react-vite/.prettierignore +6 -0
- package/template/web-app/react-vite/.prettierrc +18 -0
- package/template/web-app/react-vite/.vscode/extensions.json +1 -1
- package/template/web-app/react-vite/package.json +4 -4
- package/template/web-app/react-webpack/.prettierignore +6 -0
- package/template/web-app/react-webpack/.prettierrc +18 -0
- package/template/web-app/react-webpack/.vscode/extensions.json +8 -8
- package/template/web-app/react-webpack/.vscode/settings.json +4 -18
- package/template/web-app/react-webpack/commitlint.config.js +1 -1
- package/template/web-app/react-webpack/domain/app/app.model.ts +7 -7
- package/template/web-app/react-webpack/domain/app/app.styled.ts +3 -3
- package/template/web-app/react-webpack/domain/app/components/app-context.tsx +17 -17
- package/template/web-app/react-webpack/domain/app/components/app.tsx +24 -24
- package/template/web-app/react-webpack/domain/app/components/index.ts +1 -1
- package/template/web-app/react-webpack/domain/app/index.ts +2 -2
- package/template/web-app/react-webpack/domain/router/home/ids.ts +3 -3
- package/template/web-app/react-webpack/domain/router/home/index.ts +2 -2
- package/template/web-app/react-webpack/domain/router/home/routes.tsx +13 -13
- package/template/web-app/react-webpack/domain/router/ids.ts +6 -6
- package/template/web-app/react-webpack/domain/router/index.ts +3 -3
- package/template/web-app/react-webpack/domain/router/router.tsx +28 -28
- package/template/web-app/react-webpack/domain/router/router.types.ts +3 -3
- package/template/web-app/react-webpack/global.d.ts +26 -26
- package/template/web-app/react-webpack/index.css +3 -3
- package/template/web-app/react-webpack/main.tsx +4 -4
- package/template/web-app/react-webpack/package.json +87 -87
- package/template/web-app/react-webpack/pages/home/home.styled.ts +7 -7
- package/template/web-app/react-webpack/pages/home/home.tsx +10 -10
- package/template/web-app/react-webpack/pages/home/index.ts +1 -1
- package/template/web-app/react-webpack/pages/index.tsx +18 -18
- package/template/web-app/react-webpack/pages/not-found.tsx +3 -3
- package/template/web-app/react-webpack/postcss.config.js +7 -7
- package/template/web-app/react-webpack/shared/hooks/defineRouter/defineRouter.types.ts +33 -33
- package/template/web-app/react-webpack/shared/hooks/defineRouter/index.ts +2 -2
- package/template/web-app/react-webpack/shared/hooks/index.ts +6 -6
- package/template/web-app/react-webpack/shared/hooks/useInterval.ts +26 -26
- package/template/web-app/react-webpack/shared/hooks/useLoadingAction.ts +27 -27
- package/template/web-app/react-webpack/shared/hooks/useLowPriorityState.ts +26 -26
- package/template/web-app/react-webpack/shared/hooks/useSyncState.ts +15 -15
- package/template/web-app/react-webpack/shared/hooks/useVisible.ts +27 -27
- package/template/web-app/react-webpack/shared/service/home.ts +8 -8
- package/template/web-app/react-webpack/shared/service/index.ts +2 -2
- package/template/web-app/react-webpack/shared/service/request.ts +5 -5
- package/template/web-app/react-webpack/shared/theme/index.ts +1 -1
- package/template/web-app/react-webpack/shared/theme/theme.styled.ts +56 -56
- package/template/web-app/react-webpack/shared/tools/componentInstance.tsx +78 -78
- package/template/web-app/react-webpack/shared/tools/index.ts +1 -1
- package/template/web-app/react-webpack/shared/types/index.ts +1 -1
- package/template/web-app/react-webpack/shared/types/utils.ts +2 -2
- package/template/web-app/react-webpack/tsconfig.json +27 -38
- package/template/web-app/react-webpack/tsconfig.node.json +9 -9
- package/template/web-app/solid/package.json +51 -51
- package/template/web-app/solid/src/app.container.tsx +12 -12
- package/template/web-app/solid/src/index.css +15 -15
- package/template/web-app/solid/src/index.tsx +15 -15
- package/template/web-app/solid/src/layout/index.ts +1 -1
- package/template/web-app/solid/src/layout/layout.container.tsx +5 -5
- package/template/web-app/solid/src/pages/home/home.container.tsx +5 -5
- package/template/web-app/solid/src/pages/home/index.ts +1 -1
- package/template/web-app/solid/src/pages/notFound/index.ts +1 -1
- package/template/web-app/solid/src/pages/notFound/notFound.container.tsx +3 -3
- package/template/web-app/solid/src/router/home/index.ts +2 -2
- package/template/web-app/solid/src/router/home/paths.ts +3 -3
- package/template/web-app/solid/src/router/home/routes.tsx +12 -12
- package/template/web-app/solid/src/router/index.ts +2 -2
- package/template/web-app/solid/src/router/paths.ts +5 -5
- package/template/web-app/solid/src/router/routes.ts +16 -16
- package/template/web-app/svelte/.prettierignore +2 -0
- package/template/web-app/svelte/.prettierrc +14 -14
- package/template/web-app/svelte/.svelte-kit/ambient.d.ts +177 -153
- package/template/web-app/svelte/.svelte-kit/generated/client/app.js +23 -19
- package/template/web-app/svelte/.svelte-kit/generated/client/matchers.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/client/nodes/0.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/client/nodes/1.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/client/nodes/2.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/root.svelte +62 -56
- package/template/web-app/svelte/.svelte-kit/generated/server/internal.js +61 -30
- package/template/web-app/svelte/.svelte-kit/non-ambient.d.ts +23 -0
- package/template/web-app/svelte/.svelte-kit/tsconfig.json +32 -39
- package/template/web-app/svelte/.svelte-kit/types/route_meta_data.json +3 -3
- package/template/web-app/svelte/.svelte-kit/types/src/routes/$types.d.ts +35 -20
- package/template/web-app/svelte/.vscode/extensions.json +8 -8
- package/template/web-app/svelte/commitlint.config.cjs +1 -1
- package/template/web-app/svelte/package.json +55 -55
- package/template/web-app/svelte/scripts/createChunks.ts +26 -26
- package/template/web-app/svelte/scripts/index.ts +1 -1
- package/template/web-app/svelte/src/app.d.ts +12 -12
- package/template/web-app/svelte/src/routes/+page.svelte +2 -2
- package/template/web-app/svelte/svelte.config.js +17 -17
- package/template/web-app/svelte/tsconfig.json +21 -21
- package/template/web-app/svelte/vite-env.d.ts +11 -11
- package/template/web-app/svelte/vite.config.ts +55 -55
- package/template/web-app/vue/.prettierignore +6 -0
- package/template/web-app/vue/.prettierrc +18 -0
- package/template/web-app/vue/.vscode/extensions.json +1 -1
- package/template/web-app/vue/domain/app/components/app.vue +18 -18
- package/template/web-app/vue/package.json +4 -4
- package/template/web-app/vue/pages/home/home.vue +16 -16
- package/template/web-app/vue/pages/index.vue +3 -3
- package/template/web-app/vue/pages/not-found.vue +3 -3
- package/template/web-extension/.prettierignore +6 -0
- package/template/web-extension/.prettierrc +18 -0
- package/template/web-extension/.vscode/extensions.json +8 -8
- package/template/web-extension/.vscode/settings.json +4 -18
- package/template/web-extension/.wxt/eslintrc-auto-import.json +19 -19
- package/template/web-extension/.wxt/tsconfig.json +24 -27
- package/template/web-extension/.wxt/types/globals.d.ts +10 -10
- package/template/web-extension/.wxt/types/i18n.d.ts +80 -74
- package/template/web-extension/.wxt/types/imports.d.ts +17 -17
- package/template/web-extension/.wxt/types/paths.d.ts +12 -12
- package/template/web-extension/entrypoints/background/index.ts +1 -1
- package/template/web-extension/entrypoints/content/constants/base.ts +1 -1
- package/template/web-extension/entrypoints/content/constants/index.ts +1 -1
- package/template/web-extension/entrypoints/content/domain/app/index.ts +1 -1
- package/template/web-extension/entrypoints/content/domain/app/tools/index.ts +1 -1
- package/template/web-extension/entrypoints/content/domain/app/tools/insertApp.tsx +59 -55
- package/template/web-extension/entrypoints/content/index.tsx +12 -12
- package/template/web-extension/entrypoints/content/modules/common/common.tsx +10 -10
- package/template/web-extension/entrypoints/content/modules/common/index.ts +2 -2
- package/template/web-extension/entrypoints/content/modules/common/insert.tsx +9 -9
- package/template/web-extension/entrypoints/content/modules/index.ts +1 -1
- package/template/web-extension/entrypoints/popup/index.html +0 -1
- package/template/web-extension/entrypoints/popup/main.tsx +14 -14
- package/template/web-extension/entrypoints/popup/popup.container.tsx +3 -3
- package/template/web-extension/package.json +86 -86
- package/template/web-extension/shared/background/index.ts +1 -1
- package/template/web-extension/shared/background/message.ts +11 -11
- package/template/web-extension/shared/components/app-context.tsx +14 -14
- package/template/web-extension/shared/components/index.ts +1 -1
- package/template/web-extension/shared/content/index.ts +1 -1
- package/template/web-extension/shared/content/message.ts +15 -15
- package/template/web-extension/shared/hooks/index.ts +2 -2
- package/template/web-extension/shared/hooks/useSyncState.ts +15 -15
- package/template/web-extension/shared/hooks/useVisible.ts +27 -27
- package/template/web-extension/shared/popup/index.ts +1 -1
- package/template/web-extension/shared/popup/message.ts +12 -12
- package/template/web-extension/shared/service/index.ts +1 -1
- package/template/web-extension/shared/service/request.ts +5 -5
- package/template/web-extension/shared/styles/global.styled.ts +8 -8
- package/template/web-extension/shared/styles/index.ts +2 -2
- package/template/web-extension/shared/styles/theme.styled.ts +56 -56
- package/template/web-extension/shared/tools/index.ts +1 -1
- package/template/web-extension/shared/tools/message.ts +80 -80
- package/template/web-extension/shared/types/index.ts +1 -1
- package/template/web-extension/shared/types/utils.ts +3 -3
- package/template/web-extension/tsconfig.json +32 -32
- package/template/web-extension/tsconfig.node.json +10 -10
- package/template/web-extension/vite-env.d.ts +19 -19
- package/template/web-extension/wxt.config.ts +50 -46
- package/template/cli/biome.json +0 -40
- package/template/lib/workspace/biome.json +0 -40
- package/template/web-app/react-rsbuild/biome.json +0 -40
- package/template/web-app/react-vite/biome.json +0 -40
- package/template/web-app/react-webpack/biome.json +0 -40
- package/template/web-app/vue/biome.json +0 -40
- package/template/web-extension/biome.json +0 -40
|
@@ -1,24 +1,24 @@
|
|
|
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
|
+
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 +1 @@
|
|
|
1
|
-
export * as App from './app'
|
|
1
|
+
export * as App from './app'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './app.model'
|
|
2
|
-
export * from './components'
|
|
1
|
+
export * from './app.model'
|
|
2
|
+
export * from './components'
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
home: 'home'
|
|
3
|
-
}
|
|
1
|
+
export default {
|
|
2
|
+
home: 'home'
|
|
3
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as routes } from './routes'
|
|
2
|
-
export { default as ids } from './ids'
|
|
1
|
+
export { default as routes } from './routes'
|
|
2
|
+
export { default as ids } from './ids'
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
+
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,6 +1,6 @@
|
|
|
1
|
-
import * as home from './home'
|
|
2
|
-
export default {
|
|
3
|
-
root: 'root',
|
|
4
|
-
notFound: 'notFound',
|
|
5
|
-
...home.ids
|
|
6
|
-
}
|
|
1
|
+
import * as home from './home'
|
|
2
|
+
export default {
|
|
3
|
+
root: 'root',
|
|
4
|
+
notFound: 'notFound',
|
|
5
|
+
...home.ids
|
|
6
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as routerIds } from './ids'
|
|
2
|
-
export * from './router'
|
|
3
|
-
export * from './router.types'
|
|
1
|
+
export { default as routerIds } from './ids'
|
|
2
|
+
export * from './router'
|
|
3
|
+
export * from './router.types'
|
|
@@ -1,28 +1,28 @@
|
|
|
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: import.meta.env.PUBLIC_BASE_URL
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
export const { useMatchRoutes, useQuery, useRouter, useRoutePermission } =
|
|
28
|
-
defineRouter(routerInstance)
|
|
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: import.meta.env.PUBLIC_BASE_URL
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
export const { useMatchRoutes, useQuery, useRouter, useRoutePermission } =
|
|
28
|
+
defineRouter(routerInstance)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { routeType as $routeType } from '@/shared/hooks'
|
|
2
|
-
|
|
3
|
-
export type routeType = $routeType
|
|
1
|
+
import { routeType as $routeType } from '@/shared/hooks'
|
|
2
|
+
|
|
3
|
+
export type routeType = $routeType
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/// <reference types="@rsbuild/core/types" />
|
|
2
|
-
import 'styled-components'
|
|
3
|
-
import { themeType } from './shared/theme'
|
|
4
|
-
|
|
5
|
-
declare module 'styled-components' {
|
|
6
|
-
export interface DefaultTheme extends themeType {}
|
|
7
|
-
}
|
|
8
|
-
declare global {
|
|
9
|
-
interface ImportMetaEnv {
|
|
10
|
-
// import.meta.env.PUBLIC_FOO
|
|
11
|
-
readonly PUBLIC_BASE_URL: string
|
|
12
|
-
readonly PUBLIC_API_HOST: string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface ImportMeta {
|
|
16
|
-
readonly env: ImportMetaEnv
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare module '*.svg' {
|
|
20
|
-
const content: string
|
|
21
|
-
export default content
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare module '*.svg?react' {
|
|
25
|
-
const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement>>
|
|
26
|
-
export default ReactComponent
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
/// <reference types="@rsbuild/core/types" />
|
|
2
|
+
import 'styled-components'
|
|
3
|
+
import { themeType } from './shared/theme'
|
|
4
|
+
|
|
5
|
+
declare module 'styled-components' {
|
|
6
|
+
export interface DefaultTheme extends themeType {}
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface ImportMetaEnv {
|
|
10
|
+
// import.meta.env.PUBLIC_FOO
|
|
11
|
+
readonly PUBLIC_BASE_URL: string
|
|
12
|
+
readonly PUBLIC_API_HOST: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface ImportMeta {
|
|
16
|
+
readonly env: ImportMetaEnv
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '*.svg' {
|
|
20
|
+
const content: string
|
|
21
|
+
export default content
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.svg?react' {
|
|
25
|
+
const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement>>
|
|
26
|
+
export default ReactComponent
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRoot } from 'react-dom/client'
|
|
2
|
-
import { App } from '@/domain/app'
|
|
3
|
-
|
|
4
|
-
createRoot(document.getElementById('root') as HTMLElement).render(<App.Root />)
|
|
1
|
+
import { createRoot } from 'react-dom/client'
|
|
2
|
+
import { App } from '@/domain/app'
|
|
3
|
+
|
|
4
|
+
createRoot(document.getElementById('root') as HTMLElement).render(<App.Root />)
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"build:rsdoctor": "cross-env RSDOCTOR=true rsbuild build",
|
|
12
12
|
"preview": "rsbuild preview",
|
|
13
13
|
"up:rsbuild": "pnpm up @rsbuild/* -L",
|
|
14
|
-
"format": "
|
|
14
|
+
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
15
15
|
"lint": "tsc --noEmit && eslint **/*.{tsx,ts,jsx,js} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
|
|
16
16
|
"lint:fix": "eslint **/*.{tsx,ts,jsx,js} --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
|
|
17
17
|
"cz": "cz",
|
|
@@ -35,15 +35,14 @@
|
|
|
35
35
|
"zustand": "4.4.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@biomejs/biome": "1.9.3",
|
|
39
38
|
"@commitlint/cli": "17.6.1",
|
|
40
39
|
"@commitlint/config-conventional": "17.6.1",
|
|
41
40
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
42
|
-
"@rsbuild/core": "1.0
|
|
41
|
+
"@rsbuild/core": "1.1.0",
|
|
43
42
|
"@rsbuild/plugin-eslint": "1.0.4",
|
|
44
|
-
"@rsbuild/plugin-react": "1.0.
|
|
43
|
+
"@rsbuild/plugin-react": "1.0.7",
|
|
45
44
|
"@rsbuild/plugin-styled-components": "1.0.1",
|
|
46
|
-
"@rsbuild/plugin-svgr": "1.0.
|
|
45
|
+
"@rsbuild/plugin-svgr": "1.0.5",
|
|
47
46
|
"@rsbuild/plugin-type-check": "1.0.1",
|
|
48
47
|
"@rsdoctor/rspack-plugin": "0.4.2",
|
|
49
48
|
"@types/lodash-es": "4.17.7",
|
|
@@ -51,8 +50,8 @@
|
|
|
51
50
|
"@types/qs": "6.9.7",
|
|
52
51
|
"@types/react": "18.3.3",
|
|
53
52
|
"@types/react-dom": "18.3.0",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "
|
|
55
|
-
"@typescript-eslint/parser": "
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "8.13.0",
|
|
54
|
+
"@typescript-eslint/parser": "8.13.0",
|
|
56
55
|
"autoprefixer": "10.4.14",
|
|
57
56
|
"commitizen": "4.3.0",
|
|
58
57
|
"cssnano": "6.0.0",
|
|
@@ -61,16 +60,16 @@
|
|
|
61
60
|
"eslint-plugin-import": "2.29.1",
|
|
62
61
|
"eslint-plugin-react": "7.33.2",
|
|
63
62
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
64
|
-
"husky": "
|
|
65
|
-
"inquirer": "8.1.2",
|
|
63
|
+
"husky": "9.1.6",
|
|
66
64
|
"postcss": "8.4.35",
|
|
67
65
|
"postcss-import": "16.0.1",
|
|
68
66
|
"postcss-nesting": "12.0.3",
|
|
69
67
|
"postcss-styled-syntax": "0.6.4",
|
|
70
|
-
"
|
|
68
|
+
"prettier": "3.2.5",
|
|
69
|
+
"stylelint": "16.10.0",
|
|
71
70
|
"stylelint-config-standard": "36.0.1",
|
|
72
71
|
"stylelint-webpack-plugin": "5.0.0",
|
|
73
|
-
"typescript": "5.
|
|
72
|
+
"typescript": "5.6.3"
|
|
74
73
|
},
|
|
75
74
|
"config": {
|
|
76
75
|
"commitizen": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components'
|
|
2
|
-
|
|
3
|
-
export const StyledRoot = styled.div(({ theme }) => {
|
|
4
|
-
return css`
|
|
5
|
-
${theme.tools.flex('center', 'center')};
|
|
6
|
-
`
|
|
7
|
-
})
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const StyledRoot = styled.div(({ theme }) => {
|
|
4
|
+
return css`
|
|
5
|
+
${theme.tools.flex('center', 'center')};
|
|
6
|
+
`
|
|
7
|
+
})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useHomeQuery } from '@/shared/service'
|
|
2
|
-
import { StyledRoot } from './home.styled'
|
|
3
|
-
|
|
4
|
-
export default function Home() {
|
|
5
|
-
const query = useHomeQuery()
|
|
6
|
-
|
|
7
|
-
console.log('data', query.data)
|
|
8
|
-
|
|
9
|
-
return <StyledRoot>sdfs</StyledRoot>
|
|
10
|
-
}
|
|
1
|
+
import { useHomeQuery } from '@/shared/service'
|
|
2
|
+
import { StyledRoot } from './home.styled'
|
|
3
|
+
|
|
4
|
+
export default function Home() {
|
|
5
|
+
const query = useHomeQuery()
|
|
6
|
+
|
|
7
|
+
console.log('data', query.data)
|
|
8
|
+
|
|
9
|
+
return <StyledRoot>sdfs</StyledRoot>
|
|
10
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './home'
|
|
1
|
+
export { default } from './home'
|
|
@@ -1,18 +1,18 @@
|
|
|
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
|
+
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,3 +1,3 @@
|
|
|
1
|
-
export default function NotFound() {
|
|
2
|
-
return <div>404</div>
|
|
3
|
-
}
|
|
1
|
+
export default function NotFound() {
|
|
2
|
+
return <div>404</div>
|
|
3
|
+
}
|
|
@@ -1,85 +1,78 @@
|
|
|
1
|
-
import { defineConfig, loadEnv } from '@rsbuild/core'
|
|
2
|
-
import { pluginReact } from '@rsbuild/plugin-react'
|
|
3
|
-
import { pluginStyledComponents } from '@rsbuild/plugin-styled-components'
|
|
4
|
-
import { pluginEslint } from '@rsbuild/plugin-eslint'
|
|
5
|
-
import StylelintWebpackPlugin from 'stylelint-webpack-plugin'
|
|
6
|
-
import { pluginTypeCheck } from '@rsbuild/plugin-type-check'
|
|
7
|
-
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin'
|
|
8
|
-
import { pluginSvgr } from '@rsbuild/plugin-svgr'
|
|
9
|
-
import { createChunks } from './scripts
|
|
10
|
-
|
|
11
|
-
export default defineConfig(({ envMode, command }) => {
|
|
12
|
-
const { parsed: env } = loadEnv()
|
|
13
|
-
const proxyBaseUrl = env.PUBLIC_API_HOST
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
[proxyBaseUrl]: ''
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
})
|
|
1
|
+
import { defineConfig, loadEnv } from '@rsbuild/core'
|
|
2
|
+
import { pluginReact } from '@rsbuild/plugin-react'
|
|
3
|
+
import { pluginStyledComponents } from '@rsbuild/plugin-styled-components'
|
|
4
|
+
import { pluginEslint } from '@rsbuild/plugin-eslint'
|
|
5
|
+
import StylelintWebpackPlugin from 'stylelint-webpack-plugin'
|
|
6
|
+
import { pluginTypeCheck } from '@rsbuild/plugin-type-check'
|
|
7
|
+
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin'
|
|
8
|
+
import { pluginSvgr } from '@rsbuild/plugin-svgr'
|
|
9
|
+
import { createChunks } from './scripts'
|
|
10
|
+
|
|
11
|
+
export default defineConfig(({ envMode, command }) => {
|
|
12
|
+
const { parsed: env } = loadEnv()
|
|
13
|
+
const proxyBaseUrl = env.PUBLIC_API_HOST
|
|
14
|
+
return {
|
|
15
|
+
html: {
|
|
16
|
+
template: './index.html'
|
|
17
|
+
},
|
|
18
|
+
source: {
|
|
19
|
+
entry: {
|
|
20
|
+
index: './main.tsx'
|
|
21
|
+
},
|
|
22
|
+
alias: {
|
|
23
|
+
'@': __dirname
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
output: {
|
|
27
|
+
distPath: {
|
|
28
|
+
root: 'dist'
|
|
29
|
+
},
|
|
30
|
+
cleanDistPath: true
|
|
31
|
+
},
|
|
32
|
+
tools: {
|
|
33
|
+
rspack: {
|
|
34
|
+
plugins: [
|
|
35
|
+
new StylelintWebpackPlugin(),
|
|
36
|
+
process.env.RSDOCTOR && new RsdoctorRspackPlugin()
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
plugins: [
|
|
41
|
+
pluginTypeCheck(),
|
|
42
|
+
pluginEslint(),
|
|
43
|
+
pluginStyledComponents({
|
|
44
|
+
ssr: false,
|
|
45
|
+
displayName: false,
|
|
46
|
+
fileName: false,
|
|
47
|
+
transpileTemplateLiterals: false
|
|
48
|
+
}),
|
|
49
|
+
pluginSvgr(),
|
|
50
|
+
pluginReact()
|
|
51
|
+
],
|
|
52
|
+
performance: {
|
|
53
|
+
removeConsole: command === 'build' ? ['log'] : false,
|
|
54
|
+
chunkSplit: {
|
|
55
|
+
strategy: 'custom',
|
|
56
|
+
splitChunks: {
|
|
57
|
+
minChunks: 1,
|
|
58
|
+
cacheGroups: createChunks([{ libs: ['react', 'react-dom'], name: 'react' }])
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
bundleAnalyze: envMode === 'analyse' ? { openAnalyzer: true } : void 0
|
|
62
|
+
},
|
|
63
|
+
server: {
|
|
64
|
+
base: env.PUBLIC_BASE_URL,
|
|
65
|
+
host: '0.0.0.0',
|
|
66
|
+
compress: false,
|
|
67
|
+
proxy: [
|
|
68
|
+
{
|
|
69
|
+
context: [proxyBaseUrl],
|
|
70
|
+
target: 'http://127.0.0.1:3000',
|
|
71
|
+
pathRewrite: {
|
|
72
|
+
[proxyBaseUrl]: ''
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
})
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { CacheGroups } from '@rsbuild/core'
|
|
2
|
-
|
|
3
|
-
export function createChunks(
|
|
4
|
-
chunks: Array<{ name: string; libs: string[] | RegExp; priority?: number }>
|
|
5
|
-
) {
|
|
6
|
-
const result: CacheGroups = {
|
|
7
|
-
vendors: {
|
|
8
|
-
test: /[\\/]node_modules[\\/]/,
|
|
9
|
-
chunks: 'all',
|
|
10
|
-
name: 'vendors',
|
|
11
|
-
priority: -1
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
chunks.forEach(({ name, libs, priority }) => {
|
|
15
|
-
result[name] = {
|
|
16
|
-
test: Array.isArray(libs)
|
|
17
|
-
? new RegExp(`[\\\\/]node_modules[\\\\/](${libs.join('|')})[\\\\/]`)
|
|
18
|
-
: libs,
|
|
19
|
-
chunks: 'all',
|
|
20
|
-
name,
|
|
21
|
-
priority
|
|
22
|
-
}
|
|
23
|
-
return result
|
|
24
|
-
})
|
|
25
|
-
return result
|
|
26
|
-
}
|
|
1
|
+
import { CacheGroups } from '@rsbuild/core'
|
|
2
|
+
|
|
3
|
+
export function createChunks(
|
|
4
|
+
chunks: Array<{ name: string; libs: string[] | RegExp; priority?: number }>
|
|
5
|
+
) {
|
|
6
|
+
const result: CacheGroups = {
|
|
7
|
+
vendors: {
|
|
8
|
+
test: /[\\/]node_modules[\\/]/,
|
|
9
|
+
chunks: 'all',
|
|
10
|
+
name: 'vendors',
|
|
11
|
+
priority: -1
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
chunks.forEach(({ name, libs, priority }) => {
|
|
15
|
+
result[name] = {
|
|
16
|
+
test: Array.isArray(libs)
|
|
17
|
+
? new RegExp(`[\\\\/]node_modules[\\\\/](${libs.join('|')})[\\\\/]`)
|
|
18
|
+
: libs,
|
|
19
|
+
chunks: 'all',
|
|
20
|
+
name,
|
|
21
|
+
priority
|
|
22
|
+
}
|
|
23
|
+
return result
|
|
24
|
+
})
|
|
25
|
+
return result
|
|
26
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './createChunks'
|
|
1
|
+
export * from './createChunks'
|