From f800129f77e64346740f3977bd1356c578f0fe4b Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 31 Mar 2021 12:00:47 -0700 Subject: [PATCH 1/2] [Dev Deps] switch from `eslint-config-airbnb` to `eslint-config-airbnb-base`, since this project does not use react --- .eslintrc.json | 2 +- package.json | 2 +- src/install-peerdeps.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index c1345ae..f2dd019 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": [ - "airbnb", + "airbnb-base", "prettier" ], "plugins": [ diff --git a/package.json b/package.json index 3114f9a..e12699a 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@babel/preset-env": "^7.7.4", "@babel/register": "^7.7.4", "eslint": "^6.7.2", - "eslint-config-airbnb": "^18.0.1", + "eslint-config-airbnb-base": "^14.2.1", "eslint-config-prettier": "^6.7.0", "eslint-plugin-import": "^2.18.2", "eslint-plugin-jsx-a11y": "^6.2.3", diff --git a/src/install-peerdeps.js b/src/install-peerdeps.js index f91e9d6..a62552c 100644 --- a/src/install-peerdeps.js +++ b/src/install-peerdeps.js @@ -3,7 +3,7 @@ import "@babel/polyfill"; import fs from "fs"; import { spawn } from "child_process"; -import { valid, coerce, maxSatisfying } from "semver"; +import { maxSatisfying } from "semver"; import * as C from "./constants"; /** From 75ea9ce3ce8df30d50538c6839a50b701f90d750 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 31 Mar 2021 11:56:21 -0700 Subject: [PATCH 2/2] [Tests] migrate tests to Github Actions --- .github/workflows/node-pretest.yml | 27 ++++++++++++++++++++ .github/workflows/node.yml | 41 ++++++++++++++++++++++++++++++ .travis.yml | 21 --------------- fixtures/pnpm/package.json | 10 ++++---- 4 files changed, 73 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/node-pretest.yml create mode 100644 .github/workflows/node.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/node-pretest.yml b/.github/workflows/node-pretest.yml new file mode 100644 index 0000000..05a6569 --- /dev/null +++ b/.github/workflows/node-pretest.yml @@ -0,0 +1,27 @@ +name: 'Tests: pretest/posttest' + +on: [pull_request, push] + +jobs: + pretest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/install@main + name: 'nvm install lts/* && npm install' + with: + node-version: 'lts/*' + - run: npm run pretest + + posttest: + if: 'false' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/install@main + name: 'nvm install lts/* && npm install' + with: + node-version: 'lts/*' + - run: npm run posttest diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 0000000..7f0a353 --- /dev/null +++ b/.github/workflows/node.yml @@ -0,0 +1,41 @@ +name: 'Tests: node.js' + +on: [pull_request, push] + +jobs: + matrix: + runs-on: ubuntu-latest + outputs: + latest: ${{ steps.set-matrix.outputs.requireds }} + minors: ${{ steps.set-matrix.outputs.optionals }} + steps: + - uses: ljharb/actions/node/matrix@main + id: set-matrix + with: + preset: '>=8' + type: 'majors' + + latest: + needs: [matrix] + name: 'latest majors' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.matrix.outputs.latest) }} + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/install@main + name: 'nvm install ${{ matrix.node-version }} && npm install' + with: + node-version: ${{ matrix.node-version }} + before_install: npm install -g pnpm@3 yarn@1 + - run: npm run tests-only + + node: + name: 'node 8+' + needs: [latest] + runs-on: ubuntu-latest + steps: + - run: 'echo tests completed' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ee2a09e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: node_js -node_js: - - "15" - - "14" - - "12" - - "10" - - "8" -cache: yarn -before_install: - - nvm install-latest-npm - - npm install -g pnpm@3 -script: - - if [ "${LINT-}" = 'true']; then npm run lint; fi - - if [ "${TEST-}" = 'true' ]; then npm run tests-only; fi -env: - - TEST=true -matrix: - fast_finish: true - include: - - node_js: "node" - env: LINT=true diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json index 2961602..a6acec5 100644 --- a/fixtures/pnpm/package.json +++ b/fixtures/pnpm/package.json @@ -6,11 +6,11 @@ "license": "MIT", "private": true, "dependencies": { - "eslint": "6.1.0", - "eslint-config-airbnb": "18.0.1", - "eslint-plugin-import": "^2.18.2", - "eslint-plugin-jsx-a11y": "^6.2.3", - "eslint-plugin-react": "^7.14.3", + "eslint": "^7.2.0", + "eslint-config-airbnb": "18.2.1", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-jsx-a11y": "^6.4.1", + "eslint-plugin-react": "^7.21.5", "eslint-plugin-react-hooks": "^1.7.0" } }