-
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: using Lerna multiple packages
See #159 (comment) BREAKING CHANGE: Remove `MomgoMemoryServer.getInstanceData()` method. Use `MomgoMemoryServer.ensureInstance()` instead.
- Loading branch information
Showing
69 changed files
with
132 additions
and
48 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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
{ | ||
"packages": [ | ||
"packages/*" | ||
], | ||
"version": "0.0.0" | ||
"lerna": "2.11.0", | ||
"version": "4.2.2", | ||
"command": { | ||
"publish": { | ||
"allowBranch": ["master", "lerna"], | ||
"conventionalCommits": true, | ||
"githubRelease": true | ||
} | ||
} | ||
} |
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,9 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017-present Pavel Chertorogov | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,53 @@ | ||
{ | ||
"name": "mongodb-memory-server-core", | ||
"version": "4.2.2", | ||
"description": "In-memory MongoDB Server. Designed with testing in mind, the server will allow you to connect your favourite ODM or client library to the MongoDB Server and run integration tests isolated from each other.", | ||
"main": "lib/index", | ||
"types": "lib/index.d.ts", | ||
"repository": "https://github.com/nodkz/mongodb-memory-server", | ||
"files": [ | ||
"lib", | ||
"scripts" | ||
], | ||
"keywords": [ | ||
"mongodb", | ||
"mongoose", | ||
"mock", | ||
"stub", | ||
"mockgoose", | ||
"mongodb-prebuilt", | ||
"mongomem" | ||
], | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/nodkz/mongodb-memory-server/issues" | ||
}, | ||
"homepage": "https://github.com/nodkz/mongodb-memory-server", | ||
"dependencies": { | ||
"debug": "^4.1.1", | ||
"decompress": "^4.2.0", | ||
"dedent": "^0.7.0", | ||
"find-cache-dir": "^2.0.0", | ||
"get-port": "^4.2.0", | ||
"getos": "^3.1.1", | ||
"https-proxy-agent": "^2.2.1", | ||
"lockfile": "^1.0.4", | ||
"md5-file": "^4.0.0", | ||
"mkdirp": "^0.5.1", | ||
"tmp": "^0.0.33", | ||
"uuid": "^3.2.1" | ||
}, | ||
"optionalDependencies": { | ||
"mongodb": ">=3.0.0" | ||
}, | ||
"scripts": { | ||
"build": "npm-run-all build:*", | ||
"build:ts": "rimraf ./lib && tsc -p ../../tsconfig.build.json", | ||
"disabled-build:flow": "find ./lib -name \"*.d.ts\" -exec bash -c './node_modules/.bin/flowgen --add-flow-header \"$1\" -o \"${1%.d.ts}\".js.flow' - '{}' \\;", | ||
"watch": "cross-env MONGOMS_DOWNLOAD_DIR=./tmp jest --watch", | ||
"coverage": "cross-env MONGOMS_DOWNLOAD_DIR=./tmp jest --coverage", | ||
"lint": "eslint 'src/**/*.{js,ts}'", | ||
"test": "npm run lint && npm run tscheck && npm run coverage", | ||
"tscheck": "tsc --noEmit" | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/mongodb-memory-server-core/scripts/mongo_killer.js
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,34 @@ | ||
/* | ||
Make sure every few seconds that `parent` and `child` are alive: | ||
- if `parent` is dead: | ||
- kill child | ||
- kill itself | ||
- if `child` is dead: | ||
- kill itself | ||
*/ | ||
|
||
const parentPid = parseInt(process.argv[2], 10); | ||
const childPid = parseInt(process.argv[3], 10); | ||
|
||
if (parentPid && childPid) { | ||
setInterval(() => { | ||
// if parent dead | ||
try { | ||
process.kill(parentPid, 0); | ||
} catch (e) { | ||
try { | ||
process.kill(childPid); | ||
} catch (ee) { | ||
// doesnt matter if it is dead | ||
} | ||
process.exit(); | ||
} | ||
|
||
// if child dead | ||
try { | ||
process.kill(childPid, 0); | ||
} catch (e) { | ||
process.exit(); | ||
} | ||
}, 2000); | ||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
import MongoBinary from './util/MongoBinary'; | ||
import MongoInstance from './util/MongoInstance'; | ||
import MongoMemoryServer from './MongoMemoryServer'; | ||
import MongoMemoryReplSet from './MongoMemoryReplSet'; | ||
|
||
export default MongoMemoryServer; | ||
export { MongoBinary, MongoInstance, MongoMemoryServer, MongoMemoryReplSet }; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,16 @@ | ||
{ | ||
"extends": "../../tsconfig", | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./lib", | ||
"noEmit": false, | ||
"target": "es5", | ||
"module": "commonjs", | ||
"sourceMap": true, | ||
"declaration": true, | ||
"declarationMap": true, | ||
"skipLibCheck": false | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["**/__tests__"] | ||
} |
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 |
---|---|---|
@@ -1,7 +1 @@ | ||
import MongoBinary from './util/MongoBinary'; | ||
import MongoInstance from './util/MongoInstance'; | ||
import MongoMemoryServer from './MongoMemoryServer'; | ||
import MongoMemoryReplSet from './MongoMemoryReplSet'; | ||
|
||
export default MongoMemoryServer; | ||
export { MongoBinary, MongoInstance, MongoMemoryServer, MongoMemoryReplSet }; | ||
export * from 'mongodb-memory-server-core'; |