create-packer 1.45.16 → 1.45.18

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.
Files changed (43) hide show
  1. package/package.json +1 -1
  2. package/template/web-app/react-rsbuild/.vscode/extensions.json +0 -1
  3. package/template/web-app/react-rsbuild/README.md +1 -1
  4. package/template/web-app/react-rsbuild/domain/app/components/app-context.tsx +6 -8
  5. package/template/web-app/react-rsbuild/env.d.ts +0 -6
  6. package/template/web-app/react-rsbuild/package.json +78 -79
  7. package/template/web-app/react-rsbuild/pages/home/view.css.ts +7 -0
  8. package/template/web-app/react-rsbuild/pages/home/view.tsx +11 -10
  9. package/template/web-app/react-rsbuild/rsbuild.config.ts +1 -15
  10. package/template/web-app/react-rsbuild/shared/styles/global.ts +5 -5
  11. package/template/web-app/react-rsbuild/shared/styles/index.ts +1 -1
  12. package/template/web-app/react-rsbuild/shared/styles/tss.ts +6 -0
  13. package/template/web-app/react-rsbuild/tsconfig.json +0 -1
  14. package/template/web-app/react-vite/.vscode/extensions.json +0 -1
  15. package/template/web-app/react-vite/README.md +1 -1
  16. package/template/web-app/react-vite/domain/app/components/app-context.tsx +6 -8
  17. package/template/web-app/react-vite/package.json +77 -78
  18. package/template/web-app/react-vite/pages/home/view.css.ts +7 -0
  19. package/template/web-app/react-vite/pages/home/view.tsx +3 -2
  20. package/template/web-app/react-vite/shared/styles/global.ts +5 -5
  21. package/template/web-app/react-vite/shared/styles/index.ts +1 -0
  22. package/template/web-app/react-vite/shared/styles/tss.ts +6 -0
  23. package/template/web-app/react-vite/tsconfig.json +0 -1
  24. package/template/web-app/react-vite/vite-env.d.ts +6 -14
  25. package/template/web-app/react-vite/vite.config.ts +1 -5
  26. package/template/web-extension/.vscode/extensions.json +0 -1
  27. package/template/web-extension/README.md +1 -1
  28. package/template/web-extension/package.json +85 -86
  29. package/template/web-extension/shared/components/app-context/view.tsx +6 -8
  30. package/template/web-extension/shared/styles/global.ts +6 -6
  31. package/template/web-extension/shared/styles/index.ts +1 -0
  32. package/template/web-extension/shared/styles/tss.ts +6 -0
  33. package/template/web-extension/tsconfig.json +0 -1
  34. package/template/web-extension/vite-env.d.ts +6 -14
  35. package/template/web-extension/wxt.config.ts +1 -8
  36. package/template/web-app/react-rsbuild/pages/home/view.styled.ts +0 -5
  37. package/template/web-app/react-rsbuild/shared/types/index.ts +0 -1
  38. package/template/web-app/react-rsbuild/shared/types/utils.ts +0 -2
  39. package/template/web-app/react-vite/pages/home/view.styled.ts +0 -5
  40. package/template/web-app/react-vite/shared/types/index.ts +0 -1
  41. package/template/web-app/react-vite/shared/types/utils.ts +0 -2
  42. package/template/web-extension/shared/types/index.ts +0 -1
  43. package/template/web-extension/shared/types/utils.ts +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.45.16",
3
+ "version": "1.45.18",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -3,6 +3,5 @@
3
3
  "dbaeumer.vscode-eslint",
4
4
  "stylelint.vscode-stylelint",
5
5
  "esbenp.prettier-vscode",
6
- "styled-components.vscode-styled-components"
7
6
  ]
8
7
  }
@@ -7,7 +7,7 @@
7
7
  - Typescript
8
8
  - react-router
9
9
  - Zustand
10
- - styled-components
10
+ - tss-react
11
11
  - Eslint
12
12
  - Prettier
13
13
  - axios
@@ -1,8 +1,8 @@
1
1
  import { FunctionComponent, ReactNode } from 'react'
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
3
- import { Global, ThemeProvider } from '@emotion/react'
3
+ import { GlobalStyles } from 'tss-react'
4
4
  import { request } from '@/shared/service'
5
- import { globalCss, theme } from '@/shared/styles'
5
+ import { globalCss } from '@/shared/styles'
6
6
 
