Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(NODE-3331): offer downleveled types for legacy typescript versio…
…ns (#2859)
- Loading branch information
Showing
7 changed files
with
146 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
#!/bin/bash | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
export PROJECT_DIRECTORY="$(pwd)" | ||
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts" | ||
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | ||
|
||
npm run check:lint | ||
|
||
echo "Typescript $(npx tsc -v)" | ||
# check resolution uses the default latest types | ||
echo "import * as mdb from '.'" > file.ts && npx tsc --noEmit --traceResolution file.ts | grep 'mongodb.d.ts' && rm file.ts | ||
|
||
npm i --no-save typescript@4.0.2 # there is no 4.0.0 | ||
echo "Typescript $(npx tsc -v)" | ||
npx tsc --noEmit mongodb.ts34.d.ts | ||
# check that resolution uses the downleveled types | ||
echo "import * as mdb from '.'" > file.ts && npx tsc --noEmit --traceResolution file.ts | grep 'mongodb.ts34.d.ts' && rm 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
Oops, something went wrong.