Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"airbnb-base"
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"plugins": [
"promise"
"promise",
"import"
],
"rules": {
"no-param-reassign": 0
"no-param-reassign": "off",
"lines-between-class-members": "off",
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/require-await": "off"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
- run: npm ci
- run: npm run lint
- run: npm run test
- run: npm run coverage
- name: Coveralls
if: matrix.node-version == '16.x'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ node_modules
coverage
*/config/local.js
.nyc_output
build
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ A small rule engine for Node.

![main workflow](https://github.com/frankthelen/rools/actions/workflows/main.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/frankthelen/rools/badge.svg?branch=master)](https://coveralls.io/github/frankthelen/rools?branch=master)
[![dependencies Status](https://david-dm.org/frankthelen/rools/status.svg)](https://david-dm.org/frankthelen/rools)
![Dependency Status](https://img.shields.io/librariesio/release/npm/rools)
[![Maintainability](https://api.codeclimate.com/v1/badges/d1f858c321b03000fc63/maintainability)](https://codeclimate.com/github/frankthelen/rools/maintainability)
[![node](https://img.shields.io/node/v/rools.svg)](https://nodejs.org)
[![code style](https://img.shields.io/badge/code_style-airbnb-brightgreen.svg)](https://github.com/airbnb/javascript)
[![Types](https://img.shields.io/npm/types/rools.svg)](https://www.npmjs.com/package/rools)
[![License Status](http://img.shields.io/npm/l/rools.svg)]()
![Types](https://img.shields.io/npm/types/rools)
![Module](https://img.shields.io/badge/module-hybrid%20cjs%2Fesm-blue)
![License Status](https://img.shields.io/npm/l/rools)

*Primary goal* was to provide a nice and state-of-the-art interface for modern JavaScript (ES6).
*Facts* are plain JavaScript or JSON objects or objects from ES6 classes with getters and setters.
Expand All @@ -19,7 +20,11 @@ A small rule engine for Node.

Mission accomplished! JavaScript rocks!

See [migration info](#migration) for breaking changes between major versions 1.x.x and 2.x.x.
* TypeScript -- types included
* CommonsJS (cjs) -- supporting Node 12+
* ES Modules (esm) -- supporting Node 14+

See [migration info](#migration) for breaking changes from previous major versions.

## Install

Expand Down Expand Up @@ -500,6 +505,25 @@ For this module to work, your **TypeScript compiler options** must include

## Migration

### Version 2.x.x to Version 3.x.x

Dropped Node 10 support.

Everything was converted from ES6 to TypeScript.
All tests were converted from Mocha/Chai/Sinon to Jest.
Both, mostly just for the fun of it.

The goal was to provide Rools as a *hybrid package*
utilizing multiple TypeScript targets and conditional exports:

* TypeScript -- types included (as before)
* CommonsJS (cjs) -- supporting Node 12+ (as before -- but dropping Node 10)
* ES Modules (esm) -- supporting Node 14+ (new)

Everything should work as before -- *no breaking changes*.
But since nearly everything was touched, as a precaution,
I have created a new major version.

### Version 1.x.x to Version 2.x.x

There are a few breaking changes that require changes to your code.
Expand Down
22 changes: 22 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export default {
clearMocks: true,
collectCoverage: true,
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: [
'/node_modules/',
'/config/',
'/test/',
],
coverageProvider: 'v8',
coverageThreshold: {
global: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: '/test/.*\\.test\\.ts$',
};
Loading