create-packer 1.45.17 → 1.45.19
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/.vscode/extensions.json +0 -1
- package/template/web-app/react-rsbuild/README.md +1 -1
- package/template/web-app/react-rsbuild/domain/app/components/app-context.tsx +8 -6
- package/template/web-app/react-rsbuild/env.d.ts +7 -0
- package/template/web-app/react-rsbuild/package.json +3 -2
- package/template/web-app/react-rsbuild/pages/home/view.styled.ts +5 -0
- package/template/web-app/react-rsbuild/pages/home/view.tsx +10 -11
- package/template/web-app/react-rsbuild/rsbuild.config.ts +12 -1
- package/template/web-app/react-rsbuild/shared/styles/global.ts +5 -5
- package/template/web-app/react-rsbuild/shared/styles/index.ts +1 -1
- package/template/web-app/react-rsbuild/tsconfig.json +1 -0
- package/template/web-app/react-vite/.vscode/extensions.json +0 -1
- package/template/web-app/react-vite/README.md +1 -1
- package/template/web-app/react-vite/domain/app/components/app-context.tsx +8 -6
- package/template/web-app/react-vite/package.json +2 -1
- package/template/web-app/react-vite/pages/home/view.styled.ts +5 -0
- package/template/web-app/react-vite/pages/home/view.tsx +2 -3
- package/template/web-app/react-vite/shared/styles/global.ts +5 -5
- package/template/web-app/react-vite/shared/styles/index.ts +0 -1
- package/template/web-app/react-vite/tsconfig.json +1 -0
- package/template/web-app/react-vite/vite-env.d.ts +15 -6
- package/template/web-app/react-vite/vite.config.ts +3 -1
- package/template/web-app/vue-rsbuild/package.json +73 -73
- package/template/web-extension/.vscode/extensions.json +0 -1
- package/template/web-extension/README.md +1 -1
- package/template/web-extension/eslint.config.js +0 -1
- package/template/web-extension/package.json +2 -1
- package/template/web-extension/shared/components/app-context/view.tsx +8 -6
- package/template/web-extension/shared/styles/global.ts +6 -6
- package/template/web-extension/shared/styles/index.ts +0 -1
- package/template/web-extension/tsconfig.json +1 -0
- package/template/web-extension/vite-env.d.ts +15 -6
- package/template/web-extension/wxt.config.ts +1 -1
- package/template/web-app/react-rsbuild/pages/home/view.css.ts +0 -7
- package/template/web-app/react-rsbuild/shared/styles/tss.ts +0 -6
- package/template/web-app/react-vite/pages/home/view.css.ts +0 -7
- package/template/web-app/react-vite/shared/styles/tss.ts +0 -6
- package/template/web-extension/shared/styles/tss.ts +0 -6
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react'
|
|
2
2
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
3
|
-
import {
|
|
3
|
+
import { Global, ThemeProvider } from '@emotion/react'
|
|
4
4
|
import { request } from '@/shared/service'
|
|
5
|
-
import { globalCss } from '@/shared/styles'
|
|
5
|
+
import { globalCss, theme } from '@/shared/styles'
|
|
6
6
|
|
|
7
7
|
const queryClient = new QueryClient({
|
|
8
8
|
defaultOptions: {
|
|
@@ -21,9 +21,11 @@ export interface propsType {
|
|
|
21
21
|
}
|
|
22
22
|
export const Root: FunctionComponent<propsType> = props => {
|
|
23
23
|
return (
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
<ThemeProvider theme={theme}>
|
|
25
|
+
<QueryClientProvider client={queryClient}>
|
|
26
|
+
<Global styles={globalCss} />
|
|
27
|
+
{props.children}
|
|
28
|
+
</QueryClientProvider>
|
|
29
|
+
</ThemeProvider>
|
|
28
30
|
)
|
|
29
31
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="@rsbuild/core/types" />
|
|
2
2
|
|
|
3
|
+
import '@emotion/react'
|
|
4
|
+
import { type themeType } from '@/shared/styles'
|
|
5
|
+
|
|
3
6
|
declare global {
|
|
4
7
|
interface ImportMetaEnv {
|
|
5
8
|
readonly PUBLIC_BASE_URL: string
|
|
@@ -19,3 +22,7 @@ declare module '*.svg?react' {
|
|
|
19
22
|
const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement>>
|
|
20
23
|
export default ReactComponent
|
|
21
24
|
}
|
|
25
|
+
|
|
26
|
+
declare module '@emotion/react' {
|
|
27
|
+
export interface Theme extends themeType {}
|
|
28
|
+
}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@emotion/react": "11.14.0",
|
|
23
|
+
"@emotion/styled": "11.14.1",
|
|
23
24
|
"@tanstack/react-query": "5.51.15",
|
|
24
25
|
"axios": "1.7.9",
|
|
25
26
|
"define-zustand": "3.4.0",
|
|
@@ -30,7 +31,6 @@
|
|
|
30
31
|
"react-dom": "18.3.1",
|
|
31
32
|
"react-router": "7.5.0",
|
|
32
33
|
"react-use": "17.5.0",
|
|
33
|
-
"tss-react": "4.9.19",
|
|
34
34
|
"type-fest": "4.33.0",
|
|
35
35
|
"zustand": "5.0.3"
|
|
36
36
|
},
|
|
@@ -39,12 +39,13 @@
|
|
|
39
39
|
"@commitlint/config-conventional": "17.6.1",
|
|
40
40
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
41
41
|
"@eslint/js": "9.15.0",
|
|
42
|
-
"@rsbuild/core": "1.5.
|
|
42
|
+
"@rsbuild/core": "1.5.10",
|
|
43
43
|
"@rsbuild/plugin-eslint": "1.1.2",
|
|
44
44
|
"@rsbuild/plugin-react": "1.4.0",
|
|
45
45
|
"@rsbuild/plugin-svgr": "1.2.2",
|
|
46
46
|
"@rsbuild/plugin-type-check": "1.2.4",
|
|
47
47
|
"@rsdoctor/rspack-plugin": "1.2.3",
|
|
48
|
+
"@swc/plugin-emotion": "11.1.0",
|
|
48
49
|
"@types/node": "18.16.0",
|
|
49
50
|
"@types/qs": "6.9.7",
|
|
50
51
|
"@types/react": "18.3.3",
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { useHomeData } from '@/shared/service'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export default function Home() {
|
|
5
|
-
const { data } = useHomeData()
|
|
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
|
+
}
|
|
@@ -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: [
|
|
@@ -52,7 +59,11 @@ export default defineConfig(({ envMode, command }) => {
|
|
|
52
59
|
}
|
|
53
60
|
}),
|
|
54
61
|
pluginSvgr(),
|
|
55
|
-
pluginReact(
|
|
62
|
+
pluginReact({
|
|
63
|
+
swcReactOptions: {
|
|
64
|
+
importSource: '@emotion/react'
|
|
65
|
+
}
|
|
66
|
+
})
|
|
56
67
|
],
|
|
57
68
|
performance: {
|
|
58
69
|
removeConsole: command === 'build' ? ['log'] : false,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './global'
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './theme'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react'
|
|
2
2
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
3
|
-
import {
|
|
3
|
+
import { Global, ThemeProvider } from '@emotion/react'
|
|
4
4
|
import { request } from '@/shared/service'
|
|
5
|
-
import { globalCss } from '@/shared/styles'
|
|
5
|
+
import { globalCss, theme } from '@/shared/styles'
|
|
6
6
|
|
|
7
7
|
const queryClient = new QueryClient({
|
|
8
8
|
defaultOptions: {
|
|
@@ -21,9 +21,11 @@ export interface propsType {
|
|
|
21
21
|
}
|
|
22
22
|
export const Root: FunctionComponent<propsType> = props => {
|
|
23
23
|
return (
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
<ThemeProvider theme={theme}>
|
|
25
|
+
<QueryClientProvider client={queryClient}>
|
|
26
|
+
<Global styles={globalCss} />
|
|
27
|
+
{props.children}
|
|
28
|
+
</QueryClientProvider>
|
|
29
|
+
</ThemeProvider>
|
|
28
30
|
)
|
|
29
31
|
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@emotion/react": "11.14.0",
|
|
22
|
+
"@emotion/styled": "11.14.1",
|
|
22
23
|
"@tanstack/react-query": "5.51.15",
|
|
23
24
|
"axios": "1.7.9",
|
|
24
25
|
"define-zustand": "3.4.0",
|
|
@@ -29,7 +30,6 @@
|
|
|
29
30
|
"react-dom": "18.3.1",
|
|
30
31
|
"react-router": "7.5.0",
|
|
31
32
|
"react-use": "17.5.0",
|
|
32
|
-
"tss-react": "4.9.19",
|
|
33
33
|
"type-fest": "4.33.0",
|
|
34
34
|
"zustand": "5.0.3"
|
|
35
35
|
},
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@commitlint/cli": "17.6.1",
|
|
38
38
|
"@commitlint/config-conventional": "17.6.1",
|
|
39
39
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
40
|
+
"@emotion/babel-plugin": "11.13.5",
|
|
40
41
|
"@eslint/js": "9.15.0",
|
|
41
42
|
"@faker-js/faker": "8.4.1",
|
|
42
43
|
"@types/node": "18.16.0",
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useHomeData } from '@/shared/service'
|
|
2
|
-
import {
|
|
2
|
+
import { StyledRoot } from './view.styled'
|
|
3
3
|
|
|
4
4
|
export default function Home() {
|
|
5
5
|
const { data } = useHomeData()
|
|
6
|
-
const { classes } = useStyles()
|
|
7
6
|
|
|
8
7
|
console.log('data', data)
|
|
9
8
|
|
|
10
|
-
return <
|
|
9
|
+
return <StyledRoot>sdfs</StyledRoot>
|
|
11
10
|
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
/// <reference types="vite-plugin-svgr/client" />
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import '@emotion/react'
|
|
5
|
+
import { type themeType } from '@/shared/styles'
|
|
6
|
+
|
|
7
|
+
declare global {
|
|
8
|
+
interface ImportMetaEnv {
|
|
9
|
+
readonly VITE_BASE_URL: string
|
|
10
|
+
readonly VITE_API_HOST: string
|
|
11
|
+
// 更多环境变量...
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ImportMeta {
|
|
15
|
+
readonly env: ImportMetaEnv
|
|
16
|
+
}
|
|
8
17
|
}
|
|
9
18
|
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
declare module '@emotion/react' {
|
|
20
|
+
export interface Theme extends themeType {}
|
|
12
21
|
}
|
|
@@ -20,7 +20,9 @@ export default defineConfig(({ mode }) => {
|
|
|
20
20
|
typescript: true,
|
|
21
21
|
eslint: { useFlatConfig: true, lintCommand: 'eslint', dev: { logLevel: ['error'] } }
|
|
22
22
|
}),
|
|
23
|
-
react(
|
|
23
|
+
react({
|
|
24
|
+
babel: { plugins: [['@emotion']] }
|
|
25
|
+
})
|
|
24
26
|
]
|
|
25
27
|
|
|
26
28
|
if (mode === 'analyse') {
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vue-vite",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"prepare": "husky",
|
|
8
|
-
"dev": "rsbuild dev",
|
|
9
|
-
"build": "rsbuild build",
|
|
10
|
-
"build:analyse": "rsbuild build --env-mode analyse",
|
|
11
|
-
"build:rsdoctor": "cross-env RSDOCTOR=true rsbuild build",
|
|
12
|
-
"preview": "rsbuild preview",
|
|
13
|
-
"up:rsbuild": "pnpm up @rsbuild/* -L",
|
|
14
|
-
"format": "prettier --write \"**/*.{vue,ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
15
|
-
"lint": "vue-tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
|
|
16
|
-
"lint:fix": "eslint --fix && stylelint **/*.{css,scss,less} --fix",
|
|
17
|
-
"cz": "cz",
|
|
18
|
-
"push": "npm run commit && git push",
|
|
19
|
-
"commit": "git add . && npm run cz",
|
|
20
|
-
"up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L"
|
|
21
|
-
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"axios": "1.7.9",
|
|
24
|
-
"es-toolkit": "1.39.8",
|
|
25
|
-
"pinia": "3.0.3",
|
|
26
|
-
"tailwindcss": "4.1.4",
|
|
27
|
-
"type-fest": "4.33.0",
|
|
28
|
-
"vue": "3.5.20",
|
|
29
|
-
"vue-router": "4.5.1"
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@commitlint/cli": "17.6.1",
|
|
33
|
-
"@commitlint/config-conventional": "17.6.1",
|
|
34
|
-
"@commitlint/cz-commitlint": "17.5.0",
|
|
35
|
-
"@eslint/js": "9.15.0",
|
|
36
|
-
"@faker-js/faker": "8.4.1",
|
|
37
|
-
"@rsbuild/core": "1.5.
|
|
38
|
-
"@rsbuild/plugin-eslint": "1.1.2",
|
|
39
|
-
"@rsbuild/plugin-type-check": "1.2.4",
|
|
40
|
-
"@rsbuild/plugin-vue": "1.1.2",
|
|
41
|
-
"@rsdoctor/rspack-plugin": "1.2.3",
|
|
42
|
-
"@tailwindcss/postcss": "4.1.4",
|
|
43
|
-
"@types/mockjs": "1.0.10",
|
|
44
|
-
"autoprefixer": "10.4.14",
|
|
45
|
-
"commitizen": "4.3.0",
|
|
46
|
-
"cross-env": "7.0.3",
|
|
47
|
-
"cssnano": "6.0.0",
|
|
48
|
-
"eslint": "9.17.0",
|
|
49
|
-
"eslint-import-resolver-typescript": "3.7.0",
|
|
50
|
-
"eslint-plugin-import": "2.31.0",
|
|
51
|
-
"eslint-plugin-vue": "9.32.0",
|
|
52
|
-
"globals": "15.12.0",
|
|
53
|
-
"husky": "9.1.6",
|
|
54
|
-
"inquirer": "8.1.2",
|
|
55
|
-
"postcss": "8.4.38",
|
|
56
|
-
"postcss-html": "1.8.0",
|
|
57
|
-
"postcss-import": "16.1.0",
|
|
58
|
-
"postcss-nesting": "12.1.1",
|
|
59
|
-
"prettier": "3.2.5",
|
|
60
|
-
"rollup-plugin-visualizer": "5.12.0",
|
|
61
|
-
"stylelint": "16.10.0",
|
|
62
|
-
"stylelint-config-standard-scss": "13.1.0",
|
|
63
|
-
"stylelint-webpack-plugin": "5.0.0",
|
|
64
|
-
"typescript": "5.8.2",
|
|
65
|
-
"typescript-eslint": "8.15.0",
|
|
66
|
-
"vue-tsc": "3.0.6"
|
|
67
|
-
},
|
|
68
|
-
"config": {
|
|
69
|
-
"commitizen": {
|
|
70
|
-
"path": "@commitlint/cz-commitlint"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "vue-vite",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"prepare": "husky",
|
|
8
|
+
"dev": "rsbuild dev",
|
|
9
|
+
"build": "rsbuild build",
|
|
10
|
+
"build:analyse": "rsbuild build --env-mode analyse",
|
|
11
|
+
"build:rsdoctor": "cross-env RSDOCTOR=true rsbuild build",
|
|
12
|
+
"preview": "rsbuild preview",
|
|
13
|
+
"up:rsbuild": "pnpm up @rsbuild/* -L",
|
|
14
|
+
"format": "prettier --write \"**/*.{vue,ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
15
|
+
"lint": "vue-tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
|
|
16
|
+
"lint:fix": "eslint --fix && stylelint **/*.{css,scss,less} --fix",
|
|
17
|
+
"cz": "cz",
|
|
18
|
+
"push": "npm run commit && git push",
|
|
19
|
+
"commit": "git add . && npm run cz",
|
|
20
|
+
"up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"axios": "1.7.9",
|
|
24
|
+
"es-toolkit": "1.39.8",
|
|
25
|
+
"pinia": "3.0.3",
|
|
26
|
+
"tailwindcss": "4.1.4",
|
|
27
|
+
"type-fest": "4.33.0",
|
|
28
|
+
"vue": "3.5.20",
|
|
29
|
+
"vue-router": "4.5.1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@commitlint/cli": "17.6.1",
|
|
33
|
+
"@commitlint/config-conventional": "17.6.1",
|
|
34
|
+
"@commitlint/cz-commitlint": "17.5.0",
|
|
35
|
+
"@eslint/js": "9.15.0",
|
|
36
|
+
"@faker-js/faker": "8.4.1",
|
|
37
|
+
"@rsbuild/core": "1.5.10",
|
|
38
|
+
"@rsbuild/plugin-eslint": "1.1.2",
|
|
39
|
+
"@rsbuild/plugin-type-check": "1.2.4",
|
|
40
|
+
"@rsbuild/plugin-vue": "1.1.2",
|
|
41
|
+
"@rsdoctor/rspack-plugin": "1.2.3",
|
|
42
|
+
"@tailwindcss/postcss": "4.1.4",
|
|
43
|
+
"@types/mockjs": "1.0.10",
|
|
44
|
+
"autoprefixer": "10.4.14",
|
|
45
|
+
"commitizen": "4.3.0",
|
|
46
|
+
"cross-env": "7.0.3",
|
|
47
|
+
"cssnano": "6.0.0",
|
|
48
|
+
"eslint": "9.17.0",
|
|
49
|
+
"eslint-import-resolver-typescript": "3.7.0",
|
|
50
|
+
"eslint-plugin-import": "2.31.0",
|
|
51
|
+
"eslint-plugin-vue": "9.32.0",
|
|
52
|
+
"globals": "15.12.0",
|
|
53
|
+
"husky": "9.1.6",
|
|
54
|
+
"inquirer": "8.1.2",
|
|
55
|
+
"postcss": "8.4.38",
|
|
56
|
+
"postcss-html": "1.8.0",
|
|
57
|
+
"postcss-import": "16.1.0",
|
|
58
|
+
"postcss-nesting": "12.1.1",
|
|
59
|
+
"prettier": "3.2.5",
|
|
60
|
+
"rollup-plugin-visualizer": "5.12.0",
|
|
61
|
+
"stylelint": "16.10.0",
|
|
62
|
+
"stylelint-config-standard-scss": "13.1.0",
|
|
63
|
+
"stylelint-webpack-plugin": "5.0.0",
|
|
64
|
+
"typescript": "5.8.2",
|
|
65
|
+
"typescript-eslint": "8.15.0",
|
|
66
|
+
"vue-tsc": "3.0.6"
|
|
67
|
+
},
|
|
68
|
+
"config": {
|
|
69
|
+
"commitizen": {
|
|
70
|
+
"path": "@commitlint/cz-commitlint"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -96,7 +96,6 @@ export default tseslint.config([
|
|
|
96
96
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
97
97
|
'@typescript-eslint/no-empty-interface': 'off',
|
|
98
98
|
'@typescript-eslint/triple-slash-reference': 'off',
|
|
99
|
-
'@typescript-eslint/triple-slash-reference': 'off',
|
|
100
99
|
'react/prop-types': 'off',
|
|
101
100
|
'react/no-find-dom-node': 'off',
|
|
102
101
|
'react-hooks/exhaustive-deps': 'off',
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@emotion/react": "11.14.0",
|
|
29
|
+
"@emotion/styled": "11.14.1",
|
|
29
30
|
"@tanstack/react-query": "5.51.15",
|
|
30
31
|
"@webext-core/messaging": "2.2.0",
|
|
31
32
|
"axios": "1.7.9",
|
|
@@ -35,7 +36,6 @@
|
|
|
35
36
|
"qs": "6.11.2",
|
|
36
37
|
"react": "18.3.1",
|
|
37
38
|
"react-dom": "18.3.1",
|
|
38
|
-
"tss-react": "4.9.19",
|
|
39
39
|
"type-fest": "4.33.0",
|
|
40
40
|
"zustand": "5.0.3"
|
|
41
41
|
},
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@commitlint/cli": "17.6.1",
|
|
44
44
|
"@commitlint/config-conventional": "17.6.1",
|
|
45
45
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
46
|
+
"@emotion/babel-plugin": "11.13.5",
|
|
46
47
|
"@eslint/js": "9.15.0",
|
|
47
48
|
"@types/chrome": "0.0.254",
|
|
48
49
|
"@types/node": "18.16.0",
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react'
|
|
2
2
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
3
|
-
import {
|
|
4
|
-
import { createGlobalCss } from '@/shared/styles'
|
|
3
|
+
import { Global, ThemeProvider } from '@emotion/react'
|
|
4
|
+
import { createGlobalCss, theme } from '@/shared/styles'
|
|
5
5
|
|
|
6
6
|
const queryClient = new QueryClient()
|
|
7
7
|
|
|
8
8
|
const AppContext: FunctionComponent<{ children: ReactNode; classNameSpace?: string }> = props => {
|
|
9
9
|
return (
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
<ThemeProvider theme={theme}>
|
|
11
|
+
<QueryClientProvider client={queryClient}>
|
|
12
|
+
<Global styles={createGlobalCss(props.classNameSpace)} />
|
|
13
|
+
{props.children}
|
|
14
|
+
</QueryClientProvider>
|
|
15
|
+
</ThemeProvider>
|
|
14
16
|
)
|
|
15
17
|
}
|
|
16
18
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { css } from '@emotion/react'
|
|
2
2
|
|
|
3
|
-
export function createGlobalCss(nameSpace?: string)
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
margin: 0
|
|
3
|
+
export function createGlobalCss(nameSpace?: string) {
|
|
4
|
+
return css`
|
|
5
|
+
${nameSpace ? `.${nameSpace}` : 'body'} {
|
|
6
|
+
margin: 0;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
`
|
|
9
9
|
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
/// <reference types="./.wxt/wxt.d.ts" />
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import '@emotion/react'
|
|
5
|
+
import { type themeType } from '@/shared/styles'
|
|
6
|
+
|
|
7
|
+
declare global {
|
|
8
|
+
interface ImportMetaEnv {
|
|
9
|
+
readonly VITE_BASE_URL: string
|
|
10
|
+
readonly VITE_API_HOST: string
|
|
11
|
+
// 更多环境变量...
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ImportMeta {
|
|
15
|
+
readonly env: ImportMetaEnv
|
|
16
|
+
}
|
|
8
17
|
}
|
|
9
18
|
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
declare module '@emotion/react' {
|
|
20
|
+
export interface Theme extends themeType {}
|
|
12
21
|
}
|
|
@@ -29,7 +29,7 @@ export default defineConfig({
|
|
|
29
29
|
runner: { disabled: true },
|
|
30
30
|
imports: { eslintrc: { enabled: 9 } },
|
|
31
31
|
vite: ({ mode }) => ({
|
|
32
|
-
plugins: [svgr(), react()] as any,
|
|
32
|
+
plugins: [svgr(), react({ babel: { plugins: [['@emotion']] } })] as any,
|
|
33
33
|
resolve: {
|
|
34
34
|
alias: {
|
|
35
35
|
'@': __dirname
|