]> source.dussan.org Git - sonarqube.git/commitdiff
upgrade to babel 6
authorStas Vilchik <vilchiks@gmail.com>
Tue, 15 Dec 2015 13:53:36 +0000 (14:53 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 15 Dec 2015 13:53:36 +0000 (14:53 +0100)
server/sonar-web/.babelrc [new file with mode: 0644]
server/sonar-web/.istanbul.yml [deleted file]
server/sonar-web/package.json
server/sonar-web/src/main/js/apps/background-tasks/search.js
server/sonar-web/src/main/js/components/mixins/tooltips-mixin.js
server/sonar-web/src/main/js/main/app.js
server/sonar-web/tests/mocha.opts

diff --git a/server/sonar-web/.babelrc b/server/sonar-web/.babelrc
new file mode 100644 (file)
index 0000000..dbaabd5
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "presets": ["es2015", "react"],
+   "ignore": [
+      "**/libs/**"
+    ]
+}
diff --git a/server/sonar-web/.istanbul.yml b/server/sonar-web/.istanbul.yml
deleted file mode 100644 (file)
index 323429a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-instrumentation:
-  root: 'src/main/js'
index ce870393771928f689745f4ed8795f0b0cbcf87c..b1db429ef8fdb92b8f2805b1ad40260faed13009 100644 (file)
@@ -5,9 +5,13 @@
   "repository": "SonarSource/sonarqube",
   "license": "LGPL-3.0",
   "devDependencies": {
-    "babel": "5.8.23",
-    "babel-eslint": "^4.1.6",
-    "babelify": "6.3.0",
+    "babel-cli": "^6.3.17",
+    "babel-eslint": "4.1.6",
+    "babel-polyfill": "^6.3.14",
+    "babel-preset-es2015": "^6.3.13",
+    "babel-preset-react": "^6.3.13",
+    "babel-register": "^6.3.13",
+    "babelify": "7.2.0",
     "backbone": "1.2.3",
     "backbone.marionette": "2.4.3",
     "blueimp-md5": "1.1.1",
     "gulp-util": "3.0.6",
     "handlebars": "2.0.0",
     "hbsfy": "2.3.1",
-    "isparta": "3.0.4",
+    "isparta": "^4.0.0",
     "jquery": "2.1.4",
     "jsdom": "6.5.1",
-    "mocha": "2.3.3",
+    "mocha": "^2.3.4",
     "moment": "2.10.6",
     "numeral": "1.5.3",
     "react": "0.14.2",
@@ -61,8 +65,8 @@
   "scripts": {
     "build-fast": "gulp --fast",
     "build": "gulp",
-    "test": "./node_modules/.bin/mocha --opts tests/mocha.opts tests",
-    "coverage": "./node_modules/.bin/babel-node ./node_modules/.bin/isparta cover --dir './target/coverage' ./node_modules/.bin/_mocha -- --opts tests/mocha.opts tests",
+    "test": "mocha --opts tests/mocha.opts tests",
+    "coverage": "babel-node node_modules/.bin/isparta cover --root 'src/main/js' --include-all-sources --excludes '**/libs/**' --dir 'target/coverage' node_modules/.bin/_mocha -- --opts tests/mocha.opts tests",
     "lint": "eslint src/main/js"
   },
   "browserify-shim": {
index e1c5e6cdea58b3aed54ae4f77bd68dbf91f010f6..21294850572fcbd3034c437429af88b3f275f80a 100644 (file)
@@ -62,7 +62,7 @@ export default React.createClass({
       changeYear: true,
       onSelect: this.onDateInputChange
     };
-    if ($.fn.datepicker) {
+    if ($.fn && $.fn.datepicker) {
       $(this.refs.minDate).datepicker(opts);
       $(this.refs.maxDate).datepicker(opts);
     }
index 3f16dded6397bfee6f64ef68217a1dec14c5884d..0b48fb83fcd6f85d2b19ff8d7ad55bc60305e941 100644 (file)
@@ -19,21 +19,21 @@ export const TooltipsMixin = {
   },
 
   initTooltips () {
-    if ($.fn.tooltip) {
+    if ($.fn && $.fn.tooltip) {
       $('[data-toggle="tooltip"]', ReactDOM.findDOMNode(this))
           .tooltip({ container: 'body', placement: 'bottom', html: true });
     }
   },
 
   hideTooltips () {
-    if ($.fn.tooltip) {
+    if ($.fn && $.fn.tooltip) {
       $('[data-toggle="tooltip"]', ReactDOM.findDOMNode(this))
           .tooltip('hide');
     }
   },
 
   destroyTooltips () {
-    if ($.fn.tooltip) {
+    if ($.fn && $.fn.tooltip) {
       $('[data-toggle="tooltip"]', ReactDOM.findDOMNode(this))
           .tooltip('destroy');
     }
index b4e0170b3c76029d11201d66d7254b7127469b1f..0a6f7ab6b36c39b13d8e17b9d2498d242f8bc1b2 100644 (file)
@@ -1,4 +1,4 @@
-import 'babelify/polyfill';
+import 'babel-polyfill';
 import $ from 'jquery';
 import _ from 'underscore';
 import Backbone from 'backbone';
index 94ed8380c8d5af729a6313dcd958b32e99e54896..c33427ae69d8b95922b419ec6daaf49738828e92 100644 (file)
@@ -1,4 +1,3 @@
 --recursive
---compilers js:babel/register
---compilers jsx:babel/register
+--compilers js:babel-register
 --require tests/jsdom-setup.js