Skip to content

Commit 4a2af02

Browse files
authored
chore: Update NPM dependencies (#1330)
1 parent 53aab9e commit 4a2af02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+24092
-19429
lines changed

.eslintrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
"import/no-relative-packages": "error",
3939
"import/export": "error",
4040
"import/no-named-as-default": "error",
41-
// TODO enable and fix
42-
// "import/no-deprecated": "error",
4341
"import/no-extraneous-dependencies": "error",
4442
"import/no-mutable-exports": "error",
4543
"import/unambiguous": "error",

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
strategy:
1616
fail-fast: true
1717
matrix:
18-
reuse-v8-context: [false]
19-
node: [14, 16]
18+
reuse-v8-context: [true]
19+
node: [14, 16, 18, 20]
2020
os: [ubuntu-latest, macos-latest, windows-latest]
2121
include:
2222
- os: ubuntu-latest
23-
node: 16
24-
reuse-v8-context: true
23+
node: 20
24+
reuse-v8-context: false
2525

2626
runs-on: ${{ matrix.os }}
2727
steps:
@@ -88,7 +88,7 @@ jobs:
8888
submodules: recursive
8989
- uses: actions/setup-node@v1
9090
with:
91-
node-version: 16
91+
node-version: 20
9292
- name: Install protoc
9393
uses: arduino/setup-protoc@v1
9494
with:
@@ -120,7 +120,7 @@ jobs:
120120
submodules: recursive
121121
- uses: actions/setup-node@v1
122122
with:
123-
node-version: 16
123+
node-version: 20
124124
- name: Install protoc
125125
uses: arduino/setup-protoc@v1
126126
with:
@@ -208,22 +208,22 @@ jobs:
208208
include:
209209
- os: ubuntu-latest
210210
target: x86_64-unknown-linux-gnu
211-
node: 16
211+
node: 20
212212
server: local
213213
sample: hello-world
214214
- os: ubuntu-latest
215215
target: x86_64-unknown-linux-gnu
216-
node: 16
216+
node: 20
217217
server: local
218218
sample: fetch-esm
219219
- os: macos-latest
220220
target: x86_64-apple-darwin
221-
node: 16
221+
node: 20
222222
server: cloud
223223
sample: hello-world-mtls
224224
- os: windows-latest
225225
target: x86_64-pc-windows-msvc
226-
node: 16
226+
node: 20
227227
server: cloud
228228
sample: hello-world-mtls
229229

.prettierrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"printWidth": 120,
3-
"singleQuote": true
3+
"singleQuote": true,
4+
"trailingComma": "es5"
45
}

CONTRIBUTING.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ See [sdk-structure.md](./docs/sdk-structure.md)
5050

5151
### Environment setup
5252

53-
- Install Node 16 and [Temporal Server](https://github.com/temporalio/docker-compose#temporal-server-docker-compose-files)
53+
- Install Node 18 and [Temporal Server](https://github.com/temporalio/docker-compose#temporal-server-docker-compose-files)
5454
- Install the [Rust toolchain](https://rustup.rs/)
5555
- Install [Protocol Buffers](https://github.com/protocolbuffers/protobuf/releases/)
5656
- Clone the [sdk-typescript](https://github.com/temporalio/sdk-typescript) repo:
@@ -143,6 +143,43 @@ chore(samples): upgrade commander module
143143

144144
The `scope` options are listed in [commitlint.config.js](https://github.com/temporalio/sdk-typescript/blob/main/commitlint.config.js).
145145

146+
## Updating and pruning dependencies
147+
148+
There are various tools out there to help with updating and pruning NPM dependencies. Unfortunately,
149+
most of these tools don't work well in older lerna-style monorepos, such as this one, and updating
150+
to NPM 7 workspace would break support for Node 14.x. We must therefore rely on a more manual
151+
approach.
152+
153+
I personally use the following commands to find NPM packages that needs to be updated. It runs
154+
interactively on each package of the repo, making it easy to select and apply packages to be updated.
155+
156+
```
157+
for i in ./package.json packages/*/package.json ; do
158+
(
159+
cd "${i%%package.json}"
160+
pwd
161+
npm-check-updates -i
162+
)
163+
done
164+
```
165+
166+
To identify unused dependencies, I run the following script. Note that `npm-check` may report
167+
false-positive. Search the code before actually deleting any dependency. Also note that runtime
168+
dependencies MUST be added on the actual packages that use them to ensure proper execution in PNPM
169+
and YARN 2+ setups.
170+
171+
```
172+
for i in ./package.json packages/*/package.json ; do
173+
(
174+
cd "${i%%package.json}"
175+
pwd
176+
npm-check
177+
)
178+
done
179+
```
180+
181+
To install both tools: `npm i -g npm-check npm-check-updates`.
182+
146183
## Publishing
147184

148185
First, follow the instructions in [docs/building.md](docs/building.md).

0 commit comments

Comments
 (0)