7
7
  const queryClient = new QueryClient({
8
8
  defaultOptions: {
@@ -21,11 +21,9 @@ export interface propsType {
21
21
  }
22
22
  export const Root: FunctionComponent<propsType> = props => {
23
23
  return (
24
- <ThemeProvider theme={theme}>
25
- <QueryClientProvider client={queryClient}>
26
- <Global styles={globalCss} />
27
- {props.children}
28
- </QueryClientProvider>
29
- </ThemeProvider>
24
+ <QueryClientProvider client={queryClient}>
25
+ <GlobalStyles styles={globalCss} />
26
+ {props.children}
27
+ </QueryClientProvider>
30
28
  )
31
29
  }
@@ -1,6 +1,4 @@
1
1
  /// <reference types="@rsbuild/core/types" />
2
- import '@emotion/react'
3
- import { type themeType } from '@/shared/styles'
4
2
 
5
3
  declare global {
6
4
  interface ImportMetaEnv {
@@ -21,7 +19,3 @@ declare module '*.svg?react' {
21
19
  const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement>>
22
20
  export default ReactComponent
23
21
  }
24
-
25
- declare module '@emotion/react' {
26
- export interface Theme extends themeType {}
27
- }
@@ -1,79 +1,78 @@
1
- {
2
- "name": "react-rsbuild",
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 \"**/*.{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
- "@emotion/react": "11.14.0",
23
- "@emotion/styled": "11.14.1",
24
- "@tanstack/react-query": "5.51.15",
25
- "axios": "1.7.9",
26
- "define-zustand": "3.4.0",
27
- "es-toolkit": "1.39.8",
28
- "immer": "10.0.1",
29
- "qs": "6.11.2",
30
- "react": "18.3.1",
31
- "react-dom": "18.3.1",
32
- "react-router": "7.5.0",
33
- "react-use": "17.5.0",
34
- "type-fest": "4.33.0",
35
- "zustand": "5.0.3"
36
- },
37
- "devDependencies": {
38
- "@commitlint/cli": "17.6.1",
39
- "@commitlint/config-conventional": "17.6.1",
40
- "@commitlint/cz-commitlint": "17.5.0",
41
- "@eslint/js": "9.15.0",
42
- "@rsbuild/core": "1.5.2",
43
- "@rsbuild/plugin-eslint": "1.1.2",
44
- "@rsbuild/plugin-react": "1.4.0",
45
- "@rsbuild/plugin-svgr": "1.2.2",
46
- "@rsbuild/plugin-type-check": "1.2.4",
47
- "@rsdoctor/rspack-plugin": "1.2.3",
48
- "@swc/plugin-emotion": "11.1.0",
49
- "@types/node": "18.16.0",
50
- "@types/qs": "6.9.7",
51
- "@types/react": "18.3.3",
52
- "@types/react-dom": "18.3.0",
53
- "autoprefixer": "10.4.14",
54
- "commitizen": "4.3.0",
55
- "cross-env": "7.0.3",
56
- "cssnano": "6.0.0",
57
- "eslint": "9.17.0",
58
- "eslint-import-resolver-typescript": "3.7.0",
59
- "eslint-plugin-import": "2.31.0",
60
- "eslint-plugin-react": "7.37.2",
61
- "eslint-plugin-react-hooks": "5.1.0",
62
- "globals": "15.12.0",
63
- "husky": "9.1.6",
64
- "postcss": "8.4.35",
65
- "postcss-import": "16.0.1",
66
- "postcss-nesting": "12.0.3",
67
- "postcss-styled-syntax": "0.6.4",
68
- "prettier": "3.2.5",
69
- "stylelint": "16.10.0",
70
- "stylelint-config-standard": "36.0.1",
71
- "stylelint-webpack-plugin": "5.0.0",
72
- "typescript": "5.8.2"
73
- },
74
- "config": {
75
- "commitizen": {
76
- "path": "@commitlint/cz-commitlint"
77
- }
78
- }
79
- }
1
+ {
2
+ "name": "react-rsbuild",
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 \"**/*.{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
+ "@emotion/react": "11.14.0",
23
+ "@tanstack/react-query": "5.51.15",
24
+ "axios": "1.7.9",
25
+ "define-zustand": "3.4.0",
26
+ "es-toolkit": "1.39.8",
27
+ "immer": "10.0.1",
28
+ "qs": "6.11.2",
29
+ "react": "18.3.1",
30
+ "react-dom": "18.3.1",
31
+ "react-router": "7.5.0",
32
+ "react-use": "17.5.0",
33
+ "tss-react": "4.9.19",
34
+ "type-fest": "4.33.0",
35
+ "zustand": "5.0.3"
36
+ },
37
+ "devDependencies": {
38
+ "@commitlint/cli": "17.6.1",
39
+ "@commitlint/config-conventional": "17.6.1",
40
+ "@commitlint/cz-commitlint": "17.5.0",
41
+ "@eslint/js": "9.15.0",
42
+ "@rsbuild/core": "1.5.2",
43
+ "@rsbuild/plugin-eslint": "1.1.2",
44
+ "@rsbuild/plugin-react": "1.4.0",
45
+ "@rsbuild/plugin-svgr": "1.2.2",
46
+ "@rsbuild/plugin-type-check": "1.2.4",
47
+ "@rsdoctor/rspack-plugin": "1.2.3",
48
+ "@types/node": "18.16.0",
49
+ "@types/qs": "6.9.7",
50
+ "@types/react": "18.3.3",
51
+ "@types/react-dom": "18.3.0",
52
+ "autoprefixer": "10.4.14",
53
+ "commitizen": "4.3.0",
54
+ "cross-env": "7.0.3",
55
+ "cssnano": "6.0.0",
56
+ "eslint": "9.17.0",
57
+ "eslint-import-resolver-typescript": "3.7.0",
58
+ "eslint-plugin-import": "2.31.0",
59
+ "eslint-plugin-react": "7.37.2",
60
+ "eslint-plugin-react-hooks": "5.1.0",
61
+ "globals": "15.12.0",
62
+ "husky": "9.1.6",
63
+ "postcss": "8.4.35",
64
+ "postcss-import": "16.0.1",
65
+ "postcss-nesting": "12.0.3",
66
+ "postcss-styled-syntax": "0.6.4",
67
+ "prettier": "3.2.5",
68
+ "stylelint": "16.10.0",
69
+ "stylelint-config-standard": "36.0.1",
70
+ "stylelint-webpack-plugin": "5.0.0",
71
+ "typescript": "5.8.2"
72
+ },
73
+ "config": {
74
+ "commitizen": {
75
+ "path": "@commitlint/cz-commitlint"
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,7 @@
1
+ import { tss } from '@/shared/styles'
2
+
3
+ export const useStyles = tss.create(({ theme }) => ({
4
+ root: {
5
+ ...theme.tools.flex('center', 'center')
6
+ }
7
+ }))
@@ -1,10 +1,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
+ import { useHomeData } from '@/shared/service'
2
+ import { useStyles } from './view.css'
3
+
4
+ export default function Home() {
5
+ const { data } = useHomeData()
6
+ const { classes } = useStyles()
7
+
8
+ console.log('data', data)
9
+
10
+ return <div className={classes.root}>sdfs</div>
11
+ }
@@ -41,13 +41,6 @@ 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
- }
51
44
  }
52
45
  },
53
46
  plugins: [
@@ -59,14 +52,7 @@ export default defineConfig(({ envMode, command }) => {
59
52
  }
60
53
  }),
61
54
  pluginSvgr(),
62
- pluginReact({
63
- reactRefreshOptions: {
64
- exclude: [/\.css\.ts$/]
65
- },
66
- swcReactOptions: {
67
- importSource: '@emotion/react'
68
- }
69
- })
55
+ pluginReact()
70
56
  ],
71
57
  performance: {
72
58
  removeConsole: command === 'build' ? ['log'] : false,
@@ -1,7 +1,7 @@
1
- import { css } from '@emotion/react'
1
+ import { CSSInterpolation } from 'tss-react'
2
2
 
3
- export const globalCss = css`
4
- body {
5
- margin: 0;
3
+ export const globalCss: CSSInterpolation = {
4
+ body: {
5
+ margin: 0
6
6
  }
7
- `
7
+ }
@@ -1,2 +1,2 @@
1
1
  export * from './global'
2
- export * from './theme'
2
+ export * from './tss'
@@ -0,0 +1,6 @@
1
+ import { createTss } from 'tss-react'
2
+ import { theme } from './theme'
3
+
4
+ export const { tss } = createTss({
5
+ useContext: () => ({ theme })
6
+ })
@@ -18,7 +18,6 @@
18
18
  "isolatedModules": true,
19
19
  "noEmit": true,
20
20
  "jsx": "react-jsx",
21
- "jsxImportSource": "@emotion/react",
22
21
  "paths": {
23
22
  "@/*": ["./*"]
24
23
  }
@@ -3,6 +3,5 @@
3
3
  "dbaeumer.vscode-eslint",
4
4
  "stylelint.vscode-stylelint",
5
5
  "esbenp.prettier-vscode",
6
- "styled-components.vscode-styled-components"
7
6
  ]
8
7
  }
