@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.
- package/CHANGELOG.md +7 -0
- package/package.json +15 -0
- package/template/.env.development +5 -0
- package/template/.env.production +5 -0
- package/template/.env.test +5 -0
- package/template/README.md +30 -0
- package/template/index.html +13 -0
- package/template/package.json +40 -0
- package/template/pnpm-lock.yaml +3365 -0
- package/template/postcss.config.js +25 -0
- package/template/public/vite.svg +1 -0
- package/template/src/app.scss +12 -0
- package/template/src/app.tsx +14 -0
- package/template/src/assets/iconfont/demo.css +539 -0
- package/template/src/assets/iconfont/demo_index.html +211 -0
- package/template/src/assets/iconfont/iconfont.css +19 -0
- package/template/src/assets/iconfont/iconfont.js +1 -0
- package/template/src/assets/iconfont/iconfont.json +16 -0
- package/template/src/assets/iconfont/iconfont.ttf +0 -0
- package/template/src/assets/iconfont/iconfont.woff +0 -0
- package/template/src/assets/iconfont/iconfont.woff2 +0 -0
- package/template/src/assets/react.svg +1 -0
- package/template/src/components/403/index.tsx +21 -0
- package/template/src/components/404/index.tsx +23 -0
- package/template/src/components/index.ts +3 -0
- package/template/src/components/layout/content/index.module.scss +20 -0
- package/template/src/components/layout/content/index.tsx +55 -0
- package/template/src/components/layout/index.module.scss +5 -0
- package/template/src/components/layout/index.tsx +33 -0
- package/template/src/components/layout/navBar/index.module.scss +5 -0
- package/template/src/components/layout/navBar/index.tsx +48 -0
- package/template/src/components/layout/tabBar/index.module.scss +7 -0
- package/template/src/components/layout/tabBar/index.tsx +69 -0
- package/template/src/components/login/index.module.scss +20 -0
- package/template/src/components/login/index.tsx +127 -0
- package/template/src/global/constants.ts +4 -0
- package/template/src/pages/home/index.module.scss +4 -0
- package/template/src/pages/home/index.tsx +55 -0
- package/template/src/pages/message/index.module.scss +4 -0
- package/template/src/pages/message/index.tsx +13 -0
- package/template/src/pages/mine/index.module.scss +3 -0
- package/template/src/pages/mine/index.tsx +35 -0
- package/template/src/pages/todo/index.module.scss +4 -0
- package/template/src/pages/todo/index.tsx +13 -0
- package/template/src/router/router.tsx +129 -0
- package/template/src/service/api.ts +7 -0
- package/template/src/service/config.ts +9 -0
- package/template/src/service/index.ts +1 -0
- package/template/src/service/request/index.ts +267 -0
- package/template/src/service/request/type.ts +5 -0
- package/template/src/service/service.ts +27 -0
- package/template/src/store/login.ts +39 -0
- package/template/src/store/menus.ts +28 -0
- package/template/src/store/permission.ts +28 -0
- package/template/src/theme/darkTheme.scss +47 -0
- package/template/src/theme/lightTheme.scss +49 -0
- package/template/src/utils/cache.ts +44 -0
- package/template/src/utils/changeTheme.ts +14 -0
- package/template/src/utils/filterMenu.ts +21 -0
- package/template/src/utils/index.ts +3 -0
- package/template/src/vite-env.d.ts +4 -0
- package/template/tsconfig.json +42 -0
- package/template/tsconfig.node.json +10 -0
- package/template/vite.config.ts +57 -0
package/CHANGELOG.md
ADDED
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,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
|
+
}
|