Skip to content

feat(NODE-5420)!: remove JS bindings from libmongocrypt #667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 18, 2023
Merged
28 changes: 1 addition & 27 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,6 @@ tasks:
- func: "fetch source"
- func: "build and publish node"

- name: build-and-test-node-no-peer-dependencies
commands:
- func: "fetch source"
- func: "build and test node no peer dependencies"
- func: "attach node xunit results"

# Note: keep this disabled unless you want master to force-push
- name: build-and-test-node-force-publish
Expand Down Expand Up @@ -1004,7 +999,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- build-and-publish-node
- test-java
- name: publish-packages
Expand All @@ -1018,7 +1012,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan-mac
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- build-and-publish-node
- build-and-test-csharp
- test-python
Expand Down Expand Up @@ -1064,7 +1057,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-csharp
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- build-and-publish-node
- test-java
- windows-upload-check
Expand All @@ -1091,7 +1083,6 @@ buildvariants:
- build-and-test-and-upload
- build-and-test-shared-bson
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-java
- name: publish-packages
distros:
Expand All @@ -1109,7 +1100,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-java
- name: publish-packages
distros:
Expand All @@ -1127,7 +1117,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- name: publish-packages
distros:
- rhel70-small
Expand All @@ -1143,7 +1132,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-java
- name: publish-packages
distros:
Expand All @@ -1160,7 +1148,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-java
- name: publish-packages
distros:
Expand All @@ -1178,7 +1165,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-java
- name: publish-packages
distros:
Expand Down Expand Up @@ -1209,7 +1195,7 @@ buildvariants:
- build-and-test-and-upload
- build-and-test-shared-bson
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-python
- test-java
- name: publish-packages
distros:
Expand Down Expand Up @@ -1239,8 +1225,6 @@ buildvariants:
- build-and-test-and-upload
- build-and-test-shared-bson
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-python
- test-java
- name: publish-packages
distros:
Expand All @@ -1258,7 +1242,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-java
- name: publish-packages
distros:
Expand All @@ -1276,7 +1259,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-java
- name: publish-packages
distros:
Expand All @@ -1294,7 +1276,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- build-and-publish-node
- test-java
- name: publish-packages
Expand All @@ -1313,7 +1294,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- build-and-test-csharp
- test-java
- name: publish-packages
Expand Down Expand Up @@ -1342,7 +1322,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-java
- name: publish-packages
distros:
Expand All @@ -1361,7 +1340,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- build-and-test-csharp
- test-java
- upload-java
Expand All @@ -1379,7 +1357,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-java
- name: publish-packages
distros:
Expand All @@ -1398,7 +1375,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
# see https://jira.mongodb.org/browse/MONGOCRYPT-515
#- build-and-test-csharp
- test-java
Expand All @@ -1418,7 +1394,6 @@ buildvariants:
- build-and-test-shared-bson
- build-and-test-asan
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- test-java
- name: publish-packages
distros:
Expand Down Expand Up @@ -1448,7 +1423,6 @@ buildvariants:
tasks:
- build-and-test-and-upload
- build-and-test-node
- build-and-test-node-no-peer-dependencies
- build-and-publish-node
- test-python
- test-java
Expand Down
33 changes: 17 additions & 16 deletions bindings/node/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
"root": true,
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"ignorePatterns": "lib/**/*",
"env": {
"node": true,
"mocha": true,
Expand All @@ -13,6 +16,7 @@
"ecmaVersion": 2019
},
"plugins": [
"@typescript-eslint",
"prettier"
],
"rules": {
Expand All @@ -34,8 +38,17 @@
"prettier/prettier": "error",
"no-console": "error",
"valid-typeof": "error",
"eqeqeq": ["error", "always", {"null": "ignore"}],
"strict": ["error", "global"],
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"strict": [
"error",
"global"
],
"no-restricted-syntax": [
"error",
{
Expand All @@ -55,17 +68,5 @@
"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"
}
}
]
}
}
4 changes: 4 additions & 0 deletions bindings/node/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ deps
*.tgz

xunit.xml

# built typescript
lib
prebuilds
5 changes: 5 additions & 0 deletions bindings/node/.mocharc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json",
"require": [
"source-map-support/register",
"ts-node/register",
"test/tools/chai-addons.js"
],
"extension": [
"ts"
],
"recursive": true,
"failZero": true,
"reporter": "test/tools/mongodb_reporter.js",
Expand Down
2 changes: 2 additions & 0 deletions bindings/node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [6.0.0-alpha.0](https://github.com/mongodb/libmongocrypt/compare/node-v2.9.0...node-v6.0.0-alpha.0) (2023-07-13)

## [2.9.0](https://github.com/mongodb/libmongocrypt/compare/node-v2.8.0...node-v2.9.0) (2023-07-12)

## [2.8.0](https://github.com/mongodb/libmongocrypt/compare/node-v2.8.0-alpha.0...node-v2.8.0) (2023-05-11)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "mongocrypt.h"
#include <cassert>

#ifdef _MSC_VER
#ifdef _MSC_VER
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion bindings/node/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
]
},
'sources': [
'src/mongocrypt.cc'
'addon/mongocrypt.cc'
],
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
Expand Down
12 changes: 12 additions & 0 deletions bindings/node/etc/prepare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /usr/bin/env node
var cp = require('child_process');
var fs = require('fs');
var os = require('os');

if (fs.existsSync('src')) {
cp.spawn('npm', ['run', 'build:ts'], { stdio: 'inherit', shell: os.platform() === 'win32' });
} else {
if (!fs.existsSync('lib')) {
console.warn('MongoDB: No compiled javascript present, the driver is not installed correctly.');
}
}
Loading