Skip to content

Commit 02b099e

Browse files
docs: update CONTRIBUTING.md to use PNPM instead of NPM (#1836)
1 parent 34ff54b commit 02b099e

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ For easier testing during development you may want to use a version manager, suc
6060
2. Install the [Rust toolchain](https://rustup.rs/).
6161
3. Install [Protocol Buffers](https://github.com/protocolbuffers/protobuf/releases/).
6262
4. Clone the [sdk-typescript](https://github.com/temporalio/sdk-typescript) repo:
63+
6364
```sh
6465
git clone https://github.com/temporalio/sdk-typescript.git
6566
cd sdk-typescript
6667
```
68+
6769
5. Initialize the Core SDK submodule:
6870

6971
```sh
@@ -73,22 +75,31 @@ For easier testing during development you may want to use a version manager, suc
7375
> If you get a `The authenticity of host 'github.com (192.30.252.123)' can't be established.`
7476
> error, run `ssh-keyscan github.com >> ~/.ssh/known_hosts` and retry.
7577
76-
6. Install the dependencies:
78+
6. Install `pnpm`
79+
TS SDK uses PNPM to manage dependencies. Corepack is the recommend way to install `pnpm` and is included in Node 14+
80+
81+
```sh
82+
corepack enable
83+
```
84+
85+
7. Install the dependencies:
86+
7787
```sh
78-
npm ci
88+
pnpm install --frozen-lockfile
7989
```
90+
8091
This may take a few minutes, as it involves downloading and compiling Rust dependencies.
8192

8293
You should now be able to build:
8394

8495
```sh
85-
npm run build
96+
pnpm run build
8697
```
8798

8899
If building fails, resetting your environment may help:
89100

90101
```
91-
npx lerna clean -y && npm ci
102+
pnpm dlx lerna clean -y && pnpm install --frozen-lockfile
92103
```
93104

94105
If `npm ci` fails in `@temporalio/core-bridge` on the command `node ./scripts/build.js`, you may
@@ -103,14 +114,14 @@ To update to the latest version of the Core SDK, run `git submodule update` foll
103114

104115
After your environment is set up, you can run these commands:
105116

106-
- `npm run build` compiles protobuf definitions, Rust bridge, C++ isolate extension, and Typescript.
107-
- `npm run rebuild` deletes all generated files in the project and reruns build.
108-
- `npm run build.watch` watches filesystem for changes and incrementally compiles Typescript on change.
109-
- `npm run test` runs the test suite.
110-
- `npm run test.watch` runs the test suite on each change to Typescript files.
111-
- `npm run format` formats code with prettier.
112-
- `npm run lint` verifies code style with prettier and ES lint.
113-
- `npm run commitlint` validates [commit messages](#style-guide).
117+
- `pnpm run build` compiles protobuf definitions, Rust bridge, C++ isolate extension, and Typescript.
118+
- `pnpm run rebuild` deletes all generated files in the project and reruns build.
119+
- `pnpm run build.watch` watches filesystem for changes and incrementally compiles Typescript on change.
120+
- `pnpm run test` runs the test suite.
121+
- `pnpm run test.watch` runs the test suite on each change to Typescript files.
122+
- `pnpm run format` formats code with prettier.
123+
- `pnpm run lint` verifies code style with prettier and ES lint.
124+
- `pnpm run commitlint` validates [commit messages](#style-guide).
114125

115126
### Testing
116127

@@ -134,8 +145,8 @@ To replicate the `test-npm-init` CI test locally, you can start with the below s
134145
135146
```
136147
rm -rf /tmp/registry
137-
npm ci
138-
npm run rebuild
148+
pnpm install --frozen-lockfile
149+
pnpm run rebuild
139150
node scripts/publish-to-verdaccio.js --registry-dir /tmp/registry
140151
node scripts/init-from-verdaccio.js --registry-dir /tmp/registry --sample hello-world
141152
cd /tmp/registry/example
@@ -233,8 +244,8 @@ We're [working on automating](https://github.com/temporalio/sdk-typescript/pull/
233244
set -euo pipefail
234245

235246
git clean -fdx
236-
npm ci
237-
npm run build
247+
pnpm install --frozen-lockfile
248+
pnpm run build
238249

239250
mkdir -p packages/core-bridge/releases
240251

@@ -244,12 +255,12 @@ for f in ~/Downloads/packages-*.zip; do mkdir "$HOME/Downloads/$(basename -s .zi
244255
# we should now have all 5 build targets
245256
ls packages/core-bridge/releases/
246257

247-
npx lerna version patch --force-publish='*' # or major|minor|etc, or leave out to be prompted. either way, you get a confirmation dialog.
258+
pnpm exec lerna version patch --force-publish='*' # or major|minor|etc, or leave out to be prompted. either way, you get a confirmation dialog.
248259

249260
git checkout -B fix-deps
250261
node scripts/prepublish.mjs
251262
git commit -am 'Fix dependencies'
252-
npx lerna publish from-package # add `--dist-tag next` for pre-release versions
263+
pnpm exec lerna publish from-package # add `--dist-tag next` for pre-release versions
253264
git checkout -
254265
```
255266

0 commit comments

Comments
 (0)