Permalink
Browse files

Restructuring repo

  • Loading branch information...
1 parent c6452ac commit 5447696da4b77fc4e6329c9aa487e9ee26a054bd @darsain committed Apr 5, 2013
View
@@ -0,0 +1,9 @@
+# editorconfig.org
+root = true
+
+[*]
+indent_style = tab
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = false
View
@@ -0,0 +1,51 @@
+{
+ "predef" : [
+ "jQuery"
+ ],
+
+ "bitwise": false,
+ "camelcase": false,
+ "curly": true,
+ "eqeqeq": true,
+ "forin": false,
+ "immed": true,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "noempty": true,
+ "nonew": false,
+ "plusplus": false,
+ "quotmark": false,
+ "regexp": false,
+ "undef": true,
+ "unused": true,
+ "strict": true,
+ "trailing": true,
+
+ "asi": false,
+ "boss": false,
+ "debug": false,
+ "eqnull": true,
+ "es5": false,
+ "esnext": false,
+ "evil": false,
+ "expr": false,
+ "funcscope": false,
+ "globalstrict": false,
+ "iterator": false,
+ "lastsemic": false,
+ "laxbreak": false,
+ "laxcomma": true,
+ "loopfunc": false,
+ "multistr": false,
+ "onecase": true,
+ "proto": false,
+ "regexdash": false,
+ "scripturl": false,
+ "smarttabs": true,
+ "shadow": false,
+ "sub": false,
+ "supernew": false,
+
+ "browser": true
+}
View
@@ -0,0 +1,33 @@
+## Submitting an issue
+
+When reporting a bug, please describe it thoroughly, with attached code showcasing how are you using the library. The
+best way how to make it easy for developers, and ensure that your issue will be looked at, is to replicate it on
+[jsfiddle](http://jsfiddle.net/) or a similar service.
+
+## Contributions
+
+Contributions are welcome! But please, follow these few simple rules:
+
+**Maintain the coding style** used throughout the project, and defined in the `.editorconfig` file. You can use the
+[Editorconfig](http://editorconfig.org) plugin for your editor of choice:
+
+- [Sublime Text 2](https://github.com/sindresorhus/editorconfig-sublime)
+- [Textmate](https://github.com/Mr0grog/editorconfig-textmate)
+- [Notepad++](https://github.com/editorconfig/editorconfig-notepad-plus-plus)
+- [Emacs](https://github.com/editorconfig/editorconfig-emacs)
+- [Vim](https://github.com/editorconfig/editorconfig-vim)
+- [Visual Studio](https://github.com/editorconfig/editorconfig-visualstudio)
+- [... other editors](http://editorconfig.org/#download)
+
+---
+
+**Code has to pass JSHint** with options defined in the `.jshintrc` file. You can use `grunt jshint` task to lint
+manually, or again, there are amazing plugins for a lot of popular editors consuming this file and linting as you code:
+
+- [Sublim Text 2](https://github.com/SublimeLinter/SublimeLinter)
+- [TextMate](http://rondevera.github.com/jslintmate/), or [alternative](http://fgnass.posterous.com/jslint-in-textmate)
+- [Notepad++](http://sourceforge.net/projects/jslintnpp/)
+- [Emacs](https://github.com/daleharvey/jshint-mode)
+- [Vim](https://github.com/walm/jshint.vim)
+- [Visual Studio](https://github.com/jamietre/SharpLinter), or [alternative](http://jslint4vs2010.codeplex.com/)
+- [... other editors](http://www.jshint.com/platforms/)
View
@@ -0,0 +1,115 @@
+/*jshint node:true */
+module.exports = function(grunt) {
+ 'use strict';
+
+ // Override environment based line endings enforced by Grunt
+ grunt.util.linefeed = '\n';
+
+ // Grunt configuration
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('component.json'),
+ meta: {
+ banner: '/*!\n' +
+ ' * <%= pkg.name %> <%= pkg.version %> - <%= grunt.template.today("dS mmm yyyy") %>\n' +
+ ' * <%= pkg.homepage %>\n' +
+ ' *\n' +
+ ' * Licensed under the <%= pkg.licenses[0].type %> license.\n' +
+ ' * <%= pkg.licenses[0].url %>\n' +
+ ' */\n',
+ bannerLight: '/*! <%= pkg.name %> <%= pkg.version %>' +
+ ' - <%= grunt.template.today("dS mmm yyyy") %> | <%= pkg.homepage %> */'
+ },
+
+ // JSHint the code.
+ jshint: {
+ options: {
+ jshintrc: '.jshintrc'
+ },
+ all: ['src/*.js']
+ },
+
+ // Clean folders.
+ clean: {
+ dist: ['dist/**', '!dist']
+ },
+
+ // Concatenate files.
+ concat: {
+ options: {
+ banner: '<%= meta.banner %>'
+ },
+ vanilla: {
+ src: 'src/<%= pkg.name %>.js',
+ dest: 'dist/<%= pkg.name %>.js'
+ },
+ jquery: {
+ src: ['src/<%= pkg.name %>.js', 'src/jquery.js'],
+ dest: 'dist/jquery.<%= pkg.name %>.js'
+ }
+ },
+
+ // Minify with Google Closure Compiler.
+ gcc: {
+ options: {
+ banner: '<%= meta.bannerLight %>'
+ },
+ vanilla: {
+ src: 'src/<%= pkg.name %>.js',
+ dest: 'dist/<%= pkg.name %>.min.js'
+ },
+ jquery: {
+ src: ['src/<%= pkg.name %>.js', 'src/jquery.js'],
+ dest: 'dist/jquery.<%= pkg.name %>.min.js'
+ }
+ },
+
+ // Compress files.
+ compress: {
+ options: {
+ mode: 'gzip'
+ },
+ vanilla: {
+ src: 'dist/<%= pkg.name %>.min.js',
+ dest: 'dist/<%= pkg.name %>.min.js.gz'
+ },
+ jquery: {
+ src: 'dist/<%= pkg.name %>.jquery.min.js',
+ dest: 'dist/<%= pkg.name %>.jquery.min.js.gz'
+ }
+ },
+
+ // Bump up fields in JSON files.
+ bumpup: ['component.json', '<%= pkg.name %>.jquery.json'],
+
+ // Commit changes and tag the latest commit with a version from JSON file.
+ tagrelease: ['component.json']
+ });
+
+ // These plugins provide necessary tasks.
+ grunt.loadNpmTasks('grunt-contrib-compress');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-clean');
+ grunt.loadNpmTasks('grunt-tagrelease');
+ grunt.loadNpmTasks('grunt-bumpup');
+ grunt.loadNpmTasks('grunt-gcc');
+
+ // Build task.
+ grunt.registerTask('build', function () {
+ grunt.task.run('jshint');
+ grunt.task.run('clean');
+ grunt.task.run('concat');
+ grunt.task.run('gcc');
+ });
+
+ // Release task.
+ grunt.registerTask('release', function (type) {
+ type = type ? type : 'patch';
+ grunt.task.run('build');
+ grunt.task.run('bumpup:' + type);
+ grunt.task.run('tagrelease');
+ });
+
+ // Default task.
+ grunt.registerTask('default', ['jshint']);
+};
View
@@ -1,48 +0,0 @@
-#/bin/sh
-#
-# @description : BASH script for minifying javascript files
-# @requirements : curl
-
-# Format for minifying multiple files:
-# IN=( file1.js file2.js file3.js )
-IN=jquery.motio.js
-OUT=jquery.motio.min.js
-
-# Compiler settings
-API_URL=http://closure-compiler.appspot.com/compile
-COMPILATION_LEVEL=SIMPLE_OPTIMIZATIONS
-
-# Check if curl is installed
-if [ -z "$(which curl)" ]
-then
- echo 'Please install curl to proceed.'
- exit
-fi
-
-# Itearate through all files
-for f in ${IN[@]}
-do
- if [ -r ${f} ]
- then
- code="${code} --data-urlencode js_code@${f}"
- else
- echo "File ${f} does not exist or is not readable. Skipped."
- fi
-done
-
-# If there is no code, terminate
-if [ -z "${code}" ]
-then
- echo 'Nothing to compile.'
- exit
-fi
-
-# Compile & save new file
-`curl \
- --url ${API_URL} \
- --header 'Content-type: application/x-www-form-urlencoded' \
- ${code} \
- --data output_format=text \
- --data output_info=compiled_code \
- --data compilation_level=${COMPILATION_LEVEL} \
- --output ${OUT}`
Oops, something went wrong. Retry.

0 comments on commit 5447696

Please sign in to comment.