From 197876a922dcbc8afebe1f7b52576ffc64dea0ca Mon Sep 17 00:00:00 2001 From: Clint Pitzak Date: Thu, 25 Aug 2016 22:50:22 -0700 Subject: [PATCH] Add gruntjs, update angular-chart.js dependency to come from node.js, fix jshint error. - Changed angular-chart.js to come npm rather than bower because angular-chart.js from bower grabs the latest version of the Chart.js and the Chart.js team decided to no longer provide a distribution of their library dependency. Chart.js latest update no longer provides a dist/ folder of files. Which obviously breaks support for bower. They will be readd support in the next version, until then using the dependency from npm because the support is still there. https://github.com/chartjs/Chart.js/issues/3033 - Adding grunt to copy over dependency files. --- Gruntfile.js | 24 +++++++++++++++++++ README.md | 1 + app/index.html | 10 ++++---- .../controllers/mainController.js | 0 bower.json | 1 - package.json | 13 ++++++++-- server.js | 2 +- 7 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 Gruntfile.js mode change 100755 => 100644 README.md mode change 100755 => 100644 app/index.html rename app/{ => scripts}/controllers/mainController.js (100%) mode change 100755 => 100644 mode change 100755 => 100644 bower.json mode change 100755 => 100644 server.js diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..d3aa6e3 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,24 @@ +/*global module:false*/ +module.exports = function(grunt) { + + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + copy: { + dependencies: { + files: [ + { + src:'node_modules/angular-chart.js/dist/angular-chart.min.js', + dest: 'app/scripts/lib/angular-chart.min.js' + },{ + src:'node_modules/angular-chart.js/node_modules/chart.js/dist/Chart.min.js', + dest: 'app/scripts/lib/Chart.min.js' + } + ] + } + } + }); + + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.registerTask('build', ['copy:dependencies']); + +}; \ No newline at end of file diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 41647ed..bb8f608 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ $ sudo update-rc.d weatherWeb enable $ sudo systemctl daemon-reload $ npm install $ bower install +$ grunt build $ sudo service weatherWeb start ``` Screen shot taken around 9:30 pm at night. diff --git a/app/index.html b/app/index.html old mode 100755 new mode 100644 index 881923c..31360a5 --- a/app/index.html +++ b/app/index.html @@ -73,13 +73,13 @@

{{ location.city }}

- - + + - - + + - + diff --git a/app/controllers/mainController.js b/app/scripts/controllers/mainController.js old mode 100755 new mode 100644 similarity index 100% rename from app/controllers/mainController.js rename to app/scripts/controllers/mainController.js diff --git a/bower.json b/bower.json old mode 100755 new mode 100644 index e88a462..866a43a --- a/bower.json +++ b/bower.json @@ -19,7 +19,6 @@ "angular": "^1.5.7", "angular-resource": "^1.5.7", "angular-route": "^1.5.7", - "angular-chart.js": "^1.0.0-beta1", "bootstrap": "^3.3.6" } } diff --git a/package.json b/package.json index 850b308..59b2794 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,28 @@ { "name": "weather_web", - "version": "0.0.1", + "version": "1.0.1", "description": "Display daily weather outside and inside room. And make projections.", "main": "server.js", "scripts": { - "jshint": "./node_modules/.bin/jshint --config .jshintrc --exclude=node_modules,app/bower_components,test . || exit 0" + "jshint": "./node_modules/.bin/jshint --config .jshintrc --exclude=node_modules,app/bower_components,app/scripts/lib,test . || exit 0" }, "author": "Clint Pitzak", "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/cpitzak/weatherWeb.git" + }, "dependencies": { + "angular-chart.js": "^1.0.2", "body-parser": "^1.15.1", "config": "^1.21.0", "express": "^4.13.3", "express-session": "^1.13.0", "jshint": "^2.9.1-rc2", "mongoose": "^4.3.4" + }, + "devDependencies": { + "grunt": "^1.0.1", + "grunt-contrib-copy": "^1.0.0" } } diff --git a/server.js b/server.js old mode 100755 new mode 100644 index a9f3ddf..cc12729 --- a/server.js +++ b/server.js @@ -30,7 +30,7 @@ months[10] = "November"; months[11] = "December"; // set time zone so that when visiting the webpage from different locations it matches the time zone of the raspberry pi -process.env['TZ'] = config.timeZone; +process.env.TZ = config.timeZone; function convert24to12Hour(hour24) { var hour12 = ((hour24 + 11) % 12) + 1;