From 339d08dc71b15a3928aeab09042af94db2f43743 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Sat, 8 Aug 2020 22:42:36 -0700 Subject: [PATCH] build!: modernize deps and build (#80) --- .github/release-please.yml | 2 -- .github/workflows/ci.yaml | 45 ++++++++++++++++++++++++++++ .github/workflows/release-please.yml | 35 ++++++++++++++++++++++ .gitignore | 2 ++ .nycrc | 13 ++++++++ .travis.yml | 6 ---- README.md | 6 ++-- nyc.config.js | 9 ------ package.json | 32 +++++++------------- test/cliui.js | 2 +- 10 files changed, 109 insertions(+), 43 deletions(-) delete mode 100644 .github/release-please.yml create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/release-please.yml create mode 100644 .nycrc delete mode 100644 .travis.yml delete mode 100644 nyc.config.js diff --git a/.github/release-please.yml b/.github/release-please.yml deleted file mode 100644 index 3c06599..0000000 --- a/.github/release-please.yml +++ /dev/null @@ -1,2 +0,0 @@ -releaseType: node -handleGHRelease: true diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..9c14fc9 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,45 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node: [10, 12, 14] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - run: node --version + - run: npm install + env: + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true + - run: npm test + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + env: + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true + - run: npm test + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 14 + - run: npm install + env: + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true + - run: npm test + - run: npm run coverage diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..b616396 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,35 @@ +on: + push: + branches: + - master +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: bcoe/release-please-action@v1.6.3 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: node + package-name: cliui + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 14 + - run: npm install + env: + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true + - run: npm run compile + - name: push Deno release + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git remote add gh-token "https://${{ secrets.GITHUB_TOKEN}}@github.com/yargs/cliui.git" + git checkout -b deno + git add -f build + git commit -a -m 'chore: ${{ steps.release.outputs.tag_name }} release' + git push origin +deno + git tag -a ${{ steps.release.outputs.tag_name }}-deno -m 'chore: ${{ steps.release.outputs.tag_name }} release' + git push origin ${{ steps.release.outputs.tag_name }}-deno + if: ${{ steps.release.outputs.release_created }} diff --git a/.gitignore b/.gitignore index 7f616c8..eef5570 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ node_modules .nyc_output package-lock.json +coverage + diff --git a/.nycrc b/.nycrc new file mode 100644 index 0000000..827f9a7 --- /dev/null +++ b/.nycrc @@ -0,0 +1,13 @@ +{ + "exclude": [ + "build/test/**", + "test/**" + ], + "reporter": [ + "html", + "text" + ], + "lines": 98.0, + "branches": "98", + "statements": "98.0" +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 27b7048..0000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "8" - - "10" - - "12" -after_script: npm run coverage diff --git a/README.md b/README.md index deacfa0..b9a847f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # cliui -[![Build Status](https://travis-ci.org/yargs/cliui.svg)](https://travis-ci.org/yargs/cliui) -[![Coverage Status](https://coveralls.io/repos/yargs/cliui/badge.svg?branch=)](https://coveralls.io/r/yargs/cliui?branch=) +![ci](https://github.com/yargs/cliui/workflows/ci/badge.svg) [![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui) -[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) +![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/cliui) easily create complex multi-column command-line-interfaces. diff --git a/nyc.config.js b/nyc.config.js deleted file mode 100644 index 722b92c..0000000 --- a/nyc.config.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict' - -module.exports = { - checkCoverage: true, - functions: 100, - lines: 100, - branches: 100, - statements: 100 -} diff --git a/package.json b/package.json index f92fd10..90bfd23 100644 --- a/package.json +++ b/package.json @@ -4,26 +4,15 @@ "description": "easily create complex multi-column command-line-interfaces", "main": "index.js", "scripts": { - "pretest": "standard", - "test": "nyc mocha", - "coverage": "nyc --reporter=text-lcov mocha | coveralls" + "fix": "standard --fix", + "test": "c8 mocha", + "posttest": "standard", + "coverage": "c8 report --check-coverage" }, "repository": { "type": "git", "url": "http://github.com/yargs/cliui.git" }, - "config": { - "blanket": { - "pattern": [ - "index.js" - ], - "data-cover-never": [ - "node_modules", - "test" - ], - "output-reporter": "spec" - } - }, "standard": { "ignore": [ "**/example/**" @@ -46,20 +35,19 @@ "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "wrap-ansi": "^7.0.0" }, "devDependencies": { + "c8": "^7.3.0", "chai": "^4.2.0", - "chalk": "^3.0.0", - "coveralls": "^3.0.3", - "mocha": "^6.2.2", - "nyc": "^14.1.1", - "standard": "^12.0.1" + "chalk": "^4.1.0", + "mocha": "^8.1.1", + "standard": "^14.3.4" }, "files": [ "index.js" ], "engine": { - "node": ">=8" + "node": ">=10" } } diff --git a/test/cliui.js b/test/cliui.js index e5e6d6e..e9752a8 100644 --- a/test/cliui.js +++ b/test/cliui.js @@ -5,7 +5,7 @@ require('chai').should() // Force chalk to enable color, if it's disabled the test fails. -process.env['FORCE_COLOR'] = 1 +process.env.FORCE_COLOR = 1 const chalk = require('chalk') const cliui = require('../')