Skip to content

Commit 9941669

Browse files
authored
fix #18 add support for node 16 (#19)
1 parent e2eda93 commit 9941669

File tree

8 files changed

+232
-38
lines changed

8 files changed

+232
-38
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: regevbr
7+
8+
---
9+
10+
Your issue may already be reported!
11+
Please search on the [issue tracker](../) before creating one.
12+
13+
## Expected Behavior
14+
<!--- If you're describing a bug, tell us what should happen -->
15+
<!--- If you're suggesting a change/improvement, tell us how it should work -->
16+
17+
## Current Behavior
18+
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
19+
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
20+
21+
## Possible Solution
22+
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
23+
<!--- or ideas how to implement the addition or change -->
24+
25+
## Steps to Reproduce (for bugs)
26+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
27+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
28+
1.
29+
2.
30+
3.
31+
4.
32+
33+
## Context
34+
<!--- How has this issue affected you? What are you trying to accomplish? -->
35+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
36+
37+
## Your Environment
38+
<!--- Include as many relevant details about the environment you experienced the bug in -->
39+
* Version used:
40+
* Node version:
41+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: regevbr
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
A similar PR may already be submitted!
2+
Please search among the [Pull request](../) before creating one.
3+
4+
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
5+
6+
For more information, see the `CONTRIBUTING` guide.
7+
8+
9+
**Summary**
10+
11+
<!-- Summary of the PR -->
12+
13+
This PR fixes/implements the following **bugs/features**
14+
15+
* [ ] Bug 1
16+
* [ ] Bug 2
17+
* [ ] Feature 1
18+
* [ ] Feature 2
19+
* [ ] Breaking changes
20+
21+
<!-- You can skip this if you're fixing a typo or alike -->
22+
23+
Explain the **motivation** for making this change. What existing problem does the pull request solve?
24+
25+
<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->
26+
27+
**Test plan (required)**
28+
29+
<!-- Make sure tests pass on both Travis and locally. -->

.github/workflows/ci.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
release:
8+
types: [ published ]
9+
pull_request:
10+
branches:
11+
- '**'
12+
13+
env:
14+
PRIMARY_NODE_VERSION: 16.x
15+
PRIMARY_OS: ubuntu-latest
16+
REGISTRY: https://registry.npmjs.org/
17+
18+
jobs:
19+
test:
20+
name: CI
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
matrix:
24+
os: [ ubuntu-latest ]
25+
node-version: [ 6.x, 8.x, 10.x, 12.x, 14.x, 16.x ]
26+
27+
steps:
28+
29+
- name: Echo env variables
30+
run: |
31+
echo ref: ${{ github.event.client_payload.ref || github.ref }}
32+
echo sha: ${{ github.event.client_payload.sha || github.sha }}
33+
echo head ref: ${{ github.event.client_payload.head_ref || github.head_ref }}
34+
echo base ref: ${{ github.event.client_payload.base_ref || github.base_ref }}
35+
echo action: ${{ github.action }}
36+
echo event: ${{ github.event_name }}
37+
38+
- uses: actions/checkout@v2
39+
name: Checkout
40+
with:
41+
ref: ${{ github.event.client_payload.ref || github.ref }}
42+
43+
- name: Use Node.js ${{ matrix.node-version }}
44+
uses: actions/setup-node@v2
45+
with:
46+
node-version: ${{ matrix.node-version }}
47+
48+
- name: Get npm cache directory
49+
id: npm-cache-dir
50+
run: |
51+
echo "::set-output name=dir::$(npm config get cache)"
52+
53+
- uses: actions/cache@v2
54+
id: npm-cache
55+
with:
56+
path: ${{ steps.npm-cache-dir.outputs.dir }}
57+
key: ${{ matrix.os }}-${{ matrix.node-version }}-node
58+
restore-keys: |
59+
${{ matrix.os }}-${{ matrix.node-version }}-node
60+
61+
- name: Install dependencies and build
62+
run: |
63+
npm install
64+
npm run build
65+
66+
- name: Snyk security check
67+
if: matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS
68+
uses: snyk/actions/node@master
69+
env:
70+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
71+
72+
- name: Run unit tests with coverage
73+
if: matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS
74+
uses: paambaati/[email protected]
75+
env:
76+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
77+
with:
78+
coverageCommand: npm run cover
79+
80+
- name: Run unit tests
81+
if: "!(matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS)"
82+
run: npm run mocha
83+
84+
publish_version:
85+
name: Publish
86+
runs-on: ${{ matrix.os }}
87+
strategy:
88+
matrix:
89+
os: [ ubuntu-latest ]
90+
node-version: [ 6.x ]
91+
needs: [ test ]
92+
if: github.event_name == 'release' && github.event.action == 'published'
93+
steps:
94+
95+
- name: Checkout
96+
uses: actions/checkout@v2
97+
98+
- name: fetch
99+
run: |
100+
git fetch --prune --unshallow
101+
102+
- name: Use Node.js ${{ matrix.node-version }}
103+
uses: actions/setup-node@v2
104+
with:
105+
node-version: ${{ matrix.node-version }}
106+
registry-url: ${{ env.REGISTRY }}
107+
108+
- name: Get npm cache directory
109+
id: npm-cache-dir
110+
run: |
111+
echo "::set-output name=dir::$(npm config get cache)"
112+
113+
- uses: actions/cache@v2
114+
id: npm-cache
115+
with:
116+
path: ${{ steps.npm-cache-dir.outputs.dir }}
117+
key: ${{ matrix.os }}-${{ matrix.node-version }}-node
118+
restore-keys: |
119+
${{ matrix.os }}-${{ matrix.node-version }}-node
120+
121+
- name: Install dependencies and build
122+
run: |
123+
npm install
124+
npm run build
125+
126+
- name: Publish
127+
uses: JS-DevTools/npm-publish@v1
128+
with:
129+
token: ${{ secrets.NPM_AUTH_TOKEN }}
130+
registry: ${{ env.REGISTRY }}

