Skip to content

Commit 230d1e8

Browse files
author
vamsee
committed
Fix lint issues, updated version and deps
1 parent 92f257c commit 230d1e8

File tree

10 files changed

+297
-302
lines changed

10 files changed

+297
-302
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ npm-debug.log
77
.vscode
88
*.njsproj
99
*.sln
10+
package-lock.json
1011

1112
# Coveralls
1213
coverage

gulpfile.js

Lines changed: 82 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
const gulp = require('gulp');
99
const concat = require('gulp-concat');
10-
const watch = require('gulp-watch');
10+
// const watch = require('gulp-watch');
1111
const insert = require('gulp-insert');
1212
const clean = require('gulp-clean');
1313
const peg = require('./utils/dev/gulp-pegjs');
@@ -34,121 +34,116 @@ const log = label => {
3434
};
3535

3636
gulp.task('initialize:feel', () => gulp.src('./grammar/feel-initializer.js')
37-
.pipe(insert.transform((contents, file) => {
38-
let initializer_start = '{ \n',
39-
initializer_end = '\n }';
40-
return initializer_start + contents + initializer_end;
41-
}))
42-
.pipe(gulp.dest('./temp')));
43-
44-
gulp.task('concat:feel', ['initialize:feel'], () => gulp.src(['./temp/feel-initializer.js', './grammar/feel.pegjs'])
45-
.pipe(concat('feel.pegjs'))
46-
.pipe(gulp.dest('./src/')));
47-
48-
49-
gulp.task('clean:temp', ['initialize:feel', 'concat:feel'], () => gulp.src('./temp', {
50-
read: false,
51-
})
52-
.pipe(clean()));
53-
54-
gulp.task('clean:dist:feel', ['src:lint'], () => gulp.src('./dist/feel.js', {
55-
read: false,
56-
})
57-
.pipe(clean()));
58-
59-
gulp.task('clean:dist:feel:ast', ['src:lint'], () => gulp.src('./dist/feel-ast*.js', {
60-
read: false,
61-
})
62-
.pipe(clean()));
63-
64-
gulp.task('clean:src:feel', () => gulp.src('./src/feel.pegjs', {
65-
read: false,
66-
})
67-
.pipe(clean()));
68-
69-
gulp.task('generate:parser',['clean:dist:feel', 'concat:feel'], () => gulp.src('src/feel.pegjs')
70-
.pipe(peg({
71-
format: 'commonjs',
72-
cache: true,
73-
allowedStartRules: ["Start", "SimpleExpressions", "UnaryTests", "SimpleUnaryTests"]
74-
}))
75-
.pipe(gulp.dest('./dist')));
76-
77-
gulp.task('dist:feel:ast', ['clean:dist:feel:ast'], () => gulp.src('src/feel-ast.js')
78-
.pipe(gulp.dest('./dist')));
79-
80-
gulp.task('dist:feel:ast:parser', ['clean:dist:feel:ast'], () => gulp.src('src/feel-ast-parser.js')
81-
.pipe(gulp.dest('./dist')));
82-
83-
84-
gulp.task('mocha', () => gulp.src(['test/*.js'], {
85-
read: false,
86-
})
87-
.pipe(mocha({
88-
reporter: 'list',
89-
}))
90-
.on('error', gutil.log));
91-
37+
.pipe(insert.transform((contents, file) => {
38+
let initializer_start = '{ \n',
39+
initializer_end = '\n }';
40+
return initializer_start + contents + initializer_end;
41+
}))
42+
.pipe(gulp.dest('./temp')));
43+
44+
// gulp.task('concat:feel', ['initialize:feel']
45+
gulp.task('concat:feel', () => gulp.src(['./temp/feel-initializer.js', './grammar/feel.pegjs'])
46+
.pipe(concat('feel.pegjs'))
47+
.pipe(gulp.dest('./src/')));
48+
49+
// gulp.task('clean:temp', ['initialize:feel', 'concat:feel']
50+
gulp.task('clean:temp', () => gulp.src('./temp', {read: false})
51+
.pipe(clean()));
52+
53+
// gulp.task('clean:dist:feel', ['src:lint']
54+
gulp.task('clean:dist:feel', () => gulp.src('./dist/feel.js', {read: false})
55+
.pipe(clean()));
56+
57+
// gulp.task('clean:dist:feel:ast', ['src:lint']
58+
gulp.task('clean:dist:feel:ast', () => gulp.src('./dist/feel-ast*.js', {read: false})
59+
.pipe(clean()));
60+
61+
gulp.task('clean:src:feel', () => gulp.src('./src/feel.pegjs', {read: false})
62+
.pipe(clean()));
63+
64+
// gulp.task('generate:parser', ['clean:dist:feel', 'concat:feel']
65+
gulp.task('generate:parser', () => gulp.src('src/feel.pegjs')
66+
.pipe(peg({
67+
format: 'commonjs',
68+
cache: true,
69+
allowedStartRules: ["Start", "SimpleExpressions", "UnaryTests", "SimpleUnaryTests"]
70+
}))
71+
.pipe(gulp.dest('./dist')));
72+
73+
// gulp.task('dist:feel:ast', ['clean:dist:feel:ast']
74+
gulp.task('dist:feel:ast', () => gulp.src('src/feel-ast.js')
75+
.pipe(gulp.dest('./dist')));
76+
77+
// gulp.task('dist:feel:ast:parser', ['clean:dist:feel:ast']
78+
gulp.task('dist:feel:ast:parser', () => gulp.src('src/feel-ast-parser.js')
79+
.pipe(gulp.dest('./dist')));
80+
81+
gulp.task('mocha', () => gulp.src(['test/*.js'], {read: false})
82+
.pipe(mocha({reporter: 'list'}))
83+
.on('error', gutil.log));
9284

9385
gulp.task('lint', () => {
94-
return gulp.src(['**/*.js','!node_modules/**'])
95-
.pipe(log('linting'))
96-
.pipe(eslint())
97-
.pipe(eslint.format())
98-
.pipe(eslint.failAfterError());
86+
return gulp.src(['**/*.js', '!node_modules/**'])
87+
.pipe(log('linting'))
88+
.pipe(eslint())
89+
.pipe(eslint.format())
90+
.pipe(eslint.failAfterError());
9991
});
10092

101-
gulp.task('src:lint', ()=>{
93+
gulp.task('src:lint', () => {
10294
return gulp.src(['src/*.js'])
103-
.pipe(eslint())
104-
.pipe(eslint.format())
105-
.pipe(eslint.failAfterError());
95+
.pipe(eslint())
96+
.pipe(eslint.format())
97+
.pipe(eslint.failAfterError());
10698
});
10799

108-
gulp.task('utils:lint', ()=>{
100+
gulp.task('utils:lint', () => {
109101
return gulp.src(['utils/*.js'])
110-
.pipe(eslint())
111-
.pipe(eslint.format())
112-
.pipe(eslint.failAfterError());
102+
.pipe(eslint())
103+
.pipe(eslint.format())
104+
.pipe(eslint.failAfterError());
113105
});
114106

115107
gulp.task('pre-test-ci', function () {
116-
return gulp.src(['./dist/**/*.js','./utils/**/*.js','!./dist/**/feel.js','!./utils/**/index.js'])
108+
return gulp.src(['./dist/**/*.js', './utils/**/*.js', '!./dist/**/feel.js', '!./utils/**/index.js'])
117109
.pipe(istanbul())
118110
.pipe(istanbul.hookRequire());
119111
});
120112

121-
gulp.task('test-ci', ['pre-test-ci'], function () {
113+
gulp.task('test-ci', gulp.series('pre-test-ci', function () {
122114
return gulp.src(['test/**/*.spec.js'])
123115
.pipe(mocha())
124116
.pipe(istanbul.writeReports({
125117
dir: './coverage',
126-
reporters: [ 'lcovonly'],
118+
reporters: ['lcovonly'],
127119
reportOpts: { dir: './coverage' }
128120
}))
129-
.pipe(istanbul.enforceThresholds({ thresholds:{ global: {statements: 85, branches: 70, lines: 85, functions: 90 }} }));
130-
});
121+
.pipe(istanbul.enforceThresholds({ thresholds: { global: { statements: 85, branches: 70, lines: 85, functions: 90 } } }));
122+
}));
131123

132-
gulp.task('test-ci-html', ['pre-test-ci'], function () {
124+
gulp.task('test-ci-html', gulp.series('pre-test-ci', function () {
133125
return gulp.src(['test/**/*.spec.js'])
134126
.pipe(mocha())
135127
.pipe(istanbul.writeReports({
136128
dir: './coverage',
137-
reporters: [ 'lcov'],
129+
reporters: ['lcov'],
138130
reportOpts: { dir: './coverage' }
139131
}))
140-
.pipe(istanbul.enforceThresholds({ thresholds:{ global: {statements: 85, branches: 70, lines: 85, functions: 90 }} }));
141-
});
132+
.pipe(istanbul.enforceThresholds({ thresholds: { global: { statements: 85, branches: 70, lines: 85, functions: 90 } } }));
133+
}));
142134

143-
gulp.task('build', ['initialize:feel', 'clean:src:feel', 'concat:feel', 'clean:temp']);
135+
// ['initialize:feel', 'clean:src:feel', 'concat:feel', 'clean:temp']
136+
gulp.task('build', gulp.series('initialize:feel', 'clean:src:feel', 'concat:feel', 'clean:temp'));
144137

145-
gulp.task('default', ['build', 'generate:parser', 'mocha']);
138+
// ['build', 'generate:parser', 'mocha']
139+
gulp.task('default', gulp.series('initialize:feel', 'clean:src:feel', 'src:lint', 'concat:feel', 'clean:temp', 'clean:dist:feel', 'generate:parser', 'mocha'));
146140

147-
gulp.task('watch', () => {
148-
gulp.watch('./grammar/*', ['build']);
149-
gulp.watch('./src/*.pegjs',['generate:parser']);
150-
gulp.watch('./src/*.js', ['dist:feel:ast', 'dist:feel:ast:parser']);
151-
gulp.watch('./utils/**/*.js', ['utils:lint']);
152-
});
141+
// gulp.task('watch', () => {
142+
// gulp.watch('./grammar/*', ['build']);
143+
// gulp.watch('./src/*.pegjs', ['generate:parser']);
144+
// gulp.watch('./src/*.js', ['dist:feel:ast', 'dist:feel:ast:parser']);
145+
// gulp.watch('./utils/**/*.js', ['utils:lint']);
146+
// });
153147

154-
gulp.task('dist', ['build', 'dist:feel:ast', 'dist:feel:ast:parser', 'generate:parser']);
148+
// ['build', 'dist:feel:ast', 'dist:feel:ast:parser', 'generate:parser']
149+
gulp.task('dist', gulp.series('initialize:feel', 'clean:src:feel', 'src:lint', 'concat:feel', 'clean:temp', 'clean:dist:feel', 'generate:parser', 'clean:dist:feel:ast', 'dist:feel:ast', 'dist:feel:ast:parser'));

package.json

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-feel",
3-
"version": "1.4.4",
3+
"version": "1.4.5",
44
"description": "FEEL(Friendly Enough Expression Language) based on DMN specification 1.1 for conformance level 3",
55
"main": "index.js",
66
"scripts": {
@@ -33,37 +33,36 @@
3333
],
3434
"author": "Pragyan Das <[email protected]>",
3535
"dependencies": {
36-
"big.js": "^3.1.3",
37-
"bunyan": "^1.8.12",
38-
"lodash": "^4.17.4",
39-
"moment": "^2.18.1",
40-
"moment-timezone": "^0.5.13",
41-
"xlsx": "^0.8.0"
36+
"big.js": "3.2.0",
37+
"bunyan": "1.8.12",
38+
"lodash": "4.17.15",
39+
"moment": "2.24.0",
40+
"moment-timezone": "0.5.27",
41+
"xlsx": "0.8.8"
4242
},
4343
"devDependencies": {
44-
"chai": "^3.5.0",
45-
"chalk": "^1.1.3",
46-
"eslint": "^3.19.0",
47-
"eslint-config-airbnb": "^14.1.0",
48-
"eslint-plugin-import": "^2.2.0",
49-
"eslint-plugin-jsx-a11y": "^4.0.0",
50-
"eslint-plugin-react": "^6.9.0",
51-
"gulp": "^3.9.1",
52-
"gulp-clean": "^0.3.2",
53-
"gulp-concat": "^2.6.1",
54-
"gulp-eslint": "^3.0.1",
55-
"gulp-if": "^2.0.2",
56-
"gulp-insert": "^0.5.0",
57-
"gulp-istanbul": "^1.1.1",
58-
"gulp-mocha": "^3.0.1",
59-
"gulp-util": "^3.0.8",
60-
"gulp-watch": "^4.3.11",
61-
"istanbul": "^0.4.5",
62-
"minimist": "^1.2.0",
63-
"mocha": "^3.2.0",
64-
"pegjs": "^0.10.0",
65-
"pegjs-backtrace": "^0.1.1",
66-
"pre-commit": "^1.2.2",
67-
"through2": "^2.0.3"
44+
"chai": "3.4.1",
45+
"chalk": "1.1.1",
46+
"eslint": "4.10.0",
47+
"eslint-config-airbnb": "14.1.0",
48+
"eslint-plugin-import": "2.20.0",
49+
"eslint-plugin-jsx-a11y": "4.0.0",
50+
"eslint-plugin-react": "6.10.3",
51+
"gulp": "4.0.2",
52+
"gulp-clean": "0.3.2",
53+
"gulp-concat": "2.6.1",
54+
"gulp-eslint": "3.0.1",
55+
"gulp-if": "2.0.2",
56+
"gulp-insert": "0.5.0",
57+
"gulp-istanbul": "1.1.3",
58+
"gulp-mocha": "7.0.2",
59+
"gulp-util": "3.0.8",
60+
"istanbul": "0.4.5",
61+
"minimist": "1.2.0",
62+
"mocha": "5.2.0",
63+
"pegjs": "0.10.0",
64+
"pegjs-backtrace": "0.1.2",
65+
"pre-commit": "1.2.2",
66+
"through2": "2.0.5"
6867
}
6968
}

0 commit comments

Comments
 (0)