@@ -7,7 +7,7 @@
7
7
  - Typescript
8
8
  - react-router
9
9
  - Zustand
10
- - styled-components
10
+ - tss-react
11
11
  - Eslint
12
12
  - Prettier
13
13
  - axios
@@ -1,8 +1,8 @@
1
1
  import { FunctionComponent, ReactNode } from 'react'
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
3
- import { Global, ThemeProvider } from '@emotion/react'
3
+ import { GlobalStyles } from 'tss-react'
4
4
  import { request } from '@/shared/service'
5
- import { globalCss, theme } from '@/shared/styles'
5
+ import { globalCss } from '@/shared/styles'
6
6
 
7
7
  const queryClient = new QueryClient({
8
8
  defaultOptions: {
@@ -21,11 +21,9 @@ export interface propsType {
21
21
  }
22
22
  export const Root: FunctionComponent<propsType> = props => {
23
23
  return (
24
- <ThemeProvider theme={theme}>
25
- <QueryClientProvider client={queryClient}>
26
- <Global styles={globalCss} />
27
- {props.children}
28
- </QueryClientProvider>
29
- </ThemeProvider>
24
+ <QueryClientProvider client={queryClient}>
25
+ <GlobalStyles styles={globalCss} />
26
+ {props.children}
27
+ </QueryClientProvider>
30
28
  )
31
29
  }
@@ -1,78 +1,77 @@
1
- {
2
- "name": "react-vite",
3
- "private": true,
4
- "version": "0.0.0",
5
- "type": "module",
6
- "scripts": {
7
- "prepare": "husky",
8
- "dev": "vite",
9
- "build": "tsc --noEmit && vite build",
10
- "build:analyse": "tsc --noEmit && vite build --mode analyse",
11
- "preview": "vite preview",
12
- "up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L",
13
- "format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
14
- "lint": "tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
15
- "lint:fix": "eslint --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
16
- "cz": "cz",
17
- "push": "npm run commit && git push",
18
- "commit": "git add . && npm run cz"
19
- },
20
- "dependencies": {
21
- "@emotion/react": "11.14.0",
22
- "@emotion/styled": "11.14.1",
23
- "@tanstack/react-query": "5.51.15",
24
- "axios": "1.7.9",
25
- "define-zustand": "3.4.0",
26
- "es-toolkit": "1.39.8",
27
- "immer": "10.0.1",
28
- "qs": "6.11.2",
29
- "react": "18.3.1",
30
- "react-dom": "18.3.1",
31
- "react-router": "7.5.0",
32
- "react-use": "17.5.0",
33
- "type-fest": "4.33.0",
34
- "zustand": "5.0.3"
35
- },
36
- "devDependencies": {
37
- "@commitlint/cli": "17.6.1",
38
- "@commitlint/config-conventional": "17.6.1",
39
- "@commitlint/cz-commitlint": "17.5.0",
40
- "@emotion/babel-plugin": "11.13.5",
41
- "@eslint/js": "9.15.0",
42
- "@faker-js/faker": "8.4.1",
43
- "@types/node": "18.16.0",
44
- "@types/qs": "6.9.7",
45
- "@types/react": "18.3.3",
46
- "@types/react-dom": "18.3.0",
47
- "@vitejs/plugin-react": "5.0.1",
48
- "autoprefixer": "10.4.14",
49
- "commitizen": "4.3.0",
50
- "cssnano": "6.0.0",
51
- "eslint": "9.17.0",
52
- "eslint-import-resolver-typescript": "3.7.0",
53
- "eslint-plugin-import": "2.31.0",
54
- "eslint-plugin-react": "7.37.2",
55
- "eslint-plugin-react-hooks": "5.1.0",
56
- "globals": "15.12.0",
57
- "husky": "9.1.6",
58
- "inquirer": "8.1.2",
59
- "postcss": "8.4.35",
60
- "postcss-import": "16.0.1",
61
- "postcss-nesting": "12.0.3",
62
- "prettier": "3.2.5",
63
- "rollup-plugin-visualizer": "5.12.0",
64
- "stylelint": "16.10.0",
65
- "stylelint-config-standard": "36.0.1",
66
- "typescript": "5.8.2",
67
- "typescript-eslint": "8.15.0",
68
- "vite": "7.1.3",
69
- "vite-plugin-checker": "0.10.2",
70
- "vite-plugin-mock-dev-server": "1.9.3",
71
- "vite-plugin-svgr": "4.5.0"
72
- },
73
- "config": {
74
- "commitizen": {
75
- "path": "@commitlint/cz-commitlint"
76
- }
77
- }
78
- }
1
+ {
2
+ "name": "react-vite",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "prepare": "husky",
8
+ "dev": "vite",
9
+ "build": "tsc --noEmit && vite build",
10
+ "build:analyse": "tsc --noEmit && vite build --mode analyse",
11
+ "preview": "vite preview",
12
+ "up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L",
13
+ "format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
14
+ "lint": "tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
15
+ "lint:fix": "eslint --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
16
+ "cz": "cz",
17
+ "push": "npm run commit && git push",
18
+ "commit": "git add . && npm run cz"
19
+ },
20
+ "dependencies": {
21
+ "@emotion/react": "11.14.0",
22
+ "@tanstack/react-query": "5.51.15",
23
+ "axios": "1.7.9",
24
+ "define-zustand": "3.4.0",
25
+ "es-toolkit": "1.39.8",
26
+ "immer": "10.0.1",
27
+ "qs": "6.11.2",
28
+ "react": "18.3.1",
29
+ "react-dom": "18.3.1",
30
+ "react-router": "7.5.0",
31
+ "react-use": "17.5.0",
32
+ "tss-react": "4.9.19",
33
+ "type-fest": "4.33.0",
34
+ "zustand": "5.0.3"
35
+ },
36
+ "devDependencies": {
37
+ "@commitlint/cli": "17.6.1",
38
+ "@commitlint/config-conventional": "17.6.1",
39
+ "@commitlint/cz-commitlint": "17.5.0",
40
+ "@eslint/js": "9.15.0",
41
+ "@faker-js/faker": "8.4.1",
42
+ "@types/node": "18.16.0",
43
+ "@types/qs": "6.9.7",
44
+ "@types/react": "18.3.3",
45
+ "@types/react-dom": "18.3.0",
46
+ "@vitejs/plugin-react": "5.0.1",
47
+ "autoprefixer": "10.4.14",
48
+ "commitizen": "4.3.0",
49
+ "cssnano": "6.0.0",
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
+ "globals": "15.12.0",
56
+ "husky": "9.1.6",
57
+ "inquirer": "8.1.2",
58
+ "postcss": "8.4.35",
59
+ "postcss-import": "16.0.1",
60
+ "postcss-nesting": "12.0.3",
61
+ "prettier": "3.2.5",
62
+ "rollup-plugin-visualizer": "5.12.0",
63
+ "stylelint": "16.10.0",
64
+ "stylelint-config-standard": "36.0.1",
65
+ "typescript": "5.8.2",
66
+ "typescript-eslint": "8.15.0",
67
+ "vite": "7.1.3",
68
+ "vite-plugin-checker": "0.10.2",
69
+ "vite-plugin-mock-dev-server": "1.9.3",
70
+ "vite-plugin-svgr": "4.5.0"
71
+ },
72
+ "config": {
73
+ "commitizen": {
74
+ "path": "@commitlint/cz-commitlint"
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,7 @@
1
+ import { tss } from '@/shared/styles'
2
+
3
+ export const useStyles = tss.create(({ theme }) => ({
4
+ root: {
5
+ ...theme.tools.flex('center', 'center')
6
+ }
7
+ }))
@@ -1,10 +1,11 @@
1
1
  import { useHomeData } from '@/shared/service'
2
- import { StyledRoot } from './view.styled'
2
+ import { useStyles } from './view.css'
3
3
 
4
4
  export default function Home() {
5
5
  const { data } = useHomeData()
6
+ const { classes } = useStyles()
6
7
 
7
8
  console.log('data', data)
8
9
 
9
- return <StyledRoot>sdfs</StyledRoot>
10
+ return <div className={classes.root}>sdfs</div>
10
11
  }
@@ -1,7 +1,7 @@
1
- import { css } from '@emotion/react'
1
+ import { CSSInterpolation } from 'tss-react'
2
2
 
3
- export const globalCss = css`
4
- body {
5
- margin: 0;
3
+ export const globalCss: CSSInterpolation = {
4
+ body: {
5
+ margin: 0
6
6
  }
7
- `
7
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './global'
2
+ export * from './tss'
2
3
  export * from './theme'
@@ -0,0 +1,6 @@
1
+ import { createTss } from 'tss-react'
2
+ import { theme } from './theme'
3
+
4
+ export const { tss } = createTss({
5
+ useContext: () => ({ theme })
6
+ })
@@ -18,7 +18,6 @@
18
18
  "isolatedModules": true,
19
19
  "noEmit": true,
20
20
  "jsx": "react-jsx",
21
- "jsxImportSource": "@emotion/react",
22
21
  "paths": {
23
22
  "@/*": ["./*"]
24
23
  }
@@ -1,20 +1,12 @@
1
1
  /// <reference types="vite/client" />
2
2
  /// <reference types="vite-plugin-svgr/client" />
3
- import '@emotion/react'
4
- import { type themeType } from '@/shared/styles'
5
3
 
6
- declare global {
7
- interface ImportMetaEnv {
8
- readonly VITE_BASE_URL: string
9
- readonly VITE_API_HOST: string
10
- // 更多环境变量...
11
- }
12
-
13
- interface ImportMeta {
14
- readonly env: ImportMetaEnv
15
- }
4
+ interface ImportMetaEnv {
5
+ readonly VITE_BASE_URL: string
6
+ readonly VITE_API_HOST: string
7
+ // 更多环境变量...
16
8
  }
17
9
 
18
- declare module '@emotion/react' {
19
- export interface Theme extends themeType {}
10
+ interface ImportMeta {
11
+ readonly env: ImportMetaEnv
20
12
  }
@@ -20,11 +20,7 @@ export default defineConfig(({ mode }) => {
20
20
  typescript: true,
21
21
  eslint: { useFlatConfig: true, lintCommand: 'eslint', dev: { logLevel: ['error'] } }
22
22
  }),
23
- react({
24
- babel: {
25
- plugins: ['@emotion']
26
- }
27
- })
23
+ react()
28
24
  ]
29
25
 
30
26
  if (mode === 'analyse') {
@@ -3,6 +3,5 @@
3
3
  "dbaeumer.vscode-eslint",
4
4
  "stylelint.vscode-stylelint",
5
5
  "esbenp.prettier-vscode",
6
- "styled-components.vscode-styled-components"
7
6
  ]
8
7
  }
@@ -6,7 +6,7 @@
6
6
  - React
7
7
  - Typescript
8
8
  - Zustand
9
- - Tailwindcss
9
+ - tss-react
10
10
  - Eslint
11
11
  - Prettier
12
12
  - axios
@@ -1,86 +1,85 @@
1
- {
2
- "name": "web-extension",
3
- "private": true,
4
- "version": "0.0.0",
5
- "type": "module",
6
- "scripts": {
7
- "prepare": "husky",
8
- "dev": "wxt",
9
- "dev:firefox": "wxt -b firefox",
10
- "build": "wxt build",
11
- "build_dev": "wxt build --mode dev",
12
- "build:firefox": "wxt build -b firefox",
13
- "build_dev:firefox": "wxt build -b firefox --mode dev",
14
- "zip": "wxt zip",
15
- "zip_dev": "wxt zip --mode dev",
16
- "zip:firefox": "wxt zip -b firefox",
17
- "zip_dev:firefox": "wxt zip -b firefox --mode dev",
18
- "postinstall": "wxt prepare",
19
- "up:vite": "pnpm up vite @vitejs/* -L",
20
- "format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
21
- "lint": "tsc --noEmit && eslint **/*.{tsx,ts} && stylelint **/*.{css,scss,less,ts,tsx}",
22
- "lint:fix": "eslint **/*.{tsx,ts} --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
23
- "cz": "cz",
24
- "push": "npm run commit && git push",
25
- "commit": "git add . && npm run cz"
26
- },
27
- "dependencies": {
28
- "@emotion/react": "11.14.0",
29
- "@emotion/styled": "11.14.1",
30
- "@tanstack/react-query": "5.51.15",
31
- "@webext-core/messaging": "2.2.0",
32
- "axios": "1.7.9",
33
- "define-zustand": "3.4.0",
34
- "es-toolkit": "1.39.8",
35
- "immer": "10.0.1",
36
- "qs": "6.11.2",
37
- "react": "18.3.1",
38
- "react-dom": "18.3.1",
39
- "type-fest": "4.33.0",
40
- "zustand": "5.0.3"
41
- },
42
- "devDependencies": {
43
- "@commitlint/cli": "17.6.1",
44
- "@commitlint/config-conventional": "17.6.1",
45
- "@commitlint/cz-commitlint": "17.5.0",
46
- "@emotion/babel-plugin": "11.13.5",
47
- "@eslint/js": "9.15.0",
48
- "@types/chrome": "0.0.254",
49
- "@types/node": "18.16.0",
50
- "@types/qs": "6.9.7",
51
- "@types/react": "18.3.3",
52
- "@types/react-dom": "18.3.0",
53
- "@vitejs/plugin-react": "5.0.1",
54
- "autoprefixer": "10.4.14",
55
- "commitizen": "4.3.0",
56
- "cssnano": "6.0.0",
57
- "eslint": "9.17.0",
58
- "eslint-import-resolver-typescript": "3.7.0",
59
- "eslint-plugin-import": "2.31.0",
60
- "eslint-plugin-react": "7.37.2",
61
- "eslint-plugin-react-hooks": "5.1.0",
62
- "globals": "15.12.0",
63
- "husky": "9.1.6",
64
- "inquirer": "^8.1.2",
65
- "postcss": "8.4.31",
66
- "postcss-import": "15.1.0",
67
- "postcss-nesting": "11.2.2",
68
- "postcss-scss": "4.0.9",
69
- "postcss-styled-syntax": "0.6.4",
70
- "prettier": "3.2.5",
71
- "rimraf": "5.0.1",
72
- "sass": "1.63.4",
73
- "stylelint": "16.10.0",
74
- "stylelint-config-standard": "36.0.1",
75
- "typescript": "5.8.2",
76
- "typescript-eslint": "8.28.0",
77
- "vite": "7.1.3",
78
- "vite-plugin-svgr": "4.5.0",
79
- "wxt": "0.20.5"
80
- },
81
- "config": {
82
- "commitizen": {
83
- "path": "@commitlint/cz-commitlint"
84
- }
85
- }
86
- }
1
+ {
2
+ "name": "web-extension",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "prepare": "husky",
8
+ "dev": "wxt",
9
+ "dev:firefox": "wxt -b firefox",
10
+ "build": "wxt build",
11
+ "build_dev": "wxt build --mode dev",
12
+ "build:firefox": "wxt build -b firefox",
13
+ "build_dev:firefox": "wxt build -b firefox --mode dev",
14
+ "zip": "wxt zip",
15
+ "zip_dev": "wxt zip --mode dev",
16
+ "zip:firefox": "wxt zip -b firefox",
17
+ "zip_dev:firefox": "wxt zip -b firefox --mode dev",
18
+ "postinstall": "wxt prepare",
19
+ "up:vite": "pnpm up vite @vitejs/* -L",
20
+ "format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
21
+ "lint": "tsc --noEmit && eslint **/*.{tsx,ts} && stylelint **/*.{css,scss,less,ts,tsx}",
22
+ "lint:fix": "eslint **/*.{tsx,ts} --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
23
+ "cz": "cz",
24
+ "push": "npm run commit && git push",
25
+ "commit": "git add . && npm run cz"
26
+ },
27
+ "dependencies": {
28
+ "@emotion/react": "11.14.0",
29
+ "@tanstack/react-query": "5.51.15",
30
+ "@webext-core/messaging": "2.2.0",
31
+ "axios": "1.7.9",
32
+ "define-zustand": "3.4.0",
33
+ "es-toolkit": "1.39.8",
34
+ "immer": "10.0.1",
35
+ "qs": "6.11.2",
36
+ "react": "18.3.1",
37
+ "react-dom": "18.3.1",
38
+ "tss-react": "4.9.19",
39
+ "type-fest": "4.33.0",
40
+ "zustand": "5.0.3"
41
+ },
42
+ "devDependencies": {
43
+ "@commitlint/cli": "17.6.1",
44
+ "@commitlint/config-conventional": "17.6.1",
45
+ "@commitlint/cz-commitlint": "17.5.0",
46
+ "@eslint/js": "9.15.0",
47
+ "@types/chrome": "0.0.254",
48
+ "@types/node": "18.16.0",
49
+ "@types/qs": "6.9.7",
50
+ "@types/react": "18.3.3",
51
+ "@types/react-dom": "18.3.0",
52
+ "@vitejs/plugin-react": "5.0.1",
53
+ "autoprefixer": "10.4.14",
54
+ "commitizen": "4.3.0",
55
+ "cssnano": "6.0.0",
56
+ "eslint": "9.17.0",
57
+ "eslint-import-resolver-typescript": "3.7.0",
58
+ "eslint-plugin-import": "2.31.0",
59
+ "eslint-plugin-react": "7.37.2",
60
+ "eslint-plugin-react-hooks": "5.1.0",
61
+ "globals": "15.12.0",
62
+ "husky": "9.1.6",
63
+ "inquirer": "^8.1.2",
64
+ "postcss": "8.4.31",
65
+ "postcss-import": "15.1.0",
66
+ "postcss-nesting": "11.2.2",
67
+ "postcss-scss": "4.0.9",
68
+ "postcss-styled-syntax": "0.6.4",
69
+ "prettier": "3.2.5",
70
+ "rimraf": "5.0.1",
71
+ "sass": "1.63.4",
72
+ "stylelint": "16.10.0",
73
+ "stylelint-config-standard": "36.0.1",
74
+ "typescript": "5.8.2",
75
+ "typescript-eslint": "8.28.0",
76
+ "vite": "7.1.3",
77
+ "vite-plugin-svgr": "4.5.0",
78
+ "wxt": "0.20.5"
79
+ },
80
+ "config": {
81
+ "commitizen": {
82
+ "path": "@commitlint/cz-commitlint"
83
+ }
84
+ }
85
+ }
@@ -1,18 +1,16 @@
1
1
  import { FunctionComponent, ReactNode } from 'react'
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
3
- import { Global, ThemeProvider } from '@emotion/react'
4
- import { createGlobalCss, theme } from '@/shared/styles'
3
+ import { GlobalStyles } from 'tss-react'
4
+ import { createGlobalCss } 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
- <ThemeProvider theme={theme}>
11
- <QueryClientProvider client={queryClient}>
12
- <Global styles={createGlobalCss(props.classNameSpace)} />
13
- {props.children}
14
- </QueryClientProvider>
15
- </ThemeProvider>
10
+ <QueryClientProvider client={queryClient}>
11
+ <GlobalStyles styles={createGlobalCss(props.classNameSpace)} />
12
+ {props.children}
13
+ </QueryClientProvider>
16
14
  )
17
15
  }
18
16
 
@@ -1,9 +1,9 @@
1
- import { css } from '@emotion/react'
1
+ import { CSSInterpolation } from 'tss-react'
2
2
 
3
- export const createGlobalCss = (nameSpace?: string) => {
4
- return css`
5
- ${nameSpace ? `.${nameSpace} ` : 'body'} {
6
- margin: 0;
3
+ export function createGlobalCss(nameSpace?: string): CSSInterpolation {
4
+ return {
5
+ [nameSpace ? `.${nameSpace}` : 'body']: {
6
+ margin: 0
7
7
  }
8
- `
8
+ }
9
9
  }
@@ -1,2 +1,3 @@
1
1
  export * from './global'
2
+ export * from './tss'
2
3
  export * from './theme'
@@ -0,0 +1,6 @@
1
+ import { createTss } from 'tss-react'
2
+ import { theme } from './theme'
3
+
4
+ export const { tss } = createTss({
5
+ useContext: () => ({ theme })
6
+ })
@@ -18,7 +18,6 @@
18
18
  "isolatedModules": true,
19
19
  "noEmit": true,
20
20
  "jsx": "react-jsx",
21
- "jsxImportSource": "@emotion/react",
22
21
  "paths": {
23
22
  "@/*": ["./*"]
24
23
  }
@@ -1,20 +1,12 @@
1
1
  /// <reference types="vite/client" />
2
2
  /// <reference types="./.wxt/wxt.d.ts" />
3
- import '@emotion/react'
4
- import { type themeType } from '@/shared/styles'
5
3
 
6
- declare global {
7
- interface ImportMetaEnv {
8
- readonly VITE_API_HOST: string
9
- readonly VITE_APP_ID: string
10
- // 更多环境变量...
11
- }
12
-
13
- interface ImportMeta {
14
- readonly env: ImportMetaEnv
15
- }
4
+ interface ImportMetaEnv {
5
+ readonly VITE_API_HOST: string
6
+ readonly VITE_APP_ID: string
7
+ // 更多环境变量...
16
8
  }
17
9
 
18
- declare module '@emotion/react' {
19
- export interface Theme extends themeType {}
10
+ interface ImportMeta {
11
+ readonly env: ImportMetaEnv
20
12
  }
@@ -29,14 +29,7 @@ export default defineConfig({
29
29
  runner: { disabled: true },
30
30
  imports: { eslintrc: { enabled: 9 } },
31
31
  vite: ({ mode }) => ({
32
- plugins: [
33
- svgr(),
34
- react({
35
- babel: {
36
- plugins: ['@emotion']
37
- }
38
- })
39
- ] as any,
32
+ plugins: [svgr(), react()] as any,
40
33
  resolve: {
41
34
  alias: {
42
35
  '@': __dirname
@@ -1,5 +0,0 @@
1
- import styled from '@emotion/styled'
2
-
3
- export const StyledRoot = styled.div`
4
- ${({ theme }) => theme.tools.flex('center', 'center')}
5
- `
@@ -1 +0,0 @@
1
- export * from './utils'
@@ -1,2 +0,0 @@
1
- import { type UseBoundStore, type StoreApi } from 'zustand'
2
- export type ExtractModelType<T> = T extends UseBoundStore<StoreApi<infer S>> ? S : unknown
@@ -1,5 +0,0 @@
1
- import styled from '@emotion/styled'
2
-
3
- export const StyledRoot = styled.div`
4
- ${({ theme }) => theme.tools.flex('center', 'center')}
5
- `
@@ -1 +0,0 @@
1
- export * from './utils'
@@ -1,2 +0,0 @@
1
- import { type UseBoundStore, type StoreApi } from 'zustand'
2
- export type ExtractModelType<T> = T extends UseBoundStore<StoreApi<infer S>> ? S : unknown
@@ -1 +0,0 @@
1
- export * from './utils'
@@ -1,3 +0,0 @@
1
- import { type UseBoundStore, type StoreApi } from 'zustand'
2
-
3
- export type ExtractModelType<T> = T extends UseBoundStore<StoreApi<infer S>> ? S : unknown