Skip to content

Commit

Permalink
fixing .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
draeton committed Mar 7, 2013
1 parent 57d6824 commit 35f60a0
Show file tree
Hide file tree
Showing 132 changed files with 49,506 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
amd
dist
docs
node_modules
22 changes: 22 additions & 0 deletions .jshintrc
@@ -0,0 +1,22 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"unused": true,
"boss": true,
"eqnull": true,
"node": true,
"es5": true,
"predef": [
"requirejs",
"require",
"define",
"jQuery",
"Modernizr"
]
}
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,35 @@
# Contributing

## Important notes

Please don't edit files in the `dist` subdirectory as they are generated via Grunt. You'll find source code in the `src` subdirectory!

### Code style

Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.**

### PhantomJS

While Grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers.

## Modifying the code

First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed.

Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started guide](http://gruntjs.com/getting-started).

1. Fork and clone the repo.
1. Run `npm install` to install all dependencies (including Grunt).
1. Run `grunt` to grunt this project.

Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken.

## Submitting pull requests

1. Create a new branch, please don't work in your `master` branch directly.
1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail.
1. Fix stuff.
1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done.
1. Open `test/*.html` unit test file(s) in actual browser to ensure tests pass everywhere.
1. Update the documentation to reflect any changes.
1. Push to your fork and submit a pull request.
278 changes: 278 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,278 @@
module.exports = function(grunt) {

"use strict";

/**
* config
*/

grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),

clean: {
stitches: {
src: ["amd/", "build/", "dist/", "docs/"]
},
pages: {
src: ["stitches/"]
}
},

jshint: {
stitches: {
src: ["src/js/**/*.js"]
}
},

qunit: {
stitches: {
src: ["test/unit/**/*.js"]
}
},

replace: {
version: {
options: {
variables: {
version: "<%= pkg.version %>"
}
},
files: [
{
src: "templates/README.md",
dest: "README.md"
}
]
},
pages: {
options: {
variables: {
version: "<%= pkg.version %>"
}
},
files: [
{
src: "../gh-pages/<%= pkg.name %>/templates/index.md",
dest: "../gh-pages/<%= pkg.name %>/index.md"
}
]
}
},

docker: {
files: {
expand: true,
src: "**/*.js",
dest: "../../docs",
options: {
onlyUpdated: false,
fileSearch: true
}
}
},

requirejs: {
compile: {
options: {
appDir: "src",
baseUrl: "js",
dir: "amd",
modules: [
{
name: "stitches"
}
],
paths: {
"libs": "../libs",
"tpl" : "../tpl"
}
}
}
},

concat: {
js: {
src: ["amd/require.js", "amd/js/<%= pkg.name %>.js"],
dest: "build/<%= pkg.name %>/js/<%= pkg.name %>-<%= pkg.version %>.js"
},
css: {
src: ["amd/css/<%= pkg.name %>.css"],
dest: "build/<%= pkg.name %>/css/<%= pkg.name %>-<%= pkg.version %>.css"
}
},

cssmin: {
compress: {
files: [
{
src: "build/<%= pkg.name %>/css/<%= pkg.name %>-<%= pkg.version %>.css",
dest: "build/<%= pkg.name %>/css/<%= pkg.name %>-<%= pkg.version %>.min.css"
}
]
}
},

uglify: {
compress: {
files: [
{
src: "build/<%= pkg.name %>/js/<%= pkg.name %>-<%= pkg.version %>.js",
dest: "build/<%= pkg.name %>/js/<%= pkg.name %>-<%= pkg.version %>.min.js"
}
]
}
},

copy: {
stitches: {
files: [
{
expand: true,
cwd: "src/img/",
src: "**",
dest: "build/<%= pkg.name %>/img/"
},
{
expand: true,
src: "libs/**",
dest: "build/"
}
]
},
pages: {
files: [
{
expand: true,
src: "build/**",
dest: "../gh-pages/<%= pkg.name %>/stitches/"
},
{
expand: true,
src: "dist/**",
dest: "../gh-pages/<%= pkg.name %>/stitches/"
},
{
expand: true,
src: "docs/**",
dest: "../gh-pages/<%= pkg.name %>/stitches/"
},
{
expand: true,
src: "test/**",
dest: "../gh-pages/<%= pkg.name %>/stitches/"
},
]
}
},

zip: {
dist: {
src: "**",
dest: "../dist/<%= pkg.name %>-<%= pkg.version %>.zip"
}
},

rebase: {
stitches: {
dir: process.cwd()
},
pages: {
dir: "../gh-pages/<%= pkg.name %>/"
},
build: {
dir: "build/"
},
srcjs: {
dir: "src/js/"
}
},

push: {
stitches: {
branch: "master"
},
pages: {
branch: "gh-pages"
}
}
});

/**
* load node modules
*/

grunt.loadTasks("tasks");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks("grunt-replace");
grunt.loadNpmTasks("grunt-docker");
grunt.loadNpmTasks("grunt-contrib-requirejs");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-zip");
grunt.loadNpmTasks("grunt-bump");

/**
* master tasks
*/

grunt.registerTask("validate", [
"jshint"/*,
"qunit",*/
]);

grunt.registerTask("docs", [
"rebase:srcjs",
"docker",
"rebase:stitches"
]);

grunt.registerTask("build", [
"requirejs",
"concat",
"cssmin",
"uglify",
"copy:stitches"
]);

grunt.registerTask("dist", [
"rebase:build",
"zip",
"rebase:stitches"
]);

grunt.registerTask("stitches", [
"replace:version",
"clean:stitches",
"validate",
"docs",
"build",
"dist"
]);

/**
* gh-pages tasks
*/

grunt.registerTask("pages", [
"rebase:pages",
"clean:pages",
"rebase:stitches",
"copy:pages",
"replace:pages",
"rebase:pages",
"push:pages",
"rebase:stitches"
]);

/**
* default
*/

grunt.registerTask("default", "stitches");
grunt.registerTask("ps", "push:stitches");
grunt.registerTask("p", "pages");
};
20 changes: 20 additions & 0 deletions LICENSE
@@ -0,0 +1,20 @@
Copyright (c) 2013 Matthew Cobbs

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.

0 comments on commit 35f60a0

Please sign in to comment.