Skip to content

Commit f5677e6

Browse files
committed
Replace yarn and lerna with pnpm
1 parent 9f8a27d commit f5677e6

26 files changed

Lines changed: 2697 additions & 6231 deletions

File tree

.ackrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
--ignore-dir=dist
22
--ignore-dir=node_modules
3-
--ignore-dir=.yarn
4-
--ignore-file=match:/^yarn\.lock$/
3+
--ignore-dir=.pnpm
4+
--ignore-file=match:/^pnpm-lock\.yaml$/

.github/workflows/node.js.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ jobs:
1616
- uses: actions/setup-node@v4
1717
with:
1818
node-version: 23.x
19-
- run: yarn install
20-
- run: yarn reset
21-
- run: yarn compile
22-
- run: yarn test
19+
- run: corepack enable
20+
- run: pnpm install --frozen-lockfile
21+
- run: pnpm clean
22+
- run: pnpm build
23+
- run: pnpm test
2324
env:
2425
RINGCENTRAL_SERVER_URL: ${{ secrets.RINGCENTRAL_SERVER_URL }}
2526
RINGCENTRAL_CLIENT_ID: ${{ secrets.RINGCENTRAL_CLIENT_ID }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ test/local/
1414
*.js.map
1515
*.d.ts
1616
dist/
17+
.npmrc

README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ from our developer website.
1818
## Installation
1919

2020
```
21-
yarn add @rc-ex/core
21+
pnpm add @rc-ex/core
2222
```
2323

2424
Then you should be able to import the SDK like this:
@@ -117,8 +117,7 @@ construct the uri as [sample code](./packages/core/src/samples.md) shows.
117117
### Code style
118118

119119
```
120-
yarn lint
121-
yarn format
120+
pnpm format-lint
122121
```
123122

124123
### Regenerate code using latest swagger spec
@@ -130,39 +129,36 @@ project.
130129
### Test
131130

132131
```
133-
yarn clean && yarn build && yarn test
132+
pnpm clean && pnpm build && pnpm test
134133
```
135134

136135
### Test one test case
137136

138137
```
139-
t=auto-recover yarn test
138+
t=auto-recover pnpm test
140139
```
141140

142141
## Publish
143142

144143
Update version number in `packages/core/src/Rest.ts`
145144

146145
```
147-
yarn build
148-
yarn lerna publish from-package
146+
pnpm build
147+
pnpm --filter './packages/**' -r publish --access public
149148
```
150149

151-
By default lerna check git tag to determine which packages to publish.
152-
`from-package` will make lerna check npmjs.com instead.
153-
154-
Most of the time, it works without `from-package` option. But if the repo is in
155-
a "half-published" state, you will need this option to publish.
150+
Recursive pnpm publish checks npmjs.com and only publishes workspace packages
151+
whose current versions are not already in the registry.
156152

157153
### NPM 2FA
158154

159-
I don't know how to make it work with lerna and I have to disable it via
155+
I don't know how to make it work with publishing and I have to disable it via
160156
npmjs.com GUI: I disabled "Require two-factor authentication for write actions".
161157

162158
## Add dependency
163159

164160
```
165-
yarn workspace @rc-ex/debug add ramda
161+
pnpm --filter @rc-ex/debug add ramda
166162
```
167163

168164
### Todo

lerna.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,20 @@
44
"private": "true",
55
"description": "RingCentral Extensible SDK",
66
"license": "MIT",
7-
"workspaces": [
8-
"packages/core",
9-
"packages/extensions/*",
10-
"test"
11-
],
127
"scripts": {
13-
"build": "lerna exec 'yarn build' --scope=@rc-ex/core && lerna exec 'yarn build' --no-private --ignore=@rc-ex/core",
14-
"clean": "lerna exec 'rm -rf dist'",
15-
"reinstall": "lerna exec 'rm -rf node_modules' && yarn install",
16-
"prepack": "yarn clean && yarn build && yarn test",
17-
"test": "yarn workspace @rc-ex/test run vitest",
18-
"upgrade-all": "yarn-upgrade-all -W && yarn workspaces run yarn-upgrade-all && yarn install",
8+
"build": "pnpm --filter @rc-ex/core run build && pnpm --filter './packages/extensions/**' -r run build",
9+
"clean": "pnpm --filter './packages/**' -r exec rm -rf dist",
10+
"reinstall": "pnpm install --force",
11+
"prepack": "pnpm clean && pnpm build && pnpm test",
12+
"test": "pnpm --filter @rc-ex/test exec vitest",
13+
"upgrade-all": "pnpm update --latest --recursive",
1914
"format-lint": "biome check --write --unsafe ."
2015
},
2116
"devDependencies": {
2217
"@biomejs/biome": "^2.4.10",
2318
"@types/node": "^25.5.2",
24-
"lerna": "^9.0.7",
2519
"tsup": "^8.5.1",
26-
"typescript": "^6.0.2",
27-
"yarn-upgrade-all": "^0.7.5"
20+
"typescript": "^6.0.2"
2821
},
29-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
22+
"packageManager": "pnpm@10.33.1"
3023
}

0 commit comments

Comments
 (0)