-
Notifications
You must be signed in to change notification settings - Fork 68
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
22 changed files
with
3,443 additions
and
1,998 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"env": { | ||
"node": true, | ||
"mocha": true, | ||
"es6": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2019 | ||
}, | ||
"plugins": [ | ||
"prettier" | ||
], | ||
"rules": { | ||
"no-restricted-properties": [ | ||
"error", | ||
{ | ||
"object": "describe", | ||
"property": "only" | ||
}, | ||
{ | ||
"object": "it", | ||
"property": "only" | ||
}, | ||
{ | ||
"object": "context", | ||
"property": "only" | ||
} | ||
], | ||
"prettier/prettier": "error", | ||
"no-console": "error", | ||
"valid-typeof": "error", | ||
"eqeqeq": ["error", "always", {"null": "ignore"}], | ||
"strict": ["error", "global"], | ||
"no-restricted-syntax": [ | ||
"error", | ||
{ | ||
"selector": "TSEnumDeclaration", | ||
"message": "Do not declare enums" | ||
}, | ||
{ | ||
"selector": "BinaryExpression[operator=/[=!]==/] Identifier[name='undefined']", | ||
"message": "Do not strictly check undefined" | ||
}, | ||
{ | ||
"selector": "BinaryExpression[operator=/[=!]==/] Literal[raw='null']", | ||
"message": "Do not strictly check null" | ||
}, | ||
{ | ||
"selector": "BinaryExpression[operator=/[=!]==?/] Literal[value='undefined']", | ||
"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)" | ||
} | ||
] | ||
}, | ||
"overrides": [ | ||
{ | ||
// Settings for javascript test files | ||
"files": [ | ||
"test/**/*.js" | ||
], | ||
"rules": { | ||
"no-console": "off", | ||
"no-restricted-syntax": "off" | ||
} | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#! /usr/bin/env bash | ||
|
||
export PATH="/opt/mongodbtoolchain/v2/bin:$PATH" | ||
NODE_BINDINGS_PATH="${PROJECT_DIRECTORY}/bindings/node" | ||
NODE_ARTIFACTS_PATH="${NODE_BINDINGS_PATH}/node-artifacts" | ||
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm" | ||
|
||
if [[ "$OS" == "Windows_NT" ]]; then | ||
NVM_HOME=$(cygpath -w "$NVM_DIR") | ||
export NVM_HOME | ||
NVM_SYMLINK=$(cygpath -w "$NODE_ARTIFACTS_PATH/bin") | ||
export NVM_SYMLINK | ||
NVM_ARTIFACTS_PATH=$(cygpath -w "$NODE_ARTIFACTS_PATH/bin") | ||
export NVM_ARTIFACTS_PATH | ||
PATH=$(cygpath $NVM_SYMLINK):$(cygpath $NVM_HOME):$PATH | ||
export PATH | ||
echo "updated path on windows PATH=$PATH" | ||
nvm use lts | ||
else | ||
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" | ||
nvm use --lts | ||
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 |
---|---|---|
@@ -1,27 +1,33 @@ | ||
#!/bin/bash | ||
# set -o xtrace # Write all commands first to stderr | ||
#!/usr/bin/env bash | ||
|
||
set -o xtrace # Write all commands first to stderr | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
NODE_VERSION=${NODE_VERSION:-14} | ||
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts" | ||
NODE_BINDINGS_PATH="${PROJECT_DIRECTORY}/bindings/node" | ||
NODE_ARTIFACTS_PATH="${NODE_BINDINGS_PATH}/node-artifacts" | ||
NPM_CACHE_DIR="${NODE_ARTIFACTS_PATH}/npm" | ||
NPM_TMP_DIR="${NODE_ARTIFACTS_PATH}/tmp" | ||
BIN_DIR="$(pwd)/bin" | ||
|
||
NVM_WINDOWS_URL="https://github.com/coreybutler/nvm-windows/releases/download/1.1.7/nvm-noinstall.zip" | ||
NVM_URL="https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh" | ||
NVM_WINDOWS_URL="https://github.com/coreybutler/nvm-windows/releases/download/1.1.9/nvm-noinstall.zip" | ||
NVM_URL="https://raw.githubusercontent.com/creationix/nvm/v0.38.0/install.sh" | ||
|
||
# this needs to be explicitly exported for the nvm install below | ||
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm" | ||
export XDG_CONFIG_HOME=${NODE_ARTIFACTS_PATH} | ||
|
||
# create node artifacts path if needed | ||
mkdir -p ${NVM_DIR} | ||
mkdir -p ${NPM_CACHE_DIR} | ||
mkdir -p "${NODE_ARTIFACTS_PATH}" | ||
mkdir -p "${NPM_CACHE_DIR}" | ||
mkdir -p "${NPM_TMP_DIR}" | ||
mkdir -p "${BIN_DIR}" | ||
|
||
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm" | ||
mkdir -p "${NVM_DIR}" | ||
|
||
# install Node.js | ||
echo "Installing Node ${NODE_VERSION}" | ||
if [ "$OS" == "Windows_NT" ]; then | ||
set +o xtrace | ||
|
||
export NVM_HOME=`cygpath -w "$NVM_DIR"` | ||
export NVM_SYMLINK=`cygpath -w "$NODE_ARTIFACTS_PATH/bin"` | ||
export PATH=`cygpath $NVM_SYMLINK`:`cygpath $NVM_HOME`:$PATH | ||
|
@@ -39,23 +45,35 @@ root: $NVM_HOME | |
path: $NVM_SYMLINK | ||
EOT | ||
|
||
nvm install ${NODE_VERSION} | ||
echo "Running: nvm install lts" | ||
nvm install lts | ||
echo "Running: nvm use lts" | ||
nvm use lts | ||
echo "Running: npm install -g [email protected]" | ||
npm install -g [email protected] # https://github.com/npm/cli/issues/4341 | ||
set -o xtrace | ||
else | ||
set +o xtrace | ||
|
||
echo " Downloading nvm" | ||
curl -o- $NVM_URL | bash | ||
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh" | ||
[ -s "${NVM_DIR}/nvm.sh" ] && source "${NVM_DIR}/nvm.sh" | ||
|
||
echo "Running: nvm install --lts --latest-npm" | ||
nvm install --lts --latest-npm | ||
echo "Running: nvm use --lts" | ||
nvm use --lts | ||
|
||
nvm install --no-progress ${NODE_VERSION} | ||
set -o xtrace | ||
fi | ||
nvm use ${NODE_VERSION} | ||
|
||
# setup npm cache in a local directory | ||
cat <<EOT > .npmrc | ||
devdir=${NPM_CACHE_DIR}/.node-gyp | ||
init-module=${NPM_CACHE_DIR}/.npm-init.js | ||
cache=${NPM_CACHE_DIR} | ||
tmp=${NPM_TMP_DIR} | ||
registry=https://registry.npmjs.org | ||
EOT | ||
|
||
# install node dependencies | ||
npm install --unsafe-perm | ||
npm install |
Oops, something went wrong.