Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies to supported DMN v1.3 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ gulpfile.js
/_archive/*
/utils/dev/*
dummy.js
node_modules
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# About

dmn-eval-js is a Javascript rule engine to execute decision tables according to the [DMN](http://www.omg.org/spec/DMN/1.1/) standard.
dmn-eval-js is a Javascript rule engine to execute decision tables according to the [DMN](http://www.omg.org/spec/DMN/1.3/) standard.
This implementation is based on [FEEL by EdgeVerve](https://github.com/EdgeVerve/feel). It is tailored to evaluation of
simple expression language (S-FEEL), plus some cherry-picked parts of FEEL.

Expand Down Expand Up @@ -143,7 +143,7 @@ Function implementation should be free of side-effects. Date and time instances

#### Built-in functions

dmn-eval-js supports the following built-in functions from DMN 1.1:
dmn-eval-js supports the following built-in functions from DMN 1.3:
- string functions: ```starts with, ends with, contains, upper case, lower case```
- boolean functions: ```not```
- list functions: ```list contains, count, min, max, sum, mean, and, or, append, concatenate, insert before, remove, reverse, index of, union, distinct values, flatten```
Expand Down Expand Up @@ -345,4 +345,4 @@ npm run lintfix

For comprehensive set of documentation on DMN, you can refer to :

[DMN Specification Document](http://www.omg.org/spec/DMN/1.1/)
[DMN Specification Document](http://www.omg.org/spec/DMN/1.3/)
12 changes: 1 addition & 11 deletions dist/feel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 36 additions & 36 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ const log = label => {
return through.obj(log);
};

gulp.task('lint', () => {
return gulp.src(['**/*.js','!node_modules/**'])
.pipe(log('linting'))
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('src:lint', ()=>{
return gulp.src(['src/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('initialize:feel', () => gulp.src('./grammar/feel-initializer.js')
.pipe(insert.transform((contents, file) => {
let initializer_start = '{ \n',
Expand All @@ -41,44 +56,44 @@ gulp.task('initialize:feel', () => gulp.src('./grammar/feel-initializer.js')
}))
.pipe(gulp.dest('./temp')));

gulp.task('concat:feel', ['initialize:feel'], () => gulp.src(['./temp/feel-initializer.js', './grammar/feel.pegjs'])
gulp.task('concat:feel', gulp.series('initialize:feel', () => gulp.src(['./temp/feel-initializer.js', './grammar/feel.pegjs'])
.pipe(concat('feel.pegjs'))
.pipe(gulp.dest('./src/')));
.pipe(gulp.dest('./src/'))));


gulp.task('clean:temp', ['initialize:feel', 'concat:feel'], () => gulp.src('./temp', {
gulp.task('clean:temp', gulp.series('initialize:feel', 'concat:feel', () => gulp.src('./temp', {
read: false,
})
.pipe(clean()));
.pipe(clean())));

gulp.task('clean:dist:feel', ['src:lint'], () => gulp.src('./dist/feel.js', {
gulp.task('clean:dist:feel', gulp.series('src:lint', () => gulp.src('./dist/feel.js', {
read: false,
})
.pipe(clean()));
.pipe(clean())));

gulp.task('clean:dist:feel:ast', ['src:lint'], () => gulp.src('./dist/feel-ast*.js', {
gulp.task('clean:dist:feel:ast', gulp.series('src:lint', () => gulp.src('./dist/feel-ast*.js', {
read: false,
})
.pipe(clean()));
.pipe(clean())));

gulp.task('clean:src:feel', () => gulp.src('./src/feel.pegjs', {
read: false,
})
.pipe(clean()));

gulp.task('generate:parser',['clean:dist:feel'], () => gulp.src('src/feel.pegjs')
gulp.task('generate:parser',gulp.series('clean:dist:feel', () => gulp.src('src/feel.pegjs')
.pipe(peg({
format: 'commonjs',
cache: true,
allowedStartRules: ["Start", "SimpleExpressions", "SimpleUnaryTests"]
}))
.pipe(gulp.dest('./dist')));
.pipe(gulp.dest('./dist'))));

gulp.task('dist:feel:ast', ['clean:dist:feel:ast'], () => gulp.src('src/feel-ast.js')
.pipe(gulp.dest('./dist')));
gulp.task('dist:feel:ast', gulp.series('clean:dist:feel:ast', () => gulp.src('src/feel-ast.js')
.pipe(gulp.dest('./dist'))));

gulp.task('dist:feel:ast:parser', ['clean:dist:feel:ast'], () => gulp.src('src/feel-ast-parser.js')
.pipe(gulp.dest('./dist')));
gulp.task('dist:feel:ast:parser', gulp.series('clean:dist:feel:ast', () => gulp.src('src/feel-ast-parser.js')
.pipe(gulp.dest('./dist'))));


gulp.task('mocha', () => gulp.src(['test/*.js'], {
Expand All @@ -90,21 +105,6 @@ gulp.task('mocha', () => gulp.src(['test/*.js'], {
.on('error', gutil.log));


gulp.task('lint', () => {
return gulp.src(['**/*.js','!node_modules/**'])
.pipe(log('linting'))
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('src:lint', ()=>{
return gulp.src(['src/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('utils:lint', ()=>{
return gulp.src(['utils/*.js'])
.pipe(eslint())
Expand All @@ -118,7 +118,7 @@ gulp.task('pre-test-ci', function () {
.pipe(istanbul.hookRequire());
});

gulp.task('test-ci', ['pre-test-ci'], function () {
gulp.task('test-ci', gulp.series('pre-test-ci', function () {
return gulp.src(['test/**/*.spec.js'])
.pipe(mocha())
.pipe(istanbul.writeReports({
Expand All @@ -127,9 +127,9 @@ gulp.task('test-ci', ['pre-test-ci'], function () {
reportOpts: { dir: './coverage' }
}))
.pipe(istanbul.enforceThresholds({ thresholds:{ global: {statements: 85, branches: 70, lines: 85, functions: 90 }} }));
});
}));

gulp.task('test-ci-html', ['pre-test-ci'], function () {
gulp.task('test-ci-html', gulp.series('pre-test-ci', function () {
return gulp.src(['test/**/*.spec.js'])
.pipe(mocha())
.pipe(istanbul.writeReports({
Expand All @@ -138,13 +138,13 @@ gulp.task('test-ci-html', ['pre-test-ci'], function () {
reportOpts: { dir: './coverage' }
}))
.pipe(istanbul.enforceThresholds({ thresholds:{ global: {statements: 85, branches: 70, lines: 85, functions: 90 }} }));
});
}));

gulp.task('build', ['initialize:feel', 'clean:src:feel', 'concat:feel', 'clean:temp']);
gulp.task('build', gulp.series('initialize:feel', 'clean:src:feel', 'concat:feel', 'clean:temp'));

gulp.task('generate', ['generate:parser']);
gulp.task('generate', gulp.series('generate:parser'));

gulp.task('default', ['build', 'generate', 'mocha']);
gulp.task('default', gulp.series('build', 'generate', 'mocha'));

gulp.task('watch', () => {
gulp.watch('./grammar/*', ['build']);
Expand Down
Loading