Skip to content

Commit 4c87efb

Browse files
authored
feat!: Drop support for Node.js < 20 (#944) (#945)
chore: update dependencies and ESLint configuration (#944) chore: update Node.js CI workflow to use latest actions (#944) chore: update ava version and adjust coverage command timeout
1 parent dd35b20 commit 4c87efb

13 files changed

Lines changed: 5200 additions & 12137 deletions

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

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

.github/workflows/node.js.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
jobs:
1616
test:
1717
# https://github.community/t/github-actions-does-not-respect-skip-ci/17325/9
18-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
18+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
1919
runs-on: ubuntu-latest
2020

2121
services:
@@ -31,40 +31,40 @@ jobs:
3131
3232
strategy:
3333
matrix:
34-
node-version: [16.x, 18.x, 20.x, 21.x]
34+
node-version: [20.x, 21.x, 22.x, 23.x, 24.x, 25.x]
3535
include:
36-
- node-version: 18.x
36+
- node-version: 20.x
3737
report-coverage: true
3838

3939
steps:
40-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v6
4141
with:
4242
# For commitlint; ideally this would only check out the feature branch's history, but
4343
# that's not currently an option.
4444
fetch-depth: ${{ github.event_name == 'push' }}
4545
- name: Cache dependencies
4646
id: cache
47-
uses: actions/cache@v2
47+
uses: actions/cache@v4
4848
with:
4949
path: node_modules
5050
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}
5151
- name: Use Node.js ${{ matrix.node-version }} for dependencies
52-
uses: actions/setup-node@v1
52+
uses: actions/setup-node@v6
5353
if: '!steps.cache.outputs.cache-hit'
5454
with:
5555
node-version: ${{ matrix.node-version }}
5656
- name: Install dependencies
5757
if: '!steps.cache.outputs.cache-hit'
5858
run: npm ci
5959
- name: Use Node.js ${{ matrix.node-version }}
60-
uses: actions/setup-node@v1
60+
uses: actions/setup-node@v6
6161
with:
6262
node-version: ${{ matrix.node-version }}
6363
- run: npm run ci --if-present
6464
env:
6565
BEE_QUEUE_TEST_REDIS: redis://localhost:6379
6666
- run: npm run ci:commitlint
67-
if: "github.event_name != 'push' && github.actor != 'dependabot[bot]'"
67+
if: ${{ github.event_name != 'push' && github.actor != 'dependabot[bot]' }}
6868
env:
6969
GITHUB_BASE_REF: ${{ github.event.pull_request.base.ref }}
7070
- name: Report to Coveralls
@@ -75,26 +75,26 @@ jobs:
7575

7676
release:
7777
# https://github.community/t/github-actions-does-not-respect-skip-ci/17325/9
78-
if: "github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]')"
78+
if: ${{ github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]') }}
7979
runs-on: ubuntu-latest
8080

8181
needs: [test]
8282

8383
steps:
84-
- uses: actions/checkout@v2
84+
- uses: actions/checkout@v6
8585
with:
8686
# Necessary to prevent the checkout action from writing credentials to .git/config, which
8787
# semantic-release attempts to use to push despite those credentials being denied the
8888
# push.
8989
# See https://github.com/semantic-release/git/issues/196#issuecomment-601310576.
9090
persist-credentials: false
91-
- name: Use Node.js 18.x
92-
uses: actions/setup-node@v1
91+
- name: Use Node.js 20.x
92+
uses: actions/setup-node@v6
9393
with:
94-
node-version: 18.x
94+
node-version: 20.x
9595
- name: Restore dependencies
9696
id: cache
97-
uses: actions/cache@v2
97+
uses: actions/cache@v4
9898
with:
9999
path: node_modules
100100
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ notes.txt
4343
# Cruft from failed Docker builds
4444
entrypoint.sh
4545
package-min.json
46+
47+
# dotenv environment variables file
48+
.env

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ The `settings` fields are:
333333
- `nearTermWindow`: number, ms; the window during which delayed jobs will be specifically scheduled using `setTimeout` - if all delayed jobs are further out than this window, the Queue will double-check that it hasn't missed any jobs after the window elapses.
334334
- `delayedDebounce`: number, ms; to avoid unnecessary churn for several jobs in short succession, the Queue may delay individual jobs by up to this amount.
335335
- `redis`: object or string, specifies how to connect to Redis. See [`redis.createClient()`](https://github.com/NodeRedis/node_redis#rediscreateclient) for the full set of options.
336-
337336
- `host`: string, Redis host.
338337
- `port`: number, Redis port.
339338
- `socket`: string, Redis socket to be used instead of a host and port.

bee-queue.sublime-project

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
"node_modules",
77
"dist",
88
"coverage",
9-
".nyc_output"
9+
".nyc_output",
1010
],
11-
"file_exclude_patterns": ["package-lock.json"]
12-
}
11+
"file_exclude_patterns": ["package-lock.json"],
12+
},
1313
],
1414
"settings": {
1515
"tab_size": 2,
1616
"ensure_newline_at_eof_on_save": true,
1717
"translate_tabs_to_spaces": true,
1818
"trim_trailing_white_space_on_save": true,
1919
"detect_indentation": false,
20-
"rulers": [80]
21-
}
20+
"rulers": [80],
21+
},
2222
}

