From 1d1284ef87c6f8d1d3f3502c3db37a16f14d111c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Tue, 31 Jan 2023 17:51:57 +0100 Subject: [PATCH] feat: drop Node 6, 8 & 10 support (#16) BREAKING CHANGE: Requires Node@^12.22.0 || ^14.17.0 || >=16.0.0 --- .github/workflows/ci.yml | 33 ++--------------- docs/README.md | 2 +- package.json | 3 +- scripts/deploy.js | 76 ---------------------------------------- 4 files changed, 5 insertions(+), 109 deletions(-) delete mode 100644 scripts/deploy.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f9ef70..0a7a775 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: strategy: matrix: eslint: [7] - node: [10, 12.0.0, 12, 14.0.0, 14, 16.0.0, 16, 18.0.0, 18, 20] + node: [12.22.0, 12, 14.17.0, 14, 16.0.0, 16, 18.0.0, 18, 20] os: [ubuntu-latest] include: # On other platforms @@ -63,16 +63,9 @@ jobs: - eslint: 4 node: 18 os: ubuntu-latest - # On old Node.js versions - - eslint: 6 - node: 8 - os: ubuntu-latest - - eslint: 5 - node: 6 - os: ubuntu-latest # On the minimum supported ESLint/Node.js version - eslint: 4.19.1 - node: 6.5.0 + node: 12.22.0 os: ubuntu-latest runs-on: ${{ matrix.os }} steps: @@ -84,31 +77,11 @@ jobs: with: node-version: ${{ matrix.node }} - # - name: 📥 Install dependencies - # run: npm install - - name: 📥 Install Packages for Node v6 - run: | - sudo npm i npm@6.x - ./node_modules/.bin/npm -v - ./node_modules/.bin/npm uninstall vuepress - ./node_modules/.bin/npm install - if: ${{ matrix.node == '6.5.0' || matrix.node == '6' }} - - name: 📥 Uninstall Packages for Node v8 - run: | - npm uninstall vuepress - if: ${{ matrix.node == '8.O.O' || matrix.node == '8' }} - - name: 📥 Install Packages + - name: 📥 Install dependencies run: npm install --legacy-peer-deps - if: ${{ matrix.node != '6.5.0' && matrix.node != '6' }} - # - name: 📥 Install ESLint v${{ matrix.eslint }} - # run: npm install --save-dev eslint@${{ matrix.eslint }} - - name: 📥 Install ESLint v${{ matrix.eslint }} for Node v6 - run: ./node_modules/.bin/npm install --save-dev eslint@${{ matrix.eslint }} - if: ${{ matrix.node == '6.5.0' || matrix.node == '6' }} - name: 📥 Install ESLint v${{ matrix.eslint }} run: npm install --save-dev eslint@${{ matrix.eslint }} - if: ${{ matrix.node != '6.5.0' && matrix.node != '6' }} - name: ▶️ Run test script run: npm run test diff --git a/docs/README.md b/docs/README.md index 9304a37..0aa328b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -26,7 +26,7 @@ npm install --save-dev eslint @eslint-community/eslint-plugin-eslint-comments ``` ::: tip Requirements -- Node.js `6.5.0` or newer. +- Node.js `^12.22.0 || ^14.17.0 || >=16.0.0` - ESLint `4.19.1` or newer. ::: diff --git a/package.json b/package.json index cc071f4..eee6136 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0-semantically-released", "description": "Additional ESLint rules for ESLint directive comments.", "engines": { - "node": ">=6.5.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "main": "index.js", "files": [ @@ -41,7 +41,6 @@ "clean": "rimraf .nyc_output coverage docs/.vuepress/dist", "docs:build": "vuepress build docs", "docs:watch": "vuepress dev docs", - "docs:deploy": "node scripts/deploy", "lint": "eslint lib scripts tests", "test": "nyc mocha \"tests/lib/**/*.js\" --reporter dot --timeout 8000", "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", diff --git a/scripts/deploy.js b/scripts/deploy.js deleted file mode 100644 index baeb60e..0000000 --- a/scripts/deploy.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict" - -const { spawn } = require("child_process") -const path = require("path") -const fs = require("fs-extra") -const GH_TOKEN = process.argv[2] -const BUILD_ROOT = path.resolve(__dirname, "../docs/.vuepress/dist") -const DEPLOY_ROOT = path.resolve(__dirname, "..") - -/** - * Execute a command. - * @param {string} command The command to execute. - * @returns {Promise} - */ -function exec(command) { - console.log(`> ${command.replace(GH_TOKEN, "****")}`) - return new Promise((resolve, reject) => { - const cp = spawn(command, [], { shell: true, stdio: "inherit" }) - - cp.on("close", code => { - if (code) { - reject(new Error(`Exited with ${code}.`)) - } else { - resolve() - } - }) - }) -} - -//eslint-disable-next-line @mysticatea/node/no-unsupported-features/es-syntax -;(async () => { - // Checkout. - await exec("git fetch origin gh-pages") - await exec("git checkout gh-pages") - - // Clean. - for (const filename of await fs.readdir(DEPLOY_ROOT)) { - if (filename === "docs" || filename.startsWith(".")) { - continue - } - - console.log(`> rm -rf ${filename}`) - await fs.remove(filename) - } - - // Move. - for (const filename of await fs.readdir(BUILD_ROOT)) { - console.log(`> mv docs/.vuepress/dist/${filename} ${filename}`) - await fs.rename( - path.join(BUILD_ROOT, filename), - path.join(DEPLOY_ROOT, filename) - ) - } - - // Commit. - await exec('git config --global user.email "public@mysticatea.dev"') - await exec('git config --global user.name "Toru Nagashima"') - await exec("git add -A") - let updated = false - try { - await exec('git commit -m "Update: website"') - updated = true - } catch (_error) { - console.log("NO UPDATE") - } - - // Push. - if (updated) { - await exec( - `git push https://mysticatea:${GH_TOKEN}@github.com/eslint-community/eslint-plugin-eslint-comments.git gh-pages:gh-pages` - ) - } -})().catch(error => { - console.error(error.stack) - process.exitCode = 1 -})