From 3bb42b1d7b27810db88ab5b0654089b1fe0377d1 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 28 Jan 2019 12:14:22 +0100 Subject: [PATCH] Project configuration fixed --- .eslintignore | 3 +-- README.md | 7 ------ back/model-config.json | 9 ++++++++ .../route/back => back}/models/delivery.json | 0 .../route/back => back}/models/route.json | 0 .../route/back => back}/models/vehicle.json | 0 front/module-import.js | 21 +++++++++++++----- gulpfile.js | 3 +++ modules/route/back/model-config.json | 11 ---------- modules/route/front/index.js | 1 - modules/route/front/locale/en.yml | 1 - modules/route/front/locale/es.yml | 3 --- modules/route/front/module.js | 3 --- modules/route/front/routes.json | 22 ------------------- webpack.config.js | 10 +++++++-- 15 files changed, 37 insertions(+), 57 deletions(-) rename {modules/route/back => back}/models/delivery.json (100%) rename {modules/route/back => back}/models/route.json (100%) rename {modules/route/back => back}/models/vehicle.json (100%) delete mode 100644 modules/route/back/model-config.json delete mode 100644 modules/route/front/index.js delete mode 100644 modules/route/front/locale/en.yml delete mode 100644 modules/route/front/locale/es.yml delete mode 100644 modules/route/front/module.js delete mode 100644 modules/route/front/routes.json diff --git a/.eslintignore b/.eslintignore index 597f2d8a1..b512c09d4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1 @@ -node_modules -services/nginx/* \ No newline at end of file +node_modules \ No newline at end of file diff --git a/README.md b/README.md index ab7cf3f36..a3394cc84 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ Required applications. * Visual Studio Code * Node.js = 8.15.0 -* NGINX * Docker In Visual Studio Code we use the ESLint extension. Open Visual Studio Code, press Ctrl+P and paste the following command. @@ -44,12 +43,6 @@ Launch application in developer environment. $ gulp ``` -Also you can run backend and frontend as separately gulp tasks (including NGINX). -``` -$ gulp front -$ gulp back -``` - Manually reset fixtures. ``` $ gulp docker diff --git a/back/model-config.json b/back/model-config.json index fa412618d..f69b9d7d0 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -11,6 +11,9 @@ "Company": { "dataSource": "vn" }, + "Delivery": { + "dataSource": "vn" + }, "Message": { "dataSource": "vn" }, @@ -46,6 +49,12 @@ }, "PersonDepartment": { "dataSource": "vn" + }, + "Route": { + "dataSource": "vn" + }, + "Vehicle": { + "dataSource": "vn" } } diff --git a/modules/route/back/models/delivery.json b/back/models/delivery.json similarity index 100% rename from modules/route/back/models/delivery.json rename to back/models/delivery.json diff --git a/modules/route/back/models/route.json b/back/models/route.json similarity index 100% rename from modules/route/back/models/route.json rename to back/models/route.json diff --git a/modules/route/back/models/vehicle.json b/back/models/vehicle.json similarity index 100% rename from modules/route/back/models/vehicle.json rename to back/models/vehicle.json diff --git a/front/module-import.js b/front/module-import.js index 8929b5fda..575787ee8 100755 --- a/front/module-import.js +++ b/front/module-import.js @@ -1,7 +1,18 @@ export default function moduleImport(moduleName) { - return import( - /* webpackInclude: /modules\/[a-z0-9-]+\/front\/index.js$/ */ - `../modules/${moduleName}/front/index.js` - ); -} \ No newline at end of file + // FIXME: Webpack watches module backend files when using dynamic import + //return import( + // /* webpackInclude: /modules\/[a-z0-9-]+\/front\/index.js$/ */ + // '../modules/'+ moduleName +'/front/index.js' + //); + + switch(moduleName) { + case 'client' : return import('client/front'); + case 'item' : return import('item/front'); + case 'ticket' : return import('ticket/front'); + case 'order' : return import('order/front'); + case 'claim' : return import('claim/front'); + case 'agency' : return import('agency/front'); + case 'travel' : return import('travel/front'); + } +} diff --git a/gulpfile.js b/gulpfile.js index 6b945e0cf..f100e66ad 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -42,6 +42,9 @@ backOnly.description = `Starts backend service`; function backWatch(done) { const nodemon = require('gulp-nodemon'); + + // XXX: Workaround to avoid nodemon bug + // https://github.com/remy/nodemon/issues/1346 let sleepBin = isWindows ? '' : 'sleep 1 &&'; nodemon({ diff --git a/modules/route/back/model-config.json b/modules/route/back/model-config.json deleted file mode 100644 index 670dd69bf..000000000 --- a/modules/route/back/model-config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Delivery": { - "dataSource": "vn" - }, - "Route": { - "dataSource": "vn" - }, - "Vehicle": { - "dataSource": "vn" - } -} diff --git a/modules/route/front/index.js b/modules/route/front/index.js deleted file mode 100644 index 20a96c9a5..000000000 --- a/modules/route/front/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './module'; diff --git a/modules/route/front/locale/en.yml b/modules/route/front/locale/en.yml deleted file mode 100644 index 6659ba5dc..000000000 --- a/modules/route/front/locale/en.yml +++ /dev/null @@ -1 +0,0 @@ -Routes: Routes \ No newline at end of file diff --git a/modules/route/front/locale/es.yml b/modules/route/front/locale/es.yml deleted file mode 100644 index 63efa8289..000000000 --- a/modules/route/front/locale/es.yml +++ /dev/null @@ -1,3 +0,0 @@ -Routes: Rutas -List: Listado -Enter a new search: Introduce una nueva búsqueda \ No newline at end of file diff --git a/modules/route/front/module.js b/modules/route/front/module.js deleted file mode 100644 index bd7b1516b..000000000 --- a/modules/route/front/module.js +++ /dev/null @@ -1,3 +0,0 @@ -import {ng} from 'core/vendor'; - -export default ng.module('route', ['vnCore']); diff --git a/modules/route/front/routes.json b/modules/route/front/routes.json deleted file mode 100644 index 95da1e143..000000000 --- a/modules/route/front/routes.json +++ /dev/null @@ -1,22 +0,0 @@ -/* { - "module": "route", - "name": "Routes", - "icon" : "local_shipping", - "validations" : true, - "routes": [ - { - "url": "/route", - "state": "route", - "abstract": true, - "component": "ui-view", - "description": "Routes" - }, - { - "url": "/index?q", - "state": "route.index", - "component": "vn-route-index", - "description": "Routes", - "acl": ["developer"] - } - ] -} */ \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index e0aee3572..a7adfea0f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -70,6 +70,12 @@ let baseConfig = { 'vn-loopback': `${__dirname}/loopback` } }, + watchOptions: { + ignored: [ + 'node_modules', + './modules/*/back/**' + ] + }, plugins: [ new HtmlWebpackPlugin({ template: 'front/salix/index.ejs', @@ -79,11 +85,11 @@ let baseConfig = { }) ], devtool: 'source-map', - stats: { + stats: {/* modules: false, assets: false, children: false, - entrypoints: false, + entrypoints: false,*/ colors: true } };