From 51f00789dac760bcb5bfb981c209aeab9d0ac07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouven=20We=C3=9Fling?= Date: Thu, 5 Nov 2020 15:34:33 +0100 Subject: [PATCH 1/5] Require Node.js 10 --- .travis.yml | 1 - package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d8c94c5..caabc68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,5 @@ node_js: - '14' - '12' - '10' - - '8' after_success: - './node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov' diff --git a/package.json b/package.json index d3a4025..a1422ba 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "url": "https://sindresorhus.com" }, "engines": { - "node": ">=8" + "node": ">=10" }, "scripts": { "test": "xo && nyc ava && tsd" From 9424fad69285f859630ba9cb469a44c4cbcabf0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouven=20We=C3=9Fling?= Date: Thu, 5 Nov 2020 15:45:55 +0100 Subject: [PATCH 2/5] Upgrade xo and address errors --- index.js | 4 ++-- index.test-d.ts | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 8861110..888c6cb 100644 --- a/index.js +++ b/index.js @@ -90,7 +90,7 @@ const makeDir = async (input, options) => { if (!stats.isDirectory()) { throw new Error('The path is not a directory'); } - } catch (_) { + } catch { throw error; } @@ -143,7 +143,7 @@ module.exports.sync = (input, options) => { if (!options.fs.statSync(pth).isDirectory()) { throw new Error('The path is not a directory'); } - } catch (_) { + } catch { throw error; } } diff --git a/index.test-d.ts b/index.test-d.ts index e4baf8b..a681d6e 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -8,7 +8,7 @@ import * as gfs from 'graceful-fs'; expectType>(makeDir('path/to/somewhere')); expectType>( - makeDir('path/to/somewhere', {mode: parseInt('777', 8)}) + makeDir('path/to/somewhere', {mode: 0o777}) ); expectType>(makeDir('path/to/somewhere', {fs})); expectType>(makeDir('path/to/somewhere', {fs: gfs})); @@ -17,7 +17,7 @@ expectType>(makeDir('path/to/somewhere', {fs: gfs})); expectType(makeDirSync('path/to/somewhere')); expectType( - makeDirSync('path/to/somewhere', {mode: parseInt('777', 8)}) + makeDirSync('path/to/somewhere', {mode: 0o777}) ); expectType(makeDirSync('path/to/somewhere', {fs})); expectType(makeDirSync('path/to/somewhere', {fs: gfs})); diff --git a/package.json b/package.json index a1422ba..cde5117 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,6 @@ "path-type": "^4.0.0", "tempy": "^0.2.1", "tsd": "^0.11.0", - "xo": "^0.25.4" + "xo": "^0.34.2" } } From 777eed34cff6ac916372c95b08ba8d808acb25f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouven=20We=C3=9Fling?= Date: Thu, 5 Nov 2020 15:49:56 +0100 Subject: [PATCH 3/5] Upgrade semver to version 7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cde5117..ff95e0d 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "file-system" ], "dependencies": { - "semver": "^6.0.0" + "semver": "^7.3.2" }, "devDependencies": { "@types/graceful-fs": "^4.1.3", From edca1a2627bced3eddcfcaecff5a5ff4c1173495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouven=20We=C3=9Fling?= Date: Thu, 5 Nov 2020 15:55:16 +0100 Subject: [PATCH 4/5] Use semver/functions/gte to load less dependencies --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 888c6cb..2c0814e 100644 --- a/index.js +++ b/index.js @@ -2,9 +2,9 @@ const fs = require('fs'); const path = require('path'); const {promisify} = require('util'); -const semver = require('semver'); +const semverGte = require('semver/functions/gte'); -const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0'); +const useNativeRecursiveOption = semverGte(process.version, '10.12.0'); // https://github.com/nodejs/node/issues/8987 // https://github.com/libuv/libuv/pull/1088 From c7fe9c3786de6ad593d9c524cca069f46bebf81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouven=20We=C3=9Fling?= Date: Thu, 5 Nov 2020 16:03:46 +0100 Subject: [PATCH 5/5] Update dev dependencies --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ff95e0d..115c406 100644 --- a/package.json +++ b/package.json @@ -46,14 +46,14 @@ }, "devDependencies": { "@types/graceful-fs": "^4.1.3", - "@types/node": "^13.7.1", - "ava": "^1.4.0", + "@types/node": "^14.14.6", + "ava": "^2.4.0", "codecov": "^3.2.0", "graceful-fs": "^4.1.15", "nyc": "^15.0.0", "path-type": "^4.0.0", - "tempy": "^0.2.1", - "tsd": "^0.11.0", + "tempy": "^1.0.0", + "tsd": "^0.13.1", "xo": "^0.34.2" } }