Skip to content

Commit 2926711

Browse files
committed
Merge branch 'master' into beta
2 parents c809f1c + d194837 commit 2926711

Some content is hidden

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

45 files changed

+2004
-1454
lines changed

.github/CONTRIBUTING.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,16 @@ The `master` branch is the release branch.
8181

8282
It has the following protection rules:
8383

84-
* `linear-history`: Requires linear-history, meaning no merge-commits
85-
* `status-checks`: All required status checks must pass before being able to merge (Currently required: `tests (12.x)`)
84+
* `status-checks`: All required status checks must pass before being able to merge (Currently required: `tests (xx.x)`)
8685
* `branches-up-to-date`: The Branches must be up-to-date before being able to merge into `master`
8786

88-
### next branch
87+
### beta branch
8988

90-
The `next` branch is the development branch, to accumulate changes before releasing an version
89+
The `beta` branch is the development branch, to accumulate changes before releasing an version, unless it is one of the following:
90+
91+
* a hot-fix
92+
* a chore (like updating workflows, readme, misc config)
93+
* documentation changes
9194

9295
## Code Styles
9396

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Make sure you read [Mastering-Markdown](https://guides.github.com/features/maste
1414

1515
- NodeJS: 0.0.0
1616
- mongodb-memory-server-*: 0.0.0 <!--"latest" is not a version-->
17-
- mongodb(the binary version): 0.0.0
18-
- mongodb(the js package): 0.0.0
19-
- mongoose: 0.0.0 <!--remove this if not used-->
20-
- system: <!--either Windows, MacOS, Linux (with distro and distro version)-->
17+
- mongodb(the binary version): 0.0.0 <!--Let this stay at "0", when assuming default, also see https://nodkz.github.io/mongodb-memory-server/docs/guides/mongodb-server-versions#mongodb-memory-server-core-version-table -->
18+
- mongodb(the js package): 0.0.0 <!--Not required when having "mongoose" set-->
19+
- mongoose: 0.0.0 <!--Remove this if not used-->
20+
- system: <!--One of: Windows, MacOS, Linux (with distro and distro version)-->
2121

2222
package: mongo-memory-server <!--State the package you are using-->
2323
<!--

.github/ISSUE_TEMPLATE/docs.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Documentation
3+
about: Use this if the issue is about Documentation
4+
title: ''
5+
labels: docs
6+
assignees: ''
7+
---
8+
9+
<!--
10+
## What to include in your Issue
11+
12+
- Make sure you read [Mastering-Markdown](https://guides.github.com/features/mastering-markdown/)
13+
14+
- If it is about missing documentation, please add which feature (when possible add an code link)
15+
- If it is about somthing different, please provide all information that could be useful
16+
-->

.github/workflows/website.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v3
25-
- name: Use Node.js 14
25+
- name: Use Node.js 18
2626
uses: actions/setup-node@v3
2727
with:
28-
node-version: 14.x
28+
node-version: 18.x
2929
- name: Install & Build
3030
run: bash ./ghPagesPre.sh
3131
- name: Deploy to Github Pages
32-
uses: JamesIves/[email protected].3
32+
uses: JamesIves/[email protected].4
3333
with:
3434
token: ${{ secrets.GITHUB_TOKEN }}
3535
branch: gh-pages

CHANGELOG.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,118 @@
1+
## [8.7.2](https://github.com/nodkz/mongodb-memory-server/compare/v8.7.1...v8.7.2) (2022-06-29)
2+
3+
4+
### Style
5+
6+
* **MongoInstance::closeHandler:** add explanation in log what value is what ([69f7261](https://github.com/nodkz/mongodb-memory-server/commit/69f726163b92bc1ec2e0df436e37660bb409d41a))
7+
* **utils::killProcess:** remove duplicated function identifier from log ([6d49741](https://github.com/nodkz/mongodb-memory-server/commit/6d497416f7d4965467ba9df41b90f835d4a45be3))
8+
9+
10+
### Fixes
11+
12+
* **MongoMemoryReplSet::_initReplSet:** attempt to fix "server selection timed out" when using auth ([17522dc](https://github.com/nodkz/mongodb-memory-server/commit/17522dc069b5954473fb66221a0f6789482e8226))
13+
14+
## [8.7.1](https://github.com/nodkz/mongodb-memory-server/compare/v8.7.0...v8.7.1) (2022-06-22)
15+
16+
17+
### Fixes
18+
19+
* **utils::killProcess:** handle case where input could be undefined at runtime ([209520f](https://github.com/nodkz/mongodb-memory-server/commit/209520f124307ab6e8518d78e64a612d6393ac36)), closes [#666](https://github.com/nodkz/mongodb-memory-server/issues/666)
20+
21+
## [8.7.0](https://github.com/nodkz/mongodb-memory-server/compare/v8.6.1...v8.7.0) (2022-06-20)
22+
23+
24+
### Dependencies
25+
26+
* **@types/jest:** upgrade to version 28.1.2 ([fc76c9c](https://github.com/nodkz/mongodb-memory-server/commit/fc76c9cbae0bd158071f54c1caaf6c364111fb94))
27+
* **@types/semver:** upgrade to version 7.3.10 ([2a41ccf](https://github.com/nodkz/mongodb-memory-server/commit/2a41ccfcfc201bdd454c9f0739de47f93bf1d16d))
28+
* **@typescript-eslint/*:** upgrade to version 5.28.0 ([d4f7d45](https://github.com/nodkz/mongodb-memory-server/commit/d4f7d4552ee4ded43ec3237cd0227f3f103730dc))
29+
* **conventional-changelog-conventionalcommits:** upgrade to version 5.0.0 ([e4474f0](https://github.com/nodkz/mongodb-memory-server/commit/e4474f0bd89b5b2d85b76b39aaacc3ee3d0406c2))
30+
* **eslint:** upgrade to version 8.18.0 ([cde8a0d](https://github.com/nodkz/mongodb-memory-server/commit/cde8a0d059f5446695bcd187f1994a124f4b8e68))
31+
* **jest:** upgrade to version 28.1.1 ([d53fa0f](https://github.com/nodkz/mongodb-memory-server/commit/d53fa0fa30294e3f02090408f5670ec9f7933b0c))
32+
* **mongodb:** upgrade to version 4.7.0 ([8abb888](https://github.com/nodkz/mongodb-memory-server/commit/8abb8888d7315708a218bf9a1bec6735d83761ad))
33+
* **new-find-package-json:** upgrade to version 2.0.0 ([a22d7cb](https://github.com/nodkz/mongodb-memory-server/commit/a22d7cbc6ec0d1577bdcb18996c74553d1321c81))
34+
* **prettier:** upgrade to version 2.7.1 ([74196ad](https://github.com/nodkz/mongodb-memory-server/commit/74196ada571cd93843048844519768d2c46891a8))
35+
* **ts-jest:** upgrade to version 28.0.5 ([695d367](https://github.com/nodkz/mongodb-memory-server/commit/695d3671473b819d9b458b823ff4a9a078752117))
36+
37+
### [8.6.1](https://github.com/nodkz/mongodb-memory-server/compare/v8.6.0...v8.6.1) (2022-06-15)
38+
39+
40+
### Style
41+
42+
* **MongoBinary::MongoBinaryOpts:** remove double parameter definition ([880c445](https://github.com/nodkz/mongodb-memory-server/commit/880c445b062a68dcef88e4cf0587c9fdda917d43))
43+
* **MongoBinaryDownloadUrl:** deprecate "sunos" ([5ba9835](https://github.com/nodkz/mongodb-memory-server/commit/5ba9835f2b55141f5de426fe24e0459570c28ebd))
44+
* **MongoInstance::MongoMemoryInstanceOptsBase:** fix missing argument in tsdoc ([b937ce4](https://github.com/nodkz/mongodb-memory-server/commit/b937ce4e0966b52d1f5077ff41287a827548bb52))
45+
* **MongoInstance::ReplicaMemberConfig:** change "defaultValue" to "default" in tsdoc ([7b0c98e](https://github.com/nodkz/mongodb-memory-server/commit/7b0c98ed69f7ecb8575248464c85b564c74cb04e))
46+
47+
48+
### Fixes
49+
50+
* **MongoInstance::checkErrorInLine:** optimize "exception in initAndListen" regex ([473c278](https://github.com/nodkz/mongodb-memory-server/commit/473c278d9eb790c48e8fa32d9fe6b2c95173e6f9)), closes [#560](https://github.com/nodkz/mongodb-memory-server/issues/560)
51+
* **MongoInstance::checkErrorInLine:** optimize "libsomething: cannot open shared object" regex ([2b733b4](https://github.com/nodkz/mongodb-memory-server/commit/2b733b42dd50ad6cb060c7bf81a8bf8f30a06141)), closes [#560](https://github.com/nodkz/mongodb-memory-server/issues/560)
52+
* **MongoInstance::checkErrorInLine:** replace "replaceAll" with "replace" ([9546cf9](https://github.com/nodkz/mongodb-memory-server/commit/9546cf9db5ed4ad0c37f5979d832b242ad1d390e))
53+
54+
## [8.6.0](https://github.com/nodkz/mongodb-memory-server/compare/v8.5.2...v8.6.0) (2022-05-23)
55+
56+
57+
### Features
58+
59+
* **MongoBinaryDownloadUrl:** add archive generation for gentoo ([39b0a3d](https://github.com/nodkz/mongodb-memory-server/commit/39b0a3da5253180e5a87dec61cfd33258bd6d68d))
60+
* **MongoMemoryReplSet:** change generic "instanceinfo missing" errors to "InstanceInfoError" ([27934a4](https://github.com/nodkz/mongodb-memory-server/commit/27934a4420ac7347248039e7f23886de3b3f419a))
61+
* add environment variable to use archive name for binary name ([2fc0e1a](https://github.com/nodkz/mongodb-memory-server/commit/2fc0e1a52295e88dd78505fff03613a6a0741c07)), closes [#609](https://github.com/nodkz/mongodb-memory-server/issues/609)
62+
* update binary 4.0 to 4.0.28 ([f26f739](https://github.com/nodkz/mongodb-memory-server/commit/f26f73920edfbf55c09e8b0e1df633fa89a6b251))
63+
* update binary 4.2 to 4.2.18 ([3a47739](https://github.com/nodkz/mongodb-memory-server/commit/3a477395f4730b2455ac4260f713d252d5033c9c))
64+
* update binary 4.4 to 4.4.12 ([cde2a4a](https://github.com/nodkz/mongodb-memory-server/commit/cde2a4a3fdc7631045cdbf8251611f87dbf26bad))
65+
* update binary 4.4 to 4.4.13 ([ddaf3f9](https://github.com/nodkz/mongodb-memory-server/commit/ddaf3f988efd85fa71f72dcc94aa3950dfda6f0a))
66+
* **MongoBinaryDownloadUrl::getDebianVersionString:** use debian11 when possible ([8100b2f](https://github.com/nodkz/mongodb-memory-server/commit/8100b2ff42b404831d8f87f7f2040df528f33a09))
67+
* update binary 5.0 to 5.0.8 ([a56e02b](https://github.com/nodkz/mongodb-memory-server/commit/a56e02b7a1dfa889a57dbed3bd6bcf0d6fece9d1))
68+
69+
70+
### Reverts
71+
72+
* Revert "test(MongoMemoryReplSet): enable debug for often open-handle test" ([29e11e1](https://github.com/nodkz/mongodb-memory-server/commit/29e11e1a94ece0f4dcf5d61b629844d9f0ef6278))
73+
74+
75+
### Style
76+
77+
* **DryMongoBinary:** add tsdoc to interfaces ([ba0349c](https://github.com/nodkz/mongodb-memory-server/commit/ba0349ca7373e4974e449a1da270ec1f72edb490))
78+
* **MongoBinaryDownload::makeMD5Check:** change variable names to better represent what they do ([f8c2f05](https://github.com/nodkz/mongodb-memory-server/commit/f8c2f05c7b307a597076fbfef09d0bc9d4e45872))
79+
* **MongoBinaryDownloadUrl:** add more todo notes ([1a1bfa7](https://github.com/nodkz/mongodb-memory-server/commit/1a1bfa7521a01133c774a47811a90edb8a970947))
80+
* **MongoBinaryDownloadUrl:** add todo for ubuntu "14" default ([75d8d24](https://github.com/nodkz/mongodb-memory-server/commit/75d8d244133f0c2c4e7da67886294d44f4005a11))
81+
* **MongoBinaryDownloadUrl:** change comment to be more helpful ([2f70f53](https://github.com/nodkz/mongodb-memory-server/commit/2f70f5378bd26490df8c664c56058b630e06296d))
82+
* **MongoMemoryReplSet::_initReplSet:** add todo ([884bda5](https://github.com/nodkz/mongodb-memory-server/commit/884bda5d49adc8eb0f2c48b0e09d2a05c643cfbb))
83+
* **MongoMemoryReplSet::stop:** rename internal variable to make more sense ([a86c321](https://github.com/nodkz/mongodb-memory-server/commit/a86c321a9340ffc0de5eff0a709bcfc2cf21c870))
84+
* **MongoMemoryServer::createAuth:** change comment to make more sense ([4df5b41](https://github.com/nodkz/mongodb-memory-server/commit/4df5b4182d1a09fed673dcab8ecd30421e2b4797))
85+
* **resolveConfig:** add tsdoc to some values and interfaces ([9b9f327](https://github.com/nodkz/mongodb-memory-server/commit/9b9f327a3a952ce155129e3d08ec54ba5406802c))
86+
* **resolveConfig:** remove commented out variable ([ac854c9](https://github.com/nodkz/mongodb-memory-server/commit/ac854c920ca53c55f8cb249533de7bffe4735ad9))
87+
88+
89+
### Refactor
90+
91+
* change uses of deprecated ".stop(false)" to explicit object ([dbcd00a](https://github.com/nodkz/mongodb-memory-server/commit/dbcd00a8342f2293c26d103523c7f0828492c974))
92+
93+
94+
### Fixes
95+
96+
* **MongoBinaryDownloadUrl::translateArch:** add deprecation notice for "ia32" ([2614d18](https://github.com/nodkz/mongodb-memory-server/commit/2614d181c4cecf96540ca8c52d44b8be7fe4cf12)), closes [#638](https://github.com/nodkz/mongodb-memory-server/issues/638)
97+
* **MongoBinaryDownloadUrl.ts:** Add current openSUSE Leap relase version ([2904d7e](https://github.com/nodkz/mongodb-memory-server/commit/2904d7e88e9c4db1a68a071d5994b4c4b30070e2))
98+
* **MongoMemoryServer::createAuth:** handle connection erroring and maybe not closing ([9bad913](https://github.com/nodkz/mongodb-memory-server/commit/9bad91302b503c7627829ae2359fb8832909b7ac))
99+
100+
101+
### Dependencies
102+
103+
* **@types/jest:** upgrade to version 27.5.0 ([7749b59](https://github.com/nodkz/mongodb-memory-server/commit/7749b595709055dc56e62cb769a36178da57e1f7))
104+
* **@types/jest:** upgrade to version 27.5.1 ([7d678c7](https://github.com/nodkz/mongodb-memory-server/commit/7d678c7231cf5677e4e572c64ac596f83377127d))
105+
* **@typescript-eslint/*:** upgrade to version 5.22.0 ([e495884](https://github.com/nodkz/mongodb-memory-server/commit/e495884991e94c03fc8a1f082fe83db1aa183881))
106+
* **@typescript-eslint/*:** upgrade to version 5.26.0 ([b7f53af](https://github.com/nodkz/mongodb-memory-server/commit/b7f53af7ce32c201c35757bbe600ff6ce7c7753c))
107+
* **commitlint:** upgrade to version 16.2.4 ([ad3b242](https://github.com/nodkz/mongodb-memory-server/commit/ad3b242de7df80e74aeb17efe053f3b415ee14c7))
108+
* **doctoc:** upgrade to version 2.2.0 ([7591372](https://github.com/nodkz/mongodb-memory-server/commit/7591372c8679f40a32ee451d14e340dbf2685f10))
109+
* **eslint:** upgrade to version 8.14.0 ([08fb188](https://github.com/nodkz/mongodb-memory-server/commit/08fb188a6cb90a8ad5e3fdc16792b02f4dabb6e2))
110+
* **eslint:** upgrade to version 8.16.0 ([1b19581](https://github.com/nodkz/mongodb-memory-server/commit/1b1958188325a64c828ca5528ac0706f50ed42da))
111+
* **jest:** upgrade to version 28.0.3 ([1521838](https://github.com/nodkz/mongodb-memory-server/commit/15218382d94bdd4402507b11ae88ea99f9a45970))
112+
* **jest:** upgrade to version 28.1.0 ([1ef0f1f](https://github.com/nodkz/mongodb-memory-server/commit/1ef0f1f8358b98701459521a4a837ee710a592db))
113+
* **ts-jest:** upgrade to version 28.0.2 ([8b8a40d](https://github.com/nodkz/mongodb-memory-server/commit/8b8a40dd9102059efc9b858566c24d9746951ca3))
114+
* **tslib:** upgrade to version 2.4.0 ([0f4713d](https://github.com/nodkz/mongodb-memory-server/commit/0f4713db2ec091d2fca7a3627f9dab0159c5e93d))
115+
1116
## [8.6.0-beta.8](https://github.com/nodkz/mongodb-memory-server/compare/v8.6.0-beta.7...v8.6.0-beta.8) (2022-05-23)
2117

3118

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
id: dry-mongo-binary
3+
title: 'DryMongoBinary'
4+
---
5+
6+
API Documentation of `DryMongoBinary`-Class
7+
8+
## Functions
9+
10+
:::note
11+
This class is not actually meant to be constructed, it only consists of static functions & values
12+
:::
13+
14+
### locateBinary
15+
16+
Typings: `static async locateBinary(opts: DryMongoBinaryOptions): Promise<string | undefined>`
17+
18+
Try to locate a existing binary without downloading or touching the filesystem much.
19+
20+
### generateOptions
21+
22+
Typings: `static async generateOptions(opts?: DryMongoBinaryOptions): Promise<Required<DryMongoBinaryOptions>>`
23+
24+
Generate a full `DryMongoBinaryOptions` from partial input.
25+
26+
### parseArchiveNameRegex
27+
28+
Typings: `static parseArchiveNameRegex(input: string, opts: Required<DryMongoBinaryOptions>): Required<DryMongoBinaryOptions>`
29+
30+
Parse a archive name into useable options.
31+
32+
### getBinaryName
33+
34+
Typings: `static async getBinaryName(opts: DryMongoBinaryNameOptions): Promise<string>`
35+
36+
Get what the binary name should be formatted like.
37+
If [`USE_ARCHIVE_NAME_FOR_BINARY_NAME`](../config-options.md#use_archive_name_for_binary_name) is `true`, then the archive name will be used instead of what MMS uses by default.
38+
39+
### combineBinaryName
40+
41+
Typings: `static combineBinaryName(basePath: string, binaryName: string): string`
42+
43+
Helper function to consistently combine a `basePath` with the `binaryName` (eg. `/path/to/binary`)
44+
45+
### getSytemPath
46+
47+
Typings: `static async getSystemPath(systemBinary: string): Promise<string | undefined>`
48+
49+
Check if the given path has all the permissions required to be executed.
50+
51+
### generatePaths
52+
53+
Typings: `static async generatePaths(opts: DryMongoBinaryOptions & DryMongoBinaryNameOptions): Promise<DryMongoBinaryPaths>`
54+
55+
Get the Paths where binaries may be located in.
56+
57+
### generateDownloadPath
58+
59+
Typings: `static async generateDownloadPath(opts: DryMongoBinaryOptions & DryMongoBinaryNameOptions): Promise<[boolean, string]>`
60+
61+
Get the path where the binary will be downloaded to.
62+
63+
### homedir
64+
65+
<span class="badge badge--warning">Internal</span>
66+
67+
Typings: `private static homedir(): string`
68+
69+
Used to get the Home-Dir of the current user, it is a function on the class for easy-mocking, because `os.homedir` cannot be easily be mocked in jest.
70+
71+
## Values
72+
73+
### binaryCache
74+
75+
Typings: `static binaryCache: Map<string, string> = new Map()`
76+
77+
Cache for already found binaries to not hit the filesystem too much.

docs/api/classes/mongo-binary.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,15 @@ API Documentation of `MongoBinary`-Class
1111
This class is not actually meant to be constructed, it only consists of static functions & values
1212
:::
1313

14-
### getSystemPath
14+
### download
1515

16-
Typings: `static async getSystemPath(systemBinary: string): Promise<string | undefined>`
16+
Typings: `static async download(options: Required<MongoBinaryOpts>): Promise<string>`
1717

18-
Try to stat the given `systemBinary` path, and return it if successfull, otherwise `undefined`
19-
20-
### getDownloadPath
21-
22-
Typings: `static async getDownloadPath(options: Required<MongoBinaryOpts>): Promise<string>`
23-
24-
Get an binary from cache or download it
18+
Try to find the binary and if not found download the binary.
2519

2620
### getPath
2721

2822
Typings: `static async getPath(opts: MongoBinaryOpts = {}): Promise<string>`
2923

30-
Get an working binary and returns the path to it<br/>
31-
(Calls [`getDownloadPath`](#getdownloadpath))
32-
33-
## Values
34-
35-
### cache
36-
37-
Typings: `static cache: Map<string, string>`
38-
39-
Global Cache for binaries
24+
Get a working binary and returns the path to it.
25+
(Calls [`download`](#download) if [`RUNTIME_DOWNLOAD`](../config-options.md#runtime_download) is `true`)

docs/api/classes/mongo-instance.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ Typings: `async start(): Promise<void>`
4141

4242
Start the `mongod` and the watcher processes
4343

44+
:::caution
45+
Currently does not check if the instance is in a correct state and just resets all values, see [#662](https://github.com/nodkz/mongodb-memory-server/issues/662).
46+
:::
47+
4448
### stop
4549

4650
Typings: `async stop(): Promise<boolean>`

docs/api/classes/mongo-memory-replset.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Create an new ReplSet and start it (while being an Promise)
2929

3030
Typings: `protected stateChange(newState: MongoMemoryReplSetStates, ...args: any[]): void`
3131

32-
Used to change the state of the class, it is `protected` to not accidentally use it
32+
Used to change the state of the class, uses [`MongoMemoryReplSetStates` enum](../enums/mongo-memory-replset-states.md), it is `protected` to not accidentally use it
3333

3434
### getInstanceOpts
3535

@@ -99,7 +99,18 @@ With `options` can be set how to run a cleanup.
9999

100100
Typings: `async waitUntilRunning(): Promise<void>`
101101

102-
Wait until all instances are running
102+
Wait until all instances are running.
103+
104+
It is recommended to `await` the promise returned from `start` when available.
105+
106+
Does not start the replset instance if not already starting (unlike [`ensureInstance`](./mongo-memory-server.md#ensureinstance)).
107+
108+
:::caution
109+
Will Error if state is not `running` or `init`.
110+
:::
111+
:::caution
112+
Will **not** Error if a error is encountered while waiting.
113+
:::
103114

104115
### _initReplSet
105116

@@ -221,7 +232,7 @@ Will Throw an Error if `state` is not `stopped`
221232

222233
Typings: `protected _state: MongoMemoryReplSetStates`
223234

224-
Stores the current State
235+
Stores the current State, uses [`MongoMemoryReplSetStates` enum](../enums/mongo-memory-replset-states.md).
225236

226237
### _ranCreateAuth
227238

0 commit comments

Comments
 (0)