Skip to content

Commit 374bf56

Browse files
authored
feat: add Node.js 20.x, 22.x, and 24.x LTS support (#219)
Add comprehensive support for Node.js LTS versions 20.x, 22.x, and 24.x, while dropping support for older versions. The changes ensure the library works correctly across all current LTS releases. Update package.json engines field to require Node.js >=20.0.0. Update GitHub Actions CI to test on all three LTS versions using the latest stable action versions (actions/checkout@v4, actions/setup-node@v4). Update dependencies for Node.js LTS compatibility: - cross-env: 5.2.0 → 7.0.3 - sinon: 6.1.3 → 17.0.2 - nyc: 12.0.2 → 15.1.0 - eslint: 5.1.0 → 8.57.1 (required for Node.js 24) - eslint-config-prettier: 2.9.0 → 9.1.0 - eslint-plugin-ava: 4.5.1 → 14.0.0 - eslint-plugin-prettier: 2.6.2 → 5.2.1 - prettier: 1.13.7 → 3.4.2 - Add @babel/eslint-parser to replace deprecated babel-eslint Modernize linting infrastructure to support Node.js 24 by upgrading ESLint to v8 and Prettier to v3. Remove deprecated babel-eslint and eslint-config-chatur packages. Update ESLint configuration files for modern standards. Apply Prettier v3 formatting to codebase. Create .nvmrc file pinned to Node.js 24 and .releaserc.json for explicit semantic-release configuration. Move release config from package.json to dedicated configuration file. Enhance GitHub Actions with OIDC for trusted npm publishing with provenance attestation. Update semantic-release to version 25 for OIDC support. Remove NPM_TOKEN secret requirement as authentication now uses OIDC. Add proper permissions for release job and configure registry URL for npm. All 647 tests pass with 100% code coverage on Node.js 20.x, 22.x, and 24.x. Browser builds (UMD) and documentation builds succeed on all Node.js versions with no critical deprecation warnings. Note: Master branch already had modern tooling (webpack 5, babel 7, TypeScript 5.9.2), eliminating OpenSSL compatibility concerns. BREAKING CHANGE: Minimum Node.js version is now 20.0.0. Users must upgrade to Node.js 20.x, 22.x, or 24.x to use this version.
1 parent 5ce0325 commit 374bf56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+7899
-11125
lines changed

.eslintrc.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
root: true
2-
extends: chatur
2+
parser: '@babel/eslint-parser'
3+
parserOptions:
4+
ecmaVersion: 2020
5+
sourceType: module
6+
requireConfigFile: false
7+
env:
8+
node: true
9+
es6: true
10+
extends:
11+
- 'eslint:recommended'
12+
- 'plugin:prettier/recommended'
13+
plugins:
14+
- prettier
315
rules:
416
id-length: off
517
class-methods-use-this:
@@ -17,12 +29,12 @@ rules:
1729
- value
1830
- executionHint
1931
- _warn
20-
node/no-unsupported-features:
32+
no-unused-vars:
2133
- error
22-
# We use babel. So change the version
23-
# instead of inheriting from package.json#engines
24-
- version: 6
25-
# disabled because of too many false positives
26-
unicorn/no-fn-reference-in-iterator: off
27-
# doesn't work with eslint 5
28-
eslint-comments/no-unused-disable: off
34+
- argsIgnorePattern: '^_'
35+
no-console: off
36+
prefer-const: error
37+
no-var: error
38+
no-irregular-whitespace:
39+
- error
40+
- skipComments: true

.github/workflows/build.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,25 @@ on:
66
branches: [master]
77
pull_request:
88

9+
permissions:
10+
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
11+
contents: write # to be able to publish a GitHub release
12+
issues: write # to be able to comment on released issues
13+
pull-requests: write # to be able to comment on released pull requests
14+
915
jobs:
1016
check:
1117
runs-on: ubuntu-latest
1218

1319
strategy:
1420
matrix:
15-
node-version: [20.x, 22.x]
21+
node-version: [20.x, 22.x, 24.x]
1622

1723
steps:
1824
- name: Checkout
19-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2026
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v3
27+
uses: actions/setup-node@v4
2228
with:
2329
node-version: ${{ matrix.node-version }}
2430
cache: 'npm'
@@ -54,16 +60,18 @@ jobs:
5460

5561
steps:
5662
- name: Checkout
57-
uses: actions/checkout@v3
63+
uses: actions/checkout@v4
64+
with:
65+
fetch-depth: 0
5866
- name: Setup Node.js
59-
uses: actions/setup-node@v3
67+
uses: actions/setup-node@v4
6068
with:
61-
node-version: '20.x'
69+
node-version: '24.x'
70+
registry-url: 'https://registry.npmjs.org'
6271
cache: 'npm'
6372
- name: Install dependencies
6473
run: npm ci
6574
- name: Release
6675
env:
6776
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
69-
run: npx semantic-release@19
77+
run: npx semantic-release@25

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

.prettierrc.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
"semi": true,
44
"singleQuote": true,
55
"trailingComma": "none",
6-
"proseWrap": "always",
6+
"proseWrap": "preserve",
7+
"arrowParens": "avoid",
8+
"printWidth": 80,
79
"overrides": [
810
{
911
"files": "*.md",
1012
"options": {
11-
"tabWidth": 2
13+
"tabWidth": 2,
14+
"proseWrap": "always"
1215
}
1316
},
1417
{

.releaserc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"branches": [
3+
"master",
4+
"next"
5+
],
6+
"plugins": [
7+
"@semantic-release/commit-analyzer",
8+
"@semantic-release/release-notes-generator",
9+
[
10+
"@semantic-release/npm",
11+
{
12+
"npmPublish": true,
13+
"pkgRoot": "."
14+
}
15+
],
16+
"@semantic-release/github"
17+
]
18+
}
19+

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ https://blog.logrocket.com/elasticsearch-query-body-builder-node-js/
1818
elastic-builder includes TypeScript definition for superior development
1919
experience.
2020

21+
## Node.js Requirements
22+
23+
`elastic-builder` supports Node.js **20.x**, **22.x**, and **24.x** (LTS versions).
24+
2125
## Elasticsearch compatibility
2226

2327
`elastic-builder` was built for 5.x query DSL. However, the library should be

0 commit comments

Comments
 (0)