Skip to content

Commit

Permalink
fix: TS errors in both versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Mar 31, 2022
1 parent 59e259c commit fdf2212
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 121 deletions.
18 changes: 18 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,16 @@ functions:
script: |
${PREPARE_SHELL}
bash ${PROJECT_DIRECTORY}/.evergreen/run-checks.sh
run typescript next:
- command: subprocess.exec
params:
working_dir: src
timeout_secs: 60
env:
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
binary: bash
args:
- ${PROJECT_DIRECTORY}/.evergreen/run-typescript-next.sh
run mongosh integration tests:
- command: shell.exec
type: test
Expand Down Expand Up @@ -1742,6 +1752,14 @@ tasks:
vars:
NODE_LTS_NAME: erbium
- func: run checks
- name: run-typescript-next
tags:
- run-typescript-next
commands:
- func: install dependencies
vars:
NODE_LTS_NAME: erbium
- func: run typescript next
- name: run-mongosh-integration-tests
tags:
- run-mongosh-integration-tests
Expand Down
11 changes: 11 additions & 0 deletions .evergreen/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,17 @@ functions:
${PREPARE_SHELL}
bash ${PROJECT_DIRECTORY}/.evergreen/run-checks.sh

"run typescript next":
- command: subprocess.exec
params:
working_dir: "src"
timeout_secs: 60
env:
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
binary: bash
args:
- "${PROJECT_DIRECTORY}/.evergreen/run-typescript-next.sh"

"run mongosh integration tests":
- command: shell.exec
type: test
Expand Down
14 changes: 14 additions & 0 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,20 @@ SINGLETON_TASKS.push({
]
});

SINGLETON_TASKS.push({
name: 'run-typescript-next',
tags: ['run-typescript-next'],
commands: [
{
func: 'install dependencies',
vars: {
NODE_LTS_NAME: LOWEST_LTS
}
},
{ func: 'run typescript next' }
]
});

BUILD_VARIANTS.push({
name: 'lint',
display_name: 'lint',
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-checks.sh
Original file line number Diff line number Diff line change
@@ -1,7 +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"
source "${PROJECT_DIRECTORY}/.evergreen/init-nvm.sh"

# Attempt to update our EVG config
# if it changes, crash so that any gen script changes are forced to be run before pushing
Expand Down
20 changes: 20 additions & 0 deletions .evergreen/run-typescript-next.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -o errexit # Exit the script with error if any of the commands fail

# source "${PROJECT_DIRECTORY}/.evergreen/init-nvm.sh"

export TSC="./node_modules/typescript/bin/tsc"

# Check the next version of typescript
echo "Check the next version of typescript"
npm i --no-save typescript@next
echo "Typescript $($TSC -v)"

# clear lib directory just be sure it's a clean compile
rm -rf lib

# check driver code
npm run build:ts

# check public types
echo "import * as mdb from '.'" > file.ts && $TSC --noEmit --traceResolution file.ts | grep 'mongodb.d.ts' && rm file.ts
156 changes: 51 additions & 105 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"devDependencies": {
"@iarna/toml": "^2.2.5",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@microsoft/api-extractor": "^7.19.5",
"@microsoft/api-extractor": "^7.20.0",
"@microsoft/tsdoc-config": "^0.15.2",
"@types/chai": "^4.3.0",
"@types/chai-subset": "^1.3.3",
Expand Down
Loading

0 comments on commit fdf2212

Please sign in to comment.