diff --git a/.snyk b/.snyk new file mode 100644 index 0000000..5813c60 --- /dev/null +++ b/.snyk @@ -0,0 +1,63 @@ +# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. +version: v1.13.5 +# ignores vulnerabilities until expiry date; change duration by modifying expiry date +ignore: + 'npm:shell-quote:20160621': + - laravel-elixir > browserify > shell-quote: + reason: None given + expires: '2016-10-01T19:17:18.705Z' +# patches apply the minimum changes required to fix a vulnerability +patch: + 'npm:minimatch:20160620': + - laravel-elixir > browserify > glob > minimatch: + patched: '2016-09-01T19:17:18.824Z' + - laravel-elixir > gulp-phpunit > gulp > vinyl-fs > glob-stream > minimatch: + patched: '2016-09-01T19:17:18.824Z' + - laravel-elixir > gulp-phpunit > gulp > vinyl-fs > glob-stream > glob > minimatch: + patched: '2016-09-01T19:17:18.824Z' + - laravel-elixir > gulp-if > gulp-match > minimatch: + patched: '2016-09-01T19:17:18.824Z' + - laravel-elixir > gulp-phpunit > gulp > vinyl-fs > glob-watcher > gaze > globule > minimatch: + patched: '2016-09-01T19:17:18.824Z' + - laravel-elixir > gulp-phpunit > gulp > vinyl-fs > glob-watcher > gaze > globule > glob > minimatch: + patched: '2016-09-01T19:17:18.824Z' + 'npm:ms:20170412': + - laravel-elixir > browser-sync > serve-static > send > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > connect > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > serve-index > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > localtunnel > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io > socket.io-parser > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io-client > socket.io-parser > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io > socket.io-client > socket.io-parser > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io > socket.io-adapter > socket.io-parser > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > connect > finalhandler > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io > engine.io > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io > socket.io-adapter > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io-client > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io > socket.io-client > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io-client > engine.io-client > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > socket.io > socket.io-client > engine.io-client > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + - laravel-elixir > browser-sync > serve-static > send > debug > ms: + patched: '2017-05-25T03:56:22.137Z' + SNYK-JS-HTTPSPROXYAGENT-469131: + - snyk > proxy-agent > https-proxy-agent: + patched: '2019-10-10T02:13:47.742Z' + - snyk > proxy-agent > pac-proxy-agent > https-proxy-agent: + patched: '2019-10-10T02:13:47.742Z' diff --git a/README.md b/README.md index 486501c..2f28dfc 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ -# laravel-elixir-jscs -Laravel Elixir JSCS Extension +# Laravel Elixir JSCS Extension + +This is a fork from [chipbell4/laravel-elixir-jscs](https://github.com/chipbell4/laravel-elixir-jscs) with update to use new Laravel Elixir API + +## Install +``` +$ npm install --save-dev laravel-elixir-jscs-wrapper +``` + +## Usage + +```js +require('laravel-elixir-jscs-wrapper'); + +elixir(function(mix) { + mix.jscs(['assets/my-assets/js/**/*.js']. { + 'configPath': __dirname + '/.jscsrc' + }); +}); +``` + +Create `.jscsrc` with your settings follow [jscs options](http://jscs.info/overview#options) diff --git a/index.js b/index.js index 3d99522..035f706 100644 --- a/index.js +++ b/index.js @@ -20,13 +20,14 @@ elixir.extend('jscs', function(src, options) { // default options options = options || {}; - // Setup the task - gulp.task('jscs', function() { - return gulp.src(files) - .pipe(jscs(options)) - }); + new elixir.Task('jscs', function () { + + // Setup the task + return gulp.task('jscs', function() { - // register the task to actually run via elixir - this.registerWatcher('jscs', files); - return this.queueTask('jscs'); + return gulp.src(files) + .pipe(jscs(options)) + .pipe(jscs.reporter()); + }); + }); }); diff --git a/package.json b/package.json index 943d1b1..b1d6215 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,23 @@ { - "name": "laravel-elixir-jscs", - "version": "1.0.0", + "name": "laravel-elixir-jscs-wrapper", + "version": "2.0.0", "description": "Laravel Elixir JSCS Extension", "main": "index.js", "dependencies": { - "gulp-jscs": "^1.6.0", - "laravel-elixir": "^2.3.12", - "gulp-notify": "^2.2.0" + "gulp-jscs": "2.0.0", + "laravel-elixir": "4.0.1", + "gulp-notify": "^2.2.0", + "snyk": "^1.234.0" }, "devDependencies": {}, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "snyk-protect": "snyk protect", + "prepublish": "npm run snyk-protect" }, "repository": { "type": "git", - "url": "https://github.com/chipbell4/laravel-elixir-jscs.git" + "url": "https://github.com/NicolasPio/laravel-elixir-jscs-wrapper" }, "keywords": [ "laravel", @@ -22,10 +25,11 @@ "jscs", "gulp" ], - "author": "Chip Bell", + "author": "Nicolas Pio", "license": "MIT", "bugs": { - "url": "https://github.com/chipbell4/laravel-elixir-jscs/issues" + "url": "https://github.com/NicolasPio/laravel-elixir-jscs-wrapper/issues" }, - "homepage": "https://github.com/chipbell4/laravel-elixir-jscs" -} + "homepage": "https://github.com/NicolasPio/laravel-elixir-jscs-wrapper", + "snyk": true +} \ No newline at end of file