-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
24 changed files
with
804 additions
and
636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,19 +17,3 @@ set -o xtrace | |
|
||
## Checks typescript, eslint, and prettier | ||
npm run check:lint | ||
|
||
npx nyc npm run check:unit | ||
|
||
export TSC="./node_modules/typescript/bin/tsc" | ||
|
||
echo "Typescript $($TSC -v)" | ||
# check resolution uses the default latest types | ||
echo "import * as mdb from '.'" > file.ts && $TSC --noEmit --traceResolution file.ts | grep 'mongodb.d.ts' && rm file.ts | ||
|
||
npm i --no-save [email protected] | ||
echo "Typescript $($TSC -v)" | ||
$TSC --noEmit mongodb.ts34.d.ts | ||
# check that resolution uses the downleveled types | ||
echo "import * as mdb from '.'" > file.ts && $TSC --noEmit --traceResolution file.ts | grep 'mongodb.ts34.d.ts' && rm file.ts | ||
|
||
rm -f file.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
source "${PROJECT_DIRECTORY}/.evergreen/init-nvm.sh" | ||
|
||
set -o xtrace | ||
|
||
function get_current_ts_version { | ||
node -e "console.log(require('./package-lock.json').dependencies.typescript.version)" | ||
} | ||
|
||
CURRENT_TS_VERSION=$(get_current_ts_version) | ||
|
||
export TSC="./node_modules/typescript/bin/tsc" | ||
export TS_VERSION=${TS_VERSION:=$CURRENT_TS_VERSION} | ||
|
||
npm install --no-save --force typescript@"$TS_VERSION" | ||
|
||
echo "Typescript $($TSC -v)" | ||
|
||
# check resolution uses the default latest types | ||
echo "import * as mdb from '.'" > file.ts && node $TSC --noEmit --traceResolution file.ts | grep 'mongodb.d.ts' && rm file.ts | ||
|
||
# check compilation | ||
node $TSC mongodb.d.ts | ||
|
||
if [[ $TRY_COMPILING_DRIVER != "false" ]]; then | ||
npm run build:ts | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
source "${PROJECT_DIRECTORY}/.evergreen/init-nvm.sh" | ||
set -o xtrace | ||
|
||
npx nyc npm run check:unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,9 +46,10 @@ For version compatibility matrices, please refer to the following links: | |
|
||
#### Typescript Version | ||
|
||
We recommend using the latest version of typescript, however we do provide a [downleveled](https:/sandersn/downlevel-dts#readme) version of the type definitions that we test compiling against `[email protected]`. | ||
We recommend using the latest version of typescript, however we currently ensure the driver's public types compile against `[email protected]`. | ||
This is the lowest typescript version guaranteed to work with our driver: older versions may or may not work - use at your own risk. | ||
Since typescript [does not restrict breaking changes to major versions](https:/Microsoft/TypeScript/wiki/Breaking-Changes) we consider this support best effort. | ||
If you run into any unexpected compiler failures please let us know and we will do our best to correct it. | ||
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). | ||
|
||
## Installation | ||
|
||
|
Oops, something went wrong.