@yyp92-cli/template-react-pc 2.2.0 → 2.4.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/package.json +1 -4
  3. package/template/.env.development +5 -0
  4. package/template/.env.production +4 -0
  5. package/template/.env.test +4 -0
  6. package/template/.eslintrc.cjs +18 -0
  7. package/template/README.md +15 -0
  8. package/template/gitignore.template +24 -0
  9. package/template/index.html +13 -0
  10. package/template/package.json +42 -0
  11. package/template/pnpm-lock.yaml +3570 -0
  12. package/template/public/vite.svg +1 -0
  13. package/template/src/antdTheme/darkTheme.ts +285 -0
  14. package/template/src/antdTheme/lightTheme.ts +286 -0
  15. package/template/src/app.scss +29 -0
  16. package/template/src/app.tsx +14 -0
  17. package/template/src/assets/iconfont/demo.css +539 -0
  18. package/template/src/assets/iconfont/demo_index.html +211 -0
  19. package/template/src/assets/iconfont/iconfont.css +19 -0
  20. package/template/src/assets/iconfont/iconfont.js +1 -0
  21. package/template/src/assets/iconfont/iconfont.json +16 -0
  22. package/template/src/assets/iconfont/iconfont.ttf +0 -0
  23. package/template/src/assets/iconfont/iconfont.woff +0 -0
  24. package/template/src/assets/iconfont/iconfont.woff2 +0 -0
  25. package/template/src/assets/react.svg +1 -0
  26. package/template/src/components/403/index.tsx +22 -0
  27. package/template/src/components/404/index.tsx +24 -0
  28. package/template/src/components/index.ts +3 -0
  29. package/template/src/components/layout/content/index.module.scss +22 -0
  30. package/template/src/components/layout/content/index.tsx +109 -0
  31. package/template/src/components/layout/footer/index.module.scss +12 -0
  32. package/template/src/components/layout/footer/index.tsx +15 -0
  33. package/template/src/components/layout/header/index.module.scss +21 -0
  34. package/template/src/components/layout/header/index.tsx +115 -0
  35. package/template/src/components/layout/index.module.scss +8 -0
  36. package/template/src/components/layout/index.tsx +47 -0
  37. package/template/src/components/layout/side/index.module.scss +31 -0
  38. package/template/src/components/layout/side/index.tsx +109 -0
  39. package/template/src/components/layout-horizontal/content/index.module.scss +22 -0
  40. package/template/src/components/layout-horizontal/content/index.tsx +105 -0
  41. package/template/src/components/layout-horizontal/footer/index.module.scss +12 -0
  42. package/template/src/components/layout-horizontal/footer/index.tsx +15 -0
  43. package/template/src/components/layout-horizontal/header/index.module.scss +23 -0
  44. package/template/src/components/layout-horizontal/header/index.tsx +115 -0
  45. package/template/src/components/layout-horizontal/index.module.scss +8 -0
  46. package/template/src/components/layout-horizontal/index.tsx +48 -0
  47. package/template/src/components/layout-horizontal/side/index.module.scss +32 -0
  48. package/template/src/components/layout-horizontal/side/index.tsx +104 -0
  49. package/template/src/components/login/index.module.scss +23 -0
  50. package/template/src/components/login/index.tsx +133 -0
  51. package/template/src/global/constants.ts +5 -0
  52. package/template/src/pages/home/index.module.scss +0 -0
  53. package/template/src/pages/home/index.tsx +90 -0
  54. package/template/src/router/router.tsx +190 -0
  55. package/template/src/service/api.ts +9 -0
  56. package/template/src/service/config.ts +9 -0
  57. package/template/src/service/index.ts +1 -0
  58. package/template/src/service/request/index.ts +267 -0
  59. package/template/src/service/request/type.ts +5 -0
  60. package/template/src/service/service.ts +27 -0
  61. package/template/src/store/antdToken.ts +35 -0
  62. package/template/src/store/login.ts +38 -0
  63. package/template/src/store/menus.ts +30 -0
  64. package/template/src/store/permission.ts +30 -0
  65. package/template/src/store/token.ts +30 -0
  66. package/template/src/theme/darkTheme.scss +47 -0
  67. package/template/src/theme/lightTheme.scss +49 -0
  68. package/template/src/utils/base64ToBlob.ts +41 -0
  69. package/template/src/utils/cache.ts +44 -0
  70. package/template/src/utils/changeTheme.ts +14 -0
  71. package/template/src/utils/download.ts +45 -0
  72. package/template/src/utils/filterMenu.ts +34 -0
  73. package/template/src/utils/index.ts +5 -0
  74. package/template/src/vite-env.d.ts +5 -0
  75. package/template/tsconfig.json +45 -0
  76. package/template/tsconfig.node.json +10 -0
  77. package/template/vite.config.ts +49 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,79 @@
