Skip to content

Commit b2efd94

Browse files
authored
feat: add node 24 support (#39)
1 parent 7c62ee9 commit b2efd94

8 files changed

Lines changed: 818 additions & 771 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- '**'
1212

1313
env:
14-
PRIMARY_NODE_VERSION: 18.x
14+
PRIMARY_NODE_VERSION: 24.x
1515
PRIMARY_OS: ubuntu-latest
1616
REGISTRY: https://registry.npmjs.org/
1717

@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
os: [ ubuntu-latest ]
25-
node-version: [ 14.x, 16.x, 18.x, 20.x ]
25+
node-version: [ 18.x, 20.x, 22.x, 24.x ]
2626

2727
steps:
2828

@@ -50,7 +50,7 @@ jobs:
5050
run: |
5151
echo "::set-output name=dir::$(yarn cache dir)"
5252
53-
- uses: actions/cache@v2
53+
- uses: actions/cache@v4
5454
id: yarn-cache
5555
with:
5656
path: ${{ steps.yarn-cache-dir.outputs.dir }}
@@ -76,11 +76,14 @@ jobs:
7676
7777
- name: Run unit tests with coverage
7878
if: matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS
79-
uses: paambaati/codeclimate-action@v2.7.5
80-
env:
81-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
79+
run: yarn test:cover
80+
81+
- name: Upload coverage
82+
if: matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS
83+
uses: qltysh/qlty-action/coverage@v2
8284
with:
83-
coverageCommand: yarn test:cover
85+
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
86+
files: coverage/lcov.info
8487

8588
- name: Run unit tests
8689
if: "!(matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS)"
@@ -92,7 +95,7 @@ jobs:
9295
strategy:
9396
matrix:
9497
os: [ ubuntu-latest ]
95-
node-version: [ 18.x ]
98+
node-version: [ 24.x ]
9699
needs: [ test ]
97100
if: github.event_name == 'release' && github.event.action == 'published'
98101
steps:
@@ -115,7 +118,7 @@ jobs:
115118
run: |
116119
echo "::set-output name=dir::$(yarn cache dir)"
117120
118-
- uses: actions/cache@v2
121+
- uses: actions/cache@v4
119122
id: yarn-cache
120123
with:
121124
path: ${{ steps.yarn-cache-dir.outputs.dir }}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[![Npm Version](https://img.shields.io/npm/v/json-expression-eval.svg?style=popout)](https://www.npmjs.com/package/json-expression-eval)
22
[![node](https://img.shields.io/node/v-lts/json-expression-eval)](https://www.npmjs.com/package/json-expression-eval)
33
[![Build status](https://github.com/regevbr/json-expression-eval/actions/workflows/ci.yml/badge.svg?branch=master)](https://www.npmjs.com/package/json-expression-eval)
4-
[![Test Coverage](https://api.codeclimate.com/v1/badges/5cc9e9fe4871a315f2aa/test_coverage)](https://codeclimate.com/github/regevbr/json-expression-eval/test_coverage)
5-
[![Maintainability](https://api.codeclimate.com/v1/badges/5cc9e9fe4871a315f2aa/maintainability)](https://codeclimate.com/github/regevbr/json-expression-eval/maintainability)
4+
[![Code Coverage](https://qlty.sh/gh/regevbr/projects/json-expression-eval/coverage.svg)](https://qlty.sh/gh/regevbr/projects/json-expression-eval)
5+
[![Maintainability](https://qlty.sh/gh/regevbr/projects/json-expression-eval/maintainability.svg)](https://qlty.sh/gh/regevbr/projects/json-expression-eval)
66
[![Known Vulnerabilities](https://snyk.io/test/github/regevbr/json-expression-eval/badge.svg?targetFile=package.json)](https://snyk.io/test/github/regevbr/json-expression-eval?targetFile=package.json)
77

88
# json-expression-eval (and rule engine)

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "json-expression-eval",
3-
"version": "7.1.0",
3+
"version": "8.0.0",
44
"description": "json serializable rule engine / boolean expression evaluator",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"engines": {
8-
"node": "^14 || ^16 || ^18 || ^20"
8+
"node": "^18 || ^20 || ^22 || ^24"
99
},
1010
"scripts": {
1111
"test": "yarn lint && yarn test:tsd && yarn test:cover",
@@ -48,22 +48,22 @@
4848
"directory": "src/test/types"
4949
},
5050
"devDependencies": {
51-
"@istanbuljs/nyc-config-typescript": "1.0.2",
52-
"@types/chai": "^4.3.4",
53-
"@types/chai-as-promised": "^7.1.5",
54-
"@types/mocha": "^10.0.1",
55-
"@types/node": "^18.14.2",
56-
"@types/underscore": "^1.11.4",
57-
"chai": "^4.3.7",
58-
"chai-as-promised": "^7.1.1",
59-
"mocha": "^10.2.0",
60-
"moment": "^2.29.4",
61-
"nyc": "^15.1.0",
51+
"@istanbuljs/nyc-config-typescript": "^1.0.2",
52+
"@types/chai": "4.3.20",
53+
"@types/chai-as-promised": "7.1.8",
54+
"@types/mocha": "^10.0.10",
55+
"@types/node": "^24.10.0",
56+
"@types/underscore": "^1.13.0",
57+
"chai": "4.5.0",
58+
"chai-as-promised": "7.1.2",
59+
"mocha": "^11.7.5",
60+
"moment": "^2.30.1",
61+
"nyc": "^17.1.0",
6262
"source-map-support": "^0.5.21",
63-
"ts-node": "^10.9.1",
64-
"tsd": "^0.25.0",
63+
"ts-node": "^10.9.2",
64+
"tsd": "^0.33.0",
6565
"tslint": "^6.1.3",
66-
"typescript": "^4.9.5"
66+
"typescript": "^5.9.3"
6767
},
6868
"dependencies": {
6969
"ts-toolbelt": "^9.6.0"

src/test/.mocharc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"source-map-support/register"
66
],
77
"recursive": true,
8-
"spec": "src/test/**/*.spec.ts"
8+
"spec": "src/test/**/*.spec.ts",
9+
"extensions": ["ts"]
910
}

src/test/engine.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as chai from 'chai';
22
import {expect} from 'chai';
33
import {ValidationContext, RulesEngine, Rule, validateRules, evaluateRules} from '../';
4-
import * as chaiAsPromised from 'chai-as-promised';
4+
import chaiAsPromised from 'chai-as-promised';
55

66
chai.use(chaiAsPromised);
77

src/test/evaluator.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as chai from 'chai';
22
import {expect} from 'chai';
33
import {evaluate, ExpressionHandler, validate} from '../';
4-
import * as chaiAsPromised from 'chai-as-promised';
4+
import chaiAsPromised from 'chai-as-promised';
55

66
chai.use(chaiAsPromised);
77

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"compilerOptions": {
33
"target": "ES2020",
4-
"module": "none",
4+
"module": "commonjs",
55
"moduleResolution": "node",
6+
"esModuleInterop": true,
67
"sourceMap": true,
78
"declaration": true,
89
"outDir": "./dist",

0 commit comments

Comments
 (0)