Skip to content

Commit 3dbba7b

Browse files
PR comments
1 parent abd753c commit 3dbba7b

File tree

5 files changed

+20
-32
lines changed

5 files changed

+20
-32
lines changed

.evergreen/config.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ tasks:
19031903
- func: install dependencies
19041904
- func: bootstrap mongo-orchestration
19051905
- func: check resource management feature integration
1906-
- name: check-types-typescript-next-node-types-22.15.3
1906+
- name: check-types-typescript-next
19071907
tags:
19081908
- check-types-typescript-next
19091909
- typescript-compilation
@@ -1914,10 +1914,9 @@ tasks:
19141914
updates:
19151915
- {key: NODE_LTS_VERSION, value: 20.19.0}
19161916
- {key: TS_VERSION, value: next}
1917-
- {key: TYPES_VERSION, value: 22.15.3}
19181917
- func: install dependencies
19191918
- func: check types
1920-
- name: check-types-typescript-current-node-types-22.15.3
1919+
- name: check-types-typescript-current
19211920
tags:
19221921
- check-types-typescript-current
19231922
- typescript-compilation
@@ -1928,24 +1927,22 @@ tasks:
19281927
updates:
19291928
- {key: NODE_LTS_VERSION, value: 20.19.0}
19301929
- {key: TS_VERSION, value: current}
1931-
- {key: TYPES_VERSION, value: 22.15.3}
19321930
- func: install dependencies
19331931
- func: check types
1934-
- name: check-types-typescript-4.4-node-types-18.11.9
1932+
- name: check-types-typescript-5.6
19351933
tags:
1936-
- check-types-typescript-4.4
1934+
- check-types-typescript-5.6
19371935
- typescript-compilation
19381936
commands:
19391937
- command: expansions.update
19401938
type: setup
19411939
params:
19421940
updates:
19431941
- {key: NODE_LTS_VERSION, value: 20.19.0}
1944-
- {key: TS_VERSION, value: '4.4'}
1945-
- {key: TYPES_VERSION, value: 18.11.9}
1942+
- {key: TS_VERSION, value: '5.6'}
19461943
- func: install dependencies
19471944
- func: check types
1948-
- name: compile-driver-typescript-current-node-types-22.15.3
1945+
- name: compile-driver-typescript-current
19491946
tags:
19501947
- compile-driver-typescript-current
19511948
- typescript-compilation
@@ -1956,7 +1953,6 @@ tasks:
19561953
updates:
19571954
- {key: NODE_LTS_VERSION, value: 20.19.0}
19581955
- {key: TS_VERSION, value: current}
1959-
- {key: TYPES_VERSION, value: 22.15.3}
19601956
- func: install dependencies
19611957
- func: compile driver
19621958
- name: download-and-merge-coverage

