From aa7cf5e61cbee2f2f6db7aab30737bd79465c874 Mon Sep 17 00:00:00 2001 From: Jimmy Ha Date: Fri, 25 Jul 2014 00:00:15 -0400 Subject: [PATCH] sets up greeneyes as a nodeJS applciation stuff --- .bowerrc | 3 +++ .travis.yml | 11 +++++++++ Gruntfile.js | 54 +++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 21 ++++++++++++++++++ README.md | 24 ++++++++++++++++++++ bower.json | 30 +++++++++++++++++++++++++ build/js/main.js | 5 +++++ build/js/require.js | 1 + package.json | 40 +++++++++++++++++++++++++++++++++ src/js/analytics.js | 25 +++++++++++++++++++++ src/js/main.js | 13 +++++++++++ 11 files changed, 227 insertions(+) create mode 100644 .bowerrc create mode 100644 .travis.yml create mode 100644 Gruntfile.js create mode 100644 LICENSE create mode 100644 README.md create mode 100644 bower.json create mode 100644 build/js/main.js create mode 100644 build/js/require.js create mode 100644 package.json create mode 100644 src/js/analytics.js create mode 100644 src/js/main.js diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..35b5645 --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "src/components/" +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ccf07e4 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..5af78dc --- /dev/null +++ b/Gruntfile.js @@ -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' + ]); +}; \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c0be5ce --- /dev/null +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..89ac36c --- /dev/null +++ b/README.md @@ -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 +``` diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..5905878 --- /dev/null +++ b/bower.json @@ -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" + } +} diff --git a/build/js/main.js b/build/js/main.js new file mode 100644 index 0000000..8440273 --- /dev/null +++ b/build/js/main.js @@ -0,0 +1,5 @@ +/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ + +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=Z.type(e);return"function"===n||Z.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(Z.isFunction(t))return Z.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return Z.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(at.test(t))return Z.filter(t,e,n);t=Z.filter(t,e)}return Z.grep(e,function(e){return U.call(t,e)>=0!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(e){var t=ht[e]={};return Z.each(e.match(dt)||[],function(e,n){t[n]=!0}),t}function s(){J.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1),Z.ready()}function a(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Z.expando+Math.random()}function u(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(bt,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:xt.test(n)?Z.parseJSON(n):n}catch(i){}yt.set(e,t,n)}else n=void 0;return n}function l(){return!0}function c(){return!1}function f(){try{return J.activeElement}catch(e){}}function p(e,t){return Z.nodeName(e,"table")&&Z.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function d(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function h(e){var t=Pt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function g(e,t){for(var n=0,r=e.length;r>n;n++)vt.set(e[n],"globalEval",!t||vt.get(t[n],"globalEval"))}function m(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(vt.hasData(e)&&(o=vt.access(e),s=vt.set(t,o),l=o.events)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)Z.event.add(t,i,l[i][n])}yt.hasData(e)&&(a=yt.access(e),u=Z.extend({},a),yt.set(t,u))}}function v(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&Z.nodeName(e,t)?Z.merge([e],n):n}function y(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Nt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function x(t,n){var r,i=Z(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:Z.css(i[0],"display");return i.detach(),o}function b(e){var t=J,n=$t[e];return n||(n=x(e,t),"none"!==n&&n||(Wt=(Wt||Z("