Skip to content

Commit

Permalink
feat: set lowest supported nodejs version to 12.22
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
Lowest supported NodeJS version is now 12.22
  • Loading branch information
hasezoey committed Jun 25, 2021
1 parent a90f99e commit 7d6d018
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v2
if: github.event.inputs.git-ref == ''
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,9 @@ Choose any package, because they are the same. They differ only in the default c

### Requirements

- NodeJS: 10.15+
- NodeJS: 12.22+
- Typescript: 4.0+ (if used)

If using NodeJS below 12.10, package `rimraf` needs to be installed (when using cleanup with `force`)

And one of those:

- having `lsb-core` installed (or any that provides the `lsb_release` command)
Expand Down
6 changes: 1 addition & 5 deletions docs/guides/quick-start-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ This Guide will show how to setup this package for basic use

## Requirements

- NodeJS: 10.15+
- NodeJS: 12.22+
- Typescript: 4.0+ (if used)

:::info
When using NodeJS below 12.10, package `rimraf` needs to be installed (when using cleanup with `force`)
:::

When on Linux, one of the following are required:

- having `lsb-core` installed (or any that provides the `lsb_release` command)
Expand Down
10 changes: 4 additions & 6 deletions packages/mongodb-memory-server-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"directory": "packages/mongodb-memory-server-core"
},
"engines": {
"node": ">=10.15.0"
"node": ">=12.22.0"
},
"files": [
"lib",
Expand All @@ -36,11 +36,11 @@
"@types/find-package-json": "^1.2.1",
"@types/mkdirp": "^1.0.1",
"@types/mongodb": "^3.6.18",
"@types/rimraf": "^3.0.0",
"@types/semver": "^7.3.6",
"@types/tar-stream": "^2.1.0",
"@types/uuid": "^8.0.0",
"@types/yauzl": "^2.9.1"
"@types/yauzl": "^2.9.1",
"rimraf": "^3.0.2"
},
"dependencies": {
"@types/tmp": "^0.2.0",
Expand Down Expand Up @@ -73,7 +73,5 @@
"test:watch": "yarn run watch",
"tscheck": "tsc --noEmit"
},
"optionalDependencies": {
"rimraf": "^3.0.2"
}
"optionalDependencies": {}
}
12 changes: 1 addition & 11 deletions packages/mongodb-memory-server-core/src/MongoMemoryServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,17 +539,7 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
} else {
assertion(res.isDirectory(), new Error('Defined dbPath is not an directory'));

// exclusive semver versions are used here (yes "lt" not "lte")
if (lt(process.version, '12.10.0')) {
// this has to be used for below 12.10 (exclusive), because nodejs did not have an recursive delete
try {
const rimraf = (await import('rimraf')).sync;
rimraf(dbPath);
} catch (err) {
console.warn('When using NodeJS below 12.10 package "rimraf" is needed');
throw err;
}
} else if (lt(process.version, '14.14.0')) {
if (lt(process.version, '14.14.0')) {
// this has to be used for 12.10 - 14.13 (inclusive) because ".rm" did not exist yet
await fspromises.rmdir(dbPath, { recursive: true, maxRetries: 1 });
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-memory-server-global-3.6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"directory": "packages/mongodb-memory-server-global-3.6"
},
"engines": {
"node": ">=10.15.0"
"node": ">=12.22.0"
},
"homepage": "https://github.com/nodkz/mongodb-memory-server",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-memory-server-global-4.2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"directory": "packages/mongodb-memory-server-global-4.2"
},
"engines": {
"node": ">=10.15.0"
"node": ">=12.22.0"
},
"homepage": "https://github.com/nodkz/mongodb-memory-server",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-memory-server-global-4.4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"directory": "packages/mongodb-memory-server-global-4.4"
},
"engines": {
"node": ">=10.15.0"
"node": ">=12.22.0"
},
"homepage": "https://github.com/nodkz/mongodb-memory-server",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-memory-server-global/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"directory": "packages/mongodb-memory-server-global"
},
"engines": {
"node": ">=10.15.0"
"node": ">=12.22.0"
},
"homepage": "https://github.com/nodkz/mongodb-memory-server",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-memory-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"directory": "packages/mongodb-memory-server"
},
"engines": {
"node": ">=10.15.0"
"node": ">=12.22.0"
},
"homepage": "https://github.com/nodkz/mongodb-memory-server",
"keywords": [
Expand Down
21 changes: 0 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2027,14 +2027,6 @@
dependencies:
"@types/node" "*"

"@types/glob@*":
version "7.1.3"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183"
integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==
dependencies:
"@types/minimatch" "*"
"@types/node" "*"

"@types/graceful-fs@^4.1.2":
version "4.1.5"
resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15"
Expand Down Expand Up @@ -2082,11 +2074,6 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==

"@types/minimatch@*":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==

"@types/minimatch@^3.0.3":
version "3.0.4"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21"
Expand Down Expand Up @@ -2137,14 +2124,6 @@
resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d"
integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==

"@types/rimraf@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-3.0.0.tgz#b9d03f090ece263671898d57bb7bb007023ac19f"
integrity sha512-7WhJ0MdpFgYQPXlF4Dx+DhgvlPCfz/x5mHaeDQAKhcenvQP1KCpLQ18JklAqeGMYSAT2PxLpzd0g2/HE7fj7hQ==
dependencies:
"@types/glob" "*"
"@types/node" "*"

"@types/semver@^7.3.6":
version "7.3.6"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.6.tgz#e9831776f4512a7ba6da53e71c26e5fb67882d63"
Expand Down

0 comments on commit 7d6d018

Please sign in to comment.