From b4b71f1a1eff0295354bccad725cd9fdb5596740 Mon Sep 17 00:00:00 2001 From: smallchill Date: Thu, 3 Jan 2019 13:32:38 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 9 +++-- LICENSE | 2 +- README.md | 69 +++++++++++++++++++++------------ appveyor.yml | 4 +- doc/文件更新.md | 21 ---------- jest-puppeteer.config.js | 2 +- package.json | 24 ++++++++---- scripts/prettier.js | 18 +-------- src/pages/Monitor/Log/LogApi.js | 2 +- src/pages/document.ejs | 2 +- 10 files changed, 75 insertions(+), 78 deletions(-) delete mode 100644 doc/文件更新.md diff --git a/.circleci/config.yml b/.circleci/config.yml index f889c7d..e6c87e9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,7 @@ jobs: steps: - checkout - run: npm install + - run: npm run lint - run: npm run build test: docker: @@ -13,12 +14,12 @@ jobs: steps: - checkout - run: npm install - - run: - command : npm run test:all - no_output_timeout : 30m + - run: + command: npm run test:all + no_output_timeout: 30m workflows: version: 2 build_and_test: jobs: - build - - test \ No newline at end of file + - test diff --git a/LICENSE b/LICENSE index 7ac7318..c17ba2f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Alipay.inc +Copyright (c) 2019 Alipay.inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index f1b27bc..addeae1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## 简介 -Sword 是 [SpringBlade](https://gitee.com/smallc/SpringBlade) 前端UI项目,基于react 、ant design、dva,用于快速构建系统中后台业务。 +Sword 是 SpringBlade前端UI项目,基于react 、ant design、dva,用于快速构建系统中后台业务。 ## 特性 @@ -9,7 +9,7 @@ Sword 是 [SpringBlade](https://gitee.com/smallc/SpringBlade) 前端UI项目, - :iphone: **响应式**:针对不同屏幕大小设计 - :art: **主题**:可配置的主题满足多样化的品牌诉求 - :globe_with_meridians: **国际化**:内建业界通用的国际化方案 -- :gear: **最佳实践**:良好的工程实践助您持续产出高质量代码 +- :zap: **最佳实践**:良好的工程实践助您持续产出高质量代码 - :1234: **Mock 数据**:实用的本地数据调试方案 - :white_check_mark: **UI 测试**:自动化测试保障前端产品质量 @@ -40,29 +40,50 @@ $ npm install # mock模式 $ npm start # 服务模式 -$ npm start:no-mock +$ npm run start:no-mock # 访问 http://localhost:88 ``` # 界面一览 -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-k8s.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-traefik.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-traefik-health.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-harbor.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-consul.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-consul-nodes1.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-consul-nodes2.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-admin1.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-admin2.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-swagger1.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-swagger2.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-main.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-menu.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-menu-edit.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-menu-icon.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-role.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-user.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-dict.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-locale-cn.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-locale-us.png "业务系统") -![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-log.png "业务系统") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/appveyor.yml b/appveyor.yml index 22ae188..f2ffbbd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,10 +1,10 @@ # Test against the latest version of this Node.js version environment: - nodejs_version: "8" + nodejs_version: '10' # this is how to allow failing jobs in the matrix matrix: - fast_finish: true # set this flag to immediately finish build once one of the jobs fails. + fast_finish: true # set this flag to immediately finish build once one of the jobs fails. # Install scripts. (runs after repo cloning) install: diff --git a/doc/文件更新.md b/doc/文件更新.md deleted file mode 100644 index 6a7872e..0000000 --- a/doc/文件更新.md +++ /dev/null @@ -1,21 +0,0 @@ -#修改文件如下: -config/config.js [history:hash/proxy] - -mock/menu.js - -src/models/menu.js -src/models/login.js - -src/services/menu.js -src/services/api.js [fakeAccountLogin] - -src/utils/authority.js -src/utils/request.js -src/utils/utils.js - -src/pages/User/Login.js - -src/components/AdvancedTable -src/components/StandardTable - - diff --git a/jest-puppeteer.config.js b/jest-puppeteer.config.js index 53fa1df..d720fc2 100644 --- a/jest-puppeteer.config.js +++ b/jest-puppeteer.config.js @@ -1,7 +1,7 @@ // ps https://github.com/GoogleChrome/puppeteer/issues/3120 module.exports = { launch: { - headless: false, + headless: true, args: [ '--disable-gpu', '--disable-dev-shm-usage', diff --git a/package.json b/package.json index f79a2ed..24dce03 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "site": "npm run presite && cross-env APP_TYPE=site npm run build && firebase deploy && npm run docker:push", "analyze": "cross-env ANALYZE=1 umi build", "lint:style": "stylelint \"src/**/*.less\" --syntax less", - "lint": "eslint --ext .js src mock tests && npm run lint:style", + "lint:prettier": "check-prettier lint", + "lint": "eslint --ext .js src mock tests && npm run lint:style && npm run lint:prettier", "lint:fix": "eslint --fix --ext .js src mock tests && npm run lint:style", "lint-staged": "lint-staged", "lint-staged:js": "eslint --ext .js", @@ -31,9 +32,9 @@ }, "dependencies": { "@antv/data-set": "^0.10.0", - "@babel/runtime": "^7.1.5", + "@babel/runtime": "^7.2.0", "antd": "^3.11.6", - "bizcharts": "^3.4.0", + "bizcharts": "^3.4.2", "bizcharts-plugin-slider": "^2.1.1-beta.1", "classnames": "^2.2.6", "dva": "^2.4.0", @@ -43,6 +44,7 @@ "lodash-decorators": "^6.0.0", "memoize-one": "^5.0.0", "moment": "^2.22.2", + "npm": "^6.5.0", "numeral": "^2.0.6", "nzh": "^1.0.3", "omit.js": "^1.0.0", @@ -66,9 +68,10 @@ "antd-pro-merge-less": "^1.0.0", "antd-theme-webpack-plugin": "^1.1.8", "babel-eslint": "^10.0.1", + "check-prettier": "^1.0.1", "cross-env": "^5.1.1", "cross-port-killer": "^1.0.1", - "enzyme": "^3.7.0", + "enzyme": "3.7.0", "eslint": "^5.4.0", "eslint-config-airbnb": "^17.0.0", "eslint-config-prettier": "^3.0.1", @@ -86,16 +89,16 @@ "mockjs": "^1.0.1-beta3", "prettier": "1.15.2", "pro-download": "^1.0.1", + "slash2": "^2.0.0", "stylelint": "^9.8.0", "stylelint-config-prettier": "^4.0.0", "stylelint-config-standard": "^18.0.0", "tslint": "^5.10.0", "tslint-config-prettier": "^1.10.0", "tslint-react": "^3.6.0", - "umi": "^2.2.7", + "umi": "^2.3.1", "umi-plugin-ga": "^1.1.3", - "umi-plugin-react": "^1.2.0", - "slash2": "^2.0.0" + "umi-plugin-react": "^1.2.0" }, "optionalDependencies": { "puppeteer": "^1.10.0" @@ -116,6 +119,13 @@ "last 2 versions", "not ie <= 10" ], + "checkFiles": [ + "src/**/*.js*", + "src/**/*.ts*", + "src/**/*.less", + "config/**/*.js*", + "scripts/**/*.js" + ], "husky": { "hooks": { "pre-commit": "npm run lint-staged" diff --git a/scripts/prettier.js b/scripts/prettier.js index aa4467f..9ce7813 100644 --- a/scripts/prettier.js +++ b/scripts/prettier.js @@ -9,26 +9,12 @@ const glob = require('glob'); const prettier = require('prettier'); const fs = require('fs'); +const getPrettierFiles = require('./getPrettierFiles'); const prettierConfigPath = require.resolve('../.prettierrc'); let didError = false; -let files = []; -const configFiles = glob.sync('config/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] }); -const mockFiles = glob.sync('mock/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] }); -const jsFiles = glob.sync('src/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] }); -const scriptFiles = glob.sync('scripts/**/*.js'); -const tsFiles = glob.sync('src/**/*.ts*', { ignore: ['**/node_modules/**', 'build/**'] }); -const lessFiles = glob.sync('src/**/*.less*', { ignore: ['**/node_modules/**', 'build/**'] }); -files = files.concat(configFiles); -files = files.concat(mockFiles); -files = files.concat(jsFiles); -files = files.concat(scriptFiles); -files = files.concat(tsFiles); -files = files.concat(lessFiles); -if (!files.length) { - return; -} +const files = getPrettierFiles(); files.forEach(file => { const options = prettier.resolveConfig.sync(file, { diff --git a/src/pages/Monitor/Log/LogApi.js b/src/pages/Monitor/Log/LogApi.js index dfd2187..c0b62da 100644 --- a/src/pages/Monitor/Log/LogApi.js +++ b/src/pages/Monitor/Log/LogApi.js @@ -45,7 +45,7 @@ class LogApi extends PureComponent {
+ {' '} diff --git a/src/pages/document.ejs b/src/pages/document.ejs index 66bc4ce..2bb0c7f 100644 --- a/src/pages/document.ejs +++ b/src/pages/document.ejs @@ -3,7 +3,7 @@ - + Sword企业级开发平台