@yyp92-cli/template-react-mobile 1.1.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 (64) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +15 -0
  3. package/template/.env.development +5 -0
  4. package/template/.env.production +5 -0
  5. package/template/.env.test +5 -0
  6. package/template/README.md +30 -0
  7. package/template/index.html +13 -0
  8. package/template/package.json +40 -0
  9. package/template/pnpm-lock.yaml +3365 -0
  10. package/template/postcss.config.js +25 -0
  11. package/template/public/vite.svg +1 -0
  12. package/template/src/app.scss +12 -0
  13. package/template/src/app.tsx +14 -0
  14. package/template/src/assets/iconfont/demo.css +539 -0
  15. package/template/src/assets/iconfont/demo_index.html +211 -0
  16. package/template/src/assets/iconfont/iconfont.css +19 -0
  17. package/template/src/assets/iconfont/iconfont.js +1 -0
  18. package/template/src/assets/iconfont/iconfont.json +16 -0
  19. package/template/src/assets/iconfont/iconfont.ttf +0 -0
  20. package/template/src/assets/iconfont/iconfont.woff +0 -0
  21. package/template/src/assets/iconfont/iconfont.woff2 +0 -0
  22. package/template/src/assets/react.svg +1 -0
  23. package/template/src/components/403/index.tsx +21 -0
  24. package/template/src/components/404/index.tsx +23 -0
  25. package/template/src/components/index.ts +3 -0
  26. package/template/src/components/layout/content/index.module.scss +20 -0
  27. package/template/src/components/layout/content/index.tsx +55 -0
  28. package/template/src/components/layout/index.module.scss +5 -0
  29. package/template/src/components/layout/index.tsx +33 -0
  30. package/template/src/components/layout/navBar/index.module.scss +5 -0
  31. package/template/src/components/layout/navBar/index.tsx +48 -0
  32. package/template/src/components/layout/tabBar/index.module.scss +7 -0
  33. package/template/src/components/layout/tabBar/index.tsx +69 -0
  34. package/template/src/components/login/index.module.scss +20 -0
  35. package/template/src/components/login/index.tsx +127 -0
  36. package/template/src/global/constants.ts +4 -0
  37. package/template/src/pages/home/index.module.scss +4 -0
  38. package/template/src/pages/home/index.tsx +55 -0
  39. package/template/src/pages/message/index.module.scss +4 -0
  40. package/template/src/pages/message/index.tsx +13 -0
  41. package/template/src/pages/mine/index.module.scss +3 -0
  42. package/template/src/pages/mine/index.tsx +35 -0
  43. package/template/src/pages/todo/index.module.scss +4 -0
  44. package/template/src/pages/todo/index.tsx +13 -0
  45. package/template/src/router/router.tsx +129 -0
  46. package/template/src/service/api.ts +7 -0
  47. package/template/src/service/config.ts +9 -0
  48. package/template/src/service/index.ts +1 -0
  49. package/template/src/service/request/index.ts +267 -0
  50. package/template/src/service/request/type.ts +5 -0
  51. package/template/src/service/service.ts +27 -0
  52. package/template/src/store/login.ts +39 -0
  53. package/template/src/store/menus.ts +28 -0
  54. package/template/src/store/permission.ts +28 -0
  55. package/template/src/theme/darkTheme.scss +47 -0
  56. package/template/src/theme/lightTheme.scss +49 -0
  57. package/template/src/utils/cache.ts +44 -0
  58. package/template/src/utils/changeTheme.ts +14 -0
  59. package/template/src/utils/filterMenu.ts +21 -0
  60. package/template/src/utils/index.ts +3 -0
  61. package/template/src/vite-env.d.ts +4 -0
  62. package/template/tsconfig.json +42 -0
  63. package/template/tsconfig.node.json +10 -0
  64. package/template/vite.config.ts +57 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @yyp92-cli/template-react-mobile
2
+
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - yyp92-cli 项目模板完善
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@yyp92-cli/template-react-mobile",
3
+ "version": "1.1.0",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "main": "index.js",
8
+ "keywords": [],
9
+ "author": "",
10
+ "license": "ISC",
11
+ "description": "",
12
+ "scripts": {
13
+ "test": "echo \"Error: no test specified\" && exit 1"
14
+ }
15
+ }
@@ -0,0 +1,5 @@
1
+ # .env
2
+ NODE_ENV=development
3
+
4
+ # 接口域名
5
+ VITE_APP_BASE_API = '/api'
@@ -0,0 +1,5 @@
1
+ # .env.production
2
+ NODE_ENV=production
3
+
4
+ # 接口域名
5
+ VITE_APP_BASE_API = 'https://httpbin.org'
@@ -0,0 +1,5 @@
1
+ # .env.test
2
+ NODE_ENV=test
3
+
4
+ # 接口域名
5
+ VITE_APP_BASE_API = 'https://httpbin.org'
@@ -0,0 +1,30 @@
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## Expanding the ESLint configuration
11
+
12
+ If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
+
14
+ - Configure the top-level `parserOptions` property like this:
15
+
16
+ ```js
17
+ export default {
18
+ // other rules...
19
+ parserOptions: {
20
+ ecmaVersion: 'latest',
21
+ sourceType: 'module',
22
+ project: ['./tsconfig.json', './tsconfig.node.json'],
23
+ tsconfigRootDir: __dirname,
24
+ },
25
+ }
26
+ ```
27
+
28
+ - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
29
+ - Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
30
+ - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
@@ -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-mobile-template</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,40 @@
1
+ {
2
+ "name": "react-mobile-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
+ "antd-mobile": "^5.34.0",
15
+ "antd-mobile-icons": "^0.3.0",
16
+ "axios": "^1.9.0",
17
+ "lodash-es": "^4.17.21",
18
+ "react": "^18.2.0",
19
+ "react-dom": "^18.2.0",
20
+ "react-router-dom": "^7.6.1",
21
+ "zustand": "^5.0.5"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^20.11.16",
25
+ "@types/react": "^18.2.43",
26
+ "@types/react-dom": "^18.2.17",
27
+ "@typescript-eslint/eslint-plugin": "^6.14.0",
28
+ "@typescript-eslint/parser": "^6.14.0",
29
+ "@vitejs/plugin-react": "^4.2.1",
30
+ "autoprefixer": "^10.4.17",
31
+ "eslint": "^8.55.0",
32
+ "eslint-plugin-react-hooks": "^4.6.0",
33
+ "eslint-plugin-react-refresh": "^0.4.5",
34
+ "postcss": "^8.4.33",
35
+ "postcss-px-to-viewport": "^1.1.1",
36
+ "sass": "^1.89.0",
37
+ "typescript": "^5.2.2",
38
+ "vite": "^5.0.8"
39
+ }
40
+ }