Skip to content

Commit ee0e3bf

Browse files
committed
Fix dependencies
1 parent 79df553 commit ee0e3bf

File tree

6 files changed

+28
-34
lines changed

6 files changed

+28
-34
lines changed

docs/guide/installation-guide.txt

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Troubleshooting
2121
The MongoDB driver depends on several other packages, including:
2222

2323
* `bson <https://www.npmjs.com/package/bson>`_
24-
* `require_optional <https://www.npmjs.com/package/require_optional>`_
2524
* `safe-buffer <https://www.npmjs.com/package/safe-buffer>`_
2625
* `saslprep <https://www.npmjs.com/package/saslprep>`_
2726

lib/core/connection/utils.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict';
22

3-
const require_optional = require('require_optional');
4-
53
function debugOptions(debugFields, options) {
64
var finaloptions = {};
75
debugFields.forEach(function(n) {
@@ -16,7 +14,7 @@ function retrieveBSON() {
1614
BSON.native = false;
1715

1816
try {
19-
var optionalBSON = require_optional('bson-ext');
17+
var optionalBSON = require('bson-ext');
2018
if (optionalBSON) {
2119
optionalBSON.native = true;
2220
return optionalBSON;
@@ -37,7 +35,7 @@ function noSnappyWarning() {
3735
function retrieveSnappy() {
3836
var snappy = null;
3937
try {
40-
snappy = require_optional('snappy');
38+
snappy = require('snappy');
4139
} catch (error) {} // eslint-disable-line
4240
if (!snappy) {
4341
snappy = {

lib/core/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
'use strict';
22

33
let BSON = require('bson');
4-
const require_optional = require('require_optional');
54
const EJSON = require('./utils').retrieveEJSON();
65

76
try {
87
// Attempt to grab the native BSON parser
9-
const BSONNative = require_optional('bson-ext');
8+
const BSONNative = require('bson-ext');
109
// If we got the native parser, use it instead of the
1110
// Javascript one
1211
if (BSONNative) {

lib/core/utils.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22
const os = require('os');
33
const crypto = require('crypto');
4-
const requireOptional = require('require_optional');
54

65
/**
76
* Generate a UUIDv4
@@ -27,7 +26,7 @@ function retrieveKerberos() {
2726
let kerberos;
2827

2928
try {
30-
kerberos = requireOptional('kerberos');
29+
kerberos = require('kerberos');
3130
} catch (err) {
3231
if (err.code === 'MODULE_NOT_FOUND') {
3332
throw new Error('The `kerberos` module was not found. Please install it and try again.');
@@ -48,7 +47,7 @@ const noEJSONError = function() {
4847
function retrieveEJSON() {
4948
let EJSON = null;
5049
try {
51-
EJSON = requireOptional('mongodb-extjson');
50+
EJSON = require('mongodb-extjson');
5251
} catch (error) {} // eslint-disable-line
5352
if (!EJSON) {
5453
EJSON = {

package-lock.json

-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+23-3
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,38 @@
1616
"driver",
1717
"official"
1818
],
19-
"peerOptionalDependencies": {
19+
"peerDependencies": {
2020
"kerberos": "^1.1.0",
2121
"mongodb-client-encryption": "^1.0.0",
2222
"mongodb-extjson": "^2.1.2",
2323
"snappy": "^6.3.4",
24-
"bson-ext": "^2.0.0"
24+
"bson-ext": "^2.0.0",
25+
"aws4": "^1.10.1"
26+
},
27+
"peerDependenciesMeta": {
28+
"kerberos": {
29+
"optional": true
30+
},
31+
"mongodb-client-encryption": {
32+
"optional": true
33+
},
34+
"mongodb-extjson": {
35+
"optional": true
36+
},
37+
"snappy": {
38+
"optional": true
39+
},
40+
"bson-ext": {
41+
"optional": true
42+
},
43+
"aws4": {
44+
"optional": true
45+
}
2546
},
2647
"dependencies": {
2748
"bl": "^2.2.1",
2849
"bson": "^1.1.4",
2950
"denque": "^1.4.1",
30-
"require_optional": "^1.0.1",
3151
"safe-buffer": "^5.1.2"
3252
},
3353
"devDependencies": {

0 commit comments

Comments
 (0)