http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/n-times.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/n-times.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/n-times.directive.js index ce83da4..f369af8 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/n-times.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/n-times.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './n-times.jade!'; +import templateUrl from './n-times.jade'; export default ['igniteConfigurationClustersGeneralDiscoveryZookeeperNTimes', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/one-time.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/one-time.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/one-time.directive.js index 7329cc2..e9e114d 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/one-time.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/one-time.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './one-time.jade!'; +import templateUrl from './one-time.jade'; export default ['igniteConfigurationClustersGeneralDiscoveryZookeeperOneTime', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/until-elapsed.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/until-elapsed.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/until-elapsed.directive.js index 8997159..4ab76b2 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/until-elapsed.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/general/discovery/zookeeper/retrypolicy/until-elapsed.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './until-elapsed.jade!'; +import templateUrl from './until-elapsed.jade'; export default ['igniteConfigurationClustersGeneralDiscoveryZookeeperUntilElapsed', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/igfs.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/igfs.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/igfs.directive.js index 1d0e3d8..74d4826 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/igfs.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/igfs.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './igfs.jade!'; +import templateUrl from './igfs.jade'; export default ['igniteConfigurationClustersIgfs', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger.directive.js index 3df231f..8aec165 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './logger.jade!'; +import templateUrl from './logger.jade'; export default ['igniteConfigurationClustersLogger', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/custom.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/custom.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/custom.directive.js index 5bd586b..999a3ca 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/custom.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/custom.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './custom.jade!'; +import templateUrl from './custom.jade'; export default ['igniteConfigurationClustersLoggerCustom', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/log4j.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/log4j.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/log4j.directive.js index 64e4337..32f55e9 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/log4j.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/log4j.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './log4j.jade!'; +import templateUrl from './log4j.jade'; export default ['igniteConfigurationClustersLoggerLog4j', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/log4j2.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/log4j2.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/log4j2.directive.js index ad891f7..81ae296 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/log4j2.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/logger/log4j2.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './log4j2.jade!'; +import templateUrl from './log4j2.jade'; export default ['igniteConfigurationClustersLoggerLog4j2', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/marshaller.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/marshaller.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/marshaller.directive.js index 6c266a8..b4175b0 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/marshaller.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/marshaller.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './marshaller.jade!'; +import templateUrl from './marshaller.jade'; export default ['igniteConfigurationClustersMarshaller', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/metrics.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/metrics.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/metrics.directive.js index fc572a6..9b8ddc3 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/metrics.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/metrics.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './metrics.jade!'; +import templateUrl from './metrics.jade'; export default ['igniteConfigurationClustersMetrics', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/ssl.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/ssl.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/ssl.directive.js index d875c59..ded5bf0 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/ssl.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/ssl.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './ssl.jade!'; +import templateUrl from './ssl.jade'; export default ['igniteConfigurationClustersSsl', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/swap.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/swap.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/swap.directive.js index db83d50..c340c4b 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/swap.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/swap.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './swap.jade!'; +import templateUrl from './swap.jade'; export default ['igniteConfigurationClustersSwap', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/thread.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/thread.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/thread.directive.js index dabc574..f504e67 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/thread.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/thread.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './thread.jade!'; +import templateUrl from './thread.jade'; export default ['igniteConfigurationClustersThread', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/time.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/time.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/time.directive.js index b55b8a1..8ab3e89 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/time.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/time.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './time.jade!'; +import templateUrl from './time.jade'; export default ['igniteConfigurationClustersTime', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/clusters/transactions.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/transactions.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/transactions.directive.js index 985de49..faca0fa 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/clusters/transactions.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/clusters/transactions.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './transactions.jade!'; +import templateUrl from './transactions.jade'; export default ['igniteConfigurationClustersTransactions', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/domains/general.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/domains/general.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/domains/general.directive.js index ab03eb0..9ca02f9 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/domains/general.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/domains/general.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './general.jade!'; +import templateUrl from './general.jade'; export default ['igniteConfigurationDomainsGeneral', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/domains/query.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/domains/query.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/domains/query.directive.js index c5aa79e..2033394 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/domains/query.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/domains/query.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './query.jade!'; +import templateUrl from './query.jade'; export default ['igniteConfigurationDomainsQuery', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/domains/store.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/domains/store.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/domains/store.directive.js index 39dc184..a69b025 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/domains/store.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/domains/store.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './store.jade!'; +import templateUrl from './store.jade'; export default ['igniteConfigurationDomainsStore', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/igfs/dual.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/dual.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/dual.directive.js index 109fa63..c5afc4e 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/dual.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/dual.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './dual.jade!'; +import templateUrl from './dual.jade'; export default ['igniteConfigurationIgfsDual', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/igfs/fragmentizer.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/fragmentizer.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/fragmentizer.directive.js index f93c76c..d008933 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/fragmentizer.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/fragmentizer.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './fragmentizer.jade!'; +import templateUrl from './fragmentizer.jade'; export default ['igniteConfigurationIgfsFragmentizer', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/igfs/general.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/general.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/general.directive.js index 294c3b8..bda5418 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/general.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/general.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './general.jade!'; +import templateUrl from './general.jade'; export default ['igniteConfigurationIgfsGeneral', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/igfs/ipc.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/ipc.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/ipc.directive.js index a0bd44c..eb52e51 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/ipc.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/ipc.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './ipc.jade!'; +import templateUrl from './ipc.jade'; export default ['igniteConfigurationIgfsIpc', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/igfs/misc.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/misc.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/misc.directive.js index 6a6ca12..810944f 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/misc.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/misc.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './misc.jade!'; +import templateUrl from './misc.jade'; export default ['igniteConfigurationIgfsMisc', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/igfs/secondary.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/secondary.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/secondary.directive.js index 8b3b37b..69179c0 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/igfs/secondary.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/igfs/secondary.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import template from './secondary.jade!'; +import templateUrl from './secondary.jade'; export default ['igniteConfigurationIgfsSecondary', [() => { return { scope: true, restrict: 'E', - template, + templateUrl, replace: true }; }]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/configuration/preview-panel.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/configuration/preview-panel.directive.js b/modules/web-console/src/main/js/app/modules/states/configuration/preview-panel.directive.js index fb67326..be7bf1e 100644 --- a/modules/web-console/src/main/js/app/modules/states/configuration/preview-panel.directive.js +++ b/modules/web-console/src/main/js/app/modules/states/configuration/preview-panel.directive.js @@ -15,13 +15,13 @@ * limitations under the License. */ -import ace from 'ace'; +import ace from 'brace'; export default ['previewPanel', ['$interval', '$timeout', ($interval, $timeout) => { let animation = {editor: null, stage: 0, start: 0, stop: 0}; let prevContent = []; - const Range = ace.require('ace/range').Range; + const Range = ace.acequire('ace/range').Range; const _clearSelection = (editor) => { _.forEach(editor.session.getMarkers(false), (marker) => { http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/modules/states/signin.state.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/states/signin.state.js b/modules/web-console/src/main/js/app/modules/states/signin.state.js index 91c84a3..a23a496 100644 --- a/modules/web-console/src/main/js/app/modules/states/signin.state.js +++ b/modules/web-console/src/main/js/app/modules/states/signin.state.js @@ -16,6 +16,7 @@ */ import angular from 'angular'; +import templateUrl from 'views/signin.jade'; angular .module('ignite-console.states.login', [ @@ -28,7 +29,7 @@ angular $stateProvider .state('signin', { url: '/', - templateUrl: '/signin.html', + templateUrl, metaTags: { } }); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/services/ChartColors.service.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/services/ChartColors.service.js b/modules/web-console/src/main/js/app/services/ChartColors.service.js index ec3f365..843aa5c 100644 --- a/modules/web-console/src/main/js/app/services/ChartColors.service.js +++ b/modules/web-console/src/main/js/app/services/ChartColors.service.js @@ -15,7 +15,7 @@ * limitations under the License. */ -import COLORS from 'app/data/colors.json!'; +import COLORS from 'app/data/colors.json'; export default ['IgniteChartColors', function() { return COLORS; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/services/Countries.service.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/services/Countries.service.js b/modules/web-console/src/main/js/app/services/Countries.service.js index 87d11fd..5ad3e6a 100644 --- a/modules/web-console/src/main/js/app/services/Countries.service.js +++ b/modules/web-console/src/main/js/app/services/Countries.service.js @@ -15,7 +15,7 @@ * limitations under the License. */ -import COUNTRIES from 'app/data/countries.json!'; +import COUNTRIES from 'app/data/countries.json'; export default ['IgniteCountries', function() { const indexByName = _.keyBy(COUNTRIES, 'name'); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/app/services/JavaTypes.service.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/services/JavaTypes.service.js b/modules/web-console/src/main/js/app/services/JavaTypes.service.js index a755e13..d34d669 100644 --- a/modules/web-console/src/main/js/app/services/JavaTypes.service.js +++ b/modules/web-console/src/main/js/app/services/JavaTypes.service.js @@ -16,12 +16,12 @@ */ // Java built-in class names. -import JAVA_CLASSES from 'app/data/java-classes.json!'; +import JAVA_CLASSES from 'app/data/java-classes.json'; // Java build-in primitive. -import JAVA_PRIMITIVES from 'app/data/java-primitives.json!'; +import JAVA_PRIMITIVES from 'app/data/java-primitives.json'; -import JAVA_KEYWORDS from 'app/data/java-keywords.json!'; +import JAVA_KEYWORDS from 'app/data/java-keywords.json'; export default ['JavaTypes', function() { return { http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/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..9988b8c --- /dev/null +++ b/modules/web-console/src/main/js/app/vendor.js @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'jquery'; +import 'angular'; +import 'angular-animate'; +import 'angular-sanitize'; +import 'angular-strap'; +import 'angular-strap/dist/angular-strap.tpl'; +import 'angular-socket-io'; +import 'angular-retina'; +import 'angular-ui-router'; +import 'ui-router-metatags/dist/ui-router-metatags'; +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/transition'; +import 'bootstrap-sass/assets/javascripts/bootstrap/carousel'; +import 'brace'; +import 'brace/mode/xml'; +import 'brace/mode/sql'; +import 'brace/mode/java'; +import 'brace/mode/dockerfile'; +import 'brace/theme/chrome'; +import 'file-saver'; +import 'jszip'; +import 'nvd3'; +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'; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/build/system.config.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/build/system.config.js b/modules/web-console/src/main/js/build/system.config.js deleted file mode 100644 index 20af865..0000000 --- a/modules/web-console/src/main/js/build/system.config.js +++ /dev/null @@ -1,424 +0,0 @@ -System.config({ - defaultJSExtensions: true, - transpiler: "babel", - babelOptions: { - "optional": [ - "runtime", - "optimisation.modules.system" - ] - }, - paths: { - "github:*": "build/jspm_packages/github/*", - "npm:*": "build/jspm_packages/npm/*" - }, - separateCSS: true, - - map: { - "ace": "github:ajaxorg/[email protected]", - "angular": "github:angular/[email protected]", - "angular-animate": "github:angular/[email protected]", - "angular-drag-and-drop-lists": "github:marceljuenemann/[email protected]", - "angular-gridster": "github:ManifestWebDesign/[email protected]", - "angular-motion": "github:mgcrea/[email protected]", - "angular-nvd3": "github:krispo/[email protected]", - "angular-retina": "github:jrief/[email protected]", - "angular-sanitize": "github:angular/[email protected]", - "angular-smart-table": "github:lorenzofox3/[email protected]", - "angular-socket-io": "github:btford/[email protected]", - "angular-strap": "github:mgcrea/[email protected]", - "angular-tree-control": "github:wix/[email protected]", - "angular-ui-grid": "github:angular-ui/[email protected]", - "angular-ui-router": "github:angular-ui/[email protected]", - "angular-ui-router-metatags": "github:tinusn/[email protected]", - "babel": "npm:[email protected]", - "babel-runtime": "npm:[email protected]", - "blob": "github:eligrey/Blob.js@master", - "bootstrap-carousel": "github:twbs/[email protected]", - "clean-css": "npm:[email protected]", - "core-js": "npm:[email protected]", - "css": "github:systemjs/[email protected]", - "file-saver": "github:eligrey/FileSaver.js@master", - "font-awesome": "npm:[email protected]", - "jade": "github:johnsoftek/[email protected]", - "jquery": "github:components/[email protected]", - "json": "github:systemjs/[email protected]", - "jszip": "github:Stuk/[email protected]", - "lodash": "github:lodash/[email protected]", - "pdfmake": "github:bpampuch/[email protected]", - "query-command-supported": "github:zenorocha/[email protected]", - "socket.io-client": "github:socketio/[email protected]", - "text": "github:systemjs/[email protected]", - "github:angular-ui/[email protected]": { - "pdfmake": "github:bpampuch/[email protected]" - }, - "github:angular-ui/[email protected]": { - "angular": "github:angular/[email protected]" - }, - "github:angular/[email protected]": { - "angular": "github:angular/[email protected]" - }, - "github:angular/[email protected]": { - "angular": "github:angular/[email protected]" - }, - "github:angular/[email protected]": { - "jquery": "github:components/[email protected]" - }, - "github:btford/[email protected]": { - "socket.io-client": "github:socketio/[email protected]" - }, - "github:eligrey/FileSaver.js@master": { - "blob": "github:eligrey/Blob.js@master" - }, - "github:johnsoftek/[email protected]": { - "jade-compiler": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "assert": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "buffer": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "events": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "Base64": "npm:[email protected]", - "events": "github:jspm/[email protected]", - "inherits": "npm:[email protected]", - "stream": "github:jspm/[email protected]", - "url": "github:jspm/[email protected]", - "util": "github:jspm/[email protected]" - }, - "github:jspm/[email protected]": { - "https-browserify": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "os-browserify": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "path-browserify": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "process": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "stream-browserify": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "tty-browserify": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "url": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "util": "npm:[email protected]" - }, - "github:jspm/[email protected]": { - "vm-browserify": "npm:[email protected]" - }, - "github:krispo/[email protected]": { - "d3": "npm:[email protected]", - "nvd3": "npm:[email protected]" - }, - "github:mgcrea/[email protected]": { - "angular": "github:angular/[email protected]", - "css": "github:systemjs/[email protected]" - }, - "github:mgcrea/[email protected]": { - "angular": "github:angular/[email protected]", - "angular-animate": "github:angular/[email protected]", - "angular-motion": "github:mgcrea/[email protected]", - "angular-sanitize": "github:angular/[email protected]" - }, - "github:twbs/[email protected]": { - "jquery": "npm:[email protected]" - }, - "npm:[email protected]": { - "acorn": "npm:[email protected]" - }, - "npm:[email protected]": { - "fs": "github:jspm/[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]", - "stream": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "fs": "github:jspm/[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]", - "stream": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "kind-of": "npm:[email protected]", - "longest": "npm:[email protected]", - "repeat-string": "npm:[email protected]" - }, - "npm:[email protected]": { - "fs": "github:jspm/[email protected]", - "module": "github:jspm/[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "assert": "github:jspm/[email protected]", - "buffer": "github:jspm/[email protected]", - "buffer-shims": "npm:[email protected]", - "process": "github:jspm/[email protected]", - "util": "npm:[email protected]" - }, - "npm:[email protected]": { - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "buffer": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "base64-js": "npm:[email protected]", - "child_process": "github:jspm/[email protected]", - "fs": "github:jspm/[email protected]", - "ieee754": "npm:[email protected]", - "isarray": "npm:[email protected]", - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "align-text": "npm:[email protected]", - "lazy-cache": "npm:[email protected]" - }, - "npm:[email protected]": { - "buffer": "github:jspm/[email protected]", - "commander": "npm:[email protected]", - "fs": "github:jspm/[email protected]", - "http": "github:jspm/[email protected]", - "https": "github:jspm/[email protected]", - "os": "github:jspm/[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]", - "source-map": "npm:[email protected]", - "url": "github:jspm/[email protected]", - "util": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "center-align": "npm:[email protected]", - "right-align": "npm:[email protected]", - "wordwrap": "npm:[email protected]" - }, - "npm:[email protected]": { - "child_process": "github:jspm/[email protected]", - "events": "github:jspm/[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "child_process": "github:jspm/[email protected]", - "events": "github:jspm/[email protected]", - "fs": "github:jspm/[email protected]", - "graceful-readlink": "npm:[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "acorn": "npm:[email protected]" - }, - "npm:[email protected]": { - "fs": "github:jspm/[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]", - "systemjs-json": "github:systemjs/[email protected]" - }, - "npm:[email protected]": { - "buffer": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "assert": "github:jspm/[email protected]", - "css-parse": "npm:[email protected]", - "css-stringify": "npm:[email protected]", - "fs": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "css": "github:systemjs/[email protected]" - }, - "npm:[email protected]": { - "fs": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "http": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "util": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "buffer": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "systemjs-json": "github:systemjs/[email protected]" - }, - "npm:[email protected]": { - "buffer": "github:jspm/[email protected]", - "character-parser": "npm:[email protected]", - "clean-css": "npm:[email protected]", - "commander": "npm:[email protected]", - "constantinople": "npm:[email protected]", - "jstransformer": "npm:[email protected]", - "mkdirp": "npm:[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]", - "systemjs-json": "github:systemjs/[email protected]", - "transformers": "npm:[email protected]", - "uglify-js": "npm:[email protected]", - "void-elements": "npm:[email protected]", - "with": "npm:[email protected]" - }, - "npm:[email protected]": { - "assert": "github:jspm/[email protected]", - "fs": "github:jspm/[email protected]", - "is-promise": "npm:[email protected]", - "promise": "npm:[email protected]" - }, - "npm:[email protected]": { - "buffer": "github:jspm/[email protected]", - "is-buffer": "npm:[email protected]" - }, - "npm:[email protected]": { - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "fs": "github:jspm/[email protected]", - "minimist": "npm:[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "d3": "npm:[email protected]" - }, - "npm:[email protected]": { - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]", - "wordwrap": "npm:[email protected]" - }, - "npm:[email protected]": { - "os": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "assert": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "is-promise": "npm:[email protected]", - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "asap": "npm:[email protected]" - }, - "npm:[email protected]": { - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "buffer": "github:jspm/[email protected]", - "core-util-is": "npm:[email protected]", - "events": "github:jspm/[email protected]", - "inherits": "npm:[email protected]", - "isarray": "npm:[email protected]", - "process": "github:jspm/[email protected]", - "stream-browserify": "npm:[email protected]", - "string_decoder": "npm:[email protected]" - }, - "npm:[email protected]": { - "align-text": "npm:[email protected]" - }, - "npm:[email protected]": { - "amdefine": "npm:[email protected]", - "fs": "github:jspm/[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "amdefine": "npm:[email protected]", - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "events": "github:jspm/[email protected]", - "inherits": "npm:[email protected]", - "readable-stream": "npm:[email protected]" - }, - "npm:[email protected]": { - "buffer": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "css": "npm:[email protected]", - "fs": "github:jspm/[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]", - "promise": "npm:[email protected]", - "uglify-js": "npm:[email protected]", - "vm": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "fs": "github:jspm/[email protected]", - "optimist": "npm:[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]", - "source-map": "npm:[email protected]", - "util": "github:jspm/[email protected]", - "vm": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "async": "npm:[email protected]", - "fs": "github:jspm/[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]", - "source-map": "npm:[email protected]", - "uglify-to-browserify": "npm:[email protected]", - "yargs": "npm:[email protected]" - }, - "npm:[email protected]": { - "fs": "github:jspm/[email protected]", - "stream": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "assert": "github:jspm/[email protected]", - "punycode": "npm:[email protected]", - "querystring": "npm:[email protected]", - "util": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "inherits": "npm:[email protected]", - "process": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "indexof": "npm:[email protected]" - }, - "npm:[email protected]": { - "http": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "process": "github:jspm/[email protected]", - "tty": "github:jspm/[email protected]" - }, - "npm:[email protected]": { - "acorn": "npm:[email protected]", - "acorn-globals": "npm:[email protected]" - }, - "npm:[email protected]": { - "assert": "github:jspm/[email protected]", - "camelcase": "npm:[email protected]", - "cliui": "npm:[email protected]", - "decamelize": "npm:[email protected]", - "fs": "github:jspm/[email protected]", - "path": "github:jspm/[email protected]", - "process": "github:jspm/[email protected]", - "window-size": "npm:[email protected]" - } - } -}); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/controllers/common-module.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/controllers/common-module.js b/modules/web-console/src/main/js/controllers/common-module.js index ba6ec62..fe5f8ac 100644 --- a/modules/web-console/src/main/js/controllers/common-module.js +++ b/modules/web-console/src/main/js/controllers/common-module.js @@ -31,7 +31,7 @@ const consoleModule = angular.module('ignite-console.legacy', /* endignite */ ]); -import alertTemplate from '../views/templates/alert.jade!'; +import alertTemplateUrl from '../views/templates/alert.jade'; consoleModule.run(['$rootScope', '$http', '$state', '$common', 'Auth', 'User', 'gettingStarted', ($root, $http, $state, $common, Auth, User, gettingStarted) => { @@ -100,7 +100,7 @@ consoleModule.config(['$alertProvider', ($alertProvider) => { container: 'body', placement: 'top-right', duration: '5', - template: alertTemplate(), + templateUrl: alertTemplateUrl, type: 'danger' }); }]); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/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 b865fcf..2ce6bcb 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,69 +17,62 @@ import path from 'path'; -const srcDir = './app'; -const destDir = './build'; +const rootDir = path.resolve('./'); +const srcDir = path.resolve('app'); +const destDir = path.resolve('build'); 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' ]; const jadePaths = [ - '!./views/error.jade', './views/*.jade', './views/**/*.jade' ]; -const jadeModulePaths = [ - igniteModulesDir + '/**/view/**/*.jade' -]; - -const resourcePaths = [ - './controllers/**/*.json', - './public/**/*.png', - './public/*.ico' -]; - -const resourceModulePaths = [ - igniteModulesDir + '/**/controllers/models/*.json', - igniteModulesDir + '/**/images/*.png' -]; - const jsPaths = [ './{app,controllers,generator}/*.js', './{app,controllers,generator}/**/*.js' ]; -const jsModulePaths = [ - igniteModulesTemp + '/index.js', - igniteModulesTemp + '/**/main.js', - igniteModulesTemp + '/**/module.js', - igniteModulesTemp + '/**/app/modules/*.js', - igniteModulesTemp + '/**/app/modules/**/*.js', - igniteModulesTemp + '/**/app/modules/**/*.jade' -]; - const appPaths = [ './app/**/*.Ñss', './app/**/*.jade', './app/data/*.json' ].concat(jsPaths); -const appModulePaths = [ +const resourcePaths = [ + './public/**/*.png', + './public/*.ico' +]; + +const jadeModulePaths = [ + igniteModulesDir + '/**/view/**/*.jade' +]; + +const jsModulePaths = [ igniteModulesDir + '/index.js', igniteModulesDir + '/**/main.js', igniteModulesDir + '/**/module.js', - igniteModulesDir + '/**/app/**/*.css', - igniteModulesDir + '/**/app/data/*.json', igniteModulesDir + '/**/app/modules/*.js', igniteModulesDir + '/**/app/modules/**/*.js', igniteModulesDir + '/**/app/modules/**/*.jade' ]; +const appModulePaths = [ + igniteModulesDir + '/**/app/**/*.css', + igniteModulesDir + '/**/app/data/*.json' +].concat(jsModulePaths); + +const resourceModulePaths = [ + igniteModulesDir + '/**/images/*.png' +]; + export { + rootDir, srcDir, destDir, igniteModulesDir, @@ -88,14 +81,12 @@ export { sassPaths, jadePaths, - jadeModulePaths, - resourcePaths, - resourceModulePaths, - jsPaths, - jsModulePaths, - appPaths, + + jadeModulePaths, + resourceModulePaths, + jsModulePaths, appModulePaths }; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/gulpfile.babel.js/tasks/build.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/build.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/build.js index 69cd6cd..cc95e04 100644 --- a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/build.js +++ b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/build.js @@ -18,4 +18,4 @@ import gulp from 'gulp'; import sequence from 'gulp-sequence'; -gulp.task('build', (cb) => sequence(['clean', 'clean:ignite-modules-temp'], 'ignite:modules', ['copy', 'jade', 'sass'], 'bundle', cb)); +gulp.task('build', (cb) => sequence(['clean', 'clean:ignite-modules-temp'], 'ignite:modules', ['copy', 'jade'], 'bundle', cb)); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/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 38ed8d8..d3e8dca 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 @@ -16,61 +16,17 @@ */ import gulp from 'gulp'; -import jspm from 'jspm'; -import util from 'gulp-util'; -import sequence from 'gulp-sequence'; -import htmlReplace from 'gulp-html-replace'; - -import { srcDir, destDir, igniteModulesTemp } from '../paths'; - -const options = { - minify: true -}; - -if (util.env.debug) - delete options.minify; - -if (util.env.debug || util.env.sourcemaps) - options.sourceMaps = true; - -gulp.task('bundle', ['eslint', 'bundle:ignite']); - -// Package all external dependencies and ignite-console. -gulp.task('bundle:ignite', (cb) => { - if (util.env.debug) - return sequence('bundle:ignite:vendors', 'bundle:ignite:app', cb); - - return sequence('bundle:ignite:app-min', 'bundle:ignite:app-min:replace', cb); -}); - -gulp.task('bundle:ignite:vendors', () => { - const exclude = [ - `${srcDir}/**/*`, - `${srcDir}/**/*!jade`, - './controllers/**/*.js', - './generator/**/*.js', - './public/**/*!css', - `${igniteModulesTemp}/**/*`, - `${igniteModulesTemp}/**/*!jade`, - `${igniteModulesTemp}/**/*!css` - ].map((item) => `[${item}]`).join(' - '); - - return jspm.bundle(`${srcDir}/index - ${exclude}`, `${destDir}/vendors.js`, options); +import webpack from 'webpack'; +import webpackConfig from '../webpack'; +import WebpackDevServer from 'webpack-dev-server'; + +gulp.task('bundle', (cb) => { + if (process.env.NODE_ENV === 'development') { + // Important! Call webpack and WebpackDevServer must be inline. + new WebpackDevServer(webpack(webpackConfig), webpackConfig.devServer) + .listen(webpackConfig.devServer.port, 'localhost', cb); + } + else + webpack(webpackConfig, cb); }); -gulp.task('bundle:ignite:app', () => - jspm.bundle(`${srcDir}/index - ${destDir}/vendors`, `${destDir}/app.js`, options) -); - -gulp.task('bundle:ignite:app-min', () => - jspm.bundleSFX(`${srcDir}/index`, `${destDir}/app.min.js`, options) -); - -gulp.task('bundle:ignite:app-min:replace', () => - gulp.src('./build/index.html') - .pipe(htmlReplace({ - css: 'app.min.css', - js: 'app.min.js' - })) - .pipe(gulp.dest('./build')) -); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/gulpfile.babel.js/tasks/clean.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/clean.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/clean.js index 4c821e8..c9104b2 100644 --- a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/clean.js +++ b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/clean.js @@ -16,16 +16,13 @@ */ import gulp from 'gulp'; -import ignore from 'gulp-ignore'; import clean from 'gulp-rimraf'; import { destDir, igniteModulesTemp } from '../paths'; // Clean build folder, remove files. gulp.task('clean', () => - gulp.src(`${ destDir }/*`, {read: false}) - .pipe(ignore('jspm_packages')) - .pipe(ignore('system.config.js')) + gulp.src(`${destDir}/*`, {read: false}) .pipe(clean({ force: true })) ); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/gulpfile.babel.js/tasks/connect.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/connect.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/connect.js deleted file mode 100644 index 4bffe50..0000000 --- a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/connect.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import gulp from 'gulp'; -import connect from 'gulp-connect'; -import proxy from 'http-proxy-middleware'; - -import { destDir } from '../paths'; - -// Task run static server to local development. -gulp.task('connect', () => { - connect.server({ - port: 8090, - root: [destDir], - middleware() { - return [ - proxy('/socket.io', { - target: 'http://localhost:3000', - changeOrigin: true, - ws: true - }), - proxy('/api/v1/', { - target: 'http://localhost:3000', - changeOrigin: true, - pathRewrite: { - '^/api/v1/': '/' // remove path - } - }) - ]; - }, - fallback: `${destDir}/index.html` - }); -}); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/gulpfile.babel.js/tasks/copy.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/copy.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/copy.js index c97f11a..3522038 100644 --- a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/copy.js +++ b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/copy.js @@ -16,39 +16,24 @@ */ import gulp from 'gulp'; -import util from 'gulp-util'; -import cache from 'gulp-cached'; import sequence from 'gulp-sequence'; -import { destDir, jsPaths, jsModulePaths, resourcePaths, resourceModulePaths, igniteModulesTemp } from '../paths'; +import { destDir, rootDir, jsModulePaths, resourcePaths, resourceModulePaths, igniteModulesTemp } from '../paths'; gulp.task('copy', (cb) => { - const tasks = ['copy:resource', 'copy:ignite_modules:resource']; - - if (util.env.debug || util.env.sourcemaps) { - tasks.push('copy:js'); - - tasks.push('copy:ignite_modules:js'); - } - + const tasks = ['copy:resource', 'copy:ignite_modules:js', 'copy:ignite_modules:resource']; + return sequence(tasks, cb); }); -gulp.task('copy:js', () => - gulp.src(jsPaths, {base: './'}) - .pipe(cache('copy:js')) +gulp.task('copy:resource', () => + gulp.src(resourcePaths) .pipe(gulp.dest(destDir)) ); gulp.task('copy:ignite_modules:js', () => gulp.src(jsModulePaths) - .pipe(cache('copy:ignite_modules:js')) - .pipe(gulp.dest(`${destDir}/${igniteModulesTemp}`)) -); - -gulp.task('copy:resource', () => - gulp.src(resourcePaths) - .pipe(gulp.dest(destDir)) + .pipe(gulp.dest(`${rootDir}/${igniteModulesTemp}`)) ); gulp.task('copy:ignite_modules:resource', () => http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/gulpfile.babel.js/tasks/eslint.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/eslint.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/eslint.js deleted file mode 100644 index 2d60037..0000000 --- a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/eslint.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import gulp from 'gulp'; -import cache from 'gulp-cached'; -import eslint from 'gulp-eslint'; -import sequence from 'gulp-sequence'; - -const paths = [ - './app/**/*.js', - './controllers/**/*.js', - './generator/**/*.js', - './ignite_modules_temp/**/*.js', - './gulpfile.babel.js/**/*.js', - './gulpfile.babel.js/*.js' -]; - -gulp.task('eslint:node', () => - gulp.src('./serve/**/*.js') - .pipe(cache('eslint:node')) - .pipe(eslint({envs: ['node']})) - .pipe(eslint.format()) -); - -gulp.task('eslint:browser', () => - gulp.src(paths) - .pipe(cache('eslint:browser')) - .pipe(eslint({envs: ['browser']})) - .pipe(eslint.format()) -); - -gulp.task('eslint', (cb) => sequence('eslint:browser', 'eslint:node', cb)); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/gulpfile.babel.js/tasks/ignite-modules.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/ignite-modules.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/ignite-modules.js index b1b1190..b97de7c 100644 --- a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/ignite-modules.js +++ b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/ignite-modules.js @@ -19,8 +19,7 @@ import gulp from 'gulp'; import inject from 'gulp-inject'; import clean from 'gulp-rimraf'; import sequence from 'gulp-sequence'; - -import { appModulePaths, igniteModulesTemp } from '../paths'; +import {appModulePaths, igniteModulesTemp} from '../paths'; gulp.task('ignite:modules', (cb) => sequence('ignite:modules:copy', 'ignite:modules:inject', cb)); @@ -37,7 +36,7 @@ gulp.task('ignite:modules:inject', () => transform: (filePath) => { const igniteModuleName = filePath.replace(/.*ignite_modules_temp\/([^\/]+).*/mgi, '$1'); - // return file contents as string + // Return file contents as string. return `import './${igniteModuleName}/main';`; } })) @@ -47,10 +46,10 @@ gulp.task('ignite:modules:inject', () => transform: (filePath, file, i) => { const igniteModuleName = filePath.replace(/.*ignite_modules_temp\/([^\/]+).*/mgi, '$1'); - // return file contents as string + // Return file contents as string. return (i ? ',' : '') + `'ignite-console.${igniteModuleName}'`; } })) - .pipe(clean({ force: true })) + .pipe(clean({force: true})) .pipe(gulp.dest(igniteModulesTemp)) ); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/gulpfile.babel.js/tasks/sass.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/sass.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/sass.js deleted file mode 100644 index 13dc502..0000000 --- a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/sass.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import gulp from 'gulp'; -import sass from 'gulp-sass'; - -gulp.task('sass', () => - gulp.src('./public/stylesheets/style.scss') - .pipe(sass({ outputStyle: 'nested' }).on('error', sass.logError)) - .pipe(gulp.dest('./public/stylesheets')) -); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/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..f708e67 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 @@ -18,22 +18,14 @@ import gulp from 'gulp'; import sequence from 'gulp-sequence'; -import { sassPaths, jadePaths, jadeModulePaths, resourcePaths, resourceModulePaths, appPaths, appModulePaths } from '../paths'; +import { jadePaths, jadeModulePaths, resourcePaths, resourceModulePaths, appPaths, appModulePaths } from '../paths'; -gulp.task('watch:sass', (cb) => sequence('sass', 'bundle:ignite:app', cb)); - -gulp.task('watch:ignite-modules', (cb) => sequence('clean:ignite-modules-temp', 'ignite:modules', ['eslint:browser', 'copy:ignite_modules:js', 'bundle:ignite:app'], cb)); - -// Build + connect + watch task. -gulp.task('watch', ['build', 'connect'], () => { - gulp.watch(sassPaths, ['watch:sass']); +gulp.task('watch:ignite-modules', (cb) => sequence('clean:ignite-modules-temp', 'ignite:modules', 'copy:ignite_modules:js', cb)); +// Build + watch task. +gulp.task('watch', ['build'], () => { gulp.watch(jadePaths.concat(jadeModulePaths), ['jade']); - gulp.watch(resourcePaths, ['copy:resource']); gulp.watch(resourceModulePaths, ['copy:ignite_modules:resource']); - - gulp.watch(appPaths, ['eslint:browser', 'copy:js', 'bundle:ignite:app']); gulp.watch(appModulePaths, ['watch:ignite-modules']); }); - http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/gulpfile.babel.js/webpack/common.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/common.js b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/common.js new file mode 100644 index 0000000..80f740c --- /dev/null +++ b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/common.js @@ -0,0 +1,179 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import path from 'path'; +import webpack from 'webpack'; +import autoprefixer from 'autoprefixer-core'; +import jade from 'jade'; +import progressPlugin from './plugins/progress'; + +import ExtractTextPlugin from 'extract-text-webpack-plugin'; +import HtmlWebpackPlugin from 'html-webpack-plugin'; + +import {srcDir, destDir, rootDir} from '../paths'; + +const NODE_ENV = process.env.NODE_ENV || 'production'; +const development = NODE_ENV === 'development'; +const node_modules_path = path.resolve('node_modules'); +const stylesLoader = 'css-loader?sourceMap!postcss-loader!sass-loader?outputStyle=expanded&sourceMap=true&sourceMapContents=true'; + +export default () => { + return { + node: { + fs: 'empty' + }, + + // Entry points. + entry: { + polyfill: 'babel-polyfill', + app: path.join(srcDir, 'app.js'), + vendor: path.join(srcDir, 'vendor.js') + }, + + // Output system. + output: { + path: destDir, + publicPath: './', + filename: '[name].js' + }, + + // Resolves modules. + resolve: { + extensions: [ + '', + '.js' + ], + root: [rootDir], + modulesDirectories: [ + node_modules_path, + './' + ] + }, + + // Modules resolvers. + module: { + noParse: [], + preLoaders: [ + { + test: /\.js$/, + exclude: [node_modules_path], + loader: 'eslint-loader' + } + ], + loaders: [ + { + test: /\.json$/, + loader: 'json-loader' + }, + { + test: /\.jade$/, + loaders: [ + `ngtemplate-loader?relativeTo=${rootDir}`, + 'html-loader?attrs[]=img:src&attrs[]=img:data-src', + `jade-html-loader` + ] + }, + { + test: /\.js$/, + exclude: [node_modules_path], + loaders: ['ng-annotate-loader'] + }, + { + test: /\.js$/, + exclude: [node_modules_path], + loader: 'babel-loader', + query: { + cacheDirectory: true, + plugins: ['transform-runtime', + 'add-module-exports'], + presets: ['angular'] + + } + }, + { + test: /\.css$/, + loaders: ['style-loader', + 'css-loader?sourceMap', + 'postcss-loader'] + }, + { + test: /\.(scss|sass)$/, + loader: development ? `style-loader!${stylesLoader}` : ExtractTextPlugin.extract('style-loader', stylesLoader) + }, + { + test: /\.(woff2|woff|ttf|eot|svg)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, + loaders: [ + 'file-loader?name=assets/fonts/[name].[ext]' + ] + }, + { + test: /\.(jpe?g|png|gif)$/i, + loaders: ['file-loader?name=assets/images/[name]_[hash].[ext]'] + }, + { + test: require.resolve("jquery"), + loaders: [ + "expose-loader?$", + "expose-loader?jQuery" + ] + }, + { + test: require.resolve("nvd3"), + loaders: [ + "expose-loader?nv" + ] + } + ] + }, + + // Postcss configuration. + postcss: [autoprefixer({browsers: ['last 2 versions']})], + + // ESLint loader configuration. + eslint: { + failOnWarning: false, + failOnError: !development + }, + + // Load plugins. + plugins: [ + new webpack.ProvidePlugin({ + $: 'jquery', + jQuery: 'jquery', + _: 'lodash', + nv: 'nvd3' + }), + new webpack.DefinePlugin({'NODE_ENV': JSON.stringify(NODE_ENV)}), + // new webpack.NoErrorsPlugin(), + new webpack.optimize.DedupePlugin(), + new webpack.optimize.CommonsChunkPlugin({ + name: 'common', + chunks: ['vendor', 'app'] + }), + new webpack.optimize.AggressiveMergingPlugin({moveToParents: true}), + new ExtractTextPlugin('assets/css/[name]' + (development ? '' : '.[chunkhash]') + '.css', {allChunks: true}), + new HtmlWebpackPlugin({ + filename: 'index.html', + templateContent: () => { + return jade.renderFile(path.join(rootDir, 'views', 'index.jade')); + }, + title: 'Ignite Web Console' + }), + progressPlugin + ] + }; +}; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/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 new file mode 100644 index 0000000..6b23450 --- /dev/null +++ b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/development.js @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webpack from 'webpack'; +import {destDir, rootDir} from '../../paths'; + +export default () => { + const plugins = [ + new webpack.HotModuleReplacementPlugin() + ]; + + return { + context: rootDir, + debug: true, + devtool: 'cheap-module-eval-source-map', + watch: true, + devServer: { + historyApiFallback: true, + publicPath: '/', + contentBase: destDir, + info: true, + hot: true, + inline: true, + proxy: { + '/socket.io': { + target: 'http://localhost:3000', + changeOrigin: true, + ws: true + }, + '/api/v1/*': { + target: 'http://localhost:3000', + changeOrigin: true, + rewrite: (req) => { + req.url = req.url.replace(/^\/api\/v1/, ''); + + return req; + } + } + }, + watchOptions: { + aggregateTimeout: 1000, + poll: 1000 + }, + stats: {colors: true}, + port: 9000 + }, + stats: {colors: true}, + plugins + }; +}; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/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 new file mode 100644 index 0000000..1fede99 --- /dev/null +++ b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/environments/production.js @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webpack from 'webpack'; + +import {destDir, rootDir} from '../../paths'; + +export default () => { + const plugins = [ + new webpack.optimize.UglifyJsPlugin({ + path: destDir, + minimize: true, + warnings: false, + sourceMap: true, + mangle: true + }) + ]; + + return { + context: rootDir, + bail: true, // Cancel build on error. + debug: false, + devtool: 'cheap-source-map', + output: { + publicPath: '/', + filename: '[name].[chunkhash].js', + path: destDir + }, + plugins + }; +}; http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/gulpfile.babel.js/webpack/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/index.js b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/index.js new file mode 100644 index 0000000..6682f9c --- /dev/null +++ b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/index.js @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import _ from 'lodash'; +import commonConfig from './common'; +import devConfig from './environments/development'; +import prodConfig from './environments/production'; + +const env = process.env.NODE_ENV || 'production'; + +// Config by environments. +const configs = { + production: prodConfig, + development: devConfig +}; + +// Load config file by environment +export default _.merge(commonConfig(), configs[env]()); http://git-wip-us.apache.org/repos/asf/ignite/blob/5baae1ec/modules/web-console/src/main/js/gulpfile.babel.js/webpack/plugins/progress.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/plugins/progress.js b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/plugins/progress.js new file mode 100644 index 0000000..5258059 --- /dev/null +++ b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/plugins/progress.js @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ProgressPlugin from 'webpack/lib/ProgressPlugin'; + +let chars = 0, + lastState, lastStateTime; + +const outputStream = process.stdout; + +const _goToLineStart = (nextMessage) => { + let str = ""; + for (; chars > nextMessage.length; chars--) { + str += "\b \b"; + } + + chars = nextMessage.length; + + for (var i = 0; i < chars; i++) { + str += "\b"; + } + if (str) + outputStream.write(str); +}; + +export default new ProgressPlugin((percentage, msg) => { + let state = msg; + + if (percentage < 1) { + percentage = Math.floor(percentage * 100); + msg = percentage + "% " + msg; + if (percentage < 100) { + msg = " " + msg; + } + if (percentage < 10) { + msg = " " + msg; + } + } + + state = state.replace(/^\d+\/\d+\s+/, ""); + + if (percentage === 0) { + lastState = null; + lastStateTime = +new Date(); + } + else if (state !== lastState || percentage === 1) { + let now = +new Date(); + + if (lastState) { + var stateMsg = (now - lastStateTime) + "ms " + lastState; + _goToLineStart(stateMsg); + outputStream.write(stateMsg + "\n"); + chars = 0; + } + + lastState = state; + lastStateTime = now; + } + + _goToLineStart(msg); + outputStream.write(msg); +}); \ No newline at end of file
