Skip to content

Commit

Permalink
Add gruntjs, update angular-chart.js dependency to come from node.js,…
Browse files Browse the repository at this point in the history
… 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. chartjs/Chart.js#3033
- Adding grunt to copy over dependency files.
  • Loading branch information
cpitzak committed Aug 26, 2016
1 parent 07b12d4 commit 197876a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 9 deletions.
24 changes: 24 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -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']);

};
1 change: 1 addition & 0 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions app/index.html
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ <h4>{{ location.city }}</h4>
<!-- dependencies -->
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/bower_components/angular/angular.min.js" type="text/javascript" ></script>
<script src="/bower_components/angular-resource/angular-resource.min.js" type="text/javascript" ></script>
<script src="/bower_components/angular/angular.min.js"></script>
<script src="/bower_components/angular-resource/angular-resource.min.js"></script>
<script src="/bower_components/angular-route/angular-route.min.js"></script>
<script src="/bower_components/Chart.js/dist/Chart.min.js"></script>
<script src="/bower_components/angular-chart.js/dist/angular-chart.min.js"></script>
<script src="/scripts/lib/Chart.min.js"></script>
<script src="/scripts/lib/angular-chart.min.js"></script>

<!-- controllers -->
<script src="/controllers/mainController.js"></script>
<script src="/scripts/controllers/mainController.js"></script>
</body>
</html>
File renamed without changes.
1 change: 0 additions & 1 deletion bower.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
2 changes: 1 addition & 1 deletion server.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 197876a

Please sign in to comment.