.travis.yml

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

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44
## Development
55
- nothing yet
66

7+
## [v3.1.1](https://github.com/regevbr/busywait.js/compare/v3.1.0...v3.1.1)
8+
### Fixed
9+
- Support for node 16
10+
11+
712
## [v3.1.0](https://github.com/regevbr/busywait.js/compare/v3.0.0...v3.1.0)
813
### Added
914
- Added total delay information to the checked function call

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
[![Npm Version](https://img.shields.io/npm/v/busywait.svg?style=popout)](https://www.npmjs.com/package/busywait)
2-
[![Build Status](https://travis-ci.org/regevbr/busywait.js.svg?branch=master)](https://travis-ci.org/regevbr/busywait.js)
3-
[![Coverage Status](https://coveralls.io/repos/github/regevbr/busywait.js/badge.svg?branch=master)](https://coveralls.io/github/regevbr/busywait.js?branch=master)
4-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/58abd1713b064f4c9af7dc88d7178ebe)](https://www.codacy.com/app/regevbr/busywait.js?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=regevbr/busywait.js&amp;utm_campaign=Badge_Grade)
1+
[![Npm Version](https://img.shields.io/npm/v/busywait.js.svg?style=popout)](https://www.npmjs.com/package/busywait.js)
2+
[![node](https://img.shields.io/node/v-lts/busywait.js)](https://www.npmjs.com/package/busywait.js)
3+
[![Build status](https://github.com/regevbr/busywait.js/actions/workflows/ci.yml/badge.svg?branch=master)](https://www.npmjs.com/package/busywait.js)
4+
[![Test Coverage](https://api.codeclimate.com/v1/badges/5cc9e9fe4871a315f2aa/test_coverage)](https://codeclimate.com/github/regevbr/busywait.js/test_coverage)
5+
[![Maintainability](https://api.codeclimate.com/v1/badges/5cc9e9fe4871a315f2aa/maintainability)](https://codeclimate.com/github/regevbr/busywait.js/maintainability)
56
[![Known Vulnerabilities](https://snyk.io/test/github/regevbr/busywait.js/badge.svg?targetFile=package.json)](https://snyk.io/test/github/regevbr/busywait.js?targetFile=package.json)
6-
[![dependencies Status](https://david-dm.org/regevbr/busywait.js/status.svg)](https://david-dm.org/regevbr/busywait.js)
7-
[![devDependencies Status](https://david-dm.org/regevbr/busywait.js/dev-status.svg)](https://david-dm.org/regevbr/busywait.js?type=dev)
87

98
# busywait.js
109

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "busywait",
3-
"version": "3.1.0",
3+
"version": "3.1.1",
44
"description": "Async busy wait",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -38,7 +38,7 @@
3838
"backoff-strategy"
3939
],
4040
"engines": {
41-
"node": "^6 || ^8 || ^10 || ^12 || ^14"
41+
"node": "^6 || ^8 || ^10 || ^12 || ^14 || ^16"
4242
},
4343
"files": [
4444
"/dist/*.d.ts",

0 commit comments

Comments
 (0)