Skip to content

Commit f199b2b

Browse files
committed
Merge branch 'master' into beta
2 parents 071940e + 2a02436 commit f199b2b

File tree

6 files changed

+44
-7
lines changed

6 files changed

+44
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@
8383
* **tslib:** upgrade to version 2.3.1 ([1a36352](https://github.com/nodkz/mongodb-memory-server/commit/1a36352fcaaa6c45796cb1d1c2a0e4b509acbfdd))
8484
* **typescript:** upgrade to version 4.4.3 ([84e407b](https://github.com/nodkz/mongodb-memory-server/commit/84e407b6b14ae986ab9d4ac6a1d5caa3f694861b))
8585

86+
### [7.4.6](https://github.com/nodkz/mongodb-memory-server/compare/v7.4.5...v7.4.6) (2021-10-19)
87+
88+
89+
### Fixes
90+
91+
* **resolveConfig:** change default version to be a constant (non-changeable) ([11c9547](https://github.com/nodkz/mongodb-memory-server/commit/11c95471ef7a400374491fe8055708a133f4ae6d))
92+
8693
### [7.4.5](https://github.com/nodkz/mongodb-memory-server/compare/v7.4.4...v7.4.5) (2021-10-19)
8794

8895

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
id: mongodb-server-versions
3+
title: 'Mongodb Server Versions'
4+
---
5+
6+
7+
This Guide will show what MongoDB Server versions were the default for versions of `mongodb-memory-server-core` and the guidelines of when the version gets changed
8+
9+
*<sub>Some expressions will use [npm's semver convention](https://www.npmjs.com/package/semver).</sub>*
10+
11+
## When a Version gets upgraded
12+
13+
In a new major version of `mongodb-memory-server-core` (`X.0.0`), the default mongodb binary version may be upgraded, either the major or a minor version `X.X.0`.
14+
In a minor version of `mongodb-memory-server-core` (`0.X.0`), the default mongodb binary version may be upgraded to the latest patch version `0.0.X`.
15+
In a patch version of `mongodb-memory-server-core` (`0.0.X`), the default mongodb binary version will not be changed.
16+
17+
There are some exceptions:
18+
19+
- A mongodb binary may go offline (not being able to download it anymore), then the default version will be changed and a *minor* (`0.X.0`) release will happen.
20+
- A mongodb binary may be brocken, then the default version will be changed and a *minor* (`0.X.0`) release will happen.
21+
22+
The versions with a brocken default binary may get deprecated (when possible).
23+
24+
## Version Table
25+
26+
| `mongodb-memory-server-core` Version | Default MongoDB Version |
27+
| :----------------------------------: | :---------------------: |
28+
| 7.0.x - 7.4.x | 4.0.25 |
29+
| 6.4.x - 6.9.x | 4.0.14 |
30+
| 6.0.x - 6.4.x | 4.0.3 |

packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import debug from 'debug';
2-
import { envToBool, resolveConfig, ResolveConfigVariables } from './resolveConfig';
2+
import { DEFAULT_VERSION, envToBool, resolveConfig, ResolveConfigVariables } from './resolveConfig';
33
import { assertion, checkBinaryPermissions, isNullOrUndefined, pathExists } from './utils';
44
import * as path from 'path';
55
import { arch, homedir, platform } from 'os';
@@ -106,7 +106,7 @@ export class DryMongoBinary {
106106
opts?: DryMongoBinaryOptions
107107
): Promise<Required<DryMongoBinaryOptions>> {
108108
log('generateOptions');
109-
const defaultVersion = resolveConfig(ResolveConfigVariables.VERSION) ?? '4.0.25';
109+
const defaultVersion = resolveConfig(ResolveConfigVariables.VERSION) ?? DEFAULT_VERSION;
110110
const ensuredOpts: DryMongoBinaryOptions = isNullOrUndefined(opts)
111111
? { version: defaultVersion }
112112
: opts;

packages/mongodb-memory-server-core/src/util/resolveConfig.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ export enum ResolveConfigVariables {
2626
}
2727

2828
export const ENV_CONFIG_PREFIX = 'MONGOMS_';
29+
/** This Value exists here, because "defaultValues" can be changed with "setDefaultValue", but this property is constant */
30+
export const DEFAULT_VERSION = '4.0.25';
2931
export const defaultValues = new Map<ResolveConfigVariables, string>([
3032
// apply app-default values here
31-
[ResolveConfigVariables.VERSION, '4.0.25'],
33+
[ResolveConfigVariables.VERSION, DEFAULT_VERSION],
3234
[ResolveConfigVariables.PREFER_GLOBAL_PATH, 'true'],
3335
[ResolveConfigVariables.RUNTIME_DOWNLOAD, 'true'],
3436
[ResolveConfigVariables.USE_HTTP, 'false'],

website/sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = {
2525
'guides/enable-debug-mode',
2626
'guides/known-issues',
2727
'guides/error-warning-details',
28+
'guides/mongodb-server-versions',
2829
],
2930
},
3031
],

website/src/pages/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ function Home() {
4848
const { siteConfig = {} } = context;
4949

5050
return (
51-
<Layout
52-
title={`Hello from ${siteConfig.title}`}
53-
description="Description will go into a meta tag in <head />"
54-
>
51+
<Layout title={siteConfig.title} description="Description will go into a meta tag in <head />">
5552
<header className={clsx('hero hero--primary', styles.heroBanner)}>
5653
<div className="container">
5754
<h1 className="hero__title">{siteConfig.title}</h1>

0 commit comments

Comments
 (0)