Skip to content

Commit 3a8ccf7

Browse files
fix lint tasks in CI
1 parent 1c63e68 commit 3a8ccf7

File tree

6 files changed

+31
-14
lines changed

6 files changed

+31
-14
lines changed

.evergreen/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3500,9 +3500,9 @@ tasks:
35003500
- {key: TS_VERSION, value: current}
35013501
- func: install dependencies
35023502
- func: check types
3503-
- name: check-types-typescript-4.1.6
3503+
- name: check-types-typescript-4.4
35043504
tags:
3505-
- check-types-typescript-4.1.6
3505+
- check-types-typescript-4.4
35063506
- typescript-compilation
35073507
commands:
35083508
- command: expansions.update
@@ -3511,7 +3511,7 @@ tasks:
35113511
updates:
35123512
- {key: NODE_LTS_VERSION, value: '16'}
35133513
- {key: NPM_VERSION, value: '9'}
3514-
- {key: TS_VERSION, value: 4.1.6}
3514+
- {key: TS_VERSION, value: '4.4'}
35153515
- func: install dependencies
35163516
- func: check types
35173517
- name: download-and-merge-coverage

.evergreen/generate_evergreen_tasks.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,10 @@ SINGLETON_TASKS.push(
497497
);
498498

499499
function* makeTypescriptTasks() {
500-
for (const TS_VERSION of ['next', 'current', '4.1.6']) {
501-
// 4.1.6 can consume the public API but not compile the driver
502-
if (TS_VERSION !== '4.1.6' && TS_VERSION !== 'next') {
500+
for (const TS_VERSION of ['next', 'current', '4.4']) {
501+
// We don't compile on next, because compilation errors are likely. We do expect
502+
// that the drivers types continue to work with next though.
503+
if (TS_VERSION !== '4.4' && TS_VERSION !== 'next') {
503504
yield {
504505
name: `compile-driver-typescript-${TS_VERSION}`,
505506
tags: [`compile-driver-typescript-${TS_VERSION}`, 'typescript-compilation'],

.evergreen/run-typescript.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export TSC="./node_modules/typescript/bin/tsc"
3232
export TS_VERSION=$(get_ts_version)
3333

3434
# On old versions of TS we need to put the node types back to 18.11.19
35-
npm install --no-save --force typescript@"$TS_VERSION" "$(if [[ $TS_VERSION == '4.1.6' ]]; then echo "@types/[email protected]"; else echo ""; fi)"
35+
npm install --no-save --force typescript@"$TS_VERSION" "$(if [[ $TS_VERSION == '4.4' ]]; then echo "@types/[email protected]"; else echo ""; fi)"
3636

3737
echo "Typescript $($TSC -v)"
3838

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ The official [MongoDB](https://www.mongodb.com/) driver for Node.js.
2727
The GitHub release contains a detached signature file for the NPM package (named
2828
`mongodb-X.Y.Z.tgz.sig`).
2929

30-
The following command returns the link npm package.
30+
The following command returns the link npm package.
3131
```shell
32-
npm view [email protected] dist.tarball
32+
npm view [email protected] dist.tarball
3333
```
3434

3535
Using the result of the above command, a `curl` command can return the official npm package for the release.
@@ -81,7 +81,7 @@ The following table describes add-on component version compatibility for the Nod
8181

8282
#### Typescript Version
8383

84-
We recommend using the latest version of typescript, however we currently ensure the driver's public types compile against `typescript@4.1.6`.
84+
We recommend using the latest version of typescript, however we currently ensure the driver's public types compile against `typescript@4.4.0`.
8585
This is the lowest typescript version guaranteed to work with our driver: older versions may or may not work - use at your own risk.
8686
Since typescript [does not restrict breaking changes to major versions](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes), we consider this support best effort.
8787
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).

src/client-side-encryption/providers/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export interface KMSProviders {
122122
* Configuration options for using 'aws' as your KMS provider
123123
*/
124124
aws?: AWSKMSProviderConfiguration | Record<string, never>;
125-
[key: `aws:${string}`]: AWSKMSProviderConfiguration | Record<string, never>;
125+
[key: `aws:${string}`]: AWSKMSProviderConfiguration;
126126

127127
/**
128128
* Configuration options for using 'local' as your KMS provider
@@ -140,13 +140,13 @@ export interface KMSProviders {
140140
* Configuration options for using 'azure' as your KMS provider
141141
*/
142142
azure?: AzureKMSProviderConfiguration | Record<string, never>;
143-
[key: `azure:${string}`]: AzureKMSProviderConfiguration | Record<string, never>;
143+
[key: `azure:${string}`]: AzureKMSProviderConfiguration;
144144

145145
/**
146146
* Configuration options for using 'gcp' as your KMS provider
147147
*/
148148
gcp?: GCPKMSProviderConfiguration | Record<string, never>;
149-
[key: `gcp:${string}`]: GCPKMSProviderConfiguration | Record<string, never>;
149+
[key: `gcp:${string}`]: GCPKMSProviderConfiguration;
150150
}
151151

152152
/**

test/types/client-side-encryption.test-d.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expectAssignable, expectError, expectType } from 'tsd';
1+
import { expectAssignable, expectError, expectNotAssignable, expectType } from 'tsd';
22

33
import type {
44
AWSEncryptionKeyOptions,
@@ -9,6 +9,7 @@ import type {
99
KMSProviders,
1010
RangeOptions
1111
} from '../..';
12+
import type { ClientEncryptionDataKeyProvider } from '../mongodb';
1213

1314
type RequiredCreateEncryptedCollectionSettings = Parameters<
1415
ClientEncryption['createEncryptedCollection']
@@ -87,3 +88,18 @@ expectAssignable<RequiredCreateEncryptedCollectionSettings>({
8788
// automatic
8889
expectAssignable<KMSProviders['gcp']>({});
8990
}
91+
92+
{
93+
expectAssignable<ClientEncryptionDataKeyProvider>('aws');
94+
expectAssignable<ClientEncryptionDataKeyProvider>('gcp');
95+
expectAssignable<ClientEncryptionDataKeyProvider>('azure');
96+
expectAssignable<ClientEncryptionDataKeyProvider>('local');
97+
expectAssignable<ClientEncryptionDataKeyProvider>('kmip');
98+
expectAssignable<ClientEncryptionDataKeyProvider>('aws:named');
99+
expectAssignable<ClientEncryptionDataKeyProvider>('gcp:named');
100+
expectAssignable<ClientEncryptionDataKeyProvider>('azure:named');
101+
expectAssignable<ClientEncryptionDataKeyProvider>('local:named');
102+
expectAssignable<ClientEncryptionDataKeyProvider>('kmip:named');
103+
104+
expectNotAssignable<ClientEncryptionDataKeyProvider>('arbitrary string');
105+
}

0 commit comments

Comments
 (0)