Skip to content

Commit 4287242

Browse files
committed
Merge remote-tracking branch 'origin/master' into pr/1657
2 parents a4646b5 + 88e8898 commit 4287242

File tree

71 files changed

+20912
-16754
lines changed

Some content is hidden

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

71 files changed

+20912
-16754
lines changed

.coveralls.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
service_name: travis-pro
2+
repo_token: dO6l2UfWXIPwCzK3lmEUKQyQsfzXZUZml

.github/workflows/node-ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [12.x, 16.x]
11+
node-version: [14.x, 16.x]
1212

1313
steps:
1414
- uses: actions/checkout@v1
15+
16+
- name: Install pnpm
17+
uses: pnpm/action-setup@v2.2.2
18+
1519
- name: Use Node.js ${{ matrix.node-version }}
1620
uses: actions/setup-node@v1
1721
with:
1822
node-version: ${{ matrix.node-version }}
19-
- name: yarn intall, build, and test
23+
24+
- name: pnpm run intall, build, and test
2025
run: |
21-
yarn run init
22-
yarn run test
26+
pnpm run init
27+
pnpm run test
2328
env:
2429
CI: true

.gitleaks.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ title = "gitleaks config"
121121
tags = ["key", "twilio"]
122122
[whitelist]
123123
description = "Whitelisted files"
124-
file = '''(^\.?gitleaks.toml$|(.*?)(jpg|gif|doc|pdf|bin)$|^package-lock.json$|yarn.lock|node_modules)'''
124+
file = '''(^\.?gitleaks.toml$|(.*?)(jpg|gif|doc|pdf|bin)$|^package-lock.json$|yarn.lock|pnpm-lock.yaml|node_modules)'''

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run pretty

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
auto-install-peers=true

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ language: node_js
22
node_js:
33
- 'lts/*'
44
install:
5-
- yarn install
6-
- yarn run bootstrap
7-
- yarn install -g surge
5+
- pnpm install
6+
- pnpm install -g surge
87
script:
9-
- yarn run build:doc
8+
- pnpm run build:doc
109
- surge ./dist ahooks-$(git rev-parse --short HEAD).surge.sh
10+
- yarn coveralls # generate static files
1111
cache:
1212
directories:
1313
- 'node_modules'

CONTRIBUTING.MD

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ Before submitting a pull request, please make sure the following is done:
2222

2323
2. If you've fixed a bug or added code that should be tested, add tests!
2424

25-
3. Ensure the test suite passes `yarn run test`.
25+
3. Ensure the test suite passes `pnpm run test`.
2626

2727
## Development Workflow
2828

29-
After cloning `ahooks`, run `yarn run init` to fetch its dependencies. Then, you can run several commands:
29+
After cloning `ahooks`, run `pnpm run init` to fetch its dependencies. Then, you can run several commands:
3030

31-
1. `yarn start` runs `ahooks` website locally.
31+
1. `pnpm start` runs `ahooks` website locally.
3232

33-
2. `yarn run test` runs the complete test suite.
33+
2. `pnpm run test` runs the complete test suite.
3434

35-
3. `yarn run build` to build.
35+
3. `pnpm run build` to build.

CONTRIBUTING.zh-CN.MD

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222

2323
2. 如果你修复了一个 bug 或者新增了一个功能,请确保写了相应的测试,这很重要。
2424

25-
3. 确认所有的测试是通过的 `yarn run test`
25+
3. 确认所有的测试是通过的 `pnpm run test`
2626

2727
## 开发流程
2828

29-
在你 clone 代码并且使用 `yarn run init` 安装完依赖后,你还可以运行下面几个常用的命令:
29+
在你 clone 代码并且使用 `pnpm run init` 安装完依赖后,你还可以运行下面几个常用的命令:
3030

31-
1. `yarn start` 在本地运行 `ahooks` 网站。
31+
1. `pnpm start` 在本地运行 `ahooks` 网站。
3232

33-
2. `yarn run test` 运行测试。
33+
2. `pnpm run test` 运行测试。
3434

35-
3. `yarn run build` 构建编译。
35+
3. `pnpm run build` 构建编译。

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ A high-quality & reliable React Hooks library.
1010

