Skip to content

Commit 64b8940

Browse files
committed
Merge updates from project template
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2 parents 6580a59 + b8ee0f8 commit 64b8940

File tree

8 files changed

+128
-103
lines changed

8 files changed

+128
-103
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ charset = utf-8
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11-
[*.{coffee,js,json,yml}]
11+
[*.{cjs,coffee,js,json,mjs,yml}]
1212
indent_size = 2
1313
indent_style = space

.github/workflows/node.js.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# GitHub Actions Workflow configuration
2+
# https://docs.github.com/actions/reference/workflow-syntax-for-github-actions
3+
# https://docs.github.com/actions/guides/building-and-testing-nodejs
4+
5+
name: Node.js CI
6+
7+
# Note: on key treated as boolean key by YAML
8+
# https://github.com/adrienverge/yamllint/issues/158#issuecomment-454313233
9+
# However, GitHub Actions documentation is consistent in using it unquoted.
10+
on: # yamllint disable-line rule:truthy
11+
pull_request: {}
12+
push: {}
13+
schedule:
14+
# Run once a day (at 8:40 AM UTC) to check for exogenous breakage.
15+
# TODO: Run when dependencies are updated. (Like Dependabot, but on
16+
# in-range updates and without sending a PR.)
17+
- cron: '40 8 * * *'
18+
19+
jobs:
20+
test-primary:
21+
name: Lint and Test on Node.js * x64 on ubuntu-latest
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Set up Node.js
26+
uses: actions/setup-node@v2
27+
with:
28+
# '*' is "latest":
29+
# https://github.com/actions/setup-node/issues/61#issuecomment-577548687
30+
# https://github.com/actions/setup-node/issues/164#issuecomment-648999618
31+
# https://github.com/actions/setup-node/pull/104
32+
node-version: '*'
33+
architecture: x64
34+
- name: Display Node.js version
35+
run: node --version
36+
- name: Install dependencies
37+
run: npm install
38+
- name: Lint
39+
run: npm run lint
40+
- name: Run tests
41+
run: npm run test-unit-cov
42+
- name: Upload coverage to Codecov
43+
uses: codecov/codecov-action@v1
44+
- name: Upload coverage to Coveralls
45+
# Note: @master is currently the only version
46+
# https://github.com/coverallsapp/github-action/issues/11
47+
uses: coverallsapp/github-action@master
48+
with:
49+
flag-name: 'ubuntu-latest_x64_*'
50+
github-token: ${{ secrets.GITHUB_TOKEN }}
51+
parallel: true
52+
53+
test-secondary:
54+
# Only test secondary platforms if primary test platform passed
55+
needs:
56+
- test-primary
57+
name: >-
58+
Test on Node.js ${{ matrix.node }} ${{ matrix.arch }} on ${{ matrix.os }}
59+
runs-on: ${{ matrix.os }}
60+
strategy:
61+
matrix:
62+
arch:
63+
# Uncomment if package needs testing on different architectures
64+
# - x86
65+
- x64
66+
os:
67+
# Uncomment if package needs testing on macOS:
68+
# - macos-latest
69+
- ubuntu-latest
70+
- windows-latest
71+
node:
72+
- '10'
73+
- '*'
74+
exclude:
75+
# Exclude os/version already run in test-primary
76+
- arch: x64
77+
os: ubuntu-latest
78+
node: '*'
79+
steps:
80+
- uses: actions/checkout@v2
81+
- name: Set up Node.js ${{ matrix.node }}
82+
uses: actions/setup-node@v2
83+
with:
84+
node-version: ${{ matrix.node }}
85+
architecture: ${{ matrix.arch }}
86+
- name: Display Node.js version
87+
run: node --version
88+
- name: Install dependencies
89+
run: npm install
90+
- name: Run tests
91+
run: npm run test-unit-cov
92+
# Note: Not uploading to Codecov, due to poor support for matrix builds
93+
# https://github.com/codecov/codecov-action/issues/40
94+
- name: Upload coverage to Coveralls
95+
uses: coverallsapp/github-action@master
96+
with:
97+
flag-name: ${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.node }}
98+
github-token: ${{ secrets.GITHUB_TOKEN }}
99+
parallel: true
100+
101+
finish:
102+
needs: test-secondary
103+
runs-on: ubuntu-latest
104+
steps:
105+
- name: Coveralls Finished
106+
uses: coverallsapp/github-action@master
107+
with:
108+
github-token: ${{ secrets.github_token }}
109+
parallel-finished: true

.npmignore

Lines changed: 0 additions & 25 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
`git-branch-is`
22
===============
33

