Skip to content

Commit

Permalink
fixing compilation of grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
Nepomuceno committed Dec 9, 2016
1 parent f3ebd2d commit a8ae0a5
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 24 deletions.
6 changes: 1 addition & 5 deletions package.json
Expand Up @@ -10,10 +10,6 @@
"url": "http://github.com/grafana/grafana.git"
},
"devDependencies": {
"@types/es6-promise": "0.0.32",
"@types/es6-shim": "^0.31.32",
"@types/jquery": "^2.0.34",
"@types/mocha": "^2.2.33",
"@types/rx": "^2.5.34",
"autoprefixer": "^6.4.0",
"es6-promise": "^3.0.2",
Expand All @@ -32,6 +28,7 @@
"grunt-contrib-jshint": "~1.1.0",
"grunt-contrib-uglify": "~2.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-exec": "^1.0.1",
"grunt-filerev": "^2.3.1",
"grunt-git-describe": "~2.4.2",
"grunt-karma": "~2.0.0",
Expand All @@ -41,7 +38,6 @@
"grunt-sass": "^1.2.1",
"grunt-string-replace": "~1.3.1",
"grunt-systemjs-builder": "^0.2.7",
"grunt-tslint": "^3.3.0",
"grunt-typescript": "^0.8.0",
"grunt-usemin": "3.1.1",
"jshint-stylish": "~2.2.1",
Expand Down
15 changes: 6 additions & 9 deletions public/app/plugins/panel/graph/data_processor.ts
Expand Up @@ -130,14 +130,8 @@ export class DataProcessor {

let fields = [];
var firstItem = dataList[0];
if (firstItem.type === 'docs'){
if (firstItem.datapoints.length === 0) {
return [];
}

let fieldParts = [];

function getPropertiesRecursive(obj) {
let fieldParts = [];
function getPropertiesRecursive(obj) {
_.forEach(obj, (value, key) => {
if (_.isObject(value)) {
fieldParts.push(key);
Expand All @@ -150,8 +144,11 @@ export class DataProcessor {
}
});
fieldParts.pop();
}
if (firstItem.type === 'docs'){
if (firstItem.datapoints.length === 0) {
return [];
}

getPropertiesRecursive(firstItem.datapoints[0]);
return fields;
}
Expand Down
2 changes: 1 addition & 1 deletion tasks/build_task.js
Expand Up @@ -6,7 +6,7 @@ module.exports = function(grunt) {
'jshint:source',
'jshint:tests',
'jscs',
'tslint',
'exec:tslint',
'clean:release',
'copy:node_modules',
'copy:public_to_gen',
Expand Down
4 changes: 2 additions & 2 deletions tasks/default_task.js
Expand Up @@ -16,13 +16,13 @@ module.exports = function(grunt) {
grunt.registerTask('default', [
'jscs',
'jshint',
'tslint',
'exec:tslint',
'clean:gen',
'copy:node_modules',
'copy:public_to_gen',
'phantomjs',
'css',
'typescript:build'
'exec:tscompile'
]);

grunt.registerTask('test', ['default', 'karma:test', 'no-only-tests']);
Expand Down
7 changes: 7 additions & 0 deletions tasks/options/exec.js
@@ -0,0 +1,7 @@
module.exports = function(config) {
'use strict'
return {
tslint : "node ./node_modules/tslint/lib/tslint-cli.js -c tslint.json --project ./tsconfig.json --type-check",
tscompile: "node ./node_modules/typescript/lib/tsc.js -p tsconfig.json"
};
};
2 changes: 1 addition & 1 deletion tasks/options/watch.js
Expand Up @@ -65,7 +65,7 @@ module.exports = function(config, grunt) {
grunt.config('tslint.source.files.src', filepath);

grunt.task.run('typescript:build');
grunt.task.run('tslint');
grunt.task.run('exec:tslint');
}

done();
Expand Down
13 changes: 11 additions & 2 deletions tsconfig.json
Expand Up @@ -10,9 +10,18 @@
"module": "system",
"noEmitOnError": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
"experimentalDecorators": true,
"noImplicitReturns":false,
"noImplicitThis":false,
"noImplicitUseStrict":false,
"noUnusedLocals":false
},
"files": [
"include": [
"public/app/**/*.ts"
],
"exclude": [
"public/vendor/**/*",
"public/**/*.d.ts"
]

}
4 changes: 0 additions & 4 deletions tslint.json
Expand Up @@ -7,7 +7,6 @@
"forin": false,
"indent": [true, "spaces"],
"label-position": true,
"label-undefined": true,
"max-line-length": [true, 140],
"member-access": false,
"no-arg": true,
Expand All @@ -21,7 +20,6 @@
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
Expand All @@ -31,8 +29,6 @@
"no-switch-case-fall-through": false,
"no-trailing-whitespace": true,
"no-unused-expression": false,
"no-unused-variable": false,
"no-unreachable": true,
"no-use-before-declare": true,
"no-var-keyword": false,
"object-literal-sort-keys": false,
Expand Down

0 comments on commit a8ae0a5

Please sign in to comment.