1111
[![NPM version][image-1]][1]
1212
[![NPM downloads][image-2]][2]
13+
[![npm](https://img.shields.io/npm/dw/ahooks-v2?label=downloads%28v2%29)](https://www.npmjs.com/package/ahooks-v2)
14+
[![npm](https://img.shields.io/github/issues/alibaba/hooks)](https://github.com/alibaba/hooks/issues)
15+
[![Coverage Status](https://coveralls.io/repos/github/alibaba/hooks/badge.svg?branch=doc/beautify)](https://coveralls.io/github/alibaba/hooks?branch=doc/beautify)
1316
![gzip size](https://img.badgesize.io/https:/unpkg.com/ahooks/dist/ahooks.js?label=gzip%20size&compression=gzip)
17+
[![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/hooks.svg)](http://isitmaintained.com/project/alibaba/hooks 'Percentage of issues still open')
18+
[![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')
1419
![GitHub](https://img.shields.io/github/license/alibaba/hooks)
1520

1621
English | [简体中文](https://github.com/alibaba/hooks/blob/master/README.zh-CN.md)
@@ -37,6 +42,8 @@ English | [简体中文](https://github.com/alibaba/hooks/blob/master/README.zh-
3742
$ npm install --save ahooks
3843
# or
3944
$ yarn add ahooks
45+
# or
46+
$ pnpm add ahooks
4047
```
4148

4249
## 🔨 Usage
@@ -54,8 +61,8 @@ import { useRequest } from 'ahooks';
5461
```bash
5562
$ git clone git@github.com:alibaba/hooks.git
5663
$ cd hooks
57-
$ yarn run init
58-
$ yarn start
64+
$ pnpm run init
65+
$ pnpm start
5966
```
6067

6168
Open your browser and visit http://127.0.0.1:8000
@@ -72,8 +79,7 @@ Thanks to all the contributors:
7279

7380
<img src="https://user-images.githubusercontent.com/12526493/163084546-ed7a18a8-f05b-484e-a32c-049a05c350fd.JPG" width="200" style='display:inline'/><img src="https://user-images.githubusercontent.com/12526493/163084577-bab53c55-610e-4efe-96c7-eb0dd076c100.JPG" width="200" style='display:inline'/><img src="https://user-images.githubusercontent.com/12526493/163084584-bfb789fe-b5f4-4cd6-b4a5-2444bd67c1a5.JPG" width="200" style='display:inline'/>
7481

75-
7682
[1]: https://www.npmjs.com/package/ahooks
7783
[2]: https://npmjs.org/package/ahooks
7884
[image-1]: https://img.shields.io/npm/v/ahooks.svg?style=flat
79-
[image-2]: https://img.shields.io/npm/dm/ahooks.svg?style=flat
85+
[image-2]: https://img.shields.io/npm/dw/ahooks.svg?style=flat

README.zh-CN.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010

1111
[![NPM version][image-1]][1]
1212
[![NPM downloads][image-2]][2]
13+
[![npm](https://img.shields.io/npm/dw/ahooks-v2?label=downloads%28v2%29)](https://www.npmjs.com/package/ahooks-v2)
14+
[![Coverage Status](https://coveralls.io/repos/github/alibaba/hooks/badge.svg?branch=doc/beautify)](https://coveralls.io/github/alibaba/hooks?branch=doc/beautify)
15+
[![npm](https://img.shields.io/github/issues/alibaba/hooks)](https://github.com/alibaba/hooks/issues)
1316
![gzip size](https://img.badgesize.io/https:/unpkg.com/ahooks/dist/ahooks.js?label=gzip%20size&compression=gzip)
17+
[![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/hooks.svg)](http://isitmaintained.com/project/alibaba/hooks 'Percentage of issues still open')
18+
[![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')
1419
![GitHub](https://img.shields.io/github/license/alibaba/hooks)
1520

1621
[English](https://github.com/alibaba/hooks/blob/master/README.md) | 简体中文
@@ -37,6 +42,8 @@
3742
$ npm install --save ahooks
3843
# or
3944
$ yarn add ahooks
45+
# or
46+
$ pnpm add ahooks
4047
```
4148

4249
## 🔨 使用
@@ -54,8 +61,8 @@ import { useRequest } from 'ahooks';
5461
```bash
5562
$ git clone git@github.com:alibaba/hooks.git
5663
$ cd hooks
57-
$ yarn run init
58-
$ yarn start
64+
$ pnpm run init
65+
$ pnpm start
5966
```
6067

6168
打开浏览器访问 http://127.0.0.1:8000
@@ -75,4 +82,4 @@ $ yarn start
7582
[1]: https://www.npmjs.com/package/ahooks
7683
[2]: https://npmjs.org/package/ahooks
7784
[image-1]: https://img.shields.io/npm/v/ahooks.svg?style=flat
78-
[image-2]: https://img.shields.io/npm/dm/ahooks.svg?style=flat
85+
[image-2]: https://img.shields.io/npm/dw/ahooks.svg?style=flat

0 commit comments

Comments
 (0)