From fcf91af996b147cb1b416be8aa4ac6d4577fcdbb Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Wed, 10 Jun 2020 23:50:57 -0400 Subject: [PATCH 1/7] remove travis --- .travis.yml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9017b23..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: node_js - -node_js: - - "lts/*" - - "node" - -script: - - npm run lint - - npm run coverage - -cache: - directories: - - node_modules From f9be7e7d7b2f55be17727c5d614ed9ee8c0bdf49 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Wed, 10 Jun 2020 23:52:25 -0400 Subject: [PATCH 2/7] add codecov partial line coverage --- .codecov.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..3f58de5 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,6 @@ +coverage: + round: up + precision: 2 + parsers: + javascript: + enable_partials: yes From 71600df374b14f3d8cfed0f040c7dc340a0a154f Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Thu, 11 Jun 2020 00:01:51 -0400 Subject: [PATCH 3/7] switch coverage to c8 --- .npmrc | 3 ++- package.json | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.npmrc b/.npmrc index 9cf9495..5c69597 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ -package-lock=false \ No newline at end of file +package-lock=false +save-exact=false diff --git a/package.json b/package.json index a67617b..13d45b4 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "scripts": { "lint": "xo", "test": "xo && ava", - "report": "nyc ava", - "coverage": "nyc --reporter json --reporter text ava && codecov -f coverage/coverage-final.json", + "report": "c8 --reporter json --reporter text ava", + "coverage": "c8 --reporter json --reporter text ava && codecov -f coverage/coverage-final.json", "prepublishOnly": "tsc --declaration --emitDeclarationOnly --allowJs index.js" }, "repository": "https://github.com/node-fetch/fetch-blob.git", @@ -30,10 +30,10 @@ "homepage": "https://github.com/node-fetch/fetch-blob#readme", "devDependencies": { "ava": "^3.8.2", + "c8": "^7.2.0", "codecov": "^3.7.0", "get-stream": "^5.1.0", "node-fetch": "^2.6.0", - "nyc": "^15.1.0", "typescript": "^3.9.5", "xo": "^0.32.0" }, From ecdabc987955554986e2c0293e7ffbc83b5f08f5 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Thu, 11 Jun 2020 00:01:56 -0400 Subject: [PATCH 4/7] add GitHub Actions --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 20 ++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c117b61 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + paths: + - "**.js" + - "package.json" + - ".github/workflows/ci.yml" + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + node: ["14", "12", engines] + exclude: + # On Windows, run tests with only the LTS environments. + - os: windows-latest + node: engines + - os: windows-latest + node: "14" + # On macOS, run tests with only the LTS environments. + - os: macOS-latest + node: engines + - os: macOS-latest + node: "14" + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + + - name: Get Node.JS version from package.json + if: matrix.node == 'engines' + id: get-version + run: echo ::set-output name=node::$(npx --q minimum-node-version) + + - uses: actions/setup-node@v2-beta + if: matrix.node != 'engines' + with: + node-version: ${{ matrix.node }} + + - uses: actions/setup-node@v2-beta + if: matrix.node == 'engines' + with: + node-version: ${{steps.get-version.outputs.node}} + + - run: npm install + + - run: npm run report -- --colors + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage/coverage-final.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..1ce559e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,20 @@ +name: CI + +on: + pull_request: + paths: + - "**.js" + - "**eslint**" + - "package.json" + - ".github/workflows/lint.yml" +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2-beta + with: + node-version: 14 + - run: npm install + - run: npm run lint From b098249bea4c737994d081863fa566da9067950f Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Thu, 11 Jun 2020 00:13:20 -0400 Subject: [PATCH 5/7] update badge --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e32a509..1286c25 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # fetch-blob [![npm version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] +[![build status][ci-image]][ci-url] [![coverage status][codecov-image]][codecov-url] [![install size][install-size-image]][install-size-url] @@ -31,8 +31,8 @@ See the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blo [npm-image]: https://flat.badgen.net/npm/v/fetch-blob [npm-url]: https://www.npmjs.com/package/fetch-blob -[travis-image]: https://flat.badgen.net/travis/node-fetch/fetch-blob -[travis-url]: https://travis-ci.org/node-fetch/fetch-blob +[ci-image]: https://github.com/node-fetch/fetch-blob/workflows/CI/badge.svg +[ci-url]: https://github.com/node-fetch/fetch-blob/actions [codecov-image]: https://flat.badgen.net/codecov/c/github/node-fetch/fetch-blob/master [codecov-url]: https://codecov.io/gh/node-fetch/fetch-blob [install-size-image]: https://flat.badgen.net/packagephobia/install/fetch-blob From bc6ca02caafb1b4aa2c72a3e46e86d048ce39d5f Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Thu, 11 Jun 2020 00:16:48 -0400 Subject: [PATCH 6/7] import TextDecoder from util --- test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test.js b/test.js index 8f56b48..49cda09 100644 --- a/test.js +++ b/test.js @@ -2,6 +2,7 @@ const test = require('ava'); const Blob = require('.'); const getStream = require('get-stream'); const {Response} = require('node-fetch'); +const {TextDecoder} = require('util') test('new Blob()', t => { const blob = new Blob(); // eslint-disable-line no-unused-vars From cd619c7694fe89adeb2bf0059794b989c6b36495 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Thu, 11 Jun 2020 00:17:58 -0400 Subject: [PATCH 7/7] lint --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 49cda09..52fdb72 100644 --- a/test.js +++ b/test.js @@ -2,7 +2,7 @@ const test = require('ava'); const Blob = require('.'); const getStream = require('get-stream'); const {Response} = require('node-fetch'); -const {TextDecoder} = require('util') +const {TextDecoder} = require('util'); test('new Blob()', t => { const blob = new Blob(); // eslint-disable-line no-unused-vars