Skip to content

Commit 80f5c45

Browse files
committed
chore: replace yarn with pnpm
1 parent 77ce923 commit 80f5c45

File tree

5 files changed

+25
-23
lines changed

5 files changed

+25
-23
lines changed

.github/workflows/CI.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,39 @@ jobs:
1717
- name: Checkout code
1818
uses: actions/checkout@v4
1919

20-
- name: Cache yarn.lock
20+
- name: Install pnpm
21+
run: npm install -g pnpm
22+
23+
- name: Cache pnpm-lock.yaml
2124
uses: actions/cache@v4
2225
with:
2326
path: package-temp-dir
2427
key: lock-${{ github.sha }}
2528

26-
- name: Create yarn.lock
27-
run: yarn generate-lock-entry
28-
2929
- name: Hack for single file
3030
run: |
3131
if [ ! -d "package-temp-dir" ]; then
3232
mkdir package-temp-dir
3333
fi
34-
cp yarn.lock package-temp-dir
34+
cp pnpm-lock.yaml package-temp-dir
3535
- name: Cache node_modules
3636
id: node_modules_cache_id
3737
uses: actions/cache@v4
3838
with:
3939
path: node_modules
40-
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
40+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
4141

4242
- name: Install dependencies
4343
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
44-
run: yarn
44+
run: pnpm install
4545

4646
prettier:
4747
needs: [setup]
4848
runs-on: ubuntu-latest
4949
steps:
5050
- uses: actions/checkout@v2
5151

52-
- name: Restore cache from yarn.lock
52+
- name: Restore cache from pnpm-lock.yaml
5353
uses: actions/cache@v4
5454
with:
5555
path: package-temp-dir
@@ -59,18 +59,18 @@ jobs:
5959
uses: actions/cache@v4
6060
with:
6161
path: node_modules
62-
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
62+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
6363

6464
- name: Prettier check
65-
run: yarn prettier
65+
run: pnpm prettier
6666

6767
eslint:
6868
needs: [setup]
6969
runs-on: ubuntu-latest
7070
steps:
7171
- uses: actions/checkout@v2
7272

73-
- name: Restore cache from yarn.lock
73+
- name: Restore cache from pnpm-lock.yaml
7474
uses: actions/cache@v4
7575
with:
7676
path: package-temp-dir
@@ -80,18 +80,18 @@ jobs:
8080
uses: actions/cache@v4
8181
with:
8282
path: node_modules
83-
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
83+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
8484

8585
- name: Eslint check
86-
run: yarn eslint
86+
run: pnpm eslint
8787

8888
test:
8989
needs: [setup]
9090
runs-on: ubuntu-latest
9191
steps:
9292
- uses: actions/checkout@v2
9393

94-
- name: Restore cache from yarn.lock
94+
- name: Restore cache from pnpm-lock.yaml
9595
uses: actions/cache@v4
9696
with:
9797
path: package-temp-dir
@@ -101,23 +101,23 @@ jobs:
101101
uses: actions/cache@v4
102102
with:
103103
path: node_modules
104-
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
104+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
105105

106106
- name: Setup timezone
107107
uses: zcong1993/setup-timezone@master
108108
with:
109109
timezone: Asia/Shanghai
110110

111111
- name: Unit Test
112-
run: yarn test
112+
run: pnpm test
113113

114114
build:
115115
runs-on: ubuntu-latest
116116
needs: [setup, prettier, eslint, test]
117117
steps:
118118
- uses: actions/checkout@v2
119119

120-
- name: Restore cache from yarn.lock
120+
- name: Restore cache from pnpm-lock.yaml
121121
uses: actions/cache@v4
122122
with:
123123
path: package-temp-dir
@@ -127,7 +127,7 @@ jobs:
127127
uses: actions/cache@v4
128128
with:
129129
path: node_modules
130-
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
130+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
131131

132132
- name: Build test
133-
run: yarn build
133+
run: pnpm build

docs/contribution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
1、请 `fork` 本项目,`clone` 自己的仓库,按照上述分支定义从 `master` 分支新建 `feat` 分支进行开发,分支命名用下划线加上版本号、功能名,如:`feat_1.x_xxx`
2424

25-
2、`feat` 分支开发完毕后,本地执行 `yarn lint` 命令,再执行 `yarn test` 命令,均通过后向相应人员提 PR,期望合入 `release` 分支,待相应人员 review 代码后合入
25+
2、`feat` 分支开发完毕后,本地执行 `pnpm lint` 命令,再执行 `pnpm test` 命令,均通过后向相应人员提 PR,期望合入 `release` 分支,待相应人员 review 代码后合入
2626

2727

2828
## Bugs

docs/quickstart.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
```bash
55
npm install @dtinsight/dt-utils
66
yarn add @dtinsight/dt-utils
7+
pnpm install @dtinsight/dt-utils
78
```
89
## 使用
910

@@ -12,7 +13,7 @@ yarn add @dtinsight/dt-utils
1213
````
1314

1415
## Package Managers
15-
JavaScript @dtinsight/dt-utils supports npm and yarn under the name @dtinsight/dt-utils. Module Loaders
16+
JavaScript @dtinsight/dt-utils supports npm, yarn and pnpm under the name @dtinsight/dt-utils. Module Loaders
1617

1718
## Module Loaders
1819
JavaScript @dtinsight/dt-utils can also be loaded as an ES6 module.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"homepage": "https://dtstack.github.io/dt-utils/",
2525
"scripts": {
2626
"build": "tsc",
27+
"lint": "npm run eslint && npm run prettier",
2728
"prettier": "npx prettier --check 'src/**/*.{js,jsx,json,ts}'",
2829
"prettier:fix": "npx prettier --write 'src/**/*.{js,jsx,json,ts}'",
2930
"eslint": "npx eslint --ext .js,.ts ./src",

scripts/release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ git pull origin $branch
2626
echo "Current pull origin $branch."
2727

2828

29-
echo "yarn prepublishOnly"
30-
yarn prepublishOnly
29+
echo "pnpm prepublishOnly"
30+
pnpm prepublishOnly
3131

3232

3333
# Auto generate version number and tag

0 commit comments

Comments
 (0)