Skip to content

Commit

Permalink
Add jshint and reformat some files
Browse files Browse the repository at this point in the history
  • Loading branch information
importre committed Jun 4, 2014
1 parent 250b00c commit e273a82
Show file tree
Hide file tree
Showing 12 changed files with 1,351 additions and 1,262 deletions.
2 changes: 1 addition & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"directory": "src/bower_components"
"directory": "src/bower_components"
}
43 changes: 43 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"globals": {
"$": true,
"$routeProvider": true,
"$locationProvider": true,
"parseInt": true,
"parseProcessList": true,
"parseDeviceInfoList": true,
"parsePackageList": true,
"makeCommand": true,
"parseMemInfo": true,
"parsePackageMemInfo": true,
"parseDiskSpace": true,
"parseResolution": true,
"arrayBufferToString": true,
"arrayBufferToBinaryString": true,
"stringToArrayBuffer": true,
"newZeroArray": true,
"getChartId": true,
"integerToArrayBuffer": true,
"angular": true,
"chrome": true
}
}
268 changes: 138 additions & 130 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,144 +1,152 @@
'use strict';

module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compress: {
dist: {
options: {
archive: 'package/<%= pkg.name %>_<%= pkg.version %>.zip'
},
files: [
{
expand: true,
cwd: 'dist/src/',
src: ['**'],
dest: ''
}
]
}
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compress: {
dist: {
options: {
archive: 'package/<%= pkg.name %>_<%= pkg.version %>.zip'
},
files: [
{
expand: true,
cwd: 'dist/src/',
src: ['**'],
dest: ''
}
]
}
},

watch: {
js: {
files: ['Gruntfile.js', 'src/scripts/{,*/}*.js'],
options: {
livereload: true
}
},
views : {
files: ['src/index.html', 'src/views/{,*/}*.html'],
options: {
livereload: true
}
},
styles: {
files: ['src/styles/{,*/}*.css'],
tasks: [],
options: {
livereload: true
}
},
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'src/views/**/*.html',
'src/assets/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'src/manifest.json'
]
}
},

connect: {
options: {
port: 9000,
livereload: 35729,
hostname: 'localhost',
open: true
},
chrome: {
options: {
base: ['src']
}
}
},
watch: {
js: {
files: ['Gruntfile.js', 'src/scripts/{,*/}*.js'],
tasks: ['jshint'],
options: {
livereload: true
}
},
views: {
files: ['src/index.html', 'src/views/{,*/}*.html'],
options: {
livereload: true
}
},
styles: {
files: ['src/styles/{,*/}*.css'],
tasks: [],
options: {
livereload: true
}
},
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'src/views/**/*.html',
'src/assets/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'src/manifest.json'
]
}
},

jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'src/scripts/**/*.js'
]
},

connect: {
options: {
port: 9000,
livereload: 35729,
hostname: 'localhost',
open: true
},
chrome: {
options: {
base: ['src']
}
}
},

clean: {
dist: {
files: [
{
dot: true,
src: ['dist/*', 'package/*.zip']
}
]
}
},

copy: {
dist: {
files: [
{
cwd: '.',
dot: false,
dest: 'dist/',
src: [
"src/manifest.json",
"src/index.html",
"src/scripts/*",
"src/styles/*",
"src/assets/*",
"src/views/*",
"src/bower_components/bootstrap/dist/css/bootstrap.min.css",
"src/bower_components/bootstrap/dist/js/bootstrap.min.js",
"src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot",
"src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg",
"src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf",
"src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff",
"src/bower_components/bootstrap/dist/js/bootstrap.min.css",
"src/bower_components/jquery/jquery.min.js",
"src/bower_components/angular/angular.min.js",
"src/bower_components/angular-route/angular-route.min.js",
"src/bower_components/angular-sanitize/angular-sanitize.min.js",
"src/bower_components/jqplot/jquery.jqplot.min.css",
"src/bower_components/jqplot/jquery.jqplot.min.js",
"src/bower_components/jqplot/plugins/jqplot.canvasTextRenderer.min.js",
"src/bower_components/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js"
]
}
]
}
}
});
clean: {
dist: {
files: [
{
dot: true,
src: ['dist/*', 'package/*.zip']
}
]
}
},

grunt.registerTask('default', [
'build'
]);
copy: {
dist: {
files: [
{
cwd: '.',
dot: false,
dest: 'dist/',
src: [
'src/manifest.json',
'src/index.html',
'src/scripts/*',
'src/styles/*',
'src/assets/*',
'src/views/*',
'src/bower_components/bootstrap/dist/css/bootstrap.min.css',
'src/bower_components/bootstrap/dist/js/bootstrap.min.js',
'src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
'src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
'src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
'src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff',
'src/bower_components/bootstrap/dist/js/bootstrap.min.css',
'src/bower_components/jquery/dist/jquery.min.js',
'src/bower_components/angular/angular.min.js',
'src/bower_components/angular-route/angular-route.min.js',
'src/bower_components/angular-sanitize/angular-sanitize.min.js',
'src/bower_components/jqplot/jquery.jqplot.min.css',
'src/bower_components/jqplot/jquery.jqplot.min.js',
'src/bower_components/jqplot/plugins/jqplot.canvasTextRenderer.min.js',
'src/bower_components/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js'
]
}
]
}
}
});

grunt.registerTask('build', [
'build:dist'
]);
grunt.registerTask('default', [
'build'
]);

grunt.registerTask('debug', function (platform) {
var watch = grunt.config('watch');
platform = platform || 'chrome';
grunt.registerTask('build', [
'build:dist'
]);

// Configure updated watch task
grunt.config('watch', watch);
grunt.registerTask('debug', function (platform) {
var watch = grunt.config('watch');
platform = platform || 'chrome';

grunt.task.run([
'connect:' + platform,
'watch'
]);
});
// Configure updated watch task
grunt.config('watch', watch);
grunt.task.run(['connect:' + platform, 'watch']);
});

grunt.registerTask('build:dist', [
'clean:dist',
'copy:dist',
'compress:dist'
]);
}
grunt.registerTask('build:dist', [
'clean:dist',
'copy:dist',
'compress:dist'
]);
};
30 changes: 15 additions & 15 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"authors": [
"importre"
],
"dependencies": {
"angular": "~1.2.16",
"angular-route": "~1.2.16",
"angular-sanitize": "~1.2.16",
"bootstrap": "~3.0.2",
"jqplot": "*"
},
"description": "Chrome ADB(Android Debug Bridge) Client",
"homepage": "https://github.com/importre/chromeadb",
"license": "BSD",
"name": "ChromeADB",
"version": "0.4.2"
"authors": [
"importre"
],
"dependencies": {
"angular": "~1.2.16",
"angular-route": "~1.2.16",
"angular-sanitize": "~1.2.16",
"bootstrap": "~3.0.2",
"jqplot": "*"
},
"description": "Chrome ADB(Android Debug Bridge) Client",
"homepage": "https://github.com/importre/chromeadb",
"license": "BSD",
"name": "ChromeADB",
"version": "0.4.2"
}
Loading

0 comments on commit e273a82

Please sign in to comment.