From 19145b920bcf50b463a452ddd6837911e8e7c959 Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Thu, 13 Oct 2016 22:59:09 +0300 Subject: [PATCH] feat(debug): replacing deprecated gulp-node-inspector with vanilla node-inspector --- Dockerfile | 4 ++-- docker-compose.yml | 1 + gulpfile.js | 27 +++++---------------------- package.json | 5 ++--- 4 files changed, 10 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index 96bcb27e3b..342ce6d987 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,8 @@ FROM ubuntu:latest MAINTAINER MEAN.JS -# 80 = HTTP, 443 = HTTPS, 3000 = MEAN.JS server, 35729 = livereload -EXPOSE 80 443 3000 35729 +# 80 = HTTP, 443 = HTTPS, 3000 = MEAN.JS server, 35729 = livereload, 8080 = node-inspector +EXPOSE 80 443 3000 35729 8080 # Set development environment as default ENV NODE_ENV development diff --git a/docker-compose.yml b/docker-compose.yml index 6fbe2d6ff2..5461f79fe7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ services: ports: - "3000:3000" - "5858:5858" + - "8080:8080" - "35729:35729" environment: - NODE_ENV=development diff --git a/gulpfile.js b/gulpfile.js index bb99496a68..deca1aefa1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -51,33 +51,16 @@ gulp.task('nodemon', function () { script: 'server.js', nodeArgs: ['--debug'], ext: 'js,html', + verbose: true, watch: _.union(defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config) }); }); -gulp.task('node-inspector', function() { - gulp.src([]) - .pipe(plugins.nodeInspector({ - debugPort: 5858, - webHost: '0.0.0.0', - webPort: 1337, - saveLiveEdit: false, - preload: true, - inject: true, - hidden: [], - stackTraceLimit: 50, - sslKey: '', - sslCert: '' - })); -}); - -// Nodemon debug task -gulp.task('nodemon-debug', function () { +// Nodemon task without verbosity or debugging +gulp.task('nodemon-nodebug', function () { return plugins.nodemon({ script: 'server.js', - nodeArgs: ['--debug'], ext: 'js,html', - verbose: true, watch: _.union(defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config) }); }); @@ -463,10 +446,10 @@ gulp.task('default', function (done) { // Run the project in debug mode gulp.task('debug', function (done) { - runSequence('env:dev', ['copyLocalEnvConfig', 'makeUploadsDir'], 'lint', ['node-inspector', 'nodemon-debug', 'watch'], done); + runSequence('env:dev', ['copyLocalEnvConfig', 'makeUploadsDir'], 'lint', ['nodemon-nodebug', 'watch'], done); }); // Run the project in production mode gulp.task('prod', function (done) { - runSequence(['copyLocalEnvConfig', 'makeUploadsDir', 'templatecache'], 'build', 'env:prod', 'lint', ['nodemon', 'watch'], done); + runSequence(['copyLocalEnvConfig', 'makeUploadsDir', 'templatecache'], 'build', 'env:prod', 'lint', ['nodemon-nodebug', 'watch'], done); }); diff --git a/package.json b/package.json index e211ec687d..4ee47e6781 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "update": "npm update && npm prune && bower install --allow-root && bower prune --allow-root", "start": "gulp", "start:prod": "gulp prod", - "start:debug": "gulp debug", + "start:debug": "node-debug --web-host 0.0.0.0 server.js & gulp debug", "gulp": "gulp", "lint": "gulp lint", "test": "gulp test", @@ -92,7 +92,6 @@ "gulp-load-plugins": "~1.3.0", "gulp-mocha": "~3.0.1", "gulp-ng-annotate": "~2.0.0", - "gulp-node-inspector": "~0.1.0", "gulp-nodemon": "~2.2.1", "gulp-protractor": "~3.0.0", "gulp-rename": "~1.2.2", @@ -111,7 +110,7 @@ "karma-phantomjs-launcher": "~1.0.0", "lcov-result-merger": "~1.2.0", "mock-fs": "~3.11.0", - "node-inspector": "~0.12.7", + "node-inspector": "~0.12.8", "run-sequence": "~1.2.2", "semver": "~5.3.0", "should": "~11.1.0",