Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade yarn to pnpm #1656

Merged
merged 11 commits into from
Jun 12, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ jobs:

strategy:
matrix:
node-version: [12.x, 16.x]
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v1

- name: Install pnpm
uses: pnpm/action-setup@v2.2.2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: yarn intall, build, and test

- name: pnpm run intall, build, and test
run: |
yarn run init
yarn run test
pnpm run init
pnpm run test
env:
CI: true
2 changes: 1 addition & 1 deletion .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ title = "gitleaks config"
tags = ["key", "twilio"]
[whitelist]
description = "Whitelisted files"
file = '''(^\.?gitleaks.toml$|(.*?)(jpg|gif|doc|pdf|bin)$|^package-lock.json$|yarn.lock|node_modules)'''
file = '''(^\.?gitleaks.toml$|(.*?)(jpg|gif|doc|pdf|bin)$|^package-lock.json$|yarn.lock|pnpm-lock.yaml|node_modules)'''
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ language: node_js
node_js:
- 'lts/*'
install:
- yarn install
- yarn run bootstrap
- yarn install -g surge
- pnpm install
- pnpm install -g surge
script:
- yarn run build:doc
- pnpm run build:doc
- surge ./dist ahooks-$(git rev-parse --short HEAD).surge.sh
cache:
directories:
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Before submitting a pull request, please make sure the following is done:

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

3. Ensure the test suite passes `yarn run test`.
3. Ensure the test suite passes `pnpm run test`.

## Development Workflow

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

1. `yarn start` runs `ahooks` website locally.
1. `pnpm start` runs `ahooks` website locally.

2. `yarn run test` runs the complete test suite.
2. `pnpm run test` runs the complete test suite.

3. `yarn run build` to build.
3. `pnpm run build` to build.
10 changes: 5 additions & 5 deletions CONTRIBUTING.zh-CN.MD
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

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

3. 确认所有的测试是通过的 `yarn run test`。
3. 确认所有的测试是通过的 `pnpm run test`。

## 开发流程

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

1. `yarn start` 在本地运行 `ahooks` 网站。
1. `pnpm start` 在本地运行 `ahooks` 网站。

2. `yarn run test` 运行测试。
2. `pnpm run test` 运行测试。

3. `yarn run build` 构建编译。
3. `pnpm run build` 构建编译。
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ English | [简体中文](https://github.com/alibaba/hooks/blob/master/README.zh-
$ npm install --save ahooks
# or
$ yarn add ahooks
# or
$ pnpm add ahooks
```

## 🔨 Usage
Expand All @@ -54,8 +56,8 @@ import { useRequest } from 'ahooks';
```bash
$ git clone git@github.com:alibaba/hooks.git
$ cd hooks
$ yarn run init
$ yarn start
$ pnpm run init
$ pnpm start
```

Open your browser and visit http://127.0.0.1:8000
Expand Down
6 changes: 4 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
$ npm install --save ahooks
# or
$ yarn add ahooks
# or
$ pnpm add ahooks
```

## 🔨 使用
Expand All @@ -54,8 +56,8 @@ import { useRequest } from 'ahooks';
```bash
$ git clone git@github.com:alibaba/hooks.git
$ cd hooks
$ yarn run init
$ yarn start
$ pnpm run init
$ pnpm start
```

打开浏览器访问 http://127.0.0.1:8000
Expand Down
4 changes: 4 additions & 0 deletions config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default {
dynamicImport: {},
manifest: {},
hash: true,
alias: {
'ahooks': process.cwd() + '/packages/hooks/src/index.ts',
'@ahooksjs/use-url-state': process.cwd() + '/packages/use-url-state/src/index.ts',
},
resolve: {
includes: ['docs', 'packages/hooks/src', 'packages/use-url-state'],
},
Expand Down
2 changes: 2 additions & 0 deletions docs/guide/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ahooks, pronounced [eɪ hʊks], is a high-quality and reliable React Hooks libra
$ npm install --save ahooks
# or
$ yarn add ahooks
# or
$ pnpm add ahooks
```

## Usage
Expand Down
2 changes: 2 additions & 0 deletions docs/guide/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ahooks,发音 [eɪ hʊks],是一套高质量可靠的 React Hooks 库。在
$ npm install --save ahooks
# or
$ yarn add ahooks
# or
$ pnpm add ahooks
```

## 使用
Expand Down
6 changes: 4 additions & 2 deletions docs/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ footer: Open-source MIT Licensed | Copyright © 2019-present<br />Powered by [du
$ npm install --save ahooks
# or
$ yarn add ahooks
# or
$ pnpm add ahooks
```

## 🔨 Usage
Expand All @@ -51,8 +53,8 @@ import { useRequest } from 'ahooks';
```bash
$ git clone git@github.com:alibaba/hooks.git
$ cd hooks
$ yarn run init
$ yarn start
$ pnpm run init
$ pnpm start
```

Open your browser and visit http://127.0.0.1:8000
Expand Down
4 changes: 2 additions & 2 deletions docs/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ import { useRequest } from 'ahooks';
```bash
$ git clone git@github.com:alibaba/hooks.git
$ cd hooks
$ yarn run init
$ yarn start
$ pnpm run init
$ pnpm start
```

打开浏览器访问 http://127.0.0.1:8000
Expand Down
15 changes: 0 additions & 15 deletions lerna.json

This file was deleted.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
"url": "git+https://github.com/alibaba/hooks.git"
},
"scripts": {
"init": "rm -rf node_modules && yarn install && yarn run clean && yarn run bootstrap && yarn run build",
"start": "yarn run dev",
"init": "pnpm clean && pnpm install && pnpm run build",
"start": "pnpm run dev",
"dev": "dumi dev",
"bootstrap": "lerna bootstrap",
"clean": "lerna clean --yes",
"build": "lerna run build",
"clean": "rm -rf node_modules **/*/node_modules",
"build": "pnpm -r --filter=./packages/* run build",
"test": "jest",
"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",
"pub:doc-gitee": "cd ./dist && rm -rf .git && touch .spa && touch .nojekyll && git init && git remote add origin git@gitee.com:ahooks/ahooks.git && git add -A && git commit -m \"publish docs\" && git push origin master -f && echo https://gitee.com/ahooks/ahooks/pages",
"pub:doc": "yarn run build:doc && yarn run pub:doc-surge && yarn run pub:doc-gitee",
"pub": "yarn run build && lerna publish",
"pub:beta": "yarn run build && lerna publish --dist-tag beta"
"pub:doc": "pnpm run build:doc && pnpm run pub:doc-surge && pnpm run pub:doc-gitee",
"pub": "pnpm run build && pnpm run publish",
"pub:beta": "pnpm run build && pnpm run publish --tag beta",
"preinstall": "npx only-allow pnpm"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -53,11 +53,10 @@
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-typescript": "^6.0.0-alpha.1",
"husky": "^4.2.5",
"husky": "^8.0.1",
"jest": "^26.0.1",
"jest-fetch-mock": "^3.0.3",
"jest-localstorage-mock": "^2.4.18",
"lerna": "4.x",
"mockdate": "^3.0.2",
"mockjs": "^1.1.0",
"prettier": "^2.0.5",
Expand All @@ -73,5 +72,6 @@
"webpack": "^4.43.0",
"webpack-cli": "^3.3.10",
"webpack-merge": "^4.2.2"
}
},
"packageManager": "pnpm@7.1.9"
}
Loading