create-packer 1.43.13 → 1.43.14
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/lib/workspace/packages/ts/package.json +2 -2
- package/template/web-app/react-rsbuild/domain/app/components/app-context.tsx +21 -3
- package/template/web-app/react-rsbuild/domain/app/components/app.tsx +5 -3
- package/template/web-app/react-rsbuild/domain/app/startApp.tsx +6 -6
- package/template/web-app/react-rsbuild/domain/router/router.tsx +0 -1
- package/template/web-app/react-rsbuild/env.d.ts +6 -2
- package/template/web-app/react-rsbuild/main.tsx +3 -3
- package/template/web-app/react-rsbuild/package.json +4 -2
- package/template/web-app/react-rsbuild/pages/home/view.styled.ts +4 -6
- package/template/web-app/react-rsbuild/pages/home/view.tsx +10 -11
- package/template/web-app/react-rsbuild/postcss.config.cjs +7 -7
- package/template/web-app/react-rsbuild/rsbuild.config.ts +14 -9
- package/template/web-app/react-rsbuild/shared/service/home.ts +6 -4
- package/template/web-app/react-rsbuild/shared/styles/global-style.tsx +14 -0
- package/template/web-app/react-rsbuild/shared/styles/index.ts +2 -0
- package/template/web-app/react-rsbuild/tsconfig.node.json +1 -1
- package/template/web-app/react-vite/domain/app/components/app-context.tsx +21 -3
- package/template/web-app/react-vite/domain/app/components/app.tsx +5 -3
- package/template/web-app/react-vite/domain/router/router.tsx +0 -1
- package/template/web-app/react-vite/package.json +4 -1
- package/template/web-app/react-vite/pages/home/view.styled.ts +4 -6
- package/template/web-app/react-vite/pages/home/view.tsx +3 -4
- package/template/web-app/react-vite/shared/service/home.ts +6 -4
- package/template/web-app/react-vite/shared/styles/global-style.tsx +14 -0
- package/template/web-app/react-vite/shared/styles/index.ts +2 -0
- package/template/web-app/{react-rsbuild/shared/theme → react-vite/shared/styles}/theme.styled.ts +0 -1
- package/template/web-app/react-vite/vite-env.d.ts +5 -4
- package/template/web-app/react-vite/vite.config.ts +78 -78
- package/template/web-app/vue/domain/app/components/app.vue +1 -1
- package/template/web-app/vue/main.ts +1 -1
- package/template/web-app/vue/package.json +2 -2
- package/template/web-app/vue/vite.config.ts +4 -4
- package/template/web-app/vue-rsbuild/domain/app/components/app.vue +1 -1
- package/template/web-app/vue-rsbuild/main.ts +1 -1
- package/template/web-app/vue-rsbuild/package.json +2 -2
- package/template/web-app/vue-rsbuild/tsconfig.node.json +2 -2
- package/template/web-extension/.wxt/eslint-auto-imports.mjs +29 -1
- package/template/web-extension/.wxt/types/imports-module.d.ts +20 -0
- package/template/web-extension/.wxt/types/imports.d.ts +45 -17
- package/template/web-extension/.wxt/types/paths.d.ts +1 -0
- package/template/web-extension/.wxt/wxt.d.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/tools/insertApp.tsx +58 -58
- package/template/web-extension/entrypoints/content/index.tsx +1 -1
- package/template/web-extension/entrypoints/content/modules/common/common.tsx +10 -10
- package/template/web-extension/entrypoints/popup/main.tsx +2 -2
- package/template/web-extension/package.json +4 -2
- package/template/web-extension/shared/components/app-context/index.ts +1 -0
- package/template/web-extension/shared/components/{app-context.tsx → app-context/view.tsx} +4 -2
- package/template/web-extension/shared/components/index.ts +1 -1
- package/template/web-extension/shared/styles/global-style.tsx +14 -0
- package/template/web-extension/shared/styles/index.ts +2 -2
- package/template/web-extension/vite-env.d.ts +3 -3
- package/template/web-extension/wxt.config.ts +10 -4
- package/template/nest/.eslintrc.js +0 -25
- package/template/nest/.gitignore +0 -35
- package/template/nest/.husky/pre-commit +0 -4
- package/template/nest/.prettierrc +0 -6
- package/template/nest/README.md +0 -73
- package/template/nest/nest-cli.json +0 -5
- package/template/nest/package.json +0 -82
- package/template/nest/src/app.controller.spec.ts +0 -22
- package/template/nest/src/app.controller.ts +0 -12
- package/template/nest/src/app.module.ts +0 -10
- package/template/nest/src/app.service.ts +0 -8
- package/template/nest/src/main.ts +0 -10
- package/template/nest/src/utils/transform.interceptor.ts +0 -26
- package/template/nest/test/app.e2e-spec.ts +0 -24
- package/template/nest/test/jest-e2e.json +0 -9
- package/template/nest/tsconfig.build.json +0 -5
- package/template/nest/tsconfig.json +0 -21
- package/template/web-app/next/.editorconfig +0 -14
- package/template/web-app/next/.eslintrc.json +0 -8
- package/template/web-app/next/.gitignore +0 -36
- package/template/web-app/next/.husky/commit-msg +0 -4
- package/template/web-app/next/.husky/pre-commit +0 -4
- package/template/web-app/next/.prettierrc +0 -12
- package/template/web-app/next/.stylelintrc +0 -29
- package/template/web-app/next/.vscode/extensions.json +0 -7
- package/template/web-app/next/README.md +0 -34
- package/template/web-app/next/app/favicon.ico +0 -0
- package/template/web-app/next/app/globals.css +0 -22
- package/template/web-app/next/app/layout.tsx +0 -18
- package/template/web-app/next/app/page.tsx +0 -113
- package/template/web-app/next/commitlint.config.cjs +0 -1
- package/template/web-app/next/next-env.d.ts +0 -5
- package/template/web-app/next/next.config.js +0 -5
- package/template/web-app/next/package.json +0 -47
- package/template/web-app/next/postcss.config.js +0 -6
- package/template/web-app/next/public/next.svg +0 -1
- package/template/web-app/next/public/vercel.svg +0 -1
- package/template/web-app/next/tailwind.config.js +0 -20
- package/template/web-app/next/tsconfig.json +0 -21
- package/template/web-app/react-rsbuild/domain/app/app.styled.ts +0 -3
- package/template/web-app/react-rsbuild/shared/theme/index.ts +0 -1
- package/template/web-app/react-vite/domain/app/app.styled.ts +0 -3
- package/template/web-app/react-vite/shared/theme/index.ts +0 -1
- package/template/web-app/vue/tailwind.config.cjs +0 -15
- package/template/web-app/vue-rsbuild/tailwind.config.cjs +0 -15
- package/template/web-extension/shared/styles/global.styled.ts +0 -9
- /package/template/web-app/{react-vite/shared/theme → react-rsbuild/shared/styles}/theme.styled.ts +0 -0
- /package/template/web-app/vue/{router → domain/router}/home/index.ts +0 -0
- /package/template/web-app/vue/{router → domain/router}/home/names.ts +0 -0
- /package/template/web-app/vue/{router → domain/router}/home/routes.ts +0 -0
- /package/template/web-app/vue/{router → domain/router}/index.ts +0 -0
- /package/template/web-app/vue/{router → domain/router}/names.ts +0 -0
- /package/template/web-app/vue-rsbuild/{router → domain/router}/home/index.ts +0 -0
- /package/template/web-app/vue-rsbuild/{router → domain/router}/home/names.ts +0 -0
- /package/template/web-app/vue-rsbuild/{router → domain/router}/home/routes.ts +0 -0
- /package/template/web-app/vue-rsbuild/{router → domain/router}/index.ts +0 -0
- /package/template/web-app/vue-rsbuild/{router → domain/router}/names.ts +0 -0
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@vitest/coverage-v8": "
|
|
19
|
+
"@vitest/coverage-v8": "3.1.2",
|
|
20
20
|
"eslint": "9.17.0",
|
|
21
21
|
"eslint-import-resolver-typescript": "3.7.0",
|
|
22
22
|
"eslint-plugin-import": "2.31.0",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"stylelint-config-standard-scss": "13.0.0",
|
|
26
26
|
"typescript": "5.8.2",
|
|
27
27
|
"typescript-eslint": "8.15.0",
|
|
28
|
-
"vitest": "
|
|
28
|
+
"vitest": "3.1.2"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react'
|
|
2
|
-
import { ThemeProvider } from '
|
|
3
|
-
import {
|
|
2
|
+
import { ThemeProvider } from '@emotion/react'
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
4
|
+
import { request } from '@/shared/service'
|
|
5
|
+
import { theme } from '@/shared/styles'
|
|
4
6
|
|
|
7
|
+
const queryClient = new QueryClient({
|
|
8
|
+
defaultOptions: {
|
|
9
|
+
queries: {
|
|
10
|
+
queryFn: async ({ queryKey }) => {
|
|
11
|
+
const { data } = await request.get(queryKey[0] as string, {
|
|
12
|
+
params: queryKey[1]
|
|
13
|
+
})
|
|
14
|
+
return data
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
})
|
|
5
19
|
export interface propsType {
|
|
6
20
|
children: ReactNode
|
|
7
21
|
}
|
|
8
22
|
export const Root: FunctionComponent<propsType> = props => {
|
|
9
|
-
return
|
|
23
|
+
return (
|
|
24
|
+
<QueryClientProvider client={queryClient}>
|
|
25
|
+
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
|
|
26
|
+
</QueryClientProvider>
|
|
27
|
+
)
|
|
10
28
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useLayoutEffect } from 'react'
|
|
1
|
+
import { useLayoutEffect, Suspense } from 'react'
|
|
2
2
|
import { RouterProvider } from 'react-router/dom'
|
|
3
3
|
import { request } from '@/shared/service'
|
|
4
4
|
import { routerInstance } from '@/domain/router'
|
|
5
|
-
import { GlobalStyle } from '
|
|
5
|
+
import { GlobalStyle } from '@/shared/styles'
|
|
6
6
|
import * as AppContext from './app-context'
|
|
7
7
|
|
|
8
8
|
export const Root = () => {
|
|
@@ -18,7 +18,9 @@ export const Root = () => {
|
|
|
18
18
|
return (
|
|
19
19
|
<AppContext.Root>
|
|
20
20
|
<GlobalStyle />
|
|
21
|
-
<
|
|
21
|
+
<Suspense fallback={<>loading...</>}>
|
|
22
|
+
<RouterProvider router={routerInstance} />
|
|
23
|
+
</Suspense>
|
|
22
24
|
</AppContext.Root>
|
|
23
25
|
)
|
|
24
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createRoot } from 'react-dom/client'
|
|
2
|
-
import { App } from '@/domain/app'
|
|
3
|
-
|
|
4
|
-
export default function () {
|
|
5
|
-
createRoot(document.getElementById('root') as HTMLElement).render(<App.Root />)
|
|
6
|
-
}
|
|
1
|
+
import { createRoot } from 'react-dom/client'
|
|
2
|
+
import { App } from '@/domain/app'
|
|
3
|
+
|
|
4
|
+
export default function () {
|
|
5
|
+
createRoot(document.getElementById('root') as HTMLElement).render(<App.Root />)
|
|
6
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="@rsbuild/core/types" />
|
|
2
|
-
import '
|
|
3
|
-
import { themeType } from './shared/
|
|
2
|
+
import '@emotion/react'
|
|
3
|
+
import { themeType } from './shared/styles'
|
|
4
4
|
|
|
5
5
|
declare module 'styled-components' {
|
|
6
6
|
export interface DefaultTheme extends themeType {}
|
|
@@ -26,3 +26,7 @@ declare global {
|
|
|
26
26
|
export default ReactComponent
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
declare module '@emotion/react' {
|
|
31
|
+
export interface Theme extends themeType {}
|
|
32
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { startApp } from '@/domain/app'
|
|
2
|
-
|
|
3
|
-
startApp()
|
|
1
|
+
import { startApp } from '@/domain/app'
|
|
2
|
+
|
|
3
|
+
startApp()
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"commit": "git add . && npm run cz"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"@emotion/react": "11.14.0",
|
|
23
|
+
"@emotion/styled": "11.14.0",
|
|
24
|
+
"@tanstack/react-query": "5.51.15",
|
|
22
25
|
"axios": "1.7.9",
|
|
23
26
|
"define-zustand": "3.2.1",
|
|
24
27
|
"immer": "10.0.1",
|
|
@@ -28,7 +31,6 @@
|
|
|
28
31
|
"react-dom": "18.3.1",
|
|
29
32
|
"react-router": "7.5.0",
|
|
30
33
|
"react-use": "17.5.0",
|
|
31
|
-
"styled-components": "6.1.11",
|
|
32
34
|
"type-fest": "4.33.0",
|
|
33
35
|
"zustand": "5.0.3"
|
|
34
36
|
},
|
|
@@ -40,10 +42,10 @@
|
|
|
40
42
|
"@rsbuild/core": "1.2.19",
|
|
41
43
|
"@rsbuild/plugin-eslint": "1.1.1",
|
|
42
44
|
"@rsbuild/plugin-react": "1.1.1",
|
|
43
|
-
"@rsbuild/plugin-styled-components": "1.2.1",
|
|
44
45
|
"@rsbuild/plugin-svgr": "1.0.7",
|
|
45
46
|
"@rsbuild/plugin-type-check": "1.2.1",
|
|
46
47
|
"@rsdoctor/rspack-plugin": "0.4.13",
|
|
48
|
+
"@swc/plugin-emotion": "9.0.3",
|
|
47
49
|
"@types/lodash-es": "4.17.12",
|
|
48
50
|
"@types/node": "18.16.0",
|
|
49
51
|
"@types/qs": "6.9.7",
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import styled
|
|
1
|
+
import styled from '@emotion/styled'
|
|
2
2
|
|
|
3
|
-
export const StyledRoot = styled.div
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`
|
|
7
|
-
})
|
|
3
|
+
export const StyledRoot = styled.div`
|
|
4
|
+
${props => props.theme.tools.flex('center', 'center')}
|
|
5
|
+
`
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import { useHomeData } from '@/shared/service'
|
|
2
|
+
import { StyledRoot } from './view.styled'
|
|
3
|
+
|
|
4
|
+
export default function Home() {
|
|
5
|
+
const { data } = useHomeData()
|
|
6
|
+
|
|
7
|
+
console.log('data', data)
|
|
8
|
+
|
|
9
|
+
return <StyledRoot>sdfs</StyledRoot>
|
|
10
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
plugins: {
|
|
3
|
-
'postcss-import': {},
|
|
4
|
-
autoprefixer: {},
|
|
5
|
-
...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {})
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
plugins: {
|
|
3
|
+
'postcss-import': {},
|
|
4
|
+
autoprefixer: {},
|
|
5
|
+
...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {})
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { defineConfig, loadEnv } from '@rsbuild/core'
|
|
2
2
|
import { pluginReact } from '@rsbuild/plugin-react'
|
|
3
|
-
import { pluginStyledComponents } from '@rsbuild/plugin-styled-components'
|
|
4
3
|
import { pluginEslint } from '@rsbuild/plugin-eslint'
|
|
5
4
|
import StylelintWebpackPlugin from 'stylelint-webpack-plugin'
|
|
6
5
|
import { pluginTypeCheck } from '@rsbuild/plugin-type-check'
|
|
@@ -10,11 +9,12 @@ import { createChunks } from './scripts'
|
|
|
10
9
|
|
|
11
10
|
export default defineConfig(({ envMode, command }) => {
|
|
12
11
|
const { parsed: env } = loadEnv()
|
|
12
|
+
|
|
13
13
|
return {
|
|
14
14
|
html: {
|
|
15
15
|
template: './index.html',
|
|
16
16
|
title: 'Rsbuild + React + TS',
|
|
17
|
-
favicon: './shared/assets/react.
|
|
17
|
+
favicon: './shared/assets/react.svg'
|
|
18
18
|
},
|
|
19
19
|
source: {
|
|
20
20
|
entry: {
|
|
@@ -41,6 +41,13 @@ export default defineConfig(({ envMode, command }) => {
|
|
|
41
41
|
new StylelintWebpackPlugin(),
|
|
42
42
|
process.env.RSDOCTOR && new RsdoctorRspackPlugin()
|
|
43
43
|
]
|
|
44
|
+
},
|
|
45
|
+
swc: {
|
|
46
|
+
jsc: {
|
|
47
|
+
experimental: {
|
|
48
|
+
plugins: [['@swc/plugin-emotion', {}]]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
44
51
|
}
|
|
45
52
|
},
|
|
46
53
|
plugins: [
|
|
@@ -51,14 +58,12 @@ export default defineConfig(({ envMode, command }) => {
|
|
|
51
58
|
configType: 'flat'
|
|
52
59
|
}
|
|
53
60
|
}),
|
|
54
|
-
pluginStyledComponents({
|
|
55
|
-
ssr: false,
|
|
56
|
-
displayName: false,
|
|
57
|
-
fileName: false,
|
|
58
|
-
transpileTemplateLiterals: false
|
|
59
|
-
}),
|
|
60
61
|
pluginSvgr(),
|
|
61
|
-
pluginReact(
|
|
62
|
+
pluginReact({
|
|
63
|
+
swcReactOptions: {
|
|
64
|
+
importSource: '@emotion/react'
|
|
65
|
+
}
|
|
66
|
+
})
|
|
62
67
|
],
|
|
63
68
|
performance: {
|
|
64
69
|
removeConsole: command === 'build' ? ['log'] : false,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useQuery, UndefinedInitialDataOptions } from '@tanstack/react-query'
|
|
2
2
|
import { HOME_DATA } from './api'
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export const useHomeData = (options?: UndefinedInitialDataOptions) => {
|
|
5
|
+
return useQuery({
|
|
6
|
+
...options,
|
|
7
|
+
queryKey: [HOME_DATA, ...(options?.queryKey || [])]
|
|
8
|
+
})
|
|
7
9
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react'
|
|
2
|
+
import { css, Global } from '@emotion/react'
|
|
3
|
+
|
|
4
|
+
export const GlobalStyle: FunctionComponent<{ nameSpace?: string }> = props => {
|
|
5
|
+
return (
|
|
6
|
+
<Global
|
|
7
|
+
styles={css`
|
|
8
|
+
${props.nameSpace ? '.' + props.nameSpace : 'body'} {
|
|
9
|
+
margin: 0;
|
|
10
|
+
}
|
|
11
|
+
`}
|
|
12
|
+
/>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react'
|
|
2
|
-
import { ThemeProvider } from '
|
|
3
|
-
import {
|
|
2
|
+
import { ThemeProvider } from '@emotion/react'
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
4
|
+
import { request } from '@/shared/service'
|
|
5
|
+
import { theme } from '@/shared/styles'
|
|
4
6
|
|
|
7
|
+
const queryClient = new QueryClient({
|
|
8
|
+
defaultOptions: {
|
|
9
|
+
queries: {
|
|
10
|
+
queryFn: async ({ queryKey }) => {
|
|
11
|
+
const { data } = await request.get(queryKey[0] as string, {
|
|
12
|
+
params: queryKey[1]
|
|
13
|
+
})
|
|
14
|
+
return data
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
})
|
|
5
19
|
export interface propsType {
|
|
6
20
|
children: ReactNode
|
|
7
21
|
}
|
|
8
22
|
export const Root: FunctionComponent<propsType> = props => {
|
|
9
|
-
return
|
|
23
|
+
return (
|
|
24
|
+
<QueryClientProvider client={queryClient}>
|
|
25
|
+
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
|
|
26
|
+
</QueryClientProvider>
|
|
27
|
+
)
|
|
10
28
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useLayoutEffect } from 'react'
|
|
1
|
+
import { useLayoutEffect, Suspense } from 'react'
|
|
2
2
|
import { RouterProvider } from 'react-router/dom'
|
|
3
3
|
import { request } from '@/shared/service'
|
|
4
4
|
import { routerInstance } from '@/domain/router'
|
|
5
|
-
import { GlobalStyle } from '
|
|
5
|
+
import { GlobalStyle } from '@/shared/styles'
|
|
6
6
|
import * as AppContext from './app-context'
|
|
7
7
|
|
|
8
8
|
export const Root = () => {
|
|
@@ -18,7 +18,9 @@ export const Root = () => {
|
|
|
18
18
|
return (
|
|
19
19
|
<AppContext.Root>
|
|
20
20
|
<GlobalStyle />
|
|
21
|
-
<
|
|
21
|
+
<Suspense fallback={<>loading...</>}>
|
|
22
|
+
<RouterProvider router={routerInstance} />
|
|
23
|
+
</Suspense>
|
|
22
24
|
</AppContext.Root>
|
|
23
25
|
)
|
|
24
26
|
}
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"commit": "git add . && npm run cz"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@emotion/react": "11.14.0",
|
|
22
|
+
"@emotion/styled": "11.14.0",
|
|
23
|
+
"@tanstack/react-query": "5.51.15",
|
|
21
24
|
"axios": "1.7.9",
|
|
22
25
|
"define-zustand": "3.2.1",
|
|
23
26
|
"immer": "10.0.1",
|
|
@@ -27,7 +30,6 @@
|
|
|
27
30
|
"react-dom": "18.3.1",
|
|
28
31
|
"react-router": "7.5.0",
|
|
29
32
|
"react-use": "17.5.0",
|
|
30
|
-
"styled-components": "6.1.11",
|
|
31
33
|
"type-fest": "4.33.0",
|
|
32
34
|
"zustand": "5.0.3"
|
|
33
35
|
},
|
|
@@ -35,6 +37,7 @@
|
|
|
35
37
|
"@commitlint/cli": "17.6.1",
|
|
36
38
|
"@commitlint/config-conventional": "17.6.1",
|
|
37
39
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
40
|
+
"@emotion/babel-plugin": "11.13.5",
|
|
38
41
|
"@eslint/js": "9.15.0",
|
|
39
42
|
"@faker-js/faker": "8.4.1",
|
|
40
43
|
"@types/lodash-es": "4.17.12",
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import styled
|
|
1
|
+
import styled from '@emotion/styled'
|
|
2
2
|
|
|
3
|
-
export const StyledRoot = styled.div
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`
|
|
7
|
-
})
|
|
3
|
+
export const StyledRoot = styled.div`
|
|
4
|
+
${props => props.theme.tools.flex('center', 'center')}
|
|
5
|
+
`
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fetchHomeData } from '@/shared/service'
|
|
1
|
+
import { useHomeData } from '@/shared/service'
|
|
3
2
|
import { StyledRoot } from './view.styled'
|
|
4
3
|
|
|
5
4
|
export default function Home() {
|
|
6
|
-
const
|
|
5
|
+
const { data } = useHomeData()
|
|
7
6
|
|
|
8
|
-
console.log('data',
|
|
7
|
+
console.log('data', data)
|
|
9
8
|
|
|
10
9
|
return <StyledRoot>sdfs</StyledRoot>
|
|
11
10
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useQuery, UndefinedInitialDataOptions } from '@tanstack/react-query'
|
|
2
2
|
import { HOME_DATA } from './api'
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export const useHomeData = (options?: UndefinedInitialDataOptions) => {
|
|
5
|
+
return useQuery({
|
|
6
|
+
...options,
|
|
7
|
+
queryKey: [HOME_DATA, ...(options?.queryKey || [])]
|
|
8
|
+
})
|
|
7
9
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react'
|
|
2
|
+
import { css, Global } from '@emotion/react'
|
|
3
|
+
|
|
4
|
+
export const GlobalStyle: FunctionComponent<{ nameSpace?: string }> = props => {
|
|
5
|
+
return (
|
|
6
|
+
<Global
|
|
7
|
+
styles={css`
|
|
8
|
+
${props.nameSpace ? '.' + props.nameSpace : 'body'} {
|
|
9
|
+
margin: 0;
|
|
10
|
+
}
|
|
11
|
+
`}
|
|
12
|
+
/>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
/// <reference types="vite-plugin-svgr/client" />
|
|
3
|
-
|
|
4
|
-
import
|
|
3
|
+
|
|
4
|
+
import '@emotion/react'
|
|
5
|
+
import { themeType } from './shared/styles'
|
|
5
6
|
|
|
6
7
|
declare global {
|
|
7
8
|
interface ImportMetaEnv {
|
|
@@ -15,6 +16,6 @@ declare global {
|
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
declare module '
|
|
19
|
-
export interface
|
|
19
|
+
declare module '@emotion/react' {
|
|
20
|
+
export interface Theme extends themeType {}
|
|
20
21
|
}
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { defineConfig, loadEnv } from 'vite'
|
|
2
|
-
import react from '@vitejs/plugin-react'
|
|
3
|
-
import svgr from 'vite-plugin-svgr'
|
|
4
|
-
import mockDevServer from 'vite-plugin-mock-dev-server'
|
|
5
|
-
import checker from 'vite-plugin-checker'
|
|
6
|
-
import { visualizer } from 'rollup-plugin-visualizer'
|
|
7
|
-
import { includes } from 'lodash-es'
|
|
8
|
-
import { createChunks } from './scripts'
|
|
9
|
-
|
|
10
|
-
// https://vitejs.dev/config/
|
|
11
|
-
export default defineConfig(({ mode }) => {
|
|
12
|
-
const env = loadEnv(mode, process.cwd(), '')
|
|
13
|
-
const proxyBaseUrl = env.VITE_BASE_URL + env.VITE_API_HOST
|
|
14
|
-
const plugins: any[] = [
|
|
15
|
-
svgr(),
|
|
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
|
-
if (mode === 'analyse') {
|
|
42
|
-
plugins.push(visualizer({ open: true, sourcemap: true, brotliSize: true, gzipSize: true }))
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
base: env.VITE_BASE_URL,
|
|
47
|
-
plugins,
|
|
48
|
-
resolve: {
|
|
49
|
-
alias: {
|
|
50
|
-
'@': __dirname
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
esbuild: {
|
|
54
|
-
drop: includes(['production', 'analyse'], mode) ? ['console', 'debugger'] : []
|
|
55
|
-
},
|
|
56
|
-
build: {
|
|
57
|
-
sourcemap: mode === 'analyse',
|
|
58
|
-
reportCompressedSize: mode === 'analyse',
|
|
59
|
-
rollupOptions: {
|
|
60
|
-
output: {
|
|
61
|
-
manualChunks: createChunks({
|
|
62
|
-
react: ['react', 'react-dom']
|
|
63
|
-
})
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
server: {
|
|
68
|
-
host: '0.0.0.0',
|
|
69
|
-
proxy: {
|
|
70
|
-
[proxyBaseUrl]: {
|
|
71
|
-
target: 'http://127.0.0.1',
|
|
72
|
-
changeOrigin: true,
|
|
73
|
-
rewrite: path => path.replace(proxyBaseUrl, '')
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
})
|
|
1
|
+
import { defineConfig, loadEnv } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
import svgr from 'vite-plugin-svgr'
|
|
4
|
+
import mockDevServer from 'vite-plugin-mock-dev-server'
|
|
5
|
+
import checker from 'vite-plugin-checker'
|
|
6
|
+
import { visualizer } from 'rollup-plugin-visualizer'
|
|
7
|
+
import { includes } from 'lodash-es'
|
|
8
|
+
import { createChunks } from './scripts'
|
|
9
|
+
|
|
10
|
+
// https://vitejs.dev/config/
|
|
11
|
+
export default defineConfig(({ mode }) => {
|
|
12
|
+
const env = loadEnv(mode, process.cwd(), '')
|
|
13
|
+
const proxyBaseUrl = env.VITE_BASE_URL + env.VITE_API_HOST
|
|
14
|
+
const plugins: any[] = [
|
|
15
|
+
svgr(),
|
|
16
|
+
mockDevServer({
|
|
17
|
+
include: ['**/*.mock.{ts,js}']
|
|
18
|
+
}),
|
|
19
|
+
checker({
|
|
20
|
+
enableBuild: false,
|
|
21
|
+
typescript: true,
|
|
22
|
+
eslint: { useFlatConfig: true, lintCommand: 'eslint', dev: { logLevel: ['error'] } }
|
|
23
|
+
}),
|
|
24
|
+
react({
|
|
25
|
+
babel: {
|
|
26
|
+
plugins: [
|
|
27
|
+
[
|
|
28
|
+
'babel-plugin-styled-components',
|
|
29
|
+
{
|
|
30
|
+
ssr: false,
|
|
31
|
+
displayName: false,
|
|
32
|
+
fileName: false,
|
|
33
|
+
transpileTemplateLiterals: false
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
if (mode === 'analyse') {
|
|
42
|
+
plugins.push(visualizer({ open: true, sourcemap: true, brotliSize: true, gzipSize: true }))
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
base: env.VITE_BASE_URL,
|
|
47
|
+
plugins,
|
|
48
|
+
resolve: {
|
|
49
|
+
alias: {
|
|
50
|
+
'@': __dirname
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
esbuild: {
|
|
54
|
+
drop: includes(['production', 'analyse'], mode) ? ['console', 'debugger'] : []
|
|
55
|
+
},
|
|
56
|
+
build: {
|
|
57
|
+
sourcemap: mode === 'analyse',
|
|
58
|
+
reportCompressedSize: mode === 'analyse',
|
|
59
|
+
rollupOptions: {
|
|
60
|
+
output: {
|
|
61
|
+
manualChunks: createChunks({
|
|
62
|
+
react: ['react', 'react-dom']
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
server: {
|
|
68
|
+
host: '0.0.0.0',
|
|
69
|
+
proxy: {
|
|
70
|
+
[proxyBaseUrl]: {
|
|
71
|
+
target: 'http://127.0.0.1',
|
|
72
|
+
changeOrigin: true,
|
|
73
|
+
rewrite: path => path.replace(proxyBaseUrl, '')
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
})
|