Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Introduce Grunt build system.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfiller committed Jun 21, 2012
1 parent b85b09e commit 15a6727
Show file tree
Hide file tree
Showing 8 changed files with 638 additions and 236 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
#Sidetap

We're working on it!

##Building Files Using Grunt

Sidetap's javascript and css are written using coffeescript and less respectively. Each of these file types must be compiled before they can be used by the browser. To do this easily, we're using the excellent [grunt build system](). To use the build system, you must first install [node]() and [npm]().

1. Install grunt: ``npm install grunt``
2. Install grunt-contrib: ``npm install grunt-contrib``
3. That's it.

There are a few available commands.

- ``grunt`` or ``grunt build``: build the css & js files
- ``grunt watch``: build the css & js files whenever the less or coffee files change
47 changes: 47 additions & 0 deletions grunt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* grunt
* CoffeeScript example
*/
module.exports = function(grunt){

grunt.initConfig({
lint: {
files: ['grunt.js', 'src/*.js']
},
coffee: {
compile: {
options: {
bare: true
},
files: {
'src/sidetap.js': 'src/coffee/sidetap.coffee',
'src/sidetap_standard.js': 'src/coffee/sidetap_standard.coffee',
'src/sidetap_ios.js': 'src/coffee/sidetap_ios.coffee',
'src/sidetap_merged.js': ['src/coffee/*.coffee']
}
}
},
less: {
compile: {
files: {
'src/sidetap.css': 'src/less/sidetap.less'
}
}
},
watch: {
dist1: {
files: 'src/coffee/*',
tasks: 'coffee'
},
dist2: {
files: 'src/less/*',
tasks: 'less'
}
}
});

grunt.loadNpmTasks('grunt-contrib');
grunt.registerTask('build', 'coffee less');
grunt.registerTask('default', 'coffee less');

};
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"author": "harvest",
"name": "sidetap",
"version": "0.1.1",
"description": "Some other day.",
"repository": {
"type": "git",
"url": "https://github.com/harvesthq/sidetap"
},
"engines": {
"node": ">=0.4.0"
},
"dependencies": {},
"devDependencies": {
"coffee-script": ">= 1.2",
"less": ">= 418",
}
}
26 changes: 13 additions & 13 deletions src/sidetap.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
(function() {
/*
Constructor function for Sidetap
*/ this.sidetap = function() {
var ios5;
ios5 = navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad)/) && window.SharedWorker;
if (ios5) {
return new SidetapIos();
} else {
return new SidetapStandard();
}
};
}).call(this);
/*
Constructor function for Sidetap
*/

this.sidetap = function() {
var ios5;
ios5 = navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad)/) && window.SharedWorker;
if (ios5) {
return new SidetapIos();
} else {
return new SidetapStandard();
}
};
Loading

0 comments on commit 15a6727

Please sign in to comment.