Skip to content

Commit 1798801

Browse files
committed
chore: add global package for version "4.0"
re #559
1 parent 02f5156 commit 1798801

File tree

8 files changed

+95
-0
lines changed

8 files changed

+95
-0
lines changed

.releaserc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ module.exports = {
8686
pkgRoot: './packages/mongodb-memory-server-global-3.6',
8787
},
8888
],
89+
[
90+
'@semantic-release/npm',
91+
{
92+
npmPublish: true,
93+
pkgRoot: './packages/mongodb-memory-server-global-4.0',
94+
},
95+
],
8996
[
9097
'@semantic-release/npm',
9198
{

docs/guides/mongodb-server-versions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ If the branch is named like `old/`, then it means that this package will not be
4242
| :---------------------------------: | :----------------------: | :------------: |
4343
| `mongodb-memory-server-global-4.4` | 4.4.10 | `master` |
4444
| `mongodb-memory-server-global-4.2` | 4.2.17 | `master` |
45+
| `mongodb-memory-server-global-4.0` | 4.0.27 | `master` |
4546
| `mongodb-memory-server-global-3.6` | 3.6.23 | `master` |
4647
| `mongodb-memory-server-global-3.4` | 3.4.20 | `old/6.x` |
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2021-present Pavel Chertorogov
4+
5+
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:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
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.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# mongodb-memory-server-global-4.4
2+
3+
[![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)
4+
[![NPM version](https://img.shields.io/npm/v/mongodb-memory-server-global-4.4.svg)](https://www.npmjs.com/package/mongodb-memory-server-global-4.4)
5+
[![Downloads stat](https://img.shields.io/npm/dt/mongodb-memory-server-global-4.4.svg)](http://www.npmtrends.com/mongodb-memory-server-global-4.4)
6+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
7+
[![TypeScript compatible](https://img.shields.io/badge/typescript-compatible-brightgreen.svg)](https://www.typescriptlang.org)
8+
[![codecov.io](https://codecov.io/github/nodkz/mongodb-memory-server/coverage.svg?branch=master)](https://codecov.io/github/nodkz/mongodb-memory-server?branch=master)
9+
[![Backers on Open Collective](https://opencollective.com/mongodb-memory-server/backers/badge.svg)](#backers)
10+
[![Sponsors on Open Collective](https://opencollective.com/mongodb-memory-server/sponsors/badge.svg)](#sponsors)
11+
12+
Main default package which downloads `v4.4` mongod binary to `%HOME/.cache/mongodb-binaries` directory on package install.
13+
14+
[Full README with avaliable options and examples](https://github.com/nodkz/mongodb-memory-server)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from 'mongodb-memory-server-core';
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
2+
'use strict';
3+
Object.defineProperty(exports, '__esModule', { value: true });
4+
5+
var setDefaultValue = require('mongodb-memory-server-core/lib/util/resolveConfig').setDefaultValue;
6+
var version = require('./package.json').mongodb_version;
7+
setDefaultValue('VERSION', version);
8+
9+
const tslib = require('tslib');
10+
tslib.__exportStar(require('mongodb-memory-server-core'), exports);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "mongodb-memory-server-global-4.0",
3+
"version": "7.5.1",
4+
"mongodb_version": "4.0.27",
5+
"description": "MongoDB Server for testing (auto-download 4.0 version to ~/.cache/mongodb-binaries).",
6+
"main": "index.js",
7+
"types": "index.d.ts",
8+
"license": "MIT",
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/nodkz/mongodb-memory-server.git",
12+
"directory": "packages/mongodb-memory-server-global-4.4"
13+
},
14+
"engines": {
15+
"node": ">=12.22.0"
16+
},
17+
"homepage": "https://github.com/nodkz/mongodb-memory-server",
18+
"keywords": [
19+
"mongodb",
20+
"mongoose",
21+
"mock",
22+
"stub",
23+
"mockgoose",
24+
"mongodb-prebuilt",
25+
"mongomem"
26+
],
27+
"dependencies": {
28+
"mongodb-memory-server-core": "7.5.1",
29+
"tslib": "^2.3.0"
30+
},
31+
"scripts": {
32+
"postinstall": "node ./postinstall.js"
33+
}
34+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* eslint @typescript-eslint/no-var-requires: 0 */
2+
3+
function doesModuleExist(name) {
4+
try {
5+
return !!require.resolve(name);
6+
} catch (e) {
7+
return false;
8+
}
9+
}
10+
11+
const modulePath = 'mongodb-memory-server-core/lib/util/postinstallHelper';
12+
13+
if (!doesModuleExist(modulePath)) {
14+
console.log('Could not find file "postinstall" in core package!');
15+
16+
return;
17+
}
18+
19+
require(modulePath).postInstallEnsureBinary(require('./package.json').mongodb_version);

0 commit comments

Comments
 (0)