Debugger autoattach, autorestart services on file change

This commit is contained in:
Juan 2018-11-02 10:48:15 +01:00
parent bb50166e02
commit 375f276ef6
5 changed files with 183 additions and 555 deletions

4
.vscode/launch.json vendored
View File

@ -4,7 +4,9 @@
{ {
"type": "node", "type": "node",
"request": "attach", "request": "attach",
"name": "Attach" "name": "Attach",
"restart": true,
"timeout": 50000
}, { }, {
"type": "node", "type": "node",
"request": "attach", "request": "attach",

View File

@ -21,5 +21,5 @@ window.ngModule = function(moduleName) {
}); });
}; };
var testsContext = require.context('./', true, /\.spec\.js$/); let testsContext = require.context('./', true, /\.spec\.js$/);
testsContext.keys().forEach(testsContext); testsContext.keys().forEach(testsContext);

View File

@ -38,7 +38,7 @@ let defaultPort = proxyConf.defaultPort;
// Development // Development
gulp.task('default', () => { gulp.task('default', () => {
return gulp.start('environment', 'services', 'client'); return gulp.start('services', 'client');
}); });
gulp.task('environment', async () => { gulp.task('environment', async () => {
@ -55,13 +55,13 @@ gulp.task('client', ['build-clean'], async () => {
* Starts all backend services, including the nginx proxy and the database. * Starts all backend services, including the nginx proxy and the database.
*/ */
gulp.task('services', async () => { gulp.task('services', async () => {
await runSequenceP('environment', 'docker-start', 'services-only', 'nginx'); await runSequenceP('docker-start', 'services-only', 'nginx');
}); });
/** /**
* Starts backend services. * Starts backend services.
*/ */
gulp.task('services-only', async () => { gulp.task('services-only', ['environment'], async () => {
const services = await getServices(); const services = await getServices();
for (let service of services) for (let service of services)
require(service.index).start(service.port); require(service.index).start(service.port);
@ -88,13 +88,13 @@ gulp.task('e2e-only', () => {
process.env.E2E_SHOW = true; process.env.E2E_SHOW = true;
return gulp.src('./e2e_tests.js') return gulp.src('./e2e_tests.js')
.pipe(jasmine({reporter: 'none'})); .pipe(jasmine({reporter: 'none'}));
}); });
gulp.task('smokes-only', () => { gulp.task('smokes-only', () => {
const jasmine = require('gulp-jasmine'); const jasmine = require('gulp-jasmine');
return gulp.src('./smokes_tests.js') return gulp.src('./smokes_tests.js')
.pipe(jasmine({reporter: 'none'})); .pipe(jasmine({reporter: 'none'}));
}); });
/** /**
@ -354,10 +354,9 @@ gulp.task('webpack-dev-server', function() {
const webpackConfig = require('./webpack.config.js'); const webpackConfig = require('./webpack.config.js');
let configCopy = Object.create(webpackConfig); let configCopy = Object.create(webpackConfig);
for (let entry in configCopy.entry) { for (let entry in configCopy.entry)
configCopy.entry[entry] configCopy.entry[entry]
.unshift(`webpack-dev-server/client?http://127.0.0.1:${devServerPort}/`); .unshift(`webpack-dev-server/client?http://127.0.0.1:${devServerPort}/`);
}
let compiler = webpack(configCopy); let compiler = webpack(configCopy);
new WebpackDevServer(compiler, { new WebpackDevServer(compiler, {

715
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -64,7 +64,7 @@
"mysql2": "^1.6.1", "mysql2": "^1.6.1",
"nightmare": "^3.0.1", "nightmare": "^3.0.1",
"node-sass": "^4.9.3", "node-sass": "^4.9.3",
"nodemon": "^1.18.4", "nodemon": "^1.18.5",
"plugin-error": "^1.0.1", "plugin-error": "^1.0.1",
"raw-loader": "*", "raw-loader": "*",
"run-sequence": "^2.2.1", "run-sequence": "^2.2.1",
@ -79,6 +79,6 @@
"test": "nodemon -q services_tests.js -w services", "test": "nodemon -q services_tests.js -w services",
"dbtest": "nodemon -q db_tests.js -w services/db/tests", "dbtest": "nodemon -q db_tests.js -w services/db/tests",
"lint": "eslint ./ --cache --ignore-pattern .gitignore", "lint": "eslint ./ --cache --ignore-pattern .gitignore",
"services": "node --inspect ./node_modules/gulp/bin/gulp.js services" "services": "nodemon --inspect ./node_modules/gulp/bin/gulp.js services"
} }
} }