Skip to content

Commit 593ff24

Browse files
feat(NODE-5420)!: remove JS bindings from libmongocrypt (#667)
1 parent 57531ba commit 593ff24

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1059
-9627
lines changed

.eslintrc.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
"root": true,
33
"extends": [
44
"eslint:recommended",
5-
"plugin:prettier/recommended"
5+
"plugin:prettier/recommended",
6+
"plugin:@typescript-eslint/eslint-recommended",
7+
"plugin:@typescript-eslint/recommended"
68
],
9+
"ignorePatterns": "lib/**/*",
710
"env": {
811
"node": true,
912
"mocha": true,
@@ -13,6 +16,7 @@
1316
"ecmaVersion": 2019
1417
},
1518
"plugins": [
19+
"@typescript-eslint",
1620
"prettier"
1721
],
1822
"rules": {
@@ -34,8 +38,17 @@
3438
"prettier/prettier": "error",
3539
"no-console": "error",
3640
"valid-typeof": "error",
37-
"eqeqeq": ["error", "always", {"null": "ignore"}],
38-
"strict": ["error", "global"],
41+
"eqeqeq": [
42+
"error",
43+
"always",
44+
{
45+
"null": "ignore"
46+
}
47+
],
48+
"strict": [
49+
"error",
50+
"global"
51+
],
3952
"no-restricted-syntax": [
4053
"error",
4154
{
@@ -55,17 +68,5 @@
5568
"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)"
5669
}
5770
]
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+
}
7172
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ deps
2020
*.tgz
2121

2222
xunit.xml
23+
24+
# built typescript
25+
lib
26+
prebuilds

.mocharc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json",
33
"require": [
4+
"source-map-support/register",
5+
"ts-node/register",
46
"test/tools/chai-addons.js"
57
],
8+
"extension": [
9+
"ts"
10+
],
611
"recursive": true,
712
"failZero": true,
813
"reporter": "test/tools/mongodb_reporter.js",

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
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.
44

5+
## [6.0.0-alpha.0](https://github.com/mongodb/libmongocrypt/compare/node-v2.9.0...node-v6.0.0-alpha.0) (2023-07-13)
6+
57
## [2.9.0](https://github.com/mongodb/libmongocrypt/compare/node-v2.8.0...node-v2.9.0) (2023-07-12)
68

79
## [2.8.0](https://github.com/mongodb/libmongocrypt/compare/node-v2.8.0-alpha.0...node-v2.8.0) (2023-05-11)

src/mongocrypt.cc renamed to addon/mongocrypt.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "mongocrypt.h"
22
#include <cassert>
33

4-
#ifdef _MSC_VER
4+
#ifdef _MSC_VER
55
#define strncasecmp _strnicmp
66
#define strcasecmp _stricmp
77
#endif
File renamed without changes.

binding.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
]
1919
},
2020
'sources': [
21-
'src/mongocrypt.cc'
21+
'addon/mongocrypt.cc'
2222
],
2323
'xcode_settings': {
2424
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',

etc/prepare.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#! /usr/bin/env node
2+
var cp = require('child_process');
3+
var fs = require('fs');
4+
var os = require('os');
5+
6+
if (fs.existsSync('src')) {
7+
cp.spawn('npm', ['run', 'build:ts'], { stdio: 'inherit', shell: os.platform() === 'win32' });
8+
} else {
9+
if (!fs.existsSync('lib')) {
10+
console.warn('MongoDB: No compiled javascript present, the driver is not installed correctly.');
11+
}
12+
}

0 commit comments

Comments
 (0)