Skip to content

Commit 4cdfc8a

Browse files
committed
chore(NODE-3849): update dependencies and sync tooling
1 parent ada4c58 commit 4cdfc8a

26 files changed

+6546
-4892
lines changed

bindings/node/.eslintrc

Lines changed: 0 additions & 30 deletions
This file was deleted.

bindings/node/.eslintrc.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:prettier/recommended"
6+
],
7+
"env": {
8+
"node": true,
9+
"mocha": true,
10+
"es6": true
11+
},
12+
"parserOptions": {
13+
"ecmaVersion": 2019
14+
},
15+
"plugins": [
16+
"prettier"
17+
],
18+
"rules": {
19+
"no-restricted-properties": [
20+
"error",
21+
{
22+
"object": "describe",
23+
"property": "only"
24+
},
25+
{
26+
"object": "it",
27+
"property": "only"
28+
},
29+
{
30+
"object": "context",
31+
"property": "only"
32+
}
33+
],
34+
"prettier/prettier": "error",
35+
"no-console": "error",
36+
"valid-typeof": "error",
37+
"eqeqeq": ["error", "always", {"null": "ignore"}],
38+
"strict": ["error", "global"],
39+
"no-restricted-syntax": [
40+
"error",
41+
{
42+
"selector": "TSEnumDeclaration",
43+
"message": "Do not declare enums"
44+
},
45+
{
46+
"selector": "BinaryExpression[operator=/[=!]==/] Identifier[name='undefined']",
47+
"message": "Do not strictly check undefined"
48+
},
49+
{
50+
"selector": "BinaryExpression[operator=/[=!]==/] Literal[raw='null']",
51+
"message": "Do not strictly check null"
52+
},
53+
{
54+
"selector": "BinaryExpression[operator=/[=!]==?/] Literal[value='undefined']",
55+
"message": "Do not strictly check typeof undefined (NOTE: currently this rule only detects the usage of 'undefined' string literal so this could be a misfire)"
56+
}
57+
]
58+
},
59+
"overrides": [
60+
{
61+
// Settings for javascript test files
62+
"files": [
63+
"test/**/*.js"
64+
],
65+
"rules": {
66+
"no-console": "off",
67+
"no-restricted-syntax": "off"
68+
}
69+
}
70+
]
71+
}

bindings/node/.evergreen/find_cmake.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash -x
1+
#!/usr/bin/env bash
22

33
# Copied from the mongo-c-driver
44
find_cmake ()

bindings/node/.evergreen/setup_environment.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ NODE_ARTIFACTS_PATH="${NODE_BINDINGS_PATH}/node-artifacts"
99
NPM_CACHE_DIR="${NODE_ARTIFACTS_PATH}/npm"
1010
NPM_TMP_DIR="${NODE_ARTIFACTS_PATH}/tmp"
1111
BIN_DIR="$(pwd)/bin"
12-
NVM_WINDOWS_URL="https://github.com/coreybutler/nvm-windows/releases/download/1.1.7/nvm-noinstall.zip"
13-
NVM_URL="https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh"
12+
NVM_WINDOWS_URL="https://github.com/coreybutler/nvm-windows/releases/download/1.1.9/nvm-noinstall.zip"
13+
NVM_URL="https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh"
1414

1515
# create node artifacts path if needed
1616
mkdir -p ${NODE_ARTIFACTS_PATH}
@@ -37,6 +37,8 @@ mkdir -p ${NVM_DIR}
3737
# install Node.js
3838
echo "Installing Node ${NODE_LTS_NAME}"
3939
if [ "$OS" == "Windows_NT" ]; then
40+
set +o xtrace
41+
4042
export NVM_HOME=`cygpath -w "$NVM_DIR"`
4143
export NVM_SYMLINK=`cygpath -w "$NODE_ARTIFACTS_PATH/bin"`
4244
export PATH=`cygpath $NVM_SYMLINK`:`cygpath $NVM_HOME`:$PATH
@@ -54,14 +56,26 @@ root: $NVM_HOME
5456
path: $NVM_SYMLINK
5557
EOT
5658

57-
nvm install $NODE_VERSION
58-
nvm use $NODE_VERSION
59+
echo "Running: nvm install lts"
60+
nvm install lts
61+
echo "Running: nvm use lts"
62+
nvm use lts
63+
echo "Running: npm install -g npm@8.3.1"
64+
npm install -g npm@8.3.1 # https://github.com/npm/cli/issues/4341
65+
set -o xtrace
5966
else
67+
set +o xtrace
68+
69+
echo " Downloading nvm"
6070
curl -o- $NVM_URL | bash
6171
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"
6272

63-
nvm install $NODE_VERSION
64-
nvm use $NODE_VERSION
73+
echo "Running: nvm install --lts --latest-npm"
74+
nvm install --lts --latest-npm
75+
echo "Running: nvm use --lts"
76+
nvm use --lts
77+
78+
set -o xtrace
6579
fi
6680

6781
# setup npm cache in a local directory
@@ -71,4 +85,3 @@ init-module=${NPM_CACHE_DIR}/.npm-init.js
7185
cache=${NPM_CACHE_DIR}
7286
tmp=${NPM_TMP_DIR}
7387
EOT
74-

bindings/node/.evergreen/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ echo "Installing package dependencies (includes a static build)"
1212

1313
# Run tests
1414
echo "Running tests"
15+
npm run check:lint
1516
MONGODB_NODE_SKIP_LIVE_TESTS=true npm test
1617

1718
# Run prebuild and deploy

bindings/node/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ npm-debug.log
1818
.vscode
1919
deps
2020
*.tgz
21+
22+
xunit.xml

bindings/node/.mocharc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json",
3+
"recursive": true,
4+
"failZero": true,
5+
"reporter": "test/tools/mongodb_reporter.js",
6+
"sort": true,
7+
"color": true
8+
}

bindings/node/.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"tabWidth": 2,
4+
"printWidth": 100,
5+
"arrowParens": "avoid",
6+
"trailingComma": "none"
7+
}

bindings/node/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ The public interface for explicit client side encryption
205205
| client | <code>MongoClient</code> | The client used for encryption |
206206
| options | <code>object</code> | Additional settings |
207207
| options.keyVaultNamespace | <code>string</code> | The namespace of the key vault, used to store encryption keys |
208+
| options.tlsOptions | <code>object</code> | An object that maps KMS provider names to TLS options. |
208209
| [options.keyVaultClient] | <code>MongoClient</code> | A `MongoClient` used to fetch keys from a key vault. Defaults to `client` |
209210
| [options.kmsProviders] | [<code>KMSProviders</code>](#KMSProviders) | options for specific KMS providers to use |
210211

bindings/node/lib/autoEncrypter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
module.exports = function(modules) {
3+
module.exports = function (modules) {
44
const mc = require('bindings')('mongocrypt');
55
const common = require('./common');
66
const databaseNamespace = common.databaseNamespace;

0 commit comments

Comments
 (0)