From 4c65d87c803b720acefe009fff0503717c65ee85 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 15 Jun 2021 15:55:03 +0700 Subject: [PATCH] Require Node.js 12 and upgrade dependencies Fixes #22 Fixes #21 --- .github/funding.yml | 3 --- .github/workflows/main.yml | 4 ++-- cli.js | 6 +++--- package.json | 19 ++++++++++--------- readme.md | 1 + test.js | 2 +- 6 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 .github/funding.yml diff --git a/.github/funding.yml b/.github/funding.yml deleted file mode 100644 index 1a630e9..0000000 --- a/.github/funding.yml +++ /dev/null @@ -1,3 +0,0 @@ -github: sindresorhus -open_collective: sindresorhus -custom: https://sindresorhus.com/donate diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c1870cf..3b8aa86 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,12 +10,12 @@ jobs: fail-fast: false matrix: node-version: + - 16 - 14 - 12 - - 10 steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/cli.js b/cli.js index bb29ddb..8238046 100755 --- a/cli.js +++ b/cli.js @@ -1,7 +1,6 @@ #!/usr/bin/env node -'use strict'; -const meow = require('meow'); -const del = require('del'); +import meow from 'meow'; +import del from 'del'; const cli = meow(` Usage @@ -15,6 +14,7 @@ const cli = meow(` $ del unicorn.png rainbow.png $ del "*.png" "!unicorn.png" `, { + importMeta: import.meta, flags: { force: { type: 'boolean', diff --git a/package.json b/package.json index 201f7da..ff2a209 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,13 @@ "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, + "type": "module", "bin": { - "del": "cli.js", - "del-cli": "cli.js" + "del": "./cli.js", + "del-cli": "./cli.js" }, "engines": { - "node": ">=8" + "node": ">=12.20" }, "scripts": { "test": "xo && ava" @@ -49,13 +50,13 @@ "cross-platform" ], "dependencies": { - "del": "^5.1.0", - "meow": "^6.1.1" + "del": "^6.0.0", + "meow": "^10.0.1" }, "devDependencies": { - "ava": "^2.3.0", - "execa": "^2.0.4", - "temp-write": "^4.0.0", - "xo": "^0.24.0" + "ava": "^3.15.0", + "execa": "^5.1.1", + "temp-write": "^5.0.0", + "xo": "^0.40.2" } } diff --git a/readme.md b/readme.md index ec0283c..ed30f13 100644 --- a/readme.md +++ b/readme.md @@ -28,6 +28,7 @@ $ del --help $ del unicorn.png rainbow.png $ del "*.png" "!unicorn.png" ``` + > :warning: **Windows users**: Since `$ del` is already a builtin command on Windows, you need to use `$ del-cli` there. ## Related diff --git a/test.js b/test.js index fefece6..a0d1a1c 100644 --- a/test.js +++ b/test.js @@ -1,4 +1,4 @@ -import fs from 'fs'; +import fs from 'node:fs'; import test from 'ava'; import tempWrite from 'temp-write'; import execa from 'execa';