.evergreen/generate_evergreen_tasks.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -542,43 +542,38 @@ SINGLETON_TASKS.push(
542542
function* makeTypescriptTasks() {
543543
function makeCompileTask(TS_VERSION, TYPES_VERSION) {
544544
return {
545-
name: `compile-driver-typescript-${TS_VERSION}-node-types-${TYPES_VERSION}`,
545+
name: `compile-driver-typescript-${TS_VERSION}`,
546546
tags: [`compile-driver-typescript-${TS_VERSION}`, 'typescript-compilation'],
547547
commands: [
548548
updateExpansions({
549549
NODE_LTS_VERSION: LOWEST_LTS,
550550
TS_VERSION,
551-
TYPES_VERSION
552551
}),
553552
{ func: 'install dependencies' },
554553
{ func: 'compile driver' }
555554
]
556555
};
557556
}
558-
function makeCheckTypesTask(TS_VERSION, TYPES_VERSION) {
557+
function makeCheckTypesTask(TS_VERSION) {
559558
return {
560-
name: `check-types-typescript-${TS_VERSION}-node-types-${TYPES_VERSION}`,
559+
name: `check-types-typescript-${TS_VERSION}`,
561560
tags: [`check-types-typescript-${TS_VERSION}`, 'typescript-compilation'],
562561
commands: [
563562
updateExpansions({
564563
NODE_LTS_VERSION: LOWEST_LTS,
565564
TS_VERSION,
566-
TYPES_VERSION
567565
}),
568566
{ func: 'install dependencies' },
569567
{ func: 'check types' }
570568
]
571569
};
572570
}
573571

574-
const typesVersion = require('../package.json').devDependencies['@types/node'].slice(1);
575-
yield makeCheckTypesTask('next', typesVersion);
576-
yield makeCheckTypesTask('current', typesVersion);
572+
yield makeCheckTypesTask('next');
573+
yield makeCheckTypesTask('current');
574+
yield makeCheckTypesTask('5.6');
577575

578-
// typescript 4.4 only compiles our types with this particular version
579-
yield makeCheckTypesTask('4.4', '18.11.9');
580-
581-
yield makeCompileTask('current', typesVersion);
576+
yield makeCompileTask('current');
582577
}
583578

584579
BUILD_VARIANTS.push({

.evergreen/run-typescript.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ case $TS_CHECK in
1212
esac
1313

1414
if [ -z "$TS_VERSION" ]; then echo "TS_VERSION must be set"; exit 1; fi
15-
if [ -z "$TYPES_VERSION" ]; then echo "TYPES_VERSION must be set"; exit 1; fi
1615

1716
if [ ! -f "mongodb.d.ts" ]; then
1817
echo "mongodb.d.ts should always exist because of the installation in prior steps but in case it doesn't, build it"
@@ -30,7 +29,7 @@ function get_ts_version() {
3029
export TSC="./node_modules/typescript/bin/tsc"
3130
export TS_VERSION=$(get_ts_version)
3231

33-
npm install --no-save --force "typescript@$TS_VERSION" "@types/node@$TYPES_VERSION"
32+
npm install --no-save --force "typescript@$TS_VERSION"
3433

3534
echo "Typescript $($TSC -v)"
3635
echo "Types: $(cat node_modules/@types/node/package.json | jq -r .version)"
@@ -44,12 +43,7 @@ if [ "$TS_CHECK" == "COMPILE_DRIVER" ]; then
4443
npm run build:ts
4544
elif [ "$TS_CHECK" == "CHECK_TYPES" ]; then
4645
echo "checking driver types"
47-
if [ "$TS_VERSION" == "4.4" ]; then
48-
# check compilation
49-
node $TSC mongodb.d.ts --module commonjs --target es2021
50-
else
51-
node $TSC mongodb.d.ts --module node16 --target es2021
52-
fi
46+
node $TSC mongodb.d.ts --module node16 --target es2023
5347
else
5448
"Invalid value $TS_CHECK for TS_CHECK environment variable."
5549
exit 1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ The following table describes add-on component version compatibility for the Nod
9595

9696
#### Typescript Version
9797

98-
We recommend using the latest version of typescript, however we currently ensure the driver's public types compile against `typescript@4.4.0`.
98+
We recommend using the latest version of typescript, however we currently ensure the driver's public types compile against `typescript@5.6.0`.
9999
This is the lowest typescript version guaranteed to work with our driver: older versions may or may not work - use at your own risk.
100100
Since typescript [does not restrict breaking changes to major versions](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes), we consider this support best effort.
101101
If you run into any unexpected compiler failures against our supported TypeScript versions, please let us know by filing an issue on our [JIRA](https://jira.mongodb.org/browse/NODE).
@@ -104,7 +104,7 @@ Additionally, our Typescript types are compatible with the ECMAScript standard f
104104

105105
## Installation
106106

107-
The recommended way to get started using the Node.js 5.x driver is by using the `npm` (Node Package Manager) to install the dependency in your project.
107+
The recommended way to get started using the Node.js 6.x driver is by using the `npm` (Node Package Manager) to install the dependency in your project.
108108

109109
After you've created your own project using `npm init`, you can run:
110110

test/integration/connection-monitoring-and-pooling/connection.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@ describe('Connection', function () {
372372

373373
// Ensure that we used the drain event for this write
374374
expect(addedListeners).to.deep.equal(['drain', 'error']);
375+
376+
// https://github.com/nodejs/node/issues/59977: Node 20.11.0
377+
// does not emit a `removeListeners` event for `drain`.
375378
expect(removedListeners).to.deep.equal(['error']);
376379
expect(socket.listenerCount('drain')).to.equal(0);
377380
});

0 commit comments

Comments
 (0)