diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000000..81b7049738 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,2 @@ +service_name: travis-pro +repo_token: dO6l2UfWXIPwCzK3lmEUKQyQsfzXZUZml diff --git a/.travis.yml b/.travis.yml index 6fac0fe5b3..114c23b83e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ install: script: - yarn run build:doc - surge ./dist ahooks-$(git rev-parse --short HEAD).surge.sh + - yarn coveralls # generate static files cache: directories: - 'node_modules' diff --git a/README.md b/README.md index 270f4f7e9e..b0ad8634d7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,12 @@ A high-quality & reliable React Hooks library. [![NPM version][image-1]][1] [![NPM downloads][image-2]][2] +[![npm](https://img.shields.io/npm/dw/ahooks-v2?label=downloads%28v2%29)](https://www.npmjs.com/package/ahooks-v2) +[![npm](https://img.shields.io/github/issues/alibaba/hooks)](https://github.com/alibaba/hooks/issues) +[![Coverage Status](https://coveralls.io/repos/github/alibaba/hooks/badge.svg?branch=doc/beautify)](https://coveralls.io/github/alibaba/hooks?branch=doc/beautify) ![gzip size](https://img.badgesize.io/https:/unpkg.com/ahooks/dist/ahooks.js?label=gzip%20size&compression=gzip) +[![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/hooks.svg)](http://isitmaintained.com/project/alibaba/hooks 'Percentage of issues still open') +[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/alibaba/hooks.svg)](http://isitmaintained.com/project/alibaba/hooks 'Average time to resolve an issue') ![GitHub](https://img.shields.io/github/license/alibaba/hooks) English | [简体中文](https://github.com/alibaba/hooks/blob/master/README.zh-CN.md) @@ -72,8 +77,7 @@ Thanks to all the contributors: - [1]: https://www.npmjs.com/package/ahooks [2]: https://npmjs.org/package/ahooks [image-1]: https://img.shields.io/npm/v/ahooks.svg?style=flat -[image-2]: https://img.shields.io/npm/dm/ahooks.svg?style=flat +[image-2]: https://img.shields.io/npm/dw/ahooks.svg?style=flat diff --git a/README.zh-CN.md b/README.zh-CN.md index a9f662c808..8ec0954705 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -10,7 +10,12 @@ [![NPM version][image-1]][1] [![NPM downloads][image-2]][2] +[![npm](https://img.shields.io/npm/dw/ahooks-v2?label=downloads%28v2%29)](https://www.npmjs.com/package/ahooks-v2) +[![Coverage Status](https://coveralls.io/repos/github/alibaba/hooks/badge.svg?branch=doc/beautify)](https://coveralls.io/github/alibaba/hooks?branch=doc/beautify) +[![npm](https://img.shields.io/github/issues/alibaba/hooks)](https://github.com/alibaba/hooks/issues) ![gzip size](https://img.badgesize.io/https:/unpkg.com/ahooks/dist/ahooks.js?label=gzip%20size&compression=gzip) +[![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/hooks.svg)](http://isitmaintained.com/project/alibaba/hooks 'Percentage of issues still open') +[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/alibaba/hooks.svg)](http://isitmaintained.com/project/alibaba/hooks 'Average time to resolve an issue') ![GitHub](https://img.shields.io/github/license/alibaba/hooks) [English](https://github.com/alibaba/hooks/blob/master/README.md) | 简体中文 @@ -75,4 +80,4 @@ $ yarn start [1]: https://www.npmjs.com/package/ahooks [2]: https://npmjs.org/package/ahooks [image-1]: https://img.shields.io/npm/v/ahooks.svg?style=flat -[image-2]: https://img.shields.io/npm/dm/ahooks.svg?style=flat +[image-2]: https://img.shields.io/npm/dw/ahooks.svg?style=flat diff --git a/package.json b/package.json index 1488b6eaf5..6186f55fdd 100755 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "clean": "lerna clean --yes", "build": "lerna run build", "test": "jest", + "coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls", "lint": "eslint --ignore-pattern **/__tests__/* --ignore-pattern **/demo/* \"packages/*/src/**/*.{ts,tsx}\"", "build:doc": "dumi build", "pub:doc-surge": "surge ./dist --domain ahooks.js.org", @@ -42,6 +43,7 @@ "babel-loader": "^8.1.0", "babel-plugin-import": "^1.12.0", "babel-plugin-transform-async-to-promises": "^0.8.15", + "coveralls": "^3.1.1", "del": "^5.1.0", "dumi": "^1.1.7", "enzyme": "^3.10.0", diff --git a/yarn.lock b/yarn.lock index ac44115af3..cd78ce7d9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4852,6 +4852,17 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" +coveralls@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.1.1.tgz#f5d4431d8b5ae69c5079c8f8ca00d64ac77cf081" + integrity sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww== + dependencies: + js-yaml "^3.13.1" + lcov-parse "^1.0.0" + log-driver "^1.2.7" + minimist "^1.2.5" + request "^2.88.2" + create-ecdh@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" @@ -8753,6 +8764,11 @@ lcid@^3.0.0: dependencies: invert-kv "^3.0.0" +lcov-parse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" + integrity sha512-aprLII/vPzuQvYZnDRU78Fns9I2Ag3gi4Ipga/hxnVMCZC8DnR2nI7XBqrPoywGfxqIx/DgarGvDJZAD3YBTgQ== + lead@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" @@ -8995,6 +9011,11 @@ lodash@4.x, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +log-driver@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" + integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== + log-symbols@^4.0.0, log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503"