-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sets up greeneyes as a nodeJS applciation stuff
- Loading branch information
1 parent
63d3bd7
commit aa7cf5e
Showing
11 changed files
with
227 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "src/components/" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: node_js | ||
node_js: | ||
- "0.11" | ||
- "0.10" | ||
before_script: | ||
- npm install | ||
- npm install -g grunt-cli | ||
- npm install -g bower | ||
- bower install | ||
script: | ||
- grunt test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
// The "wrapper" function | ||
module.exports = function(grunt) { | ||
// Do grunt-related things in here | ||
// Project configuration. | ||
require('load-grunt-tasks')(grunt); | ||
grunt.initConfig({ | ||
// imports the JSON metadata stored in package.json | ||
pkg: grunt.file.readJSON('package.json'), | ||
// compiles LESS file to minified CSS | ||
paths: { | ||
src: './src', | ||
build: './build', | ||
components: './src/components' | ||
}, | ||
requirejs: { | ||
build: { | ||
options: { | ||
baseUrl: "<%= paths.src %>/js/", | ||
mainConfigFile: "<%= paths.src %>/js/main.js", | ||
name: "main", | ||
out: "<%= paths.build %>/js/main.js", | ||
optimize: 'uglify2', | ||
} | ||
} | ||
}, | ||
uglify: { | ||
options: { | ||
preserveComments: false | ||
}, | ||
require: { | ||
files: { | ||
'<%= paths.build %>/js/require.js': ['<%= paths.components %>/**/require.js'] | ||
} | ||
} | ||
}, | ||
watch: { | ||
// runs less task when any less files change | ||
js: { | ||
files: ['./src/js/*'], | ||
tasks: ['requirejs'] | ||
} | ||
} | ||
}); | ||
|
||
grunt.registerTask('default', [ | ||
'requirejs', | ||
'uglify', | ||
'watch' | ||
]); | ||
grunt.registerTask('test', [ | ||
'watch' | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014 Jimmy Ha | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Greeneyes | ||
======== | ||
|
||
[![Bower version](https://badge.fury.io/bo/greeneyes.svg)](http://badge.fury.io/bo/greeneyes) | ||
[![Build Status](https://secure.travis-ci.org/herereadthis/greeneyes.svg?branch=master)](http://travis-ci.org/herereadthis/greeneyes) | ||
[![devDependency Status](https://david-dm.org/herereadthis/greeneyes/dev-status.svg)](https://david-dm.org/herereadthis/greeneyes#info=devDependencies) | ||
|
||
Greeneyes is an AMD Javascript library of utility modules made for RequireJS" | ||
|
||
## Build | ||
|
||
``` | ||
$ git clone https://github.com/herereadthis/greeneyes.git | ||
$ cd greeneyes/ | ||
$ npm install | ||
$ grunt | ||
``` | ||
|
||
|
||
#### Recommended: Add Greeneyes as a Bower dependency | ||
|
||
``` | ||
$ bower install --save greeneyes | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "greeneyes", | ||
"version": "0.1.0", | ||
"authors": [ | ||
{ | ||
"name": "Jimmy Ha", | ||
"homepage": "http://herereadthis.com" | ||
} | ||
], | ||
"description": "AMD Javascript library of utility modules made for RequireJS", | ||
"homepage": "http://herereadthis.com/code/greeneyes", | ||
"main": [ | ||
"src/js/analytics.less" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
".bowerrc", | ||
".gitignore", | ||
".sass-cache", | ||
".travis.yml", | ||
"docs", | ||
"Gruntfile.js", | ||
"index.html", | ||
"node_modules", | ||
"src/components" | ||
], | ||
"dependencies": { | ||
"requirejs": "~2.1.14" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "greeneyes", | ||
"version": "0.1.0", | ||
"description": "AMD Javascript library of utility modules made for RequireJS", | ||
"main": "index.html", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/herereadthis/greeneyes.git" | ||
}, | ||
"keywords": [ | ||
"AMD", | ||
"RequireJS", | ||
"JavaScript" | ||
], | ||
"author": { | ||
"name": "Jimmy Ha", | ||
"email": "herereadthis@gmail.com", | ||
"url": "http://herereadthis.com/" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "GPL", | ||
"url": "https://github.com/herereadthis/greeneyes/blob/master/LICENSE" | ||
} | ||
], | ||
"bugs": { | ||
"url": "https://github.com/herereadthis/greeneyes/issues" | ||
}, | ||
"homepage": "https://github.com/herereadthis/greeneyes", | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"grunt-contrib-requirejs": "^0.4.4", | ||
"grunt-contrib-uglify": "^0.5.0", | ||
"grunt-contrib-watch": "^0.6.1", | ||
"load-grunt-tasks": "^0.6.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Google Analytics, defined as an AMD for RequireJS | ||
|
||
(function() { | ||
define(function(require) { | ||
var $, exports; | ||
$ = require("jquery"); | ||
exports = { | ||
track: function(accountId) { | ||
var ga, s, _gaq; | ||
accountId = $("body").data("google-analytics") || accountId; | ||
_gaq = window._gaq = _gaq || []; | ||
ga = document.createElement("script"); | ||
s = document.getElementsByTagName('script')[0]; | ||
_gaq.push(['_setAccount', accountId]); | ||
_gaq.push(['_trackPageview']); | ||
console.log(_gaq); | ||
ga.type = "text/javascript"; | ||
ga.async = true; | ||
ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + ".google-analytics.com/ga.js"; | ||
return s.parentNode.insertBefore(ga, s); | ||
} | ||
}; | ||
return exports; | ||
}); | ||
}).call(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(function() { | ||
requirejs.config({ | ||
paths: { | ||
// google analytics | ||
"Analytics": "analytics", | ||
// jQuery | ||
"jquery": '../components/jquery/dist/jquery.min', | ||
} | ||
}); | ||
require(['jquery', 'Analytics'], function($, Analytics) { | ||
return Analytics.track(); | ||
}); | ||
}).call(this); |