Skip to content

Commit 7c81e55

Browse files
author
fanyushun
committed
init project
0 parents  commit 7c81e55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+5101
-0
lines changed

Diff for: .editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab

Diff for: .eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/lambda/
2+
/scripts
3+
/config
4+
.history

Diff for: .eslintrc.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
extends: [require.resolve('@umijs/fabric/dist/eslint')],
3+
globals: {
4+
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
5+
page: true,
6+
REACT_APP_ENV: true,
7+
},
8+
};

Diff for: .gitignore

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
**/node_modules
5+
# roadhog-api-doc ignore
6+
/src/utils/request-temp.js
7+
_roadhog-api-doc
8+
9+
# production
10+
/dist
11+
/.vscode
12+
13+
# misc
14+
.DS_Store
15+
npm-debug.log*
16+
yarn-error.log
17+
18+
/coverage
19+
.idea
20+
yarn.lock
21+
package-lock.json
22+
*bak
23+
.vscode
24+
25+
# visual studio code
26+
.history
27+
*.log
28+
functions/*
29+
.temp/**
30+
31+
# umi
32+
.umi
33+
.umi-production
34+
35+
# screenshot
36+
screenshot
37+
.firebase
38+
.eslintcache
39+
40+
build

Diff for: .prettierignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**/*.svg
2+
package.json
3+
.umi
4+
.umi-production
5+
/dist
6+
.dockerignore
7+
.DS_Store
8+
.eslintignore
9+
*.png
10+
*.toml
11+
docker
12+
.editorconfig
13+
Dockerfile*
14+
.gitignore
15+
.prettierignore
16+
LICENSE
17+
.eslintcache
18+
*.lock
19+
yarn-error.log
20+
.history
21+
CNAME
22+
/build
23+
/public

Diff for: .prettierrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const fabric = require('@umijs/fabric');
2+
3+
module.exports = {
4+
...fabric.prettier,
5+
};

Diff for: .stylelintrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const fabric = require('@umijs/fabric');
2+
3+
module.exports = {
4+
...fabric.stylelint,
5+
};

Diff for: README.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Ant Design Pro
2+
3+
This project is initialized with [Ant Design Pro](https://pro.ant.design). Follow is the quick guide for how to use.
4+
5+
## Environment Prepare
6+
7+
Install `node_modules`:
8+
9+
```bash
10+
npm install
11+
```
12+
13+
or
14+
15+
```bash
16+
yarn
17+
```
18+
19+
## Provided Scripts
20+
21+
Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test.
22+
23+
Scripts provided in `package.json`. It's safe to modify or add additional script:
24+
25+
### Start project
26+
27+
```bash
28+
npm start
29+
```
30+
31+
### Build project
32+
33+
```bash
34+
npm run build
35+
```
36+
37+
### Check code style
38+
39+
```bash
40+
npm run lint
41+
```
42+
43+
You can also use script to auto fix some lint error:
44+
45+
```bash
46+
npm run lint:fix
47+
```
48+
49+
### Test code
50+
51+
```bash
52+
npm test
53+
```
54+
55+
## More
56+
57+
You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro).

Diff for: config/config.ts

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// https://umijs.org/config/
2+
import { defineConfig } from 'umi';
3+
import defaultSettings from './defaultSettings';
4+
import proxy from './proxy';
5+
6+
const { REACT_APP_ENV } = process.env;
7+
8+
export default defineConfig({
9+
hash: true,
10+
antd: {},
11+
dva: {
12+
hmr: true,
13+
},
14+
layout: {
15+
name: 'Ant Design Pro',
16+
locale: true,
17+
},
18+
locale: {
19+
// default zh-CN
20+
default: 'zh-CN',
21+
antd: true,
22+
// default true, when it is true, will use `navigator.language` overwrite default
23+
baseNavigator: true,
24+
},
25+
dynamicImport: {
26+
loading: '@/components/PageLoading/index',
27+
},
28+
targets: {
29+
ie: 11,
30+
},
31+
// umi routes: https://umijs.org/docs/routing
32+
routes: [
33+
{
34+
path: '/user',
35+
layout: false,
36+
routes: [
37+
{
38+
name: 'login',
39+
path: '/user/login',
40+
component: './user/login',
41+
},
42+
],
43+
},
44+
{
45+
path: '/welcome',
46+
name: 'welcome',
47+
icon: 'smile',
48+
component: './Welcome',
49+
},
50+
{
51+
path: '/admin',
52+
name: 'admin',
53+
icon: 'crown',
54+
access: 'canAdmin',
55+
component: './Admin',
56+
routes: [
57+
{
58+
path: '/admin/sub-page',
59+
name: 'sub-page',
60+
icon: 'smile',
61+
component: './Welcome',
62+
},
63+
],
64+
},
65+
{
66+
name: 'list.table-list',
67+
icon: 'table',
68+
path: '/list',
69+
component: './ListTableList',
70+
},
71+
{
72+
path: '/',
73+
redirect: '/welcome',
74+
},
75+
{
76+
component: './404',
77+
},
78+
],
79+
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
80+
theme: {
81+
// ...darkTheme,
82+
'primary-color': defaultSettings.primaryColor,
83+
},
84+
// @ts-ignore
85+
title: false,
86+
ignoreMomentLocale: true,
87+
proxy: proxy[REACT_APP_ENV || 'dev'],
88+
manifest: {
89+
basePath: '/',
90+
},
91+
});

Diff for: config/defaultSettings.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Settings as LayoutSettings } from '@ant-design/pro-layout';
2+
3+
export default {
4+
navTheme: 'light',
5+
// 拂晓蓝
6+
primaryColor: '#1890ff',
7+
layout: 'mix',
8+
contentWidth: 'Fluid',
9+
fixedHeader: false,
10+
fixSiderbar: true,
11+
colorWeak: false,
12+
menu: {
13+
locale: true,
14+
},
15+
title: 'Ant Design Pro',
16+
pwa: false,
17+
iconfontUrl: '',
18+
} as LayoutSettings & {
19+
pwa: boolean;
20+
};

Diff for: config/proxy.ts

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
3+
* The agent cannot take effect in the production environment
4+
* so there is no configuration of the production environment
5+
* For details, please see
6+
* https://pro.ant.design/docs/deploy
7+
*/
8+
export default {
9+
dev: {
10+
'/api/': {
11+
target: 'https://preview.pro.ant.design',
12+
changeOrigin: true,
13+
pathRewrite: { '^': '' },
14+
},
15+
},
16+
test: {
17+
'/api/': {
18+
target: 'https://preview.pro.ant.design',
19+
changeOrigin: true,
20+
pathRewrite: { '^': '' },
21+
},
22+
},
23+
pre: {
24+
'/api/': {
25+
target: 'your pre url',
26+
changeOrigin: true,
27+
pathRewrite: { '^': '' },
28+
},
29+
},
30+
};

Diff for: jest.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
testURL: 'http://localhost:8000',
3+
testEnvironment: './tests/PuppeteerEnvironment',
4+
verbose: false,
5+
globals: {
6+
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false,
7+
localStorage: null,
8+
},
9+
};

Diff for: jsconfig.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"emitDecoratorMetadata": true,
4+
"experimentalDecorators": true,
5+
"baseUrl": ".",
6+
"paths": {
7+
"@/*": ["./src/*"]
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)