Skip to content

Commit 53f66b1

Browse files
authored
Merge pull request #387 from chris-pardy/tools-update
Tools update
2 parents ae8fa05 + 3527791 commit 53f66b1

File tree

132 files changed

+8722
-7864
lines changed

Some content is hidden

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

132 files changed

+8722
-7864
lines changed

Diff for: .babelrc

-3
This file was deleted.

Diff for: .github/workflows/deploy.yml

+20-21
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,37 @@ name: Deploy Package
55

66
on:
77
push:
8-
branches: [ master, v6 ]
8+
branches: [ master, v6, v8 ]
99

1010
jobs:
1111
build:
12-
1312
runs-on: ubuntu-latest
1413

1514
strategy:
1615
matrix:
1716
node-version: [18.x, 20.x, 22.x]
1817

1918
steps:
20-
- uses: actions/checkout@v2
21-
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v1
23-
with:
24-
node-version: ${{ matrix.node-version }}
25-
- run: npm install
26-
- run: npm run build --if-present
27-
- run: npm run lint
28-
- run: npm test
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- run: npm install
25+
- run: npm run build --if-present
26+
- run: npm run lint
27+
- run: npm test
2928
deploy:
3029
needs: build
3130
runs-on: ubuntu-latest
3231
steps:
33-
- uses: actions/checkout@v2
34-
- uses: actions/setup-node@v1
35-
with:
36-
node-version: 18.x
37-
- run: npm install
38-
- run: npm run build --if-present
39-
# https://github.com/marketplace/actions/npm-publish
40-
- uses: JS-DevTools/npm-publish@v2
41-
with:
42-
token: ${{ secrets.NPM_TOKEN }}
32+
- uses: actions/checkout@v2
33+
- uses: actions/setup-node@v1
34+
with:
35+
node-version: 18.x
36+
- run: npm install
37+
- run: npm run build --if-present
38+
# https://github.com/marketplace/actions/npm-publish
39+
- uses: JS-DevTools/npm-publish@v2
40+
with:
41+
token: ${{ secrets.NPM_TOKEN }}

Diff for: .github/workflows/node.js.yml

+10-11
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,23 @@ name: Node.js CI
55

66
on:
77
pull_request:
8-
branches: [ master, v6 ]
8+
branches: [ master, v6, v8 ]
99

1010
jobs:
1111
build:
12-
1312
runs-on: ubuntu-latest
1413

1514
strategy:
1615
matrix:
1716
node-version: [18.x, 20.x, 22.x]
1817

1918
steps:
20-
- uses: actions/checkout@v2
21-
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v1
23-
with:
24-
node-version: ${{ matrix.node-version }}
25-
- run: npm install
26-
- run: npm run build --if-present
27-
- run: npm run lint
28-
- run: npm test
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- run: npm install
25+
- run: npm run build --if-present
26+
- run: npm run lint
27+
- run: npm test

Diff for: CHANGELOG.md

+123-81
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,209 @@
11
#### 6.1.0 / 2021-06-03
2-
* engine.removeRule() now supports removing rules by name
3-
* Added engine.updateRule(rule)
2+
3+
- engine.removeRule() now supports removing rules by name
4+
- Added engine.updateRule(rule)
45

56
#### 6.0.1 / 2021-03-09
6-
* Updates Typescript types to include `failureEvents` in EngineResult.
7+
8+
- Updates Typescript types to include `failureEvents` in EngineResult.
79

810
#### 6.0.0 / 2020-12-22
9-
* BREAKING CHANGES
10-
* To continue using [selectn](https://github.com/wilmoore/selectn.js) syntax for condition `path`s, use the new `pathResolver` feature. Read more [here](./docs/rules.md#condition-helpers-custom-path-resolver). Add the following to the engine constructor:
11-
```js
12-
const pathResolver = (object, path) => {
13-
return selectn(path)(object)
14-
}
15-
const engine = new Engine(rules, { pathResolver })
16-
```
17-
(fixes #205)
18-
* Engine and Rule events `on('success')`, `on('failure')`, and Rule callbacks `onSuccess` and `onFailure` now honor returned promises; any event handler that returns a promise will be waited upon to resolve before engine execution continues. (fixes #235)
19-
* Private `rule.event` property renamed. Use `rule.getEvent()` to avoid breaking changes in the future.
20-
* The `success-events` fact used to store successful events has been converted to an internal data structure and will no longer appear in the almanac's facts. (fixes #187)
21-
* NEW FEATURES
22-
* Engine constructor now accepts a `pathResolver` option for resolving condition `path` properties. Read more [here](./docs/rules.md#condition-helpers-custom-path-resolver). (fixes #210)
23-
* Engine.run() now returns three additional data structures:
24-
* `failureEvents`, an array of all failed rules events. (fixes #192)
25-
* `results`, an array of RuleResults for each successful rule (fixes #216)
26-
* `failureResults`, an array of RuleResults for each failed rule
2711

12+
- BREAKING CHANGES
13+
- To continue using [selectn](https://github.com/wilmoore/selectn.js) syntax for condition `path`s, use the new `pathResolver` feature. Read more [here](./docs/rules.md#condition-helpers-custom-path-resolver). Add the following to the engine constructor:
14+
```js
15+
const pathResolver = (object, path) => {
16+
return selectn(path)(object);
17+
};
18+
const engine = new Engine(rules, { pathResolver });
19+
```
20+
(fixes #205)
21+
- Engine and Rule events `on('success')`, `on('failure')`, and Rule callbacks `onSuccess` and `onFailure` now honor returned promises; any event handler that returns a promise will be waited upon to resolve before engine execution continues. (fixes #235)
22+
- Private `rule.event` property renamed. Use `rule.getEvent()` to avoid breaking changes in the future.
23+
- The `success-events` fact used to store successful events has been converted to an internal data structure and will no longer appear in the almanac's facts. (fixes #187)
24+
- NEW FEATURES
25+
- Engine constructor now accepts a `pathResolver` option for resolving condition `path` properties. Read more [here](./docs/rules.md#condition-helpers-custom-path-resolver). (fixes #210)
26+
- Engine.run() now returns three additional data structures:
27+
- `failureEvents`, an array of all failed rules events. (fixes #192)
28+
- `results`, an array of RuleResults for each successful rule (fixes #216)
29+
- `failureResults`, an array of RuleResults for each failed rule
2830
2931
#### 5.3.0 / 2020-12-02
30-
* Allow facts to have a value of `undefined`
32+
33+
- Allow facts to have a value of `undefined`
3134
3235
#### 5.2.0 / 2020-11-31
33-
* No changes; published to correct an accidental publish of untagged alpha
36+
37+
- No changes; published to correct an accidental publish of untagged alpha
3438
3539
#### 5.0.4 / 2020-09-26
36-
* Upgrade dependencies to latest
40+
41+
- Upgrade dependencies to latest
3742
3843
#### 5.0.3 / 2020-01-26
39-
* Upgrade jsonpath-plus dependency, to fix inconsistent scalar results (#175)
44+
45+
- Upgrade jsonpath-plus dependency, to fix inconsistent scalar results (#175)
4046
4147
#### 5.0.2 / 2020-01-18
42-
* BUGFIX: Add missing `DEBUG` log for almanac.addRuntimeFact()
48+
49+
- BUGFIX: Add missing `DEBUG` log for almanac.addRuntimeFact()
4350
4451
#### 5.0.1 / 2020-01-18
45-
* BUGFIX: `DEBUG` envs works with cookies disables
52+
53+
- BUGFIX: `DEBUG` envs works with cookies disables
4654
4755
#### 5.0.0 / 2019-11-29
48-
* BREAKING CHANGES
49-
* Rule conditions' `path` property is now interpreted using [json-path](https://goessner.net/articles/JsonPath/)
50-
* To continue using the old syntax (provided via [selectn](https://github.com/wilmoore/selectn.js)), `npm install selectn` as a direct dependency, and `json-rules-engine` will continue to interpret legacy paths this way.
51-
* Any path starting with `$` will be assumed to use `json-path` syntax
56+
57+
- BREAKING CHANGES
58+
- Rule conditions' `path` property is now interpreted using [json-path](https://goessner.net/articles/JsonPath/)
59+
- To continue using the old syntax (provided via [selectn](https://github.com/wilmoore/selectn.js)), `npm install selectn` as a direct dependency, and `json-rules-engine` will continue to interpret legacy paths this way.
60+
- Any path starting with `$` will be assumed to use `json-path` syntax
5261

5362
#### 4.1.0 / 2019-09-27
54-
* Export Typescript definitions (@brianphillips)
63+
64+
- Export Typescript definitions (@brianphillips)
5565

5666
#### 4.0.0 / 2019-08-22
57-
* BREAKING CHANGES
58-
* `engine.run()` now returns a hash of events and almanac: `{ events: [], almanac: Almanac instance }`. Previously in v3, the `run()` returned the `events` array.
59-
* For example, `const events = await engine.run()` under v3 will need to be changed to `const { events } = await engine.run()` under v4.
67+
68+
- BREAKING CHANGES
69+
- `engine.run()` now returns a hash of events and almanac: `{ events: [], almanac: Almanac instance }`. Previously in v3, the `run()` returned the `events` array.
70+
- For example, `const events = await engine.run()` under v3 will need to be changed to `const { events } = await engine.run()` under v4.
6071

6172
#### 3.1.0 / 2019-07-19
62-
* Feature: `rule.setName()` and `ruleResult.name`
73+
74+
- Feature: `rule.setName()` and `ruleResult.name`
6375

6476
#### 3.0.3 / 2019-07-15
65-
* Fix "localStorage.debug" not working in browsers
77+
78+
- Fix "localStorage.debug" not working in browsers
6679

6780
#### 3.0.2 / 2019-05-23
68-
* Fix "process" not defined error in browsers lacking node.js global shims
81+
82+
- Fix "process" not defined error in browsers lacking node.js global shims
6983

7084
#### 3.0.0 / 2019-05-17
71-
* BREAKING CHANGES
72-
* Previously all conditions with undefined facts would resolve false. With this change, undefined facts values are treated as `undefined`.
73-
* Greatly improved performance of `allowUndefinedfacts = true` engine option
74-
* Reduce package bundle size by ~40%
85+
86+
- BREAKING CHANGES
87+
- Previously all conditions with undefined facts would resolve false. With this change, undefined facts values are treated as `undefined`.
88+
- Greatly improved performance of `allowUndefinedfacts = true` engine option
89+
- Reduce package bundle size by ~40%
7590

7691
#### 2.3.5 / 2019-04-26
77-
* Replace debug with vanilla console.log
92+
93+
- Replace debug with vanilla console.log
7894

7995
#### 2.3.4 / 2019-04-26
80-
* Use Array.isArray instead of instanceof to test Array parameters to address edge cases
96+
97+
- Use Array.isArray instead of instanceof to test Array parameters to address edge cases
8198

8299
#### 2.3.3 / 2019-04-23
83-
* Fix rules cache not clearing after removeRule()
100+
101+
- Fix rules cache not clearing after removeRule()
84102

85103
#### 2.3.2 / 2018-12-28
86-
* Upgrade all dependencies to latest
104+
105+
- Upgrade all dependencies to latest
87106

88107
#### 2.3.1 / 2018-12-03
89-
* IE8 compatibility: replace Array.forEach with for loop (@knalbandianbrightgrove)
108+
109+
- IE8 compatibility: replace Array.forEach with for loop (@knalbandianbrightgrove)
90110

91111
#### 2.3.0 / 2018-05-03
92-
* Engine.removeFact() - removes fact from the engine (@SaschaDeWaal)
93-
* Engine.removeRule() - removes rule from the engine (@SaschaDeWaal)
94-
* Engine.removeOperator() - removes operator from the engine (@SaschaDeWaal)
112+
113+
- Engine.removeFact() - removes fact from the engine (@SaschaDeWaal)
114+
- Engine.removeRule() - removes rule from the engine (@SaschaDeWaal)
115+
- Engine.removeOperator() - removes operator from the engine (@SaschaDeWaal)
95116

96117
#### 2.2.0 / 2018-04-19
97-
* Performance: Constant facts now perform 18-26X better
98-
* Performance: Removes await/async transpilation and json.stringify calls, significantly improving overall performance
118+
119+
- Performance: Constant facts now perform 18-26X better
120+
- Performance: Removes await/async transpilation and json.stringify calls, significantly improving overall performance
99121

100122
#### 2.1.0 / 2018-02-19
101-
* Publish dist updates for 2.0.3
123+
124+
- Publish dist updates for 2.0.3
102125

103126
#### 2.0.3 / 2018-01-29
104-
* Add factResult and result to the JSON generated for Condition (@bjacobso)
127+
128+
- Add factResult and result to the JSON generated for Condition (@bjacobso)
105129

106130
#### 2.0.2 / 2017-07-24
107-
* Bugfix IE8 support
131+
132+
- Bugfix IE8 support
108133

109134
#### 2.0.1 / 2017-07-05
110-
* Bugfix rule result serialization
135+
136+
- Bugfix rule result serialization
111137

112138
#### 2.0.0 / 2017-04-21
113-
* Publishing 2.0.0
139+
140+
- Publishing 2.0.0
114141

115142
#### 2.0.0-beta2 / 2017-04-10
116-
* Fix fact path object checking to work with objects that have prototypes (lodash isObjectLike instead of isPlainObject)
143+
144+
- Fix fact path object checking to work with objects that have prototypes (lodash isObjectLike instead of isPlainObject)
117145

118146
#### 2.0.0-beta1 / 2017-04-09
119-
* Add rule results
120-
* Document fact .path ability to parse properties containing dots
121-
* Bump dependencies
122-
* BREAKING CHANGES
123-
* `engine.on('failure', (rule, almanac))` is now `engine.on('failure', (event, almanac, ruleResult))`
124-
* `engine.on(eventType, (eventParams, engine))` is now `engine.on(eventType, (eventParams, almanac, ruleResult))`
147+
148+
- Add rule results
149+
- Document fact .path ability to parse properties containing dots
150+
- Bump dependencies
151+
- BREAKING CHANGES
152+
- `engine.on('failure', (rule, almanac))` is now `engine.on('failure', (event, almanac, ruleResult))`
153+
- `engine.on(eventType, (eventParams, engine))` is now `engine.on(eventType, (eventParams, almanac, ruleResult))`
125154

126155
#### 1.5.1 / 2017-03-19
127-
* Bugfix almanac.factValue skipping interpreting condition "path" for cached facts
156+
157+
- Bugfix almanac.factValue skipping interpreting condition "path" for cached facts
128158

129159
#### 1.5.0 / 2017-03-12
130-
* Add fact comparison conditions
160+
161+
- Add fact comparison conditions
131162

132163
#### 1.4.0 / 2017-01-23
133-
* Add `allowUndefinedFacts` engine option
164+
165+
- Add `allowUndefinedFacts` engine option
134166

135167
#### 1.3.1 / 2017-01-16
136-
* Bump object-hash dependency to latest
168+
169+
- Bump object-hash dependency to latest
137170

138171
#### 1.3.0 / 2016-10-24
139-
* Rule event emissions
140-
* Rule chaining
172+
173+
- Rule event emissions
174+
- Rule chaining
141175

142176
#### 1.2.1 / 2016-10-22
143-
* Use Array.indexOf instead of Array.includes for older node version compatibility
177+
178+
- Use Array.indexOf instead of Array.includes for older node version compatibility
144179

145180
#### 1.2.0 / 2016-09-13
146-
* Fact path support
181+
182+
- Fact path support
147183

148184
#### 1.1.0 / 2016-09-11
149-
* Custom operator support
185+
186+
- Custom operator support
150187

151188
#### 1.0.4 / 2016-06-18
152-
* fix issue #6; runtime facts unique to each run()
189+
190+
- fix issue #6; runtime facts unique to each run()
153191

154192
#### 1.0.3 / 2016-06-15
155-
* fix issue #5; dependency error babel-core/register
193+
194+
- fix issue #5; dependency error babel-core/register
156195

157196
#### 1.0.0 / 2016-05-01
158-
* api stable; releasing 1.0
159-
* engine.run() now returns triggered events
197+
198+
- api stable; releasing 1.0
199+
- engine.run() now returns triggered events
160200

161201
#### 1.0.0-beta10 / 2016-04-16
162-
* Completed the 'fact-dependecy' advanced example
163-
* Updated addFact and addRule engine methods to return 'this' for easy chaining
202+
203+
- Completed the 'fact-dependecy' advanced example
204+
- Updated addFact and addRule engine methods to return 'this' for easy chaining
164205

165206
#### 1.0.0-beta9 / 2016-04-11
166-
* Completed the 'basic' example
167-
* [BREAKING CHANGE] update engine.on('success') and engine.on('failure') to pass the current almanac instance as the second argument, rather than the engine
207+
208+
- Completed the 'basic' example
209+
- [BREAKING CHANGE] update engine.on('success') and engine.on('failure') to pass the current almanac instance as the second argument, rather than the engine

0 commit comments

Comments
 (0)