Skip to content

Commit

Permalink
Build with grunt-component-build
Browse files Browse the repository at this point in the history
  • Loading branch information
sideroad committed Jul 1, 2014
1 parent 5eccb49 commit 5718757
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
components
build
node_modules
14 changes: 14 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"boss": true,
"eqnull": true,
"node": true,
"es5": true
}
47 changes: 47 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* grunt-wpt-page
* https://github.com/sideroad/grunt-wpt-page
*
* Copyright (c) 2013 sideroad
* Licensed under the MIT license.
*/

'use strict';

module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
jshint: {
all: [
'index.js',
],
options: {
jshintrc: '.jshintrc',
},
},

clean: ['build', 'components'],

// Build component
componentbuild: {
pages: {
options: {
install: true
},
src: '.',
dest: 'build'
}
}

});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-component-build');

// By default, lint and run all tests.
grunt.registerTask('default', ['jshint', 'clean', 'componentbuild']);

};
8 changes: 2 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<html>
<head>
<link rel='stylesheet' href='//cdn.oesmith.co.uk/morris-0.4.3.min.css'>
<link rel='stylesheet' href='build/components-bootstrap/css/bootstrap.min.css'>
<link rel='stylesheet' href='build/components-bootstrap/css/bootstrap-theme.min.css'>
<link rel='stylesheet' href='build/components/bootstrap/3.1.1/css/bootstrap.min.css'>
<link rel='stylesheet' href='build/components/bootstrap/3.1.1/css/bootstrap-theme.min.css'>
<link rel='stylesheet' href='build/build.css'>

<title>Grunt WebPageTest</title>
Expand Down Expand Up @@ -187,9 +187,5 @@ <h3>Detail</h3>
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="//cdn.oesmith.co.uk/morris-0.5.1.min.js"></script>
<script src='build/build.js'></script>
<script type="text/javascript">
require("grunt-wpt-page/index.js");
</script>

</body>
</html>
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/*global Morris: true */

(function( Morris ){
'use strict';

var $ = require('jquery'),
_ = require('lodash'),
Expand Down Expand Up @@ -77,7 +80,7 @@
},
filters: {
convertToDate: function(time){
return moment(time*1000).format('LLL')
return moment(time*1000).format('LLL');
},
totalBytes: function(data){
var total = _.reduce(data, function(memo, val, key){
Expand Down
43 changes: 43 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "grunt-wpt-page",
"description": "Keep tracking webpagetest score",
"homepage": "https://github.com/sideroad/grunt-wpt-page",
"author": {
"name": "sideroad",
"email": "[email protected]",
"url": "http://sideroad.secret.jp/"
},
"repository": {
"type": "git",
"url": "git://github.com/sideroad/grunt-wpt-page.git"
},
"bugs": {
"url": "https://github.com/sideroad/grunt-wpt-page/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/sideroad/grunt-wpt-page/blob/master/LICENSE-MIT"
}
],
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test": "grunt test"
},
"devDependencies": {
"grunt": "~0.4.0",
"grunt-component-build": "^0.5.0",
"grunt-contrib-clean": "^0.5.0",
"grunt-contrib-jshint": "~0.1.1"
},
"peerDependencies": {
"grunt": "~0.4.0"
},
"keywords": [
"gruntplugin"
],
"dependencies": {}
}

0 comments on commit 5718757

Please sign in to comment.