diff --git a/.travis.yml b/.travis.yml index dfb9d1a43..96b53ce6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,10 @@ node_js: before_script: - npm install vue vue-template-compiler script: + - cp ./scripts/.npmrc.template $HOME/.npmrc - COVERAGE=true npm run test - npm run codecov + - if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then npm run pub-with-ci; fi - bash ./scripts/deploy-to-gh-pages.sh env: matrix: diff --git a/BACKERS.md b/BACKERS.md new file mode 100644 index 000000000..8a3ca33dd --- /dev/null +++ b/BACKERS.md @@ -0,0 +1,26 @@ +
+ + 虚位以待... + +
+ ++ + 虚位以待... + +
+ ++ +
+ ## 特性 - 提炼自企业级中后台产品的交互语言和视觉风格。 diff --git a/README.md b/README.md index ee402d4cc..2b0c34255 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,17 @@ An enterprise-class UI components based on Ant Design 3.X and Vue. - A set of high-quality Vue components out of the box. - Shared [Ant Design of React](https://ant.design/docs/spec/introduce) design resources. +## Donation + +vue-antd-ui is an open source independent project. In order to achieve better and sustainable development of the project, we hope to get your support. You can support us in any of the following ways: + +- [Patreon](https://www.patreon.com/tangjinzhou) +- [opencollective](https://opencollective.com/ant-design-278) +- [paypal](https://www.paypal.me/tangjinzhou) + ++ +
## Using npm or yarn diff --git a/antd-tools/gulpfile.js b/antd-tools/gulpfile.js index cf8754b7c..336620da8 100644 --- a/antd-tools/gulpfile.js +++ b/antd-tools/gulpfile.js @@ -25,6 +25,7 @@ const fs = require('fs') const rimraf = require('rimraf') const replaceLib = require('./replaceLib') const stripCode = require('gulp-strip-code') +const compareVersions = require('compare-versions') const cwd = process.cwd() const libDir = path.join(cwd, 'lib') @@ -133,13 +134,15 @@ function compile (modules) { function tag () { console.log('tagging') const { version } = packageJson + execSync(`git config --global user.email ${process.env.GITHUB_USER_EMAIL}`) + execSync(`git config --global user.name ${process.env.GITHUB_USER_NAME}`) execSync(`git tag ${version}`) execSync(`git push origin ${version}:${version}`) execSync('git push origin master:master') console.log('tagged') } -function githubRelease () { +function githubRelease (done) { const changlogFiles = [ path.join(cwd, 'CHANGELOG.en-US.md'), path.join(cwd, 'CHANGELOG.zh-CN.md'), @@ -173,13 +176,14 @@ function githubRelease () { const [_, owner, repo] = execSync('git remote get-url origin') // eslint-disable-line .toString() .match(/github.com[:/](.+)\/(.+)\.git/) - github.repos.createRelease({ owner, repo, tag_name: version, name: version, body: changelog, + }).then(() => { + done() }) } gulp.task('check-git', (done) => { @@ -204,8 +208,9 @@ function publish (tagString, done) { const publishNpm = process.env.PUBLISH_NPM_CLI || 'npm' runCmd(publishNpm, args, (code) => { tag() - githubRelease() - done(code) + githubRelease(() => { + done(code) + }) }) } @@ -261,6 +266,43 @@ gulp.task('pub', ['check-git', 'compile'], (done) => { } }) +gulp.task('pub-with-ci', (done) => { + if (!process.env.NPM_TOKEN) { + console.log('no NPM token found, skip') + } else { + const github = new GitHub() + github.authenticate({ + type: 'oauth', + token: process.env.GITHUB_TOKEN, + }) + const [_, owner, repo] = execSync('git remote get-url origin') // eslint-disable-line + .toString() + .match(/github.com[:/](.+)\/(.+)\.git/) + const getLatestRelease = github.repos.getLatestRelease({ + owner, + repo, + }) + const getCommits = github.repos.getCommits({ + owner, + repo, + per_page: 1, + }) + Promise.all([getLatestRelease, getCommits]).then(([latestRelease, commits]) => { + const preVersion = latestRelease.data.tag_name + const { version } = packageJson + const [_, newVersion] = commits.data[0].commit.message.trim().match(/bump (.+)/) || [] + if (compareVersions(version, preVersion) === 1 && newVersion && newVersion.trim() === version) { + gulp.run('pub', (err) => { + err && console.log('err', err) + done() + }) + } else { + console.log('donot need publish' + version) + } + }) + } +}) + function reportError () { console.log(chalk.bgRed('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')) console.log(chalk.bgRed('!! `npm publish` is forbidden for this package. !!')) diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index a2a53ece7..cc9337970 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -119,13 +119,11 @@ After wrapped by `getFieldDecorator`, `value`(or other property defined by `valu | options.initialValue | You can specify initial value, type, optional value of children node. (Note: Because `Form` will test equality with `===` internaly, we recommend to use vairable as `initialValue`, instead of literal) | | n/a | | options.normalize | Normalize value to form component, [a select-all example](https://codesandbox.io/s/kw4l2vqqmv) | function(value, prevValue, allValues): any | - | | options.rules | Includes validation rules. Please refer to "Validation Rules" part for details. | object\[] | n/a | -| options.trigger | When to collect the value of children node | string | 'onChange' | +| options.trigger | When to collect the value of children node | string | 'change' | | options.validateFirst | Whether stop validate on first rule of error for this field. | boolean | false | -| options.validateTrigger | When to validate the value of children node. | string\|string\[] | 'onChange' | +| options.validateTrigger | When to validate the value of children node. | string\|string\[] | 'change' | | options.valuePropName | Props of children node, for example, the prop of Switch is 'checked'. | string | 'value' | -More option can be referenced at [rc-form option](https://github.com/react-component/form#option-object)。 - ### Form.Item Note: diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index 5a5ebb78e..1b95db7bc 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -118,13 +118,11 @@ CustomizedForm = Form.create({})(CustomizedForm); | options.initialValue | 子节点的初始值,类型、可选值均由子节点决定(注意:由于内部校验时使用 `===` 判断是否变化,建议使用变量缓存所需设置的值而非直接使用字面量)) | | | | options.normalize | 转换默认的 value 给控件,[一个选择全部的例子](https://codesandbox.io/s/kw4l2vqqmv) | function(value, prevValue, allValues): any | - | | options.rules | 校验规则,参考下方文档 | object\[] | | -| options.trigger | 收集子节点的值的时机 | string | 'onChange' | +| options.trigger | 收集子节点的值的时机 | string | 'change' | | options.validateFirst | 当某一规则校验不通过时,是否停止剩下的规则的校验 | boolean | false | -| options.validateTrigger | 校验子节点值的时机 | string\|string\[] | 'onChange' | +| options.validateTrigger | 校验子节点值的时机 | string\|string\[] | 'change' | | options.valuePropName | 子节点的值的属性,如 Switch 的是 'checked' | string | 'value' | -更多参数可参考 [rc-form option](https://github.com/react-component/form#option-object)。 - ### Form.Item 注意: diff --git a/package.json b/package.json index 644bc9c78..e979fe485 100644 --- a/package.json +++ b/package.json @@ -1,175 +1,177 @@ { - "name": "vue-antd-ui", - "version": "0.7.1", - "title": "Ant Design Vue", - "description": "An enterprise-class UI design language and Vue-based implementation", - "keywords": [ - "ant", - "design", - "antd", - "vue", - "vueComponent", - "component", - "components", - "ui", - "framework", - "frontend" - ], - "main": "dist/antd.min.js", - "files": [ - "dist", - "lib", - "es" - ], - "scripts": { - "dev": "NODE_ENV=development ENTRY_INDEX=dev ./node_modules/.bin/webpack-dev-server --open --hot --port 3001", - "start": "NODE_ENV=development ./node_modules/.bin/webpack-dev-server --open --hot", - "test": "jest --config .jest.js", - "site": "node scripts/run.js site-dist", - "copy": "node scripts/run.js copy-html", - "compile": "node antd-tools/cli/run.js compile", - "pub": "node antd-tools/cli/run.js pub", - "prepublish": "node antd-tools/cli/run.js guard", - "pre-publish": "npm run test && node ./scripts/prepub", - "dist": "node antd-tools/cli/run.js dist", - "lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./components", - "lint:style": "stylelint \"./examples/**/*.less\" --fix --syntax less", - "commitmsg": "commitlint -x @commitlint/config-conventional -e $GIT_PARAMS", - "codecov": "codecov" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/vueComponent/ant-design.git" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/vueComponent/ant-design/issues" - }, - "homepage": "https://github.com/vueComponent/ant-design", - "pre-commit": [ - "lint:style", - "lint" - ], - "peerDependencies": { - "vue": ">=2.5.0", - "vue-template-compiler": ">=2.5.0" - }, - "devDependencies": { - "@commitlint/cli": "^6.2.0", - "@commitlint/config-conventional": "^6.1.3", - "@octokit/rest": "^15.4.1", - "@vue/server-test-utils": "1.0.0-beta.16", - "@vue/test-utils": "1.0.0-beta.16", - "autoprefixer": "^8.1.0", - "babel-cli": "^6.26.0", - "babel-core": "^6.26.0", - "babel-eslint": "^8.0.1", - "babel-helper-vue-jsx-merge-props": "^2.0.3", - "babel-jest": "^22.4.3", - "babel-loader": "^7.1.2", - "babel-plugin-add-module-exports": "^0.2.1", - "babel-plugin-import": "^1.1.1", - "babel-plugin-istanbul": "^4.1.1", - "babel-plugin-syntax-dynamic-import": "^6.18.0", - "babel-plugin-syntax-jsx": "^6.18.0", - "babel-plugin-transform-class-properties": "^6.24.1", - "babel-plugin-transform-decorators": "^6.24.1", - "babel-plugin-transform-decorators-legacy": "^1.3.4", - "babel-plugin-transform-es3-member-expression-literals": "^6.22.0", - "babel-plugin-transform-es3-property-literals": "^6.22.0", - "babel-plugin-transform-object-assign": "^6.22.0", - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-plugin-transform-runtime": "~6.23.0", - "babel-plugin-transform-vue-jsx": "^3.7.0", - "babel-polyfill": "^6.26.0", - "babel-preset-env": "^1.6.1", - "case-sensitive-paths-webpack-plugin": "^2.1.2", - "chalk": "^2.3.2", - "cheerio": "^1.0.0-rc.2", - "codecov": "^3.0.0", - "colorful": "^2.1.0", - "commander": "^2.15.0", - "cross-env": "^5.1.4", - "css-loader": "^0.28.7", - "deep-assign": "^2.0.0", - "eslint": "^4.7.2", - "eslint-plugin-html": "^3.2.2", - "eslint-plugin-vue": "^3.13.0", - "eslint-plugin-vue-libs": "^1.2.1", - "extract-text-webpack-plugin": "^3.0.2", - "fetch-jsonp": "^1.1.3", - "glob": "^7.1.2", - "gulp": "^3.9.1", - "gulp-babel": "^7.0.0", - "gulp-strip-code": "^0.1.4", - "highlight.js": "^9.12.0", - "html-webpack-plugin": "^2.30.1", - "husky": "^0.14.3", - "istanbul-instrumenter-loader": "^3.0.0", - "jest": "^22.4.3", - "jest-serializer-vue": "^1.0.0", - "jsonp": "^0.2.1", - "less": "^2.7.2", - "less-loader": "^4.0.5", - "less-plugin-npm-import": "^2.1.0", - "markdown-it": "^8.4.0", - "markdown-it-anchor": "^4.0.0", - "marked": "^0.3.7", - "merge2": "^1.2.1", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "mockdate": "^2.0.2", - "moment-timezone": "^0.5.17", - "nprogress": "^0.2.0", - "postcss": "^6.0.20", - "postcss-loader": "^2.1.2", - "pre-commit": "^1.2.2", - "querystring": "^0.2.0", - "raw-loader": "^1.0.0-beta.0", - "reqwest": "^2.0.5", - "rimraf": "^2.6.2", - "rucksack-css": "^1.0.2", - "selenium-server": "^3.0.1", - "semver": "^5.3.0", - "style-loader": "^0.18.2", - "stylelint": "^8.1.1", - "stylelint-config-standard": "^17.0.0", - "through2": "^2.0.3", - "vue": "^2.5.16", - "vue-antd-md-loader": "^1.0.3", - "vue-clipboard2": "0.0.8", - "vue-infinite-scroll": "^2.0.2", - "vue-jest": "^2.5.0", - "vue-loader": "^13.0.5", - "vue-router": "^3.0.1", - "vue-server-renderer": "^2.5.16", - "vue-template-compiler": "^2.5.16", - "vue-virtual-scroller": "^0.12.0", - "webpack": "^3.11.0", - "webpack-chunk-hash": "^0.5.0", - "webpack-dev-server": "^2.8.2", - "webpack-merge": "^4.1.1" - }, - "dependencies": { - "add-dom-event-listener": "^1.0.2", - "array-tree-filter": "^2.1.0", - "async-validator": "^1.8.2", - "babel-helper-vue-jsx-merge-props": "^2.0.3", - "babel-runtime": "6.x", - "classnames": "^2.2.5", - "component-classes": "^1.2.6", - "dom-align": "^1.6.7", - "dom-closest": "^0.2.0", - "dom-scroll-into-view": "^1.2.1", - "enquire.js": "^2.1.6", - "json2mq": "^0.2.0", - "is-negative-zero": "^2.0.0", - "lodash": "^4.17.5", - "moment": "^2.21.0", - "omit.js": "^1.0.0", - "resize-observer-polyfill": "^1.5.0", - "shallow-equal": "^1.0.0", - "shallowequal": "^1.0.2", - "warning": "^3.0.0" - } + "name": "vue-antd-ui", + "version": "1.0.0", + "title": "Ant Design Vue", + "description": "An enterprise-class UI design language and Vue-based implementation", + "keywords": [ + "ant", + "design", + "antd", + "vue", + "vueComponent", + "component", + "components", + "ui", + "framework", + "frontend" + ], + "main": "dist/antd.min.js", + "files": [ + "dist", + "lib", + "es" + ], + "scripts": { + "dev": "NODE_ENV=development ENTRY_INDEX=dev ./node_modules/.bin/webpack-dev-server --open --hot --port 3001", + "start": "NODE_ENV=development ./node_modules/.bin/webpack-dev-server --open --hot", + "test": "jest --config .jest.js", + "site": "node scripts/run.js site-dist", + "copy": "node scripts/run.js copy-html", + "compile": "node antd-tools/cli/run.js compile", + "pub": "node antd-tools/cli/run.js pub", + "pub-with-ci": "node antd-tools/cli/run.js pub-with-ci", + "prepublish": "node antd-tools/cli/run.js guard", + "pre-publish": "node ./scripts/prepub", + "dist": "node antd-tools/cli/run.js dist", + "lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./components", + "lint:style": "stylelint \"./examples/**/*.less\" --fix --syntax less", + "commitmsg": "commitlint -x @commitlint/config-conventional -e $GIT_PARAMS", + "codecov": "codecov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vueComponent/ant-design.git" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/vueComponent/ant-design/issues" + }, + "homepage": "https://github.com/vueComponent/ant-design", + "pre-commit": [ + "lint:style", + "lint" + ], + "peerDependencies": { + "vue": ">=2.5.0", + "vue-template-compiler": ">=2.5.0" + }, + "devDependencies": { + "@commitlint/cli": "^6.2.0", + "@commitlint/config-conventional": "^6.1.3", + "@octokit/rest": "^15.4.1", + "@vue/server-test-utils": "1.0.0-beta.16", + "@vue/test-utils": "1.0.0-beta.16", + "autoprefixer": "^8.1.0", + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-eslint": "^8.0.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-jest": "^22.4.3", + "babel-loader": "^7.1.2", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-import": "^1.1.1", + "babel-plugin-istanbul": "^4.1.1", + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-decorators": "^6.24.1", + "babel-plugin-transform-decorators-legacy": "^1.3.4", + "babel-plugin-transform-es3-member-expression-literals": "^6.22.0", + "babel-plugin-transform-es3-property-literals": "^6.22.0", + "babel-plugin-transform-object-assign": "^6.22.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-plugin-transform-runtime": "~6.23.0", + "babel-plugin-transform-vue-jsx": "^3.7.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.6.1", + "case-sensitive-paths-webpack-plugin": "^2.1.2", + "chalk": "^2.3.2", + "cheerio": "^1.0.0-rc.2", + "codecov": "^3.0.0", + "colorful": "^2.1.0", + "commander": "^2.15.0", + "compare-versions": "^3.3.0", + "cross-env": "^5.1.4", + "css-loader": "^0.28.7", + "deep-assign": "^2.0.0", + "eslint": "^4.7.2", + "eslint-plugin-html": "^3.2.2", + "eslint-plugin-vue": "^3.13.0", + "eslint-plugin-vue-libs": "^1.2.1", + "extract-text-webpack-plugin": "^3.0.2", + "fetch-jsonp": "^1.1.3", + "glob": "^7.1.2", + "gulp": "^3.9.1", + "gulp-babel": "^7.0.0", + "gulp-strip-code": "^0.1.4", + "highlight.js": "^9.12.0", + "html-webpack-plugin": "^2.30.1", + "husky": "^0.14.3", + "istanbul-instrumenter-loader": "^3.0.0", + "jest": "^22.4.3", + "jest-serializer-vue": "^1.0.0", + "jsonp": "^0.2.1", + "less": "^2.7.2", + "less-loader": "^4.0.5", + "less-plugin-npm-import": "^2.1.0", + "markdown-it": "^8.4.0", + "markdown-it-anchor": "^4.0.0", + "marked": "^0.3.7", + "merge2": "^1.2.1", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "mockdate": "^2.0.2", + "moment-timezone": "^0.5.17", + "nprogress": "^0.2.0", + "postcss": "^6.0.20", + "postcss-loader": "^2.1.2", + "pre-commit": "^1.2.2", + "querystring": "^0.2.0", + "raw-loader": "^1.0.0-beta.0", + "reqwest": "^2.0.5", + "rimraf": "^2.6.2", + "rucksack-css": "^1.0.2", + "selenium-server": "^3.0.1", + "semver": "^5.3.0", + "style-loader": "^0.18.2", + "stylelint": "^8.1.1", + "stylelint-config-standard": "^17.0.0", + "through2": "^2.0.3", + "vue": "^2.5.16", + "vue-antd-md-loader": "^1.0.3", + "vue-clipboard2": "0.0.8", + "vue-infinite-scroll": "^2.0.2", + "vue-jest": "^2.5.0", + "vue-loader": "^13.0.5", + "vue-router": "^3.0.1", + "vue-server-renderer": "^2.5.16", + "vue-template-compiler": "^2.5.16", + "vue-virtual-scroller": "^0.12.0", + "webpack": "^3.11.0", + "webpack-chunk-hash": "^0.5.0", + "webpack-dev-server": "^2.8.2", + "webpack-merge": "^4.1.1" + }, + "dependencies": { + "add-dom-event-listener": "^1.0.2", + "array-tree-filter": "^2.1.0", + "async-validator": "^1.8.2", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-runtime": "6.x", + "classnames": "^2.2.5", + "component-classes": "^1.2.6", + "dom-align": "^1.6.7", + "dom-closest": "^0.2.0", + "dom-scroll-into-view": "^1.2.1", + "enquire.js": "^2.1.6", + "json2mq": "^0.2.0", + "is-negative-zero": "^2.0.0", + "lodash": "^4.17.5", + "moment": "^2.21.0", + "omit.js": "^1.0.0", + "resize-observer-polyfill": "^1.5.0", + "shallow-equal": "^1.0.0", + "shallowequal": "^1.0.2", + "warning": "^3.0.0" + } } diff --git a/scripts/.npmrc.template b/scripts/.npmrc.template new file mode 100644 index 000000000..a2ddeece3 --- /dev/null +++ b/scripts/.npmrc.template @@ -0,0 +1,3 @@ +//registry.npmjs.org/:_authToken=${NPM_TOKEN} +loglevel=info +registry=https://registry.npmjs.org/ diff --git a/site/index.html b/site/index.html index b1781f083..5fa1b984f 100644 --- a/site/index.html +++ b/site/index.html @@ -2,24 +2,22 @@ - - - - - - - - + + + + + + + + -