Skip to content

Commit 9c99704

Browse files
committed
chore: replace yarn with pnpm
1 parent 77ce923 commit 9c99704

File tree

5 files changed

+22
-23
lines changed

5 files changed

+22
-23
lines changed

.github/workflows/CI.yml

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

20-
- name: Cache yarn.lock
20+
- name: Cache pnpm-lock.yaml
2121
uses: actions/cache@v4
2222
with:
2323
path: package-temp-dir
2424
key: lock-${{ github.sha }}
2525

26-
- name: Create yarn.lock
27-
run: yarn generate-lock-entry
28-
2926
- name: Hack for single file
3027
run: |
3128
if [ ! -d "package-temp-dir" ]; then
3229
mkdir package-temp-dir
3330
fi
34-
cp yarn.lock package-temp-dir
31+
cp pnpm-lock.yaml package-temp-dir
3532
- name: Cache node_modules
3633
id: node_modules_cache_id
3734
uses: actions/cache@v4
3835
with:
3936
path: node_modules
40-
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
37+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
4138

4239
- name: Install dependencies
4340
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
44-
run: yarn
41+
run: pnpm install
4542

4643
prettier:
4744
needs: [setup]
4845
runs-on: ubuntu-latest
4946
steps:
5047
- uses: actions/checkout@v2
5148

52-
- name: Restore cache from yarn.lock
49+
- name: Restore cache from pnpm-lock.yaml
5350
uses: actions/cache@v4
5451
with:
5552
path: package-temp-dir
@@ -59,18 +56,18 @@ jobs:
5956
uses: actions/cache@v4
6057
with:
6158
path: node_modules
62-
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
59+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
6360

6461
- name: Prettier check
65-
run: yarn prettier
62+
run: pnpm prettier
6663

6764
eslint:
6865
needs: [setup]
6966
runs-on: ubuntu-latest
7067
steps:
7168
- uses: actions/checkout@v2
7269

73-
- name: Restore cache from yarn.lock
70+
- name: Restore cache from pnpm-lock.yaml
7471
uses: actions/cache@v4
7572
with:
7673
path: package-temp-dir
@@ -80,18 +77,18 @@ jobs:
8077
uses: actions/cache@v4
8178
with:
8279
path: node_modules
83-
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
80+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
8481

8582
- name: Eslint check
86-
run: yarn eslint
83+
run: pnpm eslint
8784

8885
test:
8986
needs: [setup]
9087
runs-on: ubuntu-latest
9188
steps:
9289
- uses: actions/checkout@v2
9390

94-
- name: Restore cache from yarn.lock
91+
- name: Restore cache from pnpm-lock.yaml
9592
uses: actions/cache@v4
9693
with:
9794
path: package-temp-dir
@@ -101,23 +98,23 @@ jobs:
10198
uses: actions/cache@v4
10299
with:
103100
path: node_modules
104-
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
101+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
105102

106103
- name: Setup timezone
107104
uses: zcong1993/setup-timezone@master
108105
with:
109106
timezone: Asia/Shanghai
110107

111108
- name: Unit Test
112-
run: yarn test
109+
run: pnpm test
113110

114111
build:
115112
runs-on: ubuntu-latest
116113
needs: [setup, prettier, eslint, test]
117114
steps:
118115
- uses: actions/checkout@v2
119116

120-
- name: Restore cache from yarn.lock
117+
- name: Restore cache from pnpm-lock.yaml
121118
uses: actions/cache@v4
122119
with:
123120
path: package-temp-dir
@@ -127,7 +124,7 @@ jobs:
127124
uses: actions/cache@v4
128125
with:
129126
path: node_modules
130-
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
127+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
131128

132129
- name: Build test
133-
run: yarn build
130+
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)