Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Jul 13, 2024
2 parents 2ffc024 + 1cf50d4 commit c92afdf
Show file tree
Hide file tree
Showing 35 changed files with 124 additions and 103 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Make sure you read [Mastering-Markdown](https://guides.github.com/features/maste

- NodeJS: 0.0.0
- mongodb-memory-server-*: 0.0.0 <!--"latest" is not a version-->
- 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 -->
- mongodb(the binary version): 0.0.0 <!--Let this stay at "0", when assuming default, also see https://typegoose.github.io/mongodb-memory-server/docs/guides/mongodb-server-versions#mongodb-memory-server-core-version-table -->
- mongodb(the js package): 0.0.0 <!--Not required when having "mongoose" set-->
- mongoose: 0.0.0 <!--Remove this if not used-->
- system: <!--One of: Windows, MacOS, Linux (with distro and distro version)-->
Expand All @@ -40,7 +40,7 @@ code here
## Debug Output

<!--
In most cases the [Debug Output](https://github.com/nodkz/mongodb-memory-server#enable-debug-mode) would be helpful
In most cases the [Debug Output](https://github.com/typegoose/mongodb-memory-server#enable-debug-mode) would be helpful
Please provide the debug output in one of the following ways (the higher the more its preferred):
(replace the `<details>` section with the url, if a URL is needed)
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/distribution-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: 'hasezoey'
<!--
Make sure you read [Mastering-Markdown](https://guides.github.com/features/mastering-markdown/)
List of currently [Supported Systems](https://nodkz.github.io/mongodb-memory-server/docs/guides/supported-systems)
List of currently [Supported Systems](https://typegoose.github.io/mongodb-memory-server/docs/guides/supported-systems)
-->

## Versions
Expand Down Expand Up @@ -72,7 +72,7 @@ console.log("Arch", os.arch());
## Current Error

<!--Please include the current error you are having, if any-->
<!--Also if you see any "Falling back to legacy MongoDB build!" please include Debug Output, see https://nodkz.github.io/mongodb-memory-server/docs/guides/enable-debug-mode -->
<!--Also if you see any "Falling back to legacy MongoDB build!" please include Debug Output, see https://typegoose.github.io/mongodb-memory-server/docs/guides/enable-debug-mode -->

```txt
Paste Error in Here
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ jobs:
CI: true
- name: Send codecov.io stats
if: matrix.node-version == '16.x'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

publish:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || startsWith(github.ref, 'refs/heads/old')
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
* **prettier:** upgrade to version 3.3.0 ([fe1d62d](https://github.com/nodkz/mongodb-memory-server/commit/fe1d62d4fff1849e3fd76d0db745337e6fb693d7))
* **typedoc:** upgrade to version 0.25.13 ([0775c60](https://github.com/nodkz/mongodb-memory-server/commit/0775c60f14ec3026849ed70d24535c013b1d3aa7))

## [9.4.1](https://github.com/typegoose/mongodb-memory-server/compare/v9.4.0...v9.4.1) (2024-07-13)


### Fixes

* trigger release ([8c48020](https://github.com/typegoose/mongodb-memory-server/commit/8c48020816fe19fbcc4f886fcfb96302eaff8714))

## [9.4.0](https://github.com/nodkz/mongodb-memory-server/compare/v9.3.0...v9.4.0) (2024-06-24)


Expand Down Expand Up @@ -787,6 +794,18 @@ also "disable" has been removed
* **typescript:** upgrade to version 5.0.4 ([d531dde](https://github.com/nodkz/mongodb-memory-server/commit/d531ddea767cef2c038e228597812507e0590c2a))
* **uuid:** remove package ([41b2551](https://github.com/nodkz/mongodb-memory-server/commit/41b2551a89df0eb806511efb85d5bd5f6419664c))

## [8.16.1](https://github.com/typegoose/mongodb-memory-server/compare/v8.16.0...v8.16.1) (2024-07-13)


### Fixes

* trigger release ([62f43e7](https://github.com/typegoose/mongodb-memory-server/commit/62f43e7c9801ab3541157093b73de158bae48558))


### Style

* **errors:** fix lint ([4137d32](https://github.com/typegoose/mongodb-memory-server/commit/4137d32f1c30ec65bec03191d1ab39679719533d))

## [8.16.0](https://github.com/nodkz/mongodb-memory-server/compare/v8.15.1...v8.16.0) (2023-10-05)


Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# MongoDB In-Memory Server

[![Node.js CI](https://github.com/nodkz/mongodb-memory-server/workflows/Node.js%20CI/badge.svg)](https://github.com/nodkz/mongodb-memory-server/actions/workflows/tests.yml?query=workflow%3A%22Node.js+CI%22)
[![Node.js CI](https://github.com/typegoose/mongodb-memory-server/workflows/Node.js%20CI/badge.svg)](https://github.com/typegoose/mongodb-memory-server/actions/workflows/tests.yml?query=workflow%3A%22Node.js+CI%22)
[![NPM version](https://img.shields.io/npm/v/mongodb-memory-server.svg)](https://www.npmjs.com/package/mongodb-memory-server)
[![Downloads stat](https://img.shields.io/npm/dt/mongodb-memory-server.svg)](http://www.npmtrends.com/mongodb-memory-server)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![TypeScript compatible](https://img.shields.io/badge/typescript-compatible-brightgreen.svg)](https://www.typescriptlang.org)
[![codecov.io](https://codecov.io/github/nodkz/mongodb-memory-server/coverage.svg?branch=master)](https://codecov.io/github/nodkz/mongodb-memory-server?branch=master)
[![codecov.io](https://codecov.io/github/typegoose/mongodb-memory-server/coverage.svg?branch=master)](https://codecov.io/github/typegoose/mongodb-memory-server?branch=master)
[![Backers on Open Collective](https://opencollective.com/mongodb-memory-server/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/mongodb-memory-server/sponsors/badge.svg)](#sponsors)
[![mongodb-memory-server-core](https://snyk.io/advisor/npm-package/mongodb-memory-server-core/badge.svg)](https://snyk.io/advisor/npm-package/mongodb-memory-server-core)
Expand All @@ -14,7 +14,7 @@ This package spins up an actual/real MongoDB server programmatically from within

On install, this [package downloads](#configuring-which-mongod-binary-to-use) the latest MongoDB binaries and saves them to a cache folder. (only `mongodb-memory-server-core` does not download on `postinstall`)

On starting a new instance of the memory server, if the binary cannot be found, it will be auto-downloaded (if [`RUNTIME_DOWNLOAD`](https://nodkz.github.io/mongodb-memory-server/docs/api/config-options#runtime_download) option is truthy), thus the first run may take some time. All further runs will be fast, because they will use the downloaded binaries.
On starting a new instance of the memory server, if the binary cannot be found, it will be auto-downloaded (if [`RUNTIME_DOWNLOAD`](https://typegoose.github.io/mongodb-memory-server/docs/api/config-options#runtime_download) option is truthy), thus the first run may take some time. All further runs will be fast, because they will use the downloaded binaries.

This package automatically downloads binaries from [https://fastdl.mongodb.org/](https://fastdl.mongodb.org/) according to your operating system. You can see all available versions for [Linux](https://www.mongodb.org/dl/linux) (Ubuntu, RHEL, Debian, SUSE, Amazon), [OSX](https://www.mongodb.org/dl/osx), and [Windows](https://www.mongodb.org/dl/win32).

Expand Down Expand Up @@ -82,11 +82,11 @@ On Linux, you will also need `libcurl4` (or `libcurl3` on some older distro vers

### Choose the Correct Package

[Choose the right package for the task](https://nodkz.github.io/mongodb-memory-server/docs/guides/quick-start-guide#choose-the-right-package)
[Choose the right package for the task](https://typegoose.github.io/mongodb-memory-server/docs/guides/quick-start-guide#choose-the-right-package)

### Configuring which mongod binary to use

The default behavior is that version `7.0.9` for your OS will be downloaded. By setting [Environment variables](https://nodkz.github.io/mongodb-memory-server/docs/api/config-options) you are able to specify which version and binary will be downloaded:
The default behavior is that version `7.0.9` for your OS will be downloaded. By setting [Environment variables](https://typegoose.github.io/mongodb-memory-server/docs/api/config-options) you are able to specify which version and binary will be downloaded:

```sh
export MONGOMS_DOWNLOAD_URL=https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz
Expand Down Expand Up @@ -129,7 +129,7 @@ const mongod = new MongoMemoryServer({
},
binary?: {
version?: string, // by default '7.0.9'
downloadDir?: string, // see the documentation on what is chosen by default https://nodkz.github.io/mongodb-memory-server/docs/api/config-options#download_dir
downloadDir?: string, // see the documentation on what is chosen by default https://typegoose.github.io/mongodb-memory-server/docs/api/config-options#download_dir
platform?: string, // by default os.platform()
arch?: string, // by default os.arch()
checkMD5?: boolean, // by default false OR process.env.MONGOMS_MD5_CHECK
Expand Down Expand Up @@ -217,15 +217,15 @@ const replSet = new MongoMemoryReplSet({

### Config Options

[Documentation of Config Options](https://nodkz.github.io/mongodb-memory-server/docs/api/config-options)
[Documentation of Config Options](https://typegoose.github.io/mongodb-memory-server/docs/api/config-options)

### Simple test with MongoClient in Jest

A example test file for a *single* [MongoMemoryServer](https://github.com/nodkz/mongodb-memory-server/blob/master/packages/mongodb-memory-server-core/src/__tests__/singleDB.test.ts) within jest.
A example test file for a *single* [MongoMemoryServer](https://github.com/typegoose/mongodb-memory-server/blob/master/packages/mongodb-memory-server-core/src/__tests__/singleDB.test.ts) within jest.

A example test file for *multiple* [MongoMemoryServer](https://github.com/nodkz/mongodb-memory-server/blob/master/packages/mongodb-memory-server-core/src/__tests__/multipleDB.test.ts) within jest.
A example test file for *multiple* [MongoMemoryServer](https://github.com/typegoose/mongodb-memory-server/blob/master/packages/mongodb-memory-server-core/src/__tests__/multipleDB.test.ts) within jest.

A example test file for a *single* [MongoMemoryReplSet](https://github.com/nodkz/mongodb-memory-server/blob/master/packages/mongodb-memory-server-core/src/__tests__/replset-multi.test.ts) within jest.
A example test file for a *single* [MongoMemoryReplSet](https://github.com/typegoose/mongodb-memory-server/blob/master/packages/mongodb-memory-server-core/src/__tests__/replset-multi.test.ts) within jest.

### Provide connection string to mongoose

Expand All @@ -247,13 +247,13 @@ const mongoServer = await MongoMemoryServer.create();

### Test Runner Examples

[Documentation for Test Runner Integration Examples](https://nodkz.github.io/mongodb-memory-server/docs/guides/integration-examples/test-runners)
[Documentation for Test Runner Integration Examples](https://typegoose.github.io/mongodb-memory-server/docs/guides/integration-examples/test-runners)

### Docker Alpine

There isn't currently an official MongoDB release for alpine linux. This means that we can't pull binaries for Alpine
(or any other platform that isn't officially supported by MongoDB), but you can use a Docker image that already has mongod
built in and then set the [`MONGOMS_SYSTEM_BINARY`](https://nodkz.github.io/mongodb-memory-server/docs/api/config-options#system_binary) variable to point at that binary. This should allow you to use `mongodb-memory-server` on any system on which you can install mongod manually.
built in and then set the [`MONGOMS_SYSTEM_BINARY`](https://typegoose.github.io/mongodb-memory-server/docs/api/config-options#system_binary) variable to point at that binary. This should allow you to use `mongodb-memory-server` on any system on which you can install mongod manually.

### Enable Debug Mode

Expand All @@ -275,7 +275,7 @@ or
}
```

Also see the [Enable Debug Mode](https://nodkz.github.io/mongodb-memory-server/docs/guides/enable-debug-mode) Guide.
Also see the [Enable Debug Mode](https://typegoose.github.io/mongodb-memory-server/docs/guides/enable-debug-mode) Guide.

## Contributing

Expand All @@ -287,9 +287,9 @@ To ask questions or just talk with us, [join our Discord Server](https://discord

## Documentation

- [Documentation](https://nodkz.github.io/mongodb-memory-server/docs/api/index-api)
- [Quick start guide](https://nodkz.github.io/mongodb-memory-server/docs/guides/quick-start-guide/)
- [Known Issues](https://nodkz.github.io/mongodb-memory-server/docs/guides/known-issues)
- [Documentation](https://typegoose.github.io/mongodb-memory-server/docs/api/index-api)
- [Quick start guide](https://typegoose.github.io/mongodb-memory-server/docs/guides/quick-start-guide/)
- [Known Issues](https://typegoose.github.io/mongodb-memory-server/docs/guides/known-issues)

## Credits

Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/mongo-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Typings: `async start(): Promise<void>`
Start the `mongod` and the watcher processes

:::caution
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).
Currently does not check if the instance is in a correct state and just resets all values, see [#662](https://github.com/typegoose/mongodb-memory-server/issues/662).
:::

### stop
Expand Down
2 changes: 1 addition & 1 deletion docs/api/interfaces/mongo-memory-server-createuser.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ API Documentation of `CreateUser`-Interface

## Values

This Interface inherits most values from the `CreateUserMongoDB` interface, which is a interface for the `createUser` command manually types, see [#663](https://github.com/nodkz/mongodb-memory-server/issues/663) for tracking on switching to native interface.
This Interface inherits most values from the `CreateUserMongoDB` interface, which is a interface for the `createUser` command manually types, see [#663](https://github.com/typegoose/mongodb-memory-server/issues/663) for tracking on switching to native interface.

Because most values are inherited, only the new ones and important ones are described here.

Expand Down
6 changes: 3 additions & 3 deletions docs/guides/error-warning-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Example:
```txt
Incorrect State for operation: "${gotState}", allowed States: "[${wantedStates.join(',')}]"
This may be because of using a v6.x way of calling functions, look at the following guide if anything applies:
https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything
https://typegoose.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything
```

Details:
Expand Down Expand Up @@ -186,11 +186,11 @@ The Linux distro in use does not have a mapping for a mongodb version, please re
Code: `MMS001`
Message: `mongodb-memory-server will fully drop support for ia32 in 9.0`

In the major version `9.0` MMS will fully drop support for the architecture `ia32` (`i386` / `i686`), because MongoDB stopped supporting the architecture past 3.x, and MMS never full supported 3.6 or lower anyway, see [#638 for tracking](https://github.com/nodkz/mongodb-memory-server/issues/638).
In the major version `9.0` MMS will fully drop support for the architecture `ia32` (`i386` / `i686`), because MongoDB stopped supporting the architecture past 3.x, and MMS never full supported 3.6 or lower anyway, see [#638 for tracking](https://github.com/typegoose/mongodb-memory-server/issues/638).

### MMS002

Code: `MMS002`
Message: `mongodb-memory-server will fully drop support for sunos in 9.0`

In the major version `9.0` MMS will fully drop support for the platfrom `sunos`, because MMS never actually supported `sunos` in the first place and Mongodb has stopped providing builds after ~3.4, see [#661 for tracking](https://github.com/nodkz/mongodb-memory-server/issues/661).
In the major version `9.0` MMS will fully drop support for the platfrom `sunos`, because MMS never actually supported `sunos` in the first place and Mongodb has stopped providing builds after ~3.4, see [#661 for tracking](https://github.com/typegoose/mongodb-memory-server/issues/661).
4 changes: 2 additions & 2 deletions docs/guides/migration/migrate7.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: 'Migrate to version 7.0.0'
Here are the Important changes made for 7.0.0

:::caution Important, Read this first
This Guide is written for migration from version `6.9.6` to `7.0.0`, for versions `>7.0.0 <8.0.0`, please consult the [CHANGELOG](https://github.com/nodkz/mongodb-memory-server/blob/master/CHANGELOG.md)
This Guide is written for migration from version `6.9.6` to `7.0.0`, for versions `>7.0.0 <8.0.0`, please consult the [CHANGELOG](https://github.com/typegoose/mongodb-memory-server/blob/master/CHANGELOG.md)
:::

## Requirement Changes
Expand Down Expand Up @@ -84,7 +84,7 @@ This also includes function renames:

This was changed to allow mongodb and mongoose URI's to work at the same time (they slightly differ).

[See the code comment for more information](https://github.com/nodkz/mongodb-memory-server/blob/3624253f509a54cff04997943894b9eb7e7e64fe/packages/mongodb-memory-server-core/src/util/utils.ts#L13-L17)
[See the code comment for more information](https://github.com/typegoose/mongodb-memory-server/blob/3624253f509a54cff04997943894b9eb7e7e64fe/packages/mongodb-memory-server-core/src/util/utils.ts#L13-L17)

## Non-Breaking changes / Additions

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/migration/migrate8.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: 'Migrate to version 8.0.0'
Here are the Important changes made for 8.0.0

:::caution Important, Read this first
This Guide is written for migration from version `7.6.0` to `8.0.0`, for versions `>8.0.0 <9.0.0`, please consult the [CHANGELOG](https://github.com/nodkz/mongodb-memory-server/blob/master/CHANGELOG.md)
This Guide is written for migration from version `7.6.0` to `8.0.0`, for versions `>8.0.0 <9.0.0`, please consult the [CHANGELOG](https://github.com/typegoose/mongodb-memory-server/blob/master/CHANGELOG.md)
:::

## Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/migration/migrate9.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: 'Migrate to version 9.0.0'
Here are the Important changes made for 9.0.0

:::caution Important, Read this first
This Guide is written for migration from version `8.16.0` to `9.0.0`, for versions `>9.0.0 <10.0.0`, please consult the [CHANGELOG](https://github.com/nodkz/mongodb-memory-server/blob/master/CHANGELOG.md)
This Guide is written for migration from version `8.16.0` to `9.0.0`, for versions `>9.0.0 <10.0.0`, please consult the [CHANGELOG](https://github.com/typegoose/mongodb-memory-server/blob/master/CHANGELOG.md)
:::

## Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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.",
"repository": {
"type": "git",
"url": "git+https://github.com/nodkz/mongodb-memory-server.git"
"url": "git+https://github.com/typegoose/mongodb-memory-server.git"
},
"devDependencies": {
"@commitlint/cli": "17.8.1",
Expand Down
Loading

0 comments on commit c92afdf

Please sign in to comment.