ignite-commits mailing list archives

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


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

Branch: refs/heads/ignite-3262
Commit: 00d3d90d93fba0ca42e7e2ed1cde64501db0b756
Parents: f09d217
Author: Maxim Afanasiev <mafkus@gmail.com>
Authored: Thu Jun 9 18:57:38 2016 +0700
Committer: Maxim Afanasiev <mafkus@gmail.com>
Committed: Thu Jun 9 18:57:38 2016 +0700

----------------------------------------------------------------------
 modules/web-console/src/main/js/app/index.js    |  13 +-
 .../main/js/app/modules/form/field/field.css    |   2 +-
 modules/web-console/src/main/js/app/vendor.js   |   6 +-
 .../src/main/js/gulpfile.babel.js/paths.js      |   8 +-
 .../main/js/gulpfile.babel.js/tasks/bundle.js   |  10 +-
 .../webpack/environments/development.js         |  64 +++++-----
 .../webpack/environments/production.js          |  18 +--
 .../main/js/gulpfile.babel.js/webpack/global.js | 125 +++++++++----------
 modules/web-console/src/main/js/package.json    |  20 ++-
 .../web-console/src/main/js/views/index.jade    |   2 +-
 10 files changed, 137 insertions(+), 131 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/00d3d90d/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 27b572c..91b7b84 100644
--- a/modules/web-console/src/main/js/app/index.js
+++ b/modules/web-console/src/main/js/app/index.js
@@ -14,19 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-import _ from 'lodash';
-import angular from 'angular';
-import pdfMake from 'pdfmake';
-
-window._ = _;
-window.pdfMake = pdfMake;
-
-
 import '../public/stylesheets/style.scss';
 
-
-
 import './decorator/select';
 import './decorator/tooltip';
 
@@ -149,7 +138,7 @@ angular
     'ignite-console.version',
     'ignite-console.loading',
     // Ignite legacy module.
-    'ignite-console.legacy',
+    'ignite-console.legacy'
     // Ignite modules.
     // 'ignite-console.modules'
 ])

