mongodb-runner 4.10.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -230
- package/bin/runner.js +3 -0
- package/dist/.esm-wrapper.mjs +5 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +180 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/mongocluster.d.ts +30 -0
- package/dist/mongocluster.d.ts.map +1 -0
- package/dist/mongocluster.js +179 -0
- package/dist/mongocluster.js.map +1 -0
- package/dist/mongologreader.d.ts +18 -0
- package/dist/mongologreader.d.ts.map +1 -0
- package/dist/mongologreader.js +89 -0
- package/dist/mongologreader.js.map +1 -0
- package/dist/mongoserver.d.ts +31 -0
- package/dist/mongoserver.d.ts.map +1 -0
- package/dist/mongoserver.js +235 -0
- package/dist/mongoserver.js.map +1 -0
- package/dist/util.d.ts +6 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +16 -0
- package/dist/util.js.map +1 -0
- package/package.json +66 -53
- package/appveyor.yml +0 -39
- package/bin/mongodb-runner-worker.js +0 -46
- package/bin/mongodb-runner.js +0 -56
- package/index.js +0 -1
- package/lib/index.js +0 -495
- package/lib/worker.js +0 -336
- package/mocha/after.js +0 -45
- package/mocha/before.js +0 -75
- package/usage.txt +0 -50
package/package.json
CHANGED
|
@@ -1,67 +1,80 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mongodb-runner",
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"author": "Lucas Hrabovsky <hrabovsky.lucas@gmail.com> (https://imlucas.com)",
|
|
8
|
-
"description": "The easiest way to test your code against MongoDB Server.",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"check": "mongodb-js-precommit",
|
|
11
|
-
"test": "mocha"
|
|
3
|
+
"description": "The easiest way to test your code against MongoDB Server",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "MongoDB Inc",
|
|
6
|
+
"email": "compass@mongodb.com"
|
|
12
7
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
15
10
|
},
|
|
16
|
-
"
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://jira.mongodb.org/projects/COMPASS/issues",
|
|
13
|
+
"email": "compass@mongodb.com"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/mongodb-js/devtools-shared",
|
|
16
|
+
"version": "5.2.0",
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "
|
|
20
|
-
},
|
|
21
|
-
"check": {
|
|
22
|
-
"entries": [
|
|
23
|
-
"bin/*.js"
|
|
24
|
-
],
|
|
25
|
-
"ignore": [
|
|
26
|
-
"coverage/{*,**/*}"
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
"dependency-check": {
|
|
30
|
-
"entries": [
|
|
31
|
-
"mocha/after.js",
|
|
32
|
-
"mocha/before.js"
|
|
33
|
-
]
|
|
19
|
+
"url": "https://github.com/mongodb-js/devtools-shared.git"
|
|
34
20
|
},
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"bin"
|
|
38
24
|
],
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"assets": "usage.txt"
|
|
25
|
+
"bin": {
|
|
26
|
+
"mongodb-runner": "bin/runner.js"
|
|
42
27
|
},
|
|
43
28
|
"license": "Apache-2.0",
|
|
29
|
+
"main": "dist/index.js",
|
|
30
|
+
"exports": {
|
|
31
|
+
"require": "./dist/index.js",
|
|
32
|
+
"import": "./dist/.esm-wrapper.mjs"
|
|
33
|
+
},
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"scripts": {
|
|
36
|
+
"bootstrap": "npm run compile",
|
|
37
|
+
"prepublishOnly": "npm run compile",
|
|
38
|
+
"compile": "tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"eslint": "eslint",
|
|
41
|
+
"prettier": "prettier",
|
|
42
|
+
"lint": "npm run eslint . && npm run prettier -- --check .",
|
|
43
|
+
"depcheck": "depcheck",
|
|
44
|
+
"check": "npm run typecheck && npm run lint && npm run depcheck",
|
|
45
|
+
"check-ci": "npm run check",
|
|
46
|
+
"test": "mocha",
|
|
47
|
+
"test-cov": "nyc -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test",
|
|
48
|
+
"test-watch": "npm run test -- --watch",
|
|
49
|
+
"test-ci": "npm run test-cov",
|
|
50
|
+
"reformat": "npm run prettier -- --write ."
|
|
51
|
+
},
|
|
44
52
|
"dependencies": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"is-mongodb-running": "^1.0.1",
|
|
50
|
-
"lodash.defaults": "^4.2.0",
|
|
51
|
-
"minimist": "^1.2.0",
|
|
52
|
-
"mkdirp": "^0.5.1",
|
|
53
|
-
"mongodb": "^3.4.0",
|
|
54
|
-
"mongodb-dbpath": "^0.0.1",
|
|
55
|
-
"mongodb-tools": "github:mongodb-js/mongodb-tools#0d1a90f49796c41f6d47c7c7999fe384014a16a0",
|
|
56
|
-
"mongodb-version-manager": "^1.5.0",
|
|
57
|
-
"untildify": "^4.0.0",
|
|
58
|
-
"which": "^2.0.1"
|
|
53
|
+
"@mongodb-js/mongodb-downloader": "^0.2.0",
|
|
54
|
+
"debug": "^4.3.4",
|
|
55
|
+
"mongodb": "^5.6.0",
|
|
56
|
+
"yargs": "^17.7.2"
|
|
59
57
|
},
|
|
60
58
|
"devDependencies": {
|
|
61
|
-
"eslint-config-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"mongodb-js-
|
|
65
|
-
"
|
|
66
|
-
|
|
59
|
+
"@mongodb-js/eslint-config-devtools": "0.9.5",
|
|
60
|
+
"@mongodb-js/mocha-config-compass": "^0.10.0",
|
|
61
|
+
"@mongodb-js/prettier-config-compass": "^0.5.0",
|
|
62
|
+
"@mongodb-js/tsconfig-compass": "^0.6.0",
|
|
63
|
+
"@types/chai": "^4.2.21",
|
|
64
|
+
"@types/debug": "^4.1.8",
|
|
65
|
+
"@types/mocha": "^9.0.0",
|
|
66
|
+
"@types/node": "^17.0.35",
|
|
67
|
+
"@types/sinon-chai": "^3.2.5",
|
|
68
|
+
"@types/yargs": "^17.0.24",
|
|
69
|
+
"chai": "^4.3.6",
|
|
70
|
+
"depcheck": "^1.4.1",
|
|
71
|
+
"eslint": "^7.25.0",
|
|
72
|
+
"gen-esm-wrapper": "^1.1.0",
|
|
73
|
+
"mocha": "^8.4.0",
|
|
74
|
+
"nyc": "^15.1.0",
|
|
75
|
+
"prettier": "2.3.2",
|
|
76
|
+
"sinon": "^9.2.3",
|
|
77
|
+
"typescript": "^4.3.5"
|
|
78
|
+
},
|
|
79
|
+
"gitHead": "1ce4c30d6f25b091bf6a3d8c40a14c249e65b4cc"
|
|
67
80
|
}
|
package/appveyor.yml
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# appveyor file
|
|
2
|
-
# http://www.appveyor.com/docs/appveyor-yml
|
|
3
|
-
|
|
4
|
-
# branches to build
|
|
5
|
-
branches:
|
|
6
|
-
# whitelist
|
|
7
|
-
only:
|
|
8
|
-
- master
|
|
9
|
-
|
|
10
|
-
# build version format
|
|
11
|
-
version: '{build}'
|
|
12
|
-
|
|
13
|
-
# what combinations to test
|
|
14
|
-
environment:
|
|
15
|
-
global:
|
|
16
|
-
DEBUG: '*'
|
|
17
|
-
matrix:
|
|
18
|
-
- nodejs_version: 12.4.0
|
|
19
|
-
|
|
20
|
-
# Get the stable version of node
|
|
21
|
-
install:
|
|
22
|
-
- ps: Install-Product node $env:nodejs_version
|
|
23
|
-
- npm install
|
|
24
|
-
|
|
25
|
-
build: 'off'
|
|
26
|
-
|
|
27
|
-
test_script:
|
|
28
|
-
# Output useful info for debugging.
|
|
29
|
-
- node --version && npm --version
|
|
30
|
-
- ps: 'npm test # PowerShell' # Pass comment to PS for easier debugging
|
|
31
|
-
- cmd: npm test
|
|
32
|
-
|
|
33
|
-
matrix:
|
|
34
|
-
fast_finish: true
|
|
35
|
-
|
|
36
|
-
cache:
|
|
37
|
-
- C:\Users\appveyor\AppData\Roaming\npm\node_modules -> package.json # global npm modules
|
|
38
|
-
- C:\Users\appveyor\AppData\Roaming\npm-cache -> package.json # npm cache
|
|
39
|
-
- node_modules -> package.json # local npm modules
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var debug = require('debug')('mongodb-runner:bin:mongodb-runner-worker.js');
|
|
3
|
-
var args = require('minimist')(process.argv.slice(2), {});
|
|
4
|
-
var startWorker = require('../lib/worker');
|
|
5
|
-
|
|
6
|
-
debug('Starting...');
|
|
7
|
-
startWorker(args, function(err, opts) {
|
|
8
|
-
/* eslint no-console:0 */
|
|
9
|
-
if (err) {
|
|
10
|
-
console.error(
|
|
11
|
-
'mongodb-runner:bin:mongodb-runner-worker.js Unexpected error. Exiting.',
|
|
12
|
-
err
|
|
13
|
-
);
|
|
14
|
-
process.send({
|
|
15
|
-
event: 'error',
|
|
16
|
-
opts: opts
|
|
17
|
-
});
|
|
18
|
-
setTimeout(function() {
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}, 500);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
debug('MongoDB processes spawned successfully!');
|
|
25
|
-
|
|
26
|
-
debug(
|
|
27
|
-
'Remaining alive in the background to await control commands from parent process...'
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
function onServerStopped() {
|
|
31
|
-
debug('`%s` stopped', opts.name);
|
|
32
|
-
opts = null;
|
|
33
|
-
debug('goodbye');
|
|
34
|
-
|
|
35
|
-
process.exit(0);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* When this process receives a SIGTERM, this stops the server processes
|
|
40
|
-
* by calling `mongodb-tools`'s stop function.
|
|
41
|
-
*/
|
|
42
|
-
process.on('SIGTERM', function() {
|
|
43
|
-
debug('stopping `%s`...', opts.name);
|
|
44
|
-
opts.server.stop({ signal: 9 }, onServerStopped);
|
|
45
|
-
});
|
|
46
|
-
});
|
package/bin/mongodb-runner.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
var path = require('path');
|
|
4
|
-
var fs = require('fs');
|
|
5
|
-
/* eslint no-sync:0 no-console:0 */
|
|
6
|
-
|
|
7
|
-
var usage = fs.readFileSync(path.resolve(__dirname, '../usage.txt')).toString();
|
|
8
|
-
var args = require('minimist')(process.argv.slice(2), {
|
|
9
|
-
boolean: ['debug']
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
if (args.debug) {
|
|
13
|
-
process.env.DEBUG = 'mongodb-runner*';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
var pkg = require('../package.json');
|
|
17
|
-
var clui = require('clui');
|
|
18
|
-
var debug = require('debug')('mongodb-runner:bin:mongodb-runner.js');
|
|
19
|
-
|
|
20
|
-
args.action = args.action || args._[0] || 'start';
|
|
21
|
-
|
|
22
|
-
if (args.help || args.h) {
|
|
23
|
-
console.error(usage);
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
if (args.version) {
|
|
27
|
-
console.error(pkg.version);
|
|
28
|
-
process.exit(1);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
debug('Running action `%s`...', args.action);
|
|
32
|
-
|
|
33
|
-
if (!process.env.CI) {
|
|
34
|
-
if (args.action === 'start') {
|
|
35
|
-
new clui.Spinner(
|
|
36
|
-
'Starting a MongoDB deployment to test against...'
|
|
37
|
-
).start();
|
|
38
|
-
} else if (args.action === 'stop') {
|
|
39
|
-
new clui.Spinner(
|
|
40
|
-
'Stopping any local MongoDB deployments...'
|
|
41
|
-
).start();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
debug('Importing for run...', args);
|
|
46
|
-
var run = require('../');
|
|
47
|
-
|
|
48
|
-
run(args, function(err) {
|
|
49
|
-
if (err) {
|
|
50
|
-
console.error(err);
|
|
51
|
-
process.exit(1);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
debug('ran action `%s` successfully', args.action);
|
|
55
|
-
process.exit(0);
|
|
56
|
-
});
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./lib');
|