1
+ # @yyp92-cli/template-react-pc
2
+
3
+ ## 2.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 修复模板丢失.gitignore 文件
8
+
9
+ ## 2.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 模板没有发布.gitignore
14
+
15
+ ## 2.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 模板丢失
20
+
21
+ ## 2.2.0
22
+
23
+ ### Minor Changes
24
+
25
+ - 增加发布模板的 .gitignore
26
+
27
+ ## 2.1.0
28
+
29
+ ### Minor Changes
30
+
31
+ - 更改包
32
+
33
+ ## 2.0.0
34
+
35
+ ### Major Changes
36
+
37
+ - pc 模板更新
38
+
39
+ ## 1.5.0
40
+
41
+ ### Minor Changes
42
+
43
+ - react 模板 去掉手动存储本地
44
+
45
+ ## 1.4.0
46
+
47
+ ### Minor Changes
48
+
49
+ - 路由修改
50
+
51
+ ## 1.3.0
52
+
53
+ ### Minor Changes
54
+
55
+ - 项目模板-二级路由修改
56
+
57
+ ## 1.2.1
58
+
59
+ ### Patch Changes
60
+
61
+ - 模板修改
62
+
63
+ ## 1.2.0
64
+
65
+ ### Minor Changes
66
+
67
+ - 项目模板修改
68
+
69
+ ## 1.1.1
70
+
71
+ ### Patch Changes
72
+
73
+ - react pc 模板 layout 引用修改
74
+
75
+ ## 1.1.0
76
+
77
+ ### Minor Changes
78
+
79
+ - yyp92-cli 项目模板完善
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "@yyp92-cli/template-react-pc",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "main": "index.js",
8
- "files": [
9
- ".gitignore"
10
- ],
11
8
  "keywords": [],
12
9
  "author": "",
13
10
  "license": "ISC",
@@ -0,0 +1,5 @@
1
+ # .env
2
+ NODE_ENV=development
3
+
4
+ # 接口域名
5
+ VITE_APP_BASE_API = '/api'
@@ -0,0 +1,4 @@
1
+ # .env.production
2
+ NODE_ENV=production
3
+
4
+ VITE_APP_BASE_API = 'https://httpbin.org'
@@ -0,0 +1,4 @@
1
+ # .env.test
2
+ NODE_ENV=test
3
+
4
+ VITE_APP_BASE_API = 'https://httpbin.org'
@@ -0,0 +1,18 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: { browser: true, es2020: true },
4
+ extends: [
5
+ 'eslint:recommended',
6
+ 'plugin:@typescript-eslint/recommended',
7
+ 'plugin:react-hooks/recommended',
8
+ ],
9
+ ignorePatterns: ['dist', '.eslintrc.cjs'],
10
+ parser: '@typescript-eslint/parser',
11
+ plugins: ['react-refresh'],
12
+ rules: {
13
+ 'react-refresh/only-export-components': [
14
+ 'warn',
15
+ { allowConstantExport: true },
16
+ ],
17
+ },
18
+ }
@@ -0,0 +1,15 @@
1
+ # React + TypeScript + Vite
2
+
3
+
4
+
5
+ ## 启动项目
6
+ ```bash
7
+ pnpm install
8
+ pnpm dev
9
+ ```
10
+
11
+
12
+ ## 项目技术栈
13
+ - react v18 (框架)
14
+ - antd desidn v6 (组件库)
15
+ - austand v5 (状态管理库)
@@ -0,0 +1,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + React + TS</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/app.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "vite-react-template",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite --open --mode development",
8
+ "build:test": "tsc && vite build --mode test",
9
+ "build:prod": "tsc && vite build --mode production",
10
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
11
+ "preview": "vite preview"
12
+ },
13
+ "dependencies": {
14
+ "@ant-design/icons": "^5.2.6",
15
+ "antd": "^6.1.4",
16
+ "axios": "^1.6.7",
17
+ "dayjs": "^1.11.10",
18
+ "lodash-es": "^4.17.21",
19
+ "react": "^18.2.0",
20
+ "react-dom": "^18.2.0",
21
+ "react-router-dom": "^6.20.0",
22
+ "uuid": "^11.1.0",
23
+ "zustand": "^5.0.5"
24
+ },
25
+ "devDependencies": {
26
+ "@types/lodash-es": "^4.17.12",
27
+ "@types/node": "^24.2.0",
28
+ "@types/react": "^18.2.37",
29
+ "@types/react-dom": "^18.2.15",
30
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
31
+ "@typescript-eslint/parser": "^6.10.0",
32
+ "@vitejs/plugin-react": "^4.2.0",
33
+ "eslint": "^8.53.0",
34
+ "eslint-plugin-react-hooks": "^4.6.0",
35
+ "eslint-plugin-react-refresh": "^0.4.4",
36
+ "path": "^0.12.7",
37
+ "sass": "^1.69.5",
38
+ "typescript": "^5.2.2",
39
+ "url": "^0.11.3",
40
+ "vite": "^5.0.0"
41
+ }
42
+ }