ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [09/50] [abbrv] ignite git commit: WIP webpack migration
Date Mon, 20 Jun 2016 02:58:32 GMT
WIP webpack migration


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/002452b0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/002452b0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/002452b0

Branch: refs/heads/ignite-3262
Commit: 002452b0339ce7927b1f185e97ad88872a3b4b7c
Parents: eff979c
Author: Maxim Afanasiev <mafkus@gmail.com>
Authored: Fri Jun 3 09:21:40 2016 +0700
Committer: Maxim Afanasiev <mafkus@gmail.com>
Committed: Fri Jun 3 09:21:40 2016 +0700

----------------------------------------------------------------------
 modules/web-console/src/main/js/app/index.js    |  2 -
 modules/web-console/src/main/js/app/vendor.js   | 25 ++++++++
 .../config/webpack/environments/development.js  | 64 ++++++++++++++------
 .../src/main/js/config/webpack/global.js        |  4 --
 .../main/js/gulpfile.babel.js/tasks/watch.js    |  2 +-
 modules/web-console/src/main/js/package.json    |  1 +
 .../web-console/src/main/js/views/index.jade    | 30 +++++----
 7 files changed, 85 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/002452b0/modules/web-console/src/main/js/app/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/app/index.js b/modules/web-console/src/main/js/app/index.js
index 8b7ba73..5dbf6f9 100644
--- a/modules/web-console/src/main/js/app/index.js
+++ b/modules/web-console/src/main/js/app/index.js
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-import 'vendor.js';
 import _ from 'lodash';
 import ace from 'brace';
 import angular from 'angular';
@@ -28,7 +27,6 @@ window.require = ace.require; // TODO Should be removed after full refactoring
t
 // window.pdfMake = pdfMake;
 
 
-
 import '../public/stylesheets/style.scss';
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/002452b0/modules/web-console/src/main/js/app/vendor.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/app/vendor.js b/modules/web-console/src/main/js/app/vendor.js
new file mode 100644
index 0000000..0e4c860
--- /dev/null
+++ b/modules/web-console/src/main/js/app/vendor.js
@@ -0,0 +1,25 @@
+import 'jquery';
+import 'angular';
+import 'angular-animate';
+import 'angular-sanitize';
+import 'angular-strap';
+import 'angular-socket-io';
+import 'angular-retina';
+import 'angular-ui-router';
+import 'ui-router-metatags/dist/ui-router-metatags.js';
+import 'angular-smart-table';
+import 'angular-ui-grid/ui-grid';
+import 'angular-drag-and-drop-lists';
+import 'angular-nvd3';
+import 'angular-tree-control';
+import 'angular-gridster';
+import 'bootstrap-sass/assets/javascripts/bootstrap/carousel.js';
+// import 'file-saver';
+import 'jszip';
+import 'query-command-supported';
+
+import 'angular-gridster/dist/angular-gridster.min.css';
+import 'angular-tree-control/css/tree-control-attribute.css';
+import 'angular-tree-control/css/tree-control.css';
+import 'angular-ui-grid/ui-grid.css';
+import 'angular-motion/dist/angular-motion.css';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/002452b0/modules/web-console/src/main/js/config/webpack/environments/development.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/config/webpack/environments/development.js b/modules/web-console/src/main/js/config/webpack/environments/development.js
index e0593e5..2968095 100644
--- a/modules/web-console/src/main/js/config/webpack/environments/development.js
+++ b/modules/web-console/src/main/js/config/webpack/environments/development.js
@@ -2,25 +2,49 @@
 var webpack = require('webpack');
 var HtmlWebpackPlugin = require("html-webpack-plugin");
 var path = require('path');
+var glob = require('glob');
+var jade = require('jade');
 
-module.exports = function(_path) {
-  return {
-    context: _path,
-    debug: true,
-    devtool: 'cheap-source-map',
-    devServer: {
-      contentBase: './dist',
-      info: true,
-      hot: true,
-      inline: true
-    },
-    plugins: [
-      new webpack.HotModuleReplacementPlugin(),
-      new HtmlWebpackPlugin({
-        filename: 'index.html',
-        template: path.join(_path, 'views', 'index.html'),
-        title: 'DEBUG:Ignite Web Console'
-      })
-    ]
-  };
+module.exports = function (_path) {
+    var plugins = [
+        new webpack.HotModuleReplacementPlugin(),
+        new HtmlWebpackPlugin({
+            filename: 'index.html',
+            templateContent: function () {
+                return jade.renderFile(path.join(_path, 'views', 'index.jade'));
+            },
+            title: 'DEBUG:Ignite Web Console'
+        })
+    ];
+
+    glob.sync(path.join(_path, 'views') + '/**/*.jade').map(function (file) {
+        plugins.push(
+            new HtmlWebpackPlugin({
+                filename: 'templates/'+path.basename(file).replace('.jade', '.html'),
+                templateContent: function () {
+                    return jade.renderFile(file);
+                }
+            }))
+    });
+
+    return {
+        context: _path,
+        debug: true,
+        devtool: 'cheap-source-map',
+        devServer: {
+            contentBase: './dist',
+            info: true,
+            hot: true,
+            inline: false,
+            proxy: {
+                '/api/*': {
+                    target: 'http://localhost:3000'
+                }
+            },
+            stats: {colors: true},
+            port: 9000
+        },
+
+        plugins: plugins
+    };
 };

http://git-wip-us.apache.org/repos/asf/ignite/blob/002452b0/modules/web-console/src/main/js/config/webpack/global.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/config/webpack/global.js b/modules/web-console/src/main/js/config/webpack/global.js
index 2a9a162..9cdf686 100644
--- a/modules/web-console/src/main/js/config/webpack/global.js
+++ b/modules/web-console/src/main/js/config/webpack/global.js
@@ -71,10 +71,6 @@ module.exports = function (_path) {
                     ]
                 },
                 {
-                    test: /index\.jade$/,
-                    loader: 'jade'
-                },
-                {
                     test: /\.jade$/,
                     loaders: [
                         'ngtemplate-loader?relativeTo=' + _path,

http://git-wip-us.apache.org/repos/asf/ignite/blob/002452b0/modules/web-console/src/main/js/gulpfile.babel.js/tasks/watch.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/watch.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/watch.js
index 8666999..8a78aca 100644
--- a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/watch.js
+++ b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/watch.js
@@ -26,7 +26,7 @@ gulp.task('watch:ignite-modules', (cb) => sequence('clean:ignite-modules-temp',
 
 // Build + connect + watch task.
 gulp.task('watch', ['build', 'connect'], () => {
-    gulp.watch(sassPaths, ['watch:sass']);
+    //gulp.watch(sassPaths, ['watch:sass']);
 
     gulp.watch(jadePaths.concat(jadeModulePaths), ['jade']);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/002452b0/modules/web-console/src/main/js/package.json
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/package.json b/modules/web-console/src/main/js/package.json
index 480f4b2..f81b872 100644
--- a/modules/web-console/src/main/js/package.json
+++ b/modules/web-console/src/main/js/package.json
@@ -76,6 +76,7 @@
     "fire-up": "^1.0.0",
     "font-awesome": "^4.6.1",
     "font-awesome-webpack": "0.0.4",
+    "glob": "^7.0.3",
     "html-loader": "^0.3.0",
     "html-webpack-plugin": "^1.7.0",
     "imagemin-pngquant": "^4.2.0",

http://git-wip-us.apache.org/repos/asf/ignite/blob/002452b0/modules/web-console/src/main/js/views/index.jade
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/views/index.jade b/modules/web-console/src/main/js/views/index.jade
index 8514533..8690753 100644
--- a/modules/web-console/src/main/js/views/index.jade
+++ b/modules/web-console/src/main/js/views/index.jade
@@ -30,10 +30,20 @@ html(ng-app='ignite-console' id='app' ng-strict-di)
         meta(name='keywords' content='{{$meta.keywords}}')
         meta(ng-repeat='(key, value) in $meta.properties' name='{{::key}}' content='{{::value}}')
 
-        // build:css
-        link(rel='stylesheet', href='/vendors.css')
-        link(rel='stylesheet', href='/app.css')
-        // endbuild
+
+
+        = '{% if (o.htmlWebpackPlugin.files.favicon) { %}'
+        link(rel='shortcut icon' href='{%=o.htmlWebpackPlugin.files.favicon%}')
+        = '{% } %}'
+
+        = '{% for (var css in o.htmlWebpackPlugin.files.css) { %}'
+        link(href='{%=o.htmlWebpackPlugin.files.css[css] %}' rel='stylesheet')
+        = '{% } %}'
+
+
+        = '{% for (var chunk in o.htmlWebpackPlugin.files.chunks) { %}'
+        script(src="{%=o.htmlWebpackPlugin.files.chunks[chunk].entry %}")
+        = '{% } %}'
 
     body.theme-line.body-overlap.greedy
 
@@ -52,15 +62,3 @@ html(ng-app='ignite-console' id='app' ng-strict-di)
                 label {{IgniteDemoMode ? "Demo" : "Beta" }}
 
         .wrapper(ui-view='')
-
-
-        // build:js
-        script(src='jspm_packages/system.js')
-        script(src='system.config.js')
-        script(src='vendors.js')
-        script(src='app.js')
-        script System.import('app/index');
-        // endbuild
-
-        // ignite:plugins
-        // endignite
\ No newline at end of file


Mime
View raw message