http://git-wip-us.apache.org/repos/asf/ignite/blob/00d3d90d/modules/web-console/src/main/js/app/modules/form/field/field.css
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/app/modules/form/field/field.css b/modules/web-console/src/main/js/app/modules/form/field/field.css
index 8dfe05e..3ea64f4 100644
--- a/modules/web-console/src/main/js/app/modules/form/field/field.css
+++ b/modules/web-console/src/main/js/app/modules/form/field/field.css
@@ -16,7 +16,7 @@
  */
 
 .indexField {
-	float: left;
+    float: left;
     line-height: 28px;
     margin-right: 5px;
     color: #ec1c24;

http://git-wip-us.apache.org/repos/asf/ignite/blob/00d3d90d/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
index 1361792..e71111f 100644
--- a/modules/web-console/src/main/js/app/vendor.js
+++ b/modules/web-console/src/main/js/app/vendor.js
@@ -15,7 +15,6 @@ import 'angular-nvd3';
 import 'angular-tree-control';
 import 'angular-gridster';
 import 'bootstrap-sass/assets/javascripts/bootstrap/carousel';
-import 'nvd3';
 import 'brace';
 import 'brace/mode/xml';
 import 'brace/mode/sql';
@@ -26,9 +25,12 @@ import 'font-awesome-webpack';
 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';
+
+// import pdfMake from 'pdfmake';
+
+// window.pdfMake = pdfMake;

http://git-wip-us.apache.org/repos/asf/ignite/blob/00d3d90d/modules/web-console/src/main/js/gulpfile.babel.js/paths.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/paths.js b/modules/web-console/src/main/js/gulpfile.babel.js/paths.js
index 83372f9..8de6bcb 100644
--- a/modules/web-console/src/main/js/gulpfile.babel.js/paths.js
+++ b/modules/web-console/src/main/js/gulpfile.babel.js/paths.js
@@ -17,11 +17,12 @@
 
 import path from 'path';
 
-const srcDir = './app';
-const destDir = './dist';
+const rootDir = path.resolve('./');
+const srcDir = path.resolve('app');
+const destDir = path.resolve('dist');
 
 const igniteModulesDir = process.env.IGNITE_MODULES ? path.normalize(process.env.IGNITE_MODULES)
: './ignite_modules';
-const igniteModulesTemp = './ignite_modules_temp';
+const igniteModulesTemp = path.resolve('ignite_modules_temp');
 
 const sassPaths = [
     './public/stylesheets/*.scss'
@@ -80,6 +81,7 @@ const appModulePaths = [
 ];
 
 export {
+    rootDir,
     srcDir,
     destDir,
     igniteModulesDir,

http://git-wip-us.apache.org/repos/asf/ignite/blob/00d3d90d/modules/web-console/src/main/js/gulpfile.babel.js/tasks/bundle.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/bundle.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/bundle.js
index bdff139..c584665 100644
--- a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/bundle.js
+++ b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/bundle.js
@@ -39,11 +39,9 @@ gulp.task('bundle', ['bundle:ignite']);
 
 // Package all external dependencies and ignite-console.
 gulp.task('bundle:ignite', (cb) => {
-    const bundler = webpack(webpackConfig, (err) => {
-            // if(err) throw new gutil.PluginError("webpack", err);
-            cb();
-    });
+    const compiler = webpack(webpackConfig, cb);
 
-    if(process.env.NODE_ENV==='development')
-        new WebpackDevServer(bundler).listen(webpackConfig.devServer.port, 'localhost', cb);
+    if(process.env.NODE_ENV==='development' && webpackConfig.devServer)
+        new WebpackDevServer(compiler, webpackConfig.devServer)
+            .listen(webpackConfig.devServer.port || 9000, 'localhost');
 });

http://git-wip-us.apache.org/repos/asf/ignite/blob/00d3d90d/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/development.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/development.js
b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/development.js
index eddff63..fc3c3af 100644
--- a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/development.js
+++ b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/development.js
@@ -1,24 +1,38 @@
 'use strict';
-var webpack = require('webpack');
-var ProgressPlugin = require('webpack/lib/ProgressPlugin');
-var HtmlWebpackPlugin = require("html-webpack-plugin");
-var path = require('path');
-var jade = require('jade');
 
-module.exports = function (_path) {
-    var chars = 0,
+import webpack from 'webpack';
+import ProgressPlugin from 'webpack/lib/ProgressPlugin';
+import HtmlWebpackPlugin from 'html-webpack-plugin';
+import {destDir, rootDir} from '../../paths';
+import jade from 'jade';
+import path from 'path';
+
+module.exports = function () {
+    let chars = 0,
         lastState, lastStateTime;
 
-    var plugins = [
+    const _goToLineStart = (nextMessage) => {
+        var str = "";
+        for (; chars > nextMessage.length; chars--) {
+            str += "\b \b";
+        }
+        chars = nextMessage.length;
+        for (var i = 0; i < chars; i++) {
+            str += "\b";
+        }
+        if (str) process.stderr.write(str);
+    };
+
+    let plugins = [
         new webpack.HotModuleReplacementPlugin(),
         new HtmlWebpackPlugin({
             filename: 'index.html',
             templateContent: function () {
-                return jade.renderFile(path.join(_path, 'views', 'index.jade'));
+                return jade.renderFile(path.join(rootDir, 'views', 'index.jade'));
             },
             title: 'DEBUG:Ignite Web Console'
         }),
-        new ProgressPlugin(function (percentage, msg) {
+        new ProgressPlugin((percentage, msg) => {
             var state = msg;
             if (percentage < 1) {
                 percentage = Math.floor(percentage * 100);
@@ -38,41 +52,31 @@ module.exports = function (_path) {
                 var now = +new Date();
                 if (lastState) {
                     var stateMsg = (now - lastStateTime) + "ms " + lastState;
-                    goToLineStart(stateMsg);
+                    _goToLineStart(stateMsg);
                     process.stderr.write(stateMsg + "\n");
                     chars = 0;
                 }
                 lastState = state;
                 lastStateTime = now;
             }
-            goToLineStart(msg);
+            _goToLineStart(msg);
             process.stderr.write(msg);
         })
     ];
 
-    function goToLineStart(nextMessage) {
-        var str = "";
-        for (; chars > nextMessage.length; chars--) {
-            str += "\b \b";
-        }
-        chars = nextMessage.length;
-        for (var i = 0; i < chars; i++) {
-            str += "\b";
-        }
-        if (str) process.stderr.write(str);
-    }
 
     return {
-        context: _path,
+        context: rootDir,
         debug: true,
-        devtool: 'cheap-source-map',
+        devtool: 'eval',
         devServer: {
             historyApiFallback: true,
-            publicPath: '/',
-            contentBase: './dist',
-            info: true,
-            hot: true,
-            inline: false,
+            // publicPath: '/',
+            contentBase: destDir,
+            // info: true,
+            // hot: true,
+            // inline: true,
+            // quiet: false,
             proxy: {
                 '/socket.io': {
                     target: 'http://localhost:3000',

http://git-wip-us.apache.org/repos/asf/ignite/blob/00d3d90d/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/production.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/production.js
b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/production.js
index dc91d0c..d2f1345 100644
--- a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/production.js
+++ b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/production.js
@@ -1,26 +1,30 @@
 'use strict';
-var HtmlWebpackPlugin = require("html-webpack-plugin");
-var path = require('path');
-var jade = require('jade');
+import HtmlWebpackPlugin from 'html-webpack-plugin';
+import webpack from 'webpack';
+import path from 'path';
+import jade from 'jade';
+
+import {destDir, rootDir} from '../../paths';
 
 module.exports = function (_path) {
     return {
-        context: _path,
+        context: rootDir,
         debug: false,
         devtool: 'cheap-source-map',
         output: {
             publicPath: '/',
             filename: '[name].[chunkhash].js',
-            contentBase: './dist'
+            contentBase: destDir
         },
         plugins: [
             new HtmlWebpackPlugin({
                 filename: 'index.html',
-                templateContent: function () {
+                templateContent: () => {
                     return jade.renderFile(path.join(_path, 'views', 'index.jade'));
                 },
                 title: 'Ignite Web Console'
-            })
+            }),
+            new webpack.optimize.DedupePlugin()
         ]
     };
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/00d3d90d/modules/web-console/src/main/js/gulpfile.babel.js/webpack/global.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/global.js b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/global.js
index ca5128d..c8ea2c7 100644
--- a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/global.js
+++ b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/global.js
@@ -1,62 +1,61 @@
 'use strict';
 
-// Depends
-var path = require('path');
-var webpack = require('webpack');
-var autoprefixer = require('autoprefixer-core');
-// var Manifest = require('manifest-revision-webpack-plugin');
-var ExtractTextPlugin = require("extract-text-webpack-plugin");
+import path from 'path';
+import webpack from 'webpack';
+import autoprefixer from 'autoprefixer-core';
+//import  Manifest from 'manifest-revision-webpack-plugin';
+import ExtractTextPlugin from 'extract-text-webpack-plugin';
+import {srcDir, destDir, rootDir} from '../paths';
 
-var NODE_ENV = process.env.NODE_ENV || "production";
-var DEVELOPMENT = NODE_ENV === "production" ? false : true;
-var stylesLoader = 'css-loader?sourceMap!postcss-loader!sass-loader?outputStyle=expanded&sourceMap=true&sourceMapContents=true';
+const NODE_ENV = process.env.NODE_ENV || 'production';
+const IS_DEVELOPMENT = NODE_ENV === 'development';
+const stylesLoader = 'css-loader?sourceMap!postcss-loader!sass-loader?outputStyle=expanded&sourceMap=true&sourceMapContents=true';
 
 
 module.exports = function (_path) {
-    var rootAssetPath = _path + 'src';
 
-    var webpackConfig = {
+    const NODE_MODULES_PATH = path.resolve('node_modules');
+    const webpackConfig = {
         node: {
             fs: 'empty'
         },
         // entry points
         entry: {
-            vendor: _path + '/app/vendor.js',
-            app: _path + '/app/index.js',
-            polyfill: 'babel-polyfill'
+            polyfill: 'babel-polyfill',
+            app: srcDir + '/index.js',
+            vendor: srcDir + '/vendor.js',
         },
 
-
-        // output system
+        // // output system
         output: {
-            path: path.resolve("dist"),
-            filename: '[name].js',
-            publicPath: '/'
+            path: destDir,
+            filename: '[name].js'
         },
 
         // resolves modules
         resolve: {
             extensions: ['', '.js'],
-            modulesDirectories: ['node_modules', './'],
+            root : rootDir,
+            modulesDirectories: [NODE_MODULES_PATH, './'],
             alias: {
-                _appRoot: path.join(_path, 'app'),
-                _images: path.join(_path, 'app', 'assets', 'images'),
-                _stylesheets: path.join(_path, 'app', 'assets', 'styles'),
-                _scripts: path.join(_path, 'app', 'assets', 'js'),
-                ace: path.join(_path, 'node_modules', 'ace-builds', 'src')
+                // _appRoot: path.join(_path, 'app'),
+                // _images: path.join(_path, 'app', 'assets', 'images'),
+                // _stylesheets: path.join(_path, 'app', 'assets', 'styles'),
+                // _scripts: path.join(_path, 'app', 'assets', 'js'),
+                // ace: path.join(_path, 'node_modules', 'ace-builds', 'src')
             }
         },
 
         // modules resolvers
         module: {
             noParse: [],
-            preLoaders: [
-                {
-                    test: /\.js$/,
-                    exclude: [path.resolve(_path, "node_modules")],
-                    loader: 'eslint-loader'
-                }
-            ],
+            // preLoaders: [
+            //     {
+            //         test: /\.js$/,
+            //         exclude: [NODE_MODULES_PATH],
+            //         loader: 'eslint-loader'
+            //     }
+            // ],
             loaders: [
                 {
                     test: /\.json$/,
@@ -70,18 +69,18 @@ module.exports = function (_path) {
                         'jade-html-loader'
                     ]
                 },
+                // {
+                //     test: /\.js$/,
+                //     loaders: ['baggage-loader?[file].html&[file].css']
+                // },
+                // {
+                //     test: /\.js$/,
+                //     exclude: [NODE_MODULES_PATH],
+                //     loaders: ['ng-annotate-loader']
+                // },
                 {
                     test: /\.js$/,
-                    loaders: ['baggage-loader?[file].html&[file].css']
-                },
-                {
-                    test: /\.js$/,
-                    exclude: [path.resolve(_path, "node_modules")],
-                    loaders: ['ng-annotate-loader']
-                },
-                {
-                    test: /\.js$/,
-                    exclude: [path.resolve(_path, "node_modules")],
+                    exclude: [NODE_MODULES_PATH],
                     loader: 'babel-loader',
                     query: {
                         cacheDirectory: true,
@@ -95,27 +94,31 @@ module.exports = function (_path) {
                 },
                 {
                     test: /\.(scss|sass)$/,
-                    loader: DEVELOPMENT ? ('style-loader!' + stylesLoader) : ExtractTextPlugin.extract('style-loader',
stylesLoader)
+                    loader: IS_DEVELOPMENT ? ('style-loader!' + stylesLoader) : ExtractTextPlugin.extract('style-loader',
stylesLoader)
                 },
                 {
                     test: /\.(woff2|woff|ttf|eot|svg)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
                     loaders: [
-                        "url-loader?name=fonts/[name]_[hash].[ext]"
+                        'url-loader?name=fonts/[name]_[hash].[ext]'
                     ]
                 },
                 {
                     test: /\.(jpe?g|png|gif)$/i,
                     loaders: ['url-loader?name=images/[name]_[hash].[ext]']
-                },
-                {
-                    test: require.resolve("angular"),
-                    loaders: ["expose?angular"]
-                },
-                {
-                    test: require.resolve("jquery"),
-                    loaders: ["expose?$", "expose?jQuery"]
                 }
-
+                // {
+                //     test: require.resolve("jquery"),
+                //     loaders: [
+                //         "expose?$",
+                //         "expose?jQuery"
+                //     ]
+                // },
+                // {
+                //     test: require.resolve("angular"),
+                //     loaders: [
+                //         "expose?angular"
+                //     ]
+                // }
             ]
         },
 
@@ -124,37 +127,31 @@ module.exports = function (_path) {
 
         // load plugins
         plugins: [
-            //new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en|hu/),
             new webpack.ProvidePlugin({
                 $: 'jquery',
                 jQuery: 'jquery',
                 _: 'lodash',
                 nv: 'nvd3'
             }),
-            new webpack.DefinePlugin({
-                'NODE_ENV': JSON.stringify(NODE_ENV)
-            }),
+            new webpack.DefinePlugin({'NODE_ENV': JSON.stringify(NODE_ENV)}),
             new webpack.NoErrorsPlugin(),
-            new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
-            new webpack.optimize.DedupePlugin(),
-            new webpack.optimize.AggressiveMergingPlugin({
-                moveToParents: true
-            }),
+            new webpack.optimize.AggressiveMergingPlugin({moveToParents: true}),
             new webpack.optimize.CommonsChunkPlugin({
                 name: 'common',
                 async: true,
                 children: true,
                 minChunks: Infinity
             }),
+
             // new Manifest(path.join(_path + '/config', 'manifest.json'), {
             //     rootAssetPath: rootAssetPath,
             //     ignorePaths: ['.DS_Store']
             // }),
-            new ExtractTextPlugin('assets/styles/css/[name]' + (NODE_ENV === 'development'
? '' : '.[chunkhash]') + '.css', {allChunks: true})
+            new ExtractTextPlugin('assets/css/[name]' + (IS_DEVELOPMENT ? '' : '.[chunkhash]')
+ '.css', {allChunks: true})
         ]
     };
 
-    if (NODE_ENV !== 'development') {
+    if (!IS_DEVELOPMENT) {
         webpackConfig.plugins = webpackConfig.plugins.concat([
             new webpack.optimize.UglifyJsPlugin({
                 minimize: true,

http://git-wip-us.apache.org/repos/asf/ignite/blob/00d3d90d/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 9bdf2ec..c71f7c5 100644
--- a/modules/web-console/src/main/js/package.json
+++ b/modules/web-console/src/main/js/package.json
@@ -93,7 +93,6 @@
     "ngtemplate-loader": "^1.3.1",
     "node-sass": "^3.4.2",
     "nodemailer": "^2.3.0",
-    "oclazyload": "^1.0.9",
     "passport": "^0.3.2",
     "passport-local": "^1.0.0",
     "passport-local-mongoose": "^4.0.0",
@@ -107,21 +106,32 @@
     "socket.io": "^1.4.5",
     "socket.io-client": "^1.4.6",
     "style-loader": "^0.13.1",
-    "swagger-client-generator": "^0.2.13",
     "ui-router-metatags": "^1.0.3",
     "url": "^0.11.0",
     "url-loader": "^0.5.6",
     "webpack": "^1.12.12",
-    "webpack-dev-server": "1.14.0",
     "ws": "^0.8.0"
   },
   "devDependencies": {
+    "gulp": "^3.9.0",
+    "gulp-cached": "^1.1.0",
+    "gulp-connect": "^3.2.2",
+    "gulp-environments": "^0.1.1",
+    "gulp-eslint": "^2.0.0",
+    "gulp-html-replace": "^1.5.5",
+    "gulp-ignore": "^2.0.1",
+    "gulp-inject": "^4.0.0",
+    "gulp-jade": "^1.1.0",
+    "gulp-rimraf": "^0.2.0",
+    "gulp-sass": "^2.1.0",
+    "gulp-sequence": "^0.4.1",
+    "gulp-util": "^3.0.7",
     "http-proxy-middleware": "^0.13.0",
     "json-loader": "^0.5.4",
-    "jspm": "^0.16.32",
     "mocha": "~2.4.5",
     "morgan": "^1.7.0",
     "should": "^8.3.0",
-    "supertest": "^1.1.0"
+    "supertest": "^1.1.0",
+    "webpack-dev-server": "1.14.0"
   }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/00d3d90d/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 8690753..757f281 100644
--- a/modules/web-console/src/main/js/views/index.jade
+++ b/modules/web-console/src/main/js/views/index.jade
@@ -42,7 +42,7 @@ html(ng-app='ignite-console' id='app' ng-strict-di)
 
 
         = '{% for (var chunk in o.htmlWebpackPlugin.files.chunks) { %}'
-        script(src="{%=o.htmlWebpackPlugin.files.chunks[chunk].entry %}")
+        script(src='{%=o.htmlWebpackPlugin.files.chunks[chunk].entry %}')
         = '{% } %}'
 
     body.theme-line.body-overlap.greedy


Mime
View raw message