eslint.config.js

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
const prettierPlugin = require('eslint-plugin-prettier');
2+
3+
module.exports = [
4+
{
5+
ignores: ['coverage/**'],
6+
},
7+
{
8+
languageOptions: {
9+
ecmaVersion: 2017,
10+
globals: {
11+
__dirname: 'readonly',
12+
__filename: 'readonly',
13+
console: 'readonly',
14+
process: 'readonly',
15+
Buffer: 'readonly',
16+
setImmediate: 'readonly',
17+
clearImmediate: 'readonly',
18+
setTimeout: 'readonly',
19+
clearTimeout: 'readonly',
20+
setInterval: 'readonly',
21+
clearInterval: 'readonly',
22+
require: 'readonly',
23+
module: 'writable',
24+
exports: 'writable',
25+
global: 'readonly',
26+
Promise: 'readonly',
27+
Map: 'readonly',
28+
Set: 'readonly',
29+
Symbol: 'readonly',
30+
WeakMap: 'readonly',
31+
WeakSet: 'readonly',
32+
Reflect: 'readonly',
33+
},
34+
},
35+
plugins: {
36+
prettier: prettierPlugin,
37+
},
38+
rules: {
39+
'prettier/prettier': 'error',
40+
'max-len': ['error', {code: 100}],
41+
'array-bracket-spacing': ['error', 'never'],
42+
'brace-style': ['error', '1tbs'],
43+
camelcase: 'error',
44+
'comma-style': ['error', 'last'],
45+
'computed-property-spacing': ['error', 'never'],
46+
'consistent-this': ['error', 'self'],
47+
curly: ['warn', 'multi-line'],
48+
'dot-notation': 'error',
49+
'eol-last': 'error',
50+
eqeqeq: ['error', 'smart'],
51+
'key-spacing': 'warn',
52+
'new-cap': ['error', {capIsNew: false}],
53+
'no-console': 'warn',
54+
'no-floating-decimal': 'error',
55+
'no-inner-declarations': 'error',
56+
'no-mixed-spaces-and-tabs': 'error',
57+
'no-redeclare': 'error',
58+
'no-shadow': 'warn',
59+
'no-spaced-func': 'error',
60+
'no-trailing-spaces': 'error',
61+
'no-undef': 'error',
62+
'no-underscore-dangle': 'off',
63+
'no-unused-vars': ['error', {vars: 'all', args: 'after-used'}],
64+
'no-use-before-define': ['error', 'nofunc'],
65+
'no-var': 'error',
66+
'no-warning-comments': ['warn', {terms: ['todo'], location: 'anywhere'}],
67+
'object-curly-spacing': ['error', 'never'],
68+
'prefer-const': ['error', {destructuring: 'all'}],
69+
quotes: ['error', 'single'],
70+
semi: ['error', 'always'],
71+
'semi-spacing': ['error', {before: false, after: true}],
72+
'keyword-spacing': 'error',
73+
'space-before-blocks': 'error',
74+
'space-before-function-paren': [
75+
'error',
76+
{anonymous: 'always', named: 'never'},
77+
],
78+
'space-in-parens': 'error',
79+
'space-infix-ops': 'error',
80+
strict: 'off',
81+
},
82+
},
83+
{
84+
files: ['lib/**'],
85+
rules: {
86+
'max-len': ['error', {code: 100}],
87+
},
88+
},
89+
{
90+
files: ['benchmark/**', 'examples/**'],
91+
languageOptions: {
92+
ecmaVersion: 2017,
93+
},
94+
rules: {
95+
'no-console': 'off',
96+
},
97+
},
98+
{
99+
files: ['test/**'],
100+
languageOptions: {
101+
ecmaVersion: 2017,
102+
sourceType: 'module',
103+
},
104+
rules: {
105+
'handle-callback-err': 'warn',
106+
'no-shadow': 'off',
107+
'no-warning-comments': 'off',
108+
},
109+
},
110+
];

lib/queue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,8 @@ class Queue extends Emitter {
737737
status === 'retrying'
738738
? 'failed'
739739
: status === 'failed'
740-
? 'failed:fatal'
741-
: null;
740+
? 'failed:fatal'
741+
: null;
742742
if (emitExtra) this.emit(emitExtra, job, result);
743743
}
744744
}, this._emitErrorAfterTick);

0 commit comments

Comments
 (0)