4-
[![Build Status: Linux](https://img.shields.io/travis/kevinoid/git-branch-is/master.svg?style=flat&label=build+on+linux)](https://travis-ci.org/kevinoid/git-branch-is)
5-
[![Build Status: Windows](https://img.shields.io/appveyor/ci/kevinoid/git-branch-is/master.svg?style=flat&label=build+on+windows)](https://ci.appveyor.com/project/kevinoid/git-branch-is)
4+
[![Build Status](https://img.shields.io/github/workflow/status/kevinoid/git-branch-is/Node.js%20CI/master.svg?style=flat&label=build)](https://github.com/kevinoid/git-branch-is/actions?query=branch%3Amaster)
65
[![Coverage](https://img.shields.io/codecov/c/github/kevinoid/git-branch-is.svg?style=flat)](https://codecov.io/github/kevinoid/git-branch-is?branch=master)
76
[![Dependency Status](https://img.shields.io/david/kevinoid/git-branch-is.svg?style=flat)](https://david-dm.org/kevinoid/git-branch-is)
87
[![Supported Node Version](https://img.shields.io/node/v/git-branch-is.svg?style=flat)](https://www.npmjs.com/package/git-branch-is)

appveyor.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @copyright Copyright 2016 Kevin Locke <kevin@kevinlocke.name>
2+
* @copyright Copyright 2016-2020 Kevin Locke <kevin@kevinlocke.name>
33
* @license MIT
44
*/
55

package.json

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@
1717
"type": "git",
1818
"url": "https://github.com/kevinoid/git-branch-is.git"
1919
},
20+
"type": "commonjs",
21+
"files": [
22+
"*.js",
23+
"bin/",
24+
"lib/",
25+
"!**/.*"
26+
],
2027
"main": "index.js",
28+
"exports": {
29+
".": "./index.js"
30+
},
2131
"bin": {
2232
"git-branch-is": "bin/git-branch-is.js"
2333
},
@@ -33,7 +43,7 @@
3343
"lint-js": "eslint --report-unused-disable-directives . && echo ESLint passed.",
3444
"postpublish": "git -C doc push && git push --follow-tags origin master gh-pages && echo Remember to update GitHub Releases from CHANGELOG.md",
3545
"postversion": "rimraf doc && git clone -b gh-pages -l -q . doc && npm run doc && git -C doc add . && git -C doc commit -n -m \"Docs for v$npm_package_version\"",
36-
"preversion": "npm run test-cov && nyc check-coverage --statements 95 && depcheck --ignore-dirs doc --ignores mocha-ur2ue && david && node ./bin/git-branch-is.js master && travis-status -b master -c -w -x && appveyor-status -b master -c -w -p kevinoid/git-branch-is",
46+
"preversion": "npm run test-cov && nyc check-coverage --statements 95 && depcheck --ignore-dirs doc --ignores mocha-ur2ue && david && node ./bin/git-branch-is.js master && hub-ci-status -vv --wait",
3747
"test": "npm run lint && npm run test-unit",
3848
"test-cov": "npm run lint && npm run test-unit-cov",
3949
"pretest-unit": "node test-bin/set-up-test-repos.js",
@@ -42,32 +52,31 @@
4252
"test-unit-cov": "nyc npm run test-unit",
4353
"upload-cov": "codecov < ./coverage/lcov.info && coveralls < ./coverage/lcov.info",
4454
"version": "npm run changelog && echo && echo === Please edit CHANGELOG.md as desired, then exit === && echo && $npm_config_shell && git commit -m \"Update CHANGELOG.md for $npm_package_version\" CHANGELOG.md",
45-
"version-deps": "npm install conventional-changelog-cli david depcheck git-branch-is travis-status"
55+
"version-deps": "npm install conventional-changelog-cli david depcheck git-branch-is hub-ci-status"
4656
},
4757
"dependencies": {
4858
"commander": "^7.0.0"
4959
},
5060
"devDependencies": {
51-
"@kevinoid/eslint-config": "^11.0.0",
61+
"@kevinoid/eslint-config": "^14.0.0",
5262
"codecov": "^3.0.0",
5363
"coveralls": "^3.0.0",
5464
"escape-string-regexp": "^4.0.0",
5565
"eslint": "^7.3.0",
5666
"eslint-config-airbnb-base": "^14.2.0",
5767
"eslint-plugin-import": "^2.18.2",
58-
"eslint-plugin-jsdoc": "^30.0.3",
68+
"eslint-plugin-jsdoc": "^31.0.7",
5969
"eslint-plugin-node": "^11.0.0",
6070
"eslint-plugin-promise": "^4.2.1",
61-
"eslint-plugin-unicorn": "^21.0.0",
71+
"eslint-plugin-unicorn": "^27.0.0",
6272
"jsdoc": "^3.6.0",
6373
"mocha": "^8.0.1",
64-
"mocha-ur2ue": "^1.0.0",
6574
"nodecat": "^2.0.0",
6675
"nyc": "^15.0.0",
6776
"rimraf": "^3.0.0"
6877
},
6978
"engines": {
70-
"node": ">=10.13",
79+
"node": ">=10.17",
7180
"npm": ">=1.3.7"
7281
},
7382
"david": {

0 commit comments

Comments
 (0)