diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index e6c87e9a789df3daf425268c58e92c186767d2a0..0000000000000000000000000000000000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: circleci/node:latest - steps: - - checkout - - run: npm install - - run: npm run lint - - run: npm run build - test: - docker: - - image: circleci/node:latest-browsers - steps: - - checkout - - run: npm install - - run: - command: npm run test:all - no_output_timeout: 30m -workflows: - version: 2 - build_and_test: - jobs: - - build - - test diff --git a/AccountCenter/package.json b/AccountCenter/package.json index 6058ebff7305e1efaf8e3590e7f3a1bdd64e346f..e687973c4019ab29fbe5ec2b51cba13d08b670f9 100644 --- a/AccountCenter/package.json +++ b/AccountCenter/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/accountcenter" }, "dependencies": { - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "react": "^16.6.3", "umi-request": "^1.0.0" @@ -22,4 +22,4 @@ "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" -} +} \ No newline at end of file diff --git a/AccountSettings/package.json b/AccountSettings/package.json index aa8984ad3702b9c9356e7da4bfcb6ca106c29479..298c2698a78f86bf23b23aa1d5ea55e959c64ea8 100644 --- a/AccountSettings/package.json +++ b/AccountSettings/package.json @@ -12,7 +12,7 @@ "dev": "umi dev" }, "dependencies": { - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "react": "^16.6.3", "umi-request": "^1.0.0" diff --git a/AdvancedForm/package.json b/AdvancedForm/package.json index f9433b1b383bba8d56f2bd364328a4d6d27e616d..39b5c0179933e6e6355ab8bb4e61233deb2ce254 100644 --- a/AdvancedForm/package.json +++ b/AdvancedForm/package.json @@ -12,8 +12,7 @@ "dev": "umi dev" }, "dependencies": { - "ant-design-pro": "^2.1.1", - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "lodash": "^4.17.10", "react": "^16.6.3", diff --git a/AdvancedProfile/package.json b/AdvancedProfile/package.json index 386e0e138edb7bff330fa3dd1f2f1f3b2993f8d5..43a044fc0abc586552eb9015e28ff36705b68463 100644 --- a/AdvancedProfile/package.json +++ b/AdvancedProfile/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/advancedprofile" }, "dependencies": { - "antd": "^3.10.9", + "antd": "^3.16.3", "classnames": "^2.2.6", "dva": "^2.4.0", "lodash-decorators": "^6.0.0", @@ -25,4 +25,4 @@ "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" -} +} \ No newline at end of file diff --git a/Analysis/package.json b/Analysis/package.json index 170d660d4e4b021c90c8a5a0f8f95c2cc1c120af..3cc7f0b33517a55cfd00ffb171295b7fa530ddff 100644 --- a/Analysis/package.json +++ b/Analysis/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@antv/data-set": "^0.10.2", - "antd": "^3.10.9", + "antd": "^3.16.3", "bizcharts": "^3.5.2", "bizcharts-plugin-slider": "^2.1.1-beta.1", "dva": "^2.4.0", diff --git a/BasicForm/package.json b/BasicForm/package.json index 62a6f81d55ad17f9ae0f56149de03bb9d25101fe..9a8800894c74a296c6a31af2f6d3fecf40a255f5 100644 --- a/BasicForm/package.json +++ b/BasicForm/package.json @@ -11,8 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/basicform" }, "dependencies": { - "ant-design-pro": "^2.1.1", - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "react": "^16.6.3", "umi-request": "^1.0.0", @@ -24,4 +23,4 @@ "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" -} +} \ No newline at end of file diff --git a/BasicList/package.json b/BasicList/package.json index 27957a83bedb47a4ea4abc86ff5fca18b62b5ec1..bd684cdfdea5ed842bcabab30005b7f3136dc4fb 100644 --- a/BasicList/package.json +++ b/BasicList/package.json @@ -12,7 +12,7 @@ "dev": "umi dev" }, "dependencies": { - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "hash.js": "^1.1.5", "moment": "^2.22.2", diff --git a/BasicProfile/package.json b/BasicProfile/package.json index 9fc8477ae837d55f7040f620446f8eeaa70e6fbd..853d5343844ea31f193ac7431acb09afa7d5a6b4 100644 --- a/BasicProfile/package.json +++ b/BasicProfile/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/basicprofile" }, "dependencies": { - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "react": "^16.6.3", "umi-request": "^1.0.0" diff --git a/CardList/package.json b/CardList/package.json index 4fc5e6b0daa5ffacd5951e665febe61e115a429d..2106ac91c247fef73d00f6578598cb4e8269d9d8 100644 --- a/CardList/package.json +++ b/CardList/package.json @@ -11,8 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/cardlist" }, "dependencies": { - "ant-design-pro": "^2.1.1", - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "react": "^16.6.3", "umi-request": "^1.0.0" diff --git a/Monitor/package.json b/Monitor/package.json index 2af3f5f5fde566a0e83e68d1a0308faf538f665a..0c00322047a59b749ff81f7aa902c8fdcd5d1b65 100644 --- a/Monitor/package.json +++ b/Monitor/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@antv/data-set": "^0.10.2", - "antd": "^3.10.9", + "antd": "^3.16.3", "bizcharts": "^3.5.2", "bizcharts-plugin-slider": "^2.1.1-beta.1", "dva": "^2.4.0", diff --git a/ResultFail/package.json b/ResultFail/package.json index 7c448286baa4e0aaa61bc4a19a09cfdc7141fdc5..601520e6921e764fb32d8c3941dd8bcf333aff46 100644 --- a/ResultFail/package.json +++ b/ResultFail/package.json @@ -12,8 +12,7 @@ }, "dependencies": { "react": "^16.6.3", - "antd": "^3.10.9", - "ant-design-pro": "^2.1.1" + "antd": "^3.16.3" }, "devDependencies": { "umi": "^2.6.9", diff --git a/SearchListApplications/package.json b/SearchListApplications/package.json index 8dd5dcd814e34eafe3ac5a3d64eeeb94adfa0ab6..03aa7ffe5727554d3c842a100434f972c075e988 100644 --- a/SearchListApplications/package.json +++ b/SearchListApplications/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/searchlistapplications" }, "dependencies": { - "antd": "^3.10.9", + "antd": "^3.16.3", "classnames": "^2.2.6", "dva": "^2.4.0", "hash.js": "^1.1.5", diff --git a/SearchListArticles/package.json b/SearchListArticles/package.json index 9fb68ae58e443141b979202d68c37acac0239b25..55ba68c33c4d6571de2b4b53697b530501ffb206 100644 --- a/SearchListArticles/package.json +++ b/SearchListArticles/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/searchlistarticles" }, "dependencies": { - "antd": "^3.10.9", + "antd": "^3.16.3", "classnames": "^2.2.6", "dva": "^2.4.0", "moment": "^2.22.2", diff --git a/SearchListProjects/package.json b/SearchListProjects/package.json index 85dda4f6d1bd102bbc4d46977e87039ee362ebcd..8869ff24b5bfc789e3c552a079a1393eb542f3e1 100644 --- a/SearchListProjects/package.json +++ b/SearchListProjects/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/searchlistprojects" }, "dependencies": { - "antd": "^3.10.9", + "antd": "^3.16.3", "classnames": "^2.2.6", "dva": "^2.4.0", "moment": "^2.22.2", diff --git a/StepForm/package.json b/StepForm/package.json index 58301d1887d428a8eefd4ccd4e0d1431ea737ec0..2f3caad5bb4d5fdabbaa502abb172a3852795e71 100644 --- a/StepForm/package.json +++ b/StepForm/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/stepform" }, "dependencies": { - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "react": "^16.6.3", "umi-request": "^1.0.0", diff --git a/TableList/package.json b/TableList/package.json index 0c6f62c23edc5a4d1c7c68040f95db5cae8871c3..f661a0ecf11c223ff07884bf4ea72b8e5109dff2 100644 --- a/TableList/package.json +++ b/TableList/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/tablelist" }, "dependencies": { - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "moment": "^2.22.2", "react": "^16.6.3", diff --git a/UserLogin/package.json b/UserLogin/package.json index e41e85c5b07d8e373d8a4a83c708670061260c7a..098c6f58c07d698cf0221c3f29c608f364c0d440 100644 --- a/UserLogin/package.json +++ b/UserLogin/package.json @@ -11,8 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/userlogin" }, "dependencies": { - "ant-design-pro": "^2.1.1", - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "moment": "^2.22.2", "query-string": "^6.0.0", @@ -25,4 +24,4 @@ "umi-plugin-react": "^1.3.0-beta.1" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/UserLogin/src/_mock.ts b/UserLogin/src/_mock.ts index 362b027c6a9a0c47cc7808c1e75b46619b4a2f74..1bdba394c355190defbbe2dc0ef703c15f2b629e 100644 --- a/UserLogin/src/_mock.ts +++ b/UserLogin/src/_mock.ts @@ -1,9 +1,14 @@ -function getFakeCaptcha(req, res) { +function getFakeCaptcha(req: any, res: { json: (arg0: string) => void }) { return res.json('captcha-xxx'); } export default { - 'POST /api/BLOCK_NAME/account': (req, res) => { + 'POST /api/BLOCK_NAME/account': ( + req: { body: { password: any; userName: any; type: any } }, + res: { + send: (data: any) => void; + } + ) => { const { password, userName, type } = req.body; if (password === 'ant.design' && userName === 'admin') { res.send({ diff --git a/UserLogin/src/components/Login/LoginItem.tsx b/UserLogin/src/components/Login/LoginItem.tsx index e3694eff163aa91b6dde13c947eaf16b0b9b16f2..18a80e750063a482be28f0c3f44645252e2aa116 100644 --- a/UserLogin/src/components/Login/LoginItem.tsx +++ b/UserLogin/src/components/Login/LoginItem.tsx @@ -3,7 +3,7 @@ import { Form, Input, Button, Row, Col } from 'antd'; import omit from 'omit.js'; import styles from './index.less'; import ItemMap from './map'; -import LoginContext, { ILoginContext } from './loginContext'; +import LoginContext, { ILoginContext } from './LoginContext'; import { FormComponentProps } from 'antd/lib/form'; type Omit = Pick>; @@ -12,7 +12,7 @@ export type WrappedLoginItemProps = Omit }; -export interface LoginItemProps extends FormComponentProps { +export interface LoginItemProps { name?: string; rules?: any[]; style?: React.CSSProperties; @@ -23,9 +23,10 @@ export interface LoginItemProps extends FormComponentProps { countDown?: number; getCaptchaButtonText?: string; getCaptchaSecondText?: string; - updateActive: ILoginContext['updateActive']; - type: string; + updateActive?: ILoginContext['updateActive']; + type?: string; defaultValue?: string; + form?: FormComponentProps['form']; customProps?: { [key: string]: any }; onChange?: (e: any) => void; } @@ -124,7 +125,6 @@ class WrapFormItem extends Component { console.warn('name is required!'); return null; } - console.log(form); if (!form) { return null; } diff --git a/UserLogin/src/components/Login/LoginSubmit.tsx b/UserLogin/src/components/Login/LoginSubmit.tsx index 2a6c246cc07517a5034536fc863e6a032506c87c..ecac1c28372aa73c7a7cec2b47076a33bda29fd1 100644 --- a/UserLogin/src/components/Login/LoginSubmit.tsx +++ b/UserLogin/src/components/Login/LoginSubmit.tsx @@ -6,7 +6,7 @@ import { ButtonProps } from 'antd/lib/button'; const FormItem = Form.Item; interface LoginSubmitProps extends ButtonProps { - className: string; + className?: string; } const LoginSubmit: React.SFC = ({ className, ...rest }) => { diff --git a/UserLogin/src/components/Login/LoginTab.tsx b/UserLogin/src/components/Login/LoginTab.tsx index 90743f08cdd12b5dbe12527f67c20704d21b995a..6620882c05378f48e3f803c283db25d86c08daa8 100644 --- a/UserLogin/src/components/Login/LoginTab.tsx +++ b/UserLogin/src/components/Login/LoginTab.tsx @@ -34,13 +34,15 @@ class LoginTab extends Component { } } -const wrapContext = (props: TabPaneProps) => ( +const WrapContext: React.SFC & { + typeName: string; +} = props => ( {value => } ); // 标志位 用来判断是不是自定义组件 -wrapContext.typeName = 'LoginTab'; +WrapContext.typeName = 'LoginTab'; -export default wrapContext; +export default WrapContext; diff --git a/UserLogin/src/components/Login/index.tsx b/UserLogin/src/components/Login/index.tsx index 8ff29d165380812d763688eb2c7af5ece0b3e53b..289f2fbf4dddf0919350b4d155433c196cf76b33 100644 --- a/UserLogin/src/components/Login/index.tsx +++ b/UserLogin/src/components/Login/index.tsx @@ -8,12 +8,13 @@ import LoginContext, { ILoginContext } from './LoginContext'; import { FormComponentProps } from 'antd/lib/form'; import LoginSubmit from './LoginSubmit'; -export interface LoginProps extends FormComponentProps { +export interface LoginProps { defaultActiveKey?: string; onTabChange?: (key: string) => void; style?: React.CSSProperties; onSubmit?: (error: any, values: any) => void; className?: string; + form?: FormComponentProps['form']; children: React.ReactElement[]; } @@ -96,9 +97,10 @@ class Login extends Component { const { active = {}, type = '' } = this.state; const { form, onSubmit } = this.props; const activeFields = active[type] || []; - form.validateFields(activeFields, { force: true }, (err, values) => { - onSubmit && onSubmit(err, values); - }); + form && + form.validateFields(activeFields, { force: true }, (err, values) => { + onSubmit && onSubmit(err, values); + }); }; render() { @@ -119,7 +121,6 @@ class Login extends Component { } } ); - console.log(this.getContext()); return (
@@ -149,4 +150,4 @@ class Login extends Component { Login[item] = LoginItem[item]; }); -export default Form.create()(Login); +export default (Form.create()(Login as any) as unknown) as typeof Login; diff --git a/UserLogin/src/index.tsx b/UserLogin/src/index.tsx index cfcc0b8e774f6cb4754f46a0a374e43337d1bf55..c22c8e6bc4779de6215e637cfcccef10b74f8cfc 100644 --- a/UserLogin/src/index.tsx +++ b/UserLogin/src/index.tsx @@ -5,40 +5,78 @@ import Link from 'umi/link'; import { Checkbox, Alert, Icon } from 'antd'; import Login from './components/Login'; import styles from './style.less'; +import { Dispatch } from 'redux'; +import { IStateType } from './model'; +import { FormComponentProps } from 'antd/lib/form'; +import { CheckboxChangeEvent } from 'antd/lib/checkbox'; const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login; -@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({ - BLOCK_NAME_CAMEL_CASE, - submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/login'], -})) -class LoginPage extends Component { - state = { +interface BLOCK_NAME_CAMEL_CASEProps { + dispatch: Dispatch; + BLOCK_NAME_CAMEL_CASE: IStateType; + submitting: boolean; +} +interface BLOCK_NAME_CAMEL_CASEState { + type: string; + autoLogin: boolean; +} +export interface FromDataType { + userName: string; + password: string; + mobile: string; + captcha: string; +} + +@connect( + ({ + BLOCK_NAME_CAMEL_CASE, + loading, + }: { + BLOCK_NAME_CAMEL_CASE: IStateType; + loading: { + effects: { + [key: string]: string; + }; + }; + }) => ({ + BLOCK_NAME_CAMEL_CASE, + submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/login'], + }) +) +class BLOCK_NAME_CAMEL_CASE extends Component< + BLOCK_NAME_CAMEL_CASEProps, + BLOCK_NAME_CAMEL_CASEState +> { + state: BLOCK_NAME_CAMEL_CASEState = { type: 'account', autoLogin: true, }; - onTabChange = type => { + onTabChange = (type: string) => { this.setState({ type }); }; - loginForm: loginForm; + loginForm: FormComponentProps['form'] | undefined | null; onGetCaptcha = () => new Promise((resolve, reject) => { - this.loginForm.validateFields(['mobile'], {}, (err, values) => { + if (!this.loginForm) { + return; + } + this.loginForm.validateFields(['mobile'], {}, (err: any, values: FromDataType) => { if (err) { reject(err); } else { const { dispatch } = this.props; - dispatch({ + ((dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/getCaptcha', payload: values.mobile, - }) + }) as unknown) as Promise) .then(resolve) .catch(reject); } }); }); - handleSubmit = (err, values) => { + handleSubmit = (err: any, values: FromDataType) => { const { type } = this.state; if (!err) { const { dispatch } = this.props; @@ -52,13 +90,13 @@ class LoginPage extends Component { } }; - changeAutoLogin = e => { + changeAutoLogin = (e: CheckboxChangeEvent) => { this.setState({ autoLogin: e.target.checked, }); }; - renderMessage = content => ( + renderMessage = (content: string) => ( ); @@ -72,7 +110,7 @@ class LoginPage extends Component { defaultActiveKey={type} onTabChange={this.onTabChange} onSubmit={this.handleSubmit} - ref={form => { + ref={(form: any) => { this.loginForm = form; }} > @@ -92,7 +130,7 @@ class LoginPage extends Component { message: formatMessage({ id: 'BLOCK_NAME.userName.required' }), }, ]} - />{' '} + /> this.loginForm.validateFields(this.handleSubmit)} + onPressEnter={() => + this.loginForm && this.loginForm.validateFields(this.handleSubmit) + } /> @@ -112,7 +152,7 @@ class LoginPage extends Component { this.renderMessage( formatMessage({ id: 'BLOCK_NAME.login.message-invalid-verification-code' }) )} - {/* */} + />
@@ -167,4 +207,4 @@ class LoginPage extends Component { } } -export default LoginPage; +export default BLOCK_NAME_CAMEL_CASE; diff --git a/UserLogin/src/model.ts b/UserLogin/src/model.ts index 80d73caa4d5c290400a6ad4e01bf0f0ae2845386..60361f5891cb413ea9025a0839fb31843c90a5e1 100644 --- a/UserLogin/src/model.ts +++ b/UserLogin/src/model.ts @@ -2,7 +2,34 @@ import { routerRedux } from 'dva/router'; import { getPageQuery } from './utils/utils'; import { fakeAccountLogin, getFakeCaptcha } from './service'; -export default { +import { Reducer } from 'redux'; +import { EffectsCommandMap } from 'dva'; +import { AnyAction } from 'redux'; + +export interface IStateType { + status?: 'ok' | 'error'; + type?: string; + currentAuthority?: 'user' | 'guest' | 'admin'; +} + +export type Effect = ( + action: AnyAction, + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T } +) => void; + +export interface ModelType { + namespace: string; + state: IStateType; + effects: { + login: Effect; + getCaptcha: Effect; + }; + reducers: { + changeLoginStatus: Reducer; + }; +} + +const Model: ModelType = { namespace: 'BLOCK_NAME_CAMEL_CASE', state: { @@ -20,7 +47,7 @@ export default { if (response.status === 'ok') { const urlParams = new URL(window.location.href); const params = getPageQuery(); - let { redirect } = params; + let { redirect } = params as { redirect: string }; if (redirect) { const redirectUrlParams = new URL(redirect); if (redirectUrlParams.origin === urlParams.origin) { @@ -44,7 +71,6 @@ export default { reducers: { changeLoginStatus(state, { payload }) { - setAuthority(payload.currentAuthority); return { ...state, status: payload.status, @@ -53,3 +79,5 @@ export default { }, }, }; + +export default Model; diff --git a/UserLogin/src/service.ts b/UserLogin/src/service.ts index 9e99a1b848fa0c325be864d4e02db2093c32cd93..2943090d6b99095aa72461d2ab0a6a868cb0f2c8 100644 --- a/UserLogin/src/service.ts +++ b/UserLogin/src/service.ts @@ -1,12 +1,13 @@ import request from 'umi-request'; +import { FromDataType } from './index'; -export async function fakeAccountLogin(params) { +export async function fakeAccountLogin(params: FromDataType) { return request('/api/BLOCK_NAME/account', { method: 'POST', data: params, }); } -export async function getFakeCaptcha(mobile) { +export async function getFakeCaptcha(mobile: string) { return request(`/api/BLOCK_NAME/captcha?mobile=${mobile}`); } diff --git a/UserRegister/package.json b/UserRegister/package.json index ffc8f2d6741fd48f1c25168b13e18ec1451b787d..d00479f6cd448a80c1fba2334839a0629d432eed 100644 --- a/UserRegister/package.json +++ b/UserRegister/package.json @@ -11,8 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/userregister" }, "dependencies": { - "ant-design-pro": "^2.1.1", - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "hash.js": "^1.1.5", "moment": "^2.22.2", @@ -26,4 +25,4 @@ "umi-plugin-block-dev": "^1.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/UserRegisterResult/package.json b/UserRegisterResult/package.json index add0eb1a5ddf7564543a0535eae2711de43f090a..6872d14a64bf29ce69f4788d96c983cdd082fc56 100644 --- a/UserRegisterResult/package.json +++ b/UserRegisterResult/package.json @@ -12,8 +12,7 @@ }, "dependencies": { "react": "^16.6.3", - "antd": "^3.10.9", - "ant-design-pro": "^2.1.1" + "antd": "^3.16.3" }, "devDependencies": { "umi": "^2.6.9", @@ -21,4 +20,4 @@ "umi-plugin-block-dev": "^1.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/Workplace/package.json b/Workplace/package.json index f8cb63021524bc8880bb89f5404d29ae5c51fa3b..ff500b4c83538eef7bc851a675ace0a8bf2d5414 100644 --- a/Workplace/package.json +++ b/Workplace/package.json @@ -11,8 +11,7 @@ "url": "https://github.com/umijs/umi-blocks/ant-design-pro/workplace" }, "dependencies": { - "ant-design-pro": "^2.1.1", - "antd": "^3.10.9", + "antd": "^3.16.3", "dva": "^2.4.0", "moment": "^2.22.2", "prop-types": "^15.5.10", @@ -25,4 +24,4 @@ "umi-plugin-react": "^1.3.0-beta.1" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/package.json b/package.json index a40dfa0583e0f2cf2a32f81d96aaa05a52d2df12..c932f2d5db79176f77d57d5be4af94a66f6b963a 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,32 @@ "private": true, "scripts": { "dev": "cross-env PAGES_PATH='UserLogin/src' umi dev", - "lint:style": "stylelint \"src/**/*.less\" --syntax less", "lint": "eslint --ext .js src mock tests && npm run lint:style", - "lint:fix": "eslint --fix --ext .js src mock tests && npm run lint:style", "lint-staged": "lint-staged", "lint-staged:js": "eslint --ext .js", + "lint:fix": "eslint --fix --ext .js src mock tests && npm run lint:style", + "lint:style": "stylelint \"src/**/*.less\" --syntax less", "prettier": "node ./_scripts/prettier.js" }, + "husky": { + "hooks": { + "pre-commit": "npm run lint-staged" + } + }, + "lint-staged": { + "**/*.less": "stylelint --syntax less", + "x/**/*.{js,jsx}": "npm run lint-staged:js", + "x/**/*.{js,ts,tsx,json,jsx,less}": [ + "node ./_scripts/lint-prettier.js", + "git add" + ] + }, + "dependencies": { + "cross-env": "^5.2.0" + }, + "peerDependencies": { + "antd": "^3.16.3" + }, "devDependencies": { "@types/classnames": "^2.2.7", "babel-eslint": "^10.0.1", @@ -32,21 +51,5 @@ "umi-plugin-block-dev": "^2.0.2", "umi-plugin-react": "^1.3.0-0", "umi-request": "^1.0.0" - }, - "lint-staged": { - "x/**/*.{js,ts,tsx,json,jsx,less}": [ - "node ./_scripts/lint-prettier.js", - "git add" - ], - "x/**/*.{js,jsx}": "npm run lint-staged:js", - "**/*.less": "stylelint --syntax less" - }, - "husky": { - "hooks": { - "pre-commit": "npm run lint-staged" - } - }, - "dependencies": { - "cross-env": "^5.2.0" } } \ No newline at end of file