@modernpoacher/rules-runner 2.2.2 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,24 +30,10 @@ const presets = [
30
30
  ]
31
31
  ]
32
32
 
33
- const plugins = [
34
- '@babel/proposal-export-default-from',
35
- [
36
- 'module-resolver', {
37
- alias: {
38
- '@modernpoacher/rules-runner': './src'
39
- }
40
- }
41
- ]
42
- ]
43
-
44
33
  module.exports = (api) => {
45
34
  if (api) api.cache.using(env)
46
35
 
47
36
  return {
48
- compact: true,
49
- comments: false,
50
- presets,
51
- plugins
37
+ presets
52
38
  }
53
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/rules-runner",
3
- "version": "2.2.2",
3
+ "version": "2.3.1",
4
4
  "description": "A business rules engine for Node",
5
5
  "keywords": [
6
6
  "business rules",
@@ -10,8 +10,8 @@
10
10
  "rules engine",
11
11
  "business rules engine"
12
12
  ],
13
- "main": "./index.js",
14
- "types": "./index.d.ts",
13
+ "main": "./src/index.mjs",
14
+ "type": "module",
15
15
  "author": "Jonathan Perry for Modern Poacher Limited <modernpoacher@modernpoacher.com>",
16
16
  "contributors": [
17
17
  {
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "engines": {
30
- "node": ">=16.13.0"
30
+ "node": ">=18.5.0"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",
@@ -38,40 +38,35 @@
38
38
  "url": "http://github.com/modernpoacher/rules-runner/issues"
39
39
  },
40
40
  "scripts": {
41
- "prepublishOnly": "cross-env NODE_ENV=production npm run build",
42
- "prebuild": "npm run clean",
43
- "build": "npm run babel",
44
- "build:watch": "npm run babel:watch",
45
- "clean": "rimraf lib",
46
- "babel": "babel src -d lib",
47
- "babel:watch": "npm run babel -- -w",
48
- "lint": "eslint src test *.js",
41
+ "lint": "eslint src test --ext .mjs --ext .cjs --ext .mts --ext .cts",
49
42
  "lint:fix": "npm run lint -- --fix",
50
- "test": "cross-env NODE_ENV=test mocha test --recursive -r @babel/register"
43
+ "test": "cross-env NODE_ENV=test mocha test --recursive",
44
+ "prepare": "npx husky install"
51
45
  },
52
46
  "dependencies": {
53
47
  "debug": "^4.3.4",
54
48
  "object-path": "^0.11.8"
55
49
  },
56
50
  "devDependencies": {
57
- "@babel/cli": "^7.21.5",
58
51
  "@babel/core": "^7.21.8",
59
52
  "@babel/eslint-parser": "^7.21.8",
60
- "@babel/plugin-proposal-export-default-from": "^7.18.10",
61
53
  "@babel/preset-env": "^7.21.5",
62
- "@babel/register": "^7.21.0",
63
- "@modernpoacher/hooks": "^1.0.392",
64
- "babel-plugin-module-resolver": "^5.0.0",
54
+ "@modernpoacher/hooks": "^1.0.401",
55
+ "@typescript-eslint/eslint-plugin": "^5.59.5",
56
+ "@typescript-eslint/parser": "^5.59.5",
65
57
  "chai": "^4.3.7",
66
58
  "cross-env": "^7.0.3",
67
- "eslint": "^8.39.0",
59
+ "eslint": "^8.40.0",
68
60
  "eslint-config-standard": "^17.0.0",
69
- "eslint-import-resolver-babel-module": "^5.3.2",
61
+ "eslint-config-standard-with-typescript": "^34.0.1",
70
62
  "eslint-plugin-import": "^2.27.5",
71
63
  "eslint-plugin-node": "^11.1.0",
72
64
  "eslint-plugin-promise": "^6.1.1",
73
65
  "husky": "^8.0.3",
74
- "mocha": "^10.2.0",
75
- "rimraf": "^5.0.0"
66
+ "mocha": "^10.2.0"
67
+ },
68
+ "imports": {
69
+ "#rules-runner/common": "./src/common/index.mjs",
70
+ "#rules-runner": "./src/index.mjs"
76
71
  }
77
72
  }
@@ -1,6 +1,6 @@
1
1
  import debug from 'debug'
2
2
 
3
- const log = debug('@modernpoacher/rules-runner:common')
3
+ const log = debug('@modernpoacher/rules-runner/common')
4
4
 
5
5
  log('`rules-runner` is awake')
6
6
 
@@ -1,6 +1,6 @@
1
1
  import debug from 'debug'
2
2
 
3
- const log = debug('@modernpoacher/rules-runner:comparators:all-of')
3
+ const log = debug('@modernpoacher/rules-runner/comparators/all-of')
4
4
 
5
5
  log('`allOf` is awake')
6
6
 
@@ -1,6 +1,6 @@
1
1
  import debug from 'debug'
2
2
 
3
- const log = debug('@modernpoacher/rules-runner:comparators:any-of')
3
+ const log = debug('@modernpoacher/rules-runner/comparators/any-of')
4
4
 
5
5
  log('`anyOf` is awake')
6
6
 
@@ -1,8 +1,8 @@
1
1
  import debug from 'debug'
2
2
 
3
- import { toNumber } from '@modernpoacher/rules-runner/common'
3
+ import { toNumber } from '#rules-runner/common'
4
4
 
5
- const log = debug('@modernpoacher/rules-runner:comparators:between')
5
+ const log = debug('@modernpoacher/rules-runner/comparators/between')
6
6
 
7
7
  log('`between` is awake')
8
8
 
@@ -1,8 +1,8 @@
1
1
  import debug from 'debug'
2
2
 
3
- import { toBoolean } from '@modernpoacher/rules-runner/common'
3
+ import { toBoolean } from '#rules-runner/common'
4
4
 
5
- const log = debug('@modernpoacher/rules-runner:comparators:boolean')
5
+ const log = debug('@modernpoacher/rules-runner/comparators/boolean')
6
6
 
7
7
  log('`boolean` is awake')
8
8
 
@@ -1,8 +1,8 @@
1
1
  import debug from 'debug'
2
2
 
3
- import { toString } from '@modernpoacher/rules-runner/common'
3
+ import { toString } from '#rules-runner/common'
4
4
 
5
- const log = debug('@modernpoacher/rules-runner:comparators:contains')
5
+ const log = debug('@modernpoacher/rules-runner/comparators/contains')
6
6
 
7
7
  log('`contains` is awake')
8
8
 
@@ -1,6 +1,6 @@
1
1
  import debug from 'debug'
2
2
 
3
- const log = debug('@modernpoacher/rules-runner:comparators:equals')
3
+ const log = debug('@modernpoacher/rules-runner/comparators/equals')
4
4
 
5
5
  log('`equals` is awake')
6
6
 
@@ -1,8 +1,8 @@
1
1
  import debug from 'debug'
2
2
 
3
- import { toNumber } from '@modernpoacher/rules-runner/common'
3
+ import { toNumber } from '#rules-runner/common'
4
4
 
5
- const log = debug('@modernpoacher/rules-runner:comparators:greater-than')
5
+ const log = debug('@modernpoacher/rules-runner/comparators/greater-than')
6
6
 
7
7
  log('`greaterThan` is awake')
8
8
 
@@ -0,0 +1,11 @@
1
+ export { default as between } from './between.mjs'
2
+ export { default as boolean } from './boolean.mjs'
3
+ export { default as contains } from './contains.mjs'
4
+ export { default as equals } from './equals.mjs'
5
+ export { default as anyOf } from './any-of.mjs'
6
+ export { default as allOf } from './all-of.mjs'
7
+ export { default as oneOf } from './one-of.mjs'
8
+ export { default as greaterThan } from './greater-than.mjs'
9
+ export { default as lessThan } from './less-than.mjs'
10
+ export { default as matches } from './matches.mjs'
11
+ export { default as not } from './not.mjs'
@@ -1,8 +1,8 @@
1
1
  import debug from 'debug'
2
2
 
3
- import { toNumber } from '@modernpoacher/rules-runner/common'
3
+ import { toNumber } from '#rules-runner/common'
4
4
 
5
- const log = debug('@modernpoacher/rules-runner:comparators:less-than')
5
+ const log = debug('@modernpoacher/rules-runner/comparators/less-than')
6
6
 
7
7
  log('`lessThan` is awake')
8
8
 
@@ -1,8 +1,8 @@
1
1
  import debug from 'debug'
2
2
 
3
- import { toRegExp, toString } from '@modernpoacher/rules-runner/common'
3
+ import { toRegExp, toString } from '#rules-runner/common'
4
4
 
5
- const log = debug('@modernpoacher/rules-runner:comparators:matches')
5
+ const log = debug('@modernpoacher/rules-runner/comparators/matches')
6
6
 
7
7
  log('`matches` is awake')
8
8
 
@@ -1,6 +1,6 @@
1
1
  import debug from 'debug'
2
2
 
3
- const log = debug('@modernpoacher/rules-runner:comparators:not')
3
+ const log = debug('@modernpoacher/rules-runner/comparators/not')
4
4
 
5
5
  log('`not` is awake')
6
6
 
@@ -1,6 +1,6 @@
1
1
  import debug from 'debug'
2
2
 
3
- const log = debug('@modernpoacher/rules-runner:comparators:one-of')
3
+ const log = debug('@modernpoacher/rules-runner/comparators/one-of')
4
4
 
5
5
  log('`oneOf` is awake')
6
6
 
@@ -1,11 +1,13 @@
1
1
  import debug from 'debug'
2
2
 
3
3
  import objectPath from 'object-path'
4
+
4
5
  import {
5
6
  isBoolean,
6
7
  isObject
7
- } from './common'
8
- import * as comparators from './comparators'
8
+ } from './common/index.mjs'
9
+
10
+ import * as comparators from './comparators/index.mjs'
9
11
 
10
12
  const log = debug('@modernpoacher/rules-runner')
11
13
 
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npx cross-env DEBUG=@modernpoacher/hooks* node .husky/post-commit.mjs
@@ -1,8 +0,0 @@
1
- module.exports = (
2
- import('@modernpoacher/hooks')
3
- .then(({
4
- postCommit
5
- }) => (
6
- postCommit()
7
- ))
8
- )
@@ -1,5 +0,0 @@
1
- import {
2
- postCommit
3
- } from '@modernpoacher/hooks'
4
-
5
- export default postCommit()
package/.husky/pre-commit DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npm run lint
5
- git add *.js
package/index.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./lib')
@@ -1,11 +0,0 @@
1
- export { default as between } from './between'
2
- export { default as boolean } from './boolean'
3
- export { default as contains } from './contains'
4
- export { default as equals } from './equals'
5
- export { default as anyOf } from './any-of'
6
- export { default as allOf } from './all-of'
7
- export { default as oneOf } from './one-of'
8
- export { default as greaterThan } from './greater-than'
9
- export { default as lessThan } from './less-than'
10
- export { default as matches } from './matches'
11
- export { default as not } from './not'
File without changes