Skip to content

Commit

Permalink
Resolved npm vulnerabilities (#153)
Browse files Browse the repository at this point in the history
The only way I found for resolving npm audit warnings was by forcing the usage of the latest version of the `gulp-parent` dependency.

For that I've used a new `override` support in Node v8: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides

Here is the output from `npm audit` after the change:
![image](https://user-images.githubusercontent.com/34246760/176778632-0ad02fc3-b392-4b7e-b0e2-092ac3b6560b.png)

I've also updated the license header of the jquery-validation-unobtrusive.js file so that it is aligned with our current (MIT) license as well as is written in JSDoc style, as that's what the new gulp-uglify dependency requires. Otherwise, the license comments will be stripped out from the generated `.min.js` file.

Keeping this as `draft` for now to validate the fix before actually proceeding with merging, given that I've updated the dependencies to their latest versions.

** Validation **
Did some basic validation and it works:
<img width="617" alt="image" src="https://user-images.githubusercontent.com/34246760/176960882-76a24951-c619-45c8-ba91-8b7c8ca32b87.png">
  • Loading branch information
mkArtakMSFT authored Jul 5, 2022
1 parent 19f88bf commit 5e49a4a
Show file tree
Hide file tree
Showing 5 changed files with 5,430 additions and 884 deletions.
9 changes: 6 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ function minifyjs() {
.pipe(replace(/@version.*/, '@version v' + pkg.version))
.pipe(gulp.dest("dist"))
.pipe(uglify({
preserveComments: 'license'
mangle: true,
output: {
comments: "some"
}
}))
.pipe(lec({eolc: 'CRLF'}))
.pipe(rename({suffix: '.min'}))
.pipe(lec({ eolc: 'CRLF' }))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest("dist"));
}

Expand Down
Loading

0 comments on commit 5e49a4a

Please sign in to comment.