Permalink
Browse files

Scaffold out new structure

  • Loading branch information...
1 parent 1de7a2e commit d223f638a367abbc10ee31be4eb5ac0a3cc2e522 @geekjuice geekjuice committed May 23, 2015
View
@@ -0,0 +1,59 @@
+# Contributing Guide
+
+You will need:
+
+- Node.js/io.js & npm
+- Bower
+- Gulp
+
+
+## Getting started
+
+1. Fork the project
+2. Clone your forked project by running `git clone git@github.com:{
+ YOUR_USERNAME }/tether.git`
+3. Run `npm install` to install both node modules and bower components
+4. Test that you can build the source by moving/renaming the existing `dist`
+ directory and running `npm run build`
+5. Assuming everything went well, you should now have a `dist` directory that
+ matches the one you moved in step 4
+
+
+## Writing code!
+
+We use `gulp` to facilitate things like transpilation, minification, etc. so
+can you focus on writing relevant code. If there is a fix or feature you would like
+to contribute, we ask that you take the following steps:
+
+1. Most of the _editable_ code lives in the `src` directory while built code
+ will end up in the `dist` directory upon running `npm run build`.
+
+2. Depending on how big your changes are, bump the version numbers appropriately
+ in `bower.json` and `package.json`. We try to follow semver, so a good rule
+ of thumb for how to bump the version is:
+ - A fix to existing code, perform a patch bump e.g. x.x.0 -> x.x.1
+ - New feature, perform a minor bump e.g. x.0.x -> x.1.x
+ - Breaking changes such a rewrite, perform a major bump e.g.
+ 1.x.x -> 2.x.x
+
+ Versioning is hard, so just use good judgement and we'll be more than happy
+ to help out.
+
+ __NOTE__: There is a `gulp` task that will automate some of the versioning.
+ You can run `gulp version:{type}` where type is `patch|minor|major` to
+ update both `bower.json` and `package.json` as well as add the appropriate
+ git tag.
+
+3. Provide a thoughtful commit message and push your changes to your fork using
+ `git push origin master` (assuming your forked project is using `origin` for
+ the remote name and you are on the `master` branch).
+
+4. Open a Pull Request on GitHub with a description of your changes.
+
+
+## Testing
+
+Work in progress. We are hoping to add some tests, so if you would like to help
+us get started, feel free to contact us through the Issues or open a Pull
+Request.
+
View
@@ -1,17 +1,20 @@
{
"name": "tether",
- "version": "0.7.2",
- "main": "tether.js",
+ "version": "1.0.0",
"homepage": "https://github.hubspot.com/tether",
"authors": [
"Zack Bloom <zackbloom@gmail.com>",
"Adam Schwartz <adam.flynn.schwartz@gmail.com>"
],
+ "maintainers": [
+ "Nicholas Hwang <nick.joosung.hwang@gmail.com>"
+ ],
"description": "A client-side library to make absolutely positioned elements attach to elements in the page efficiently.",
"keywords": [
"javascript"
],
"license": "MIT",
+ "main": "dist/js/tether.js",
"ignore": [
"**/.*",
"node_modules",
View
@@ -1,19 +1,22 @@
{
"name": "tether",
"repo": "HubSpot/tether",
- "version": "0.6.5",
+ "version": "1.0.0",
"description": "A client-side library to make absolutely positioned elements attach to elements in the page efficiently.",
"authors": [
"Zack Bloom <zackbloom@gmail.com>",
"Adam Schwartz <adam.flynn.schwartz@gmail.com>"
],
+ "maintainers": [
+ "Nicholas Hwang <nick.joosung.hwang@gmail.com>"
+ ],
"license": "MIT",
"demo": "http://github.hubspot.com/tether/docs/welcome/",
- "main": "tether.js",
+ "main": "dist/js/tether.js",
"styles": [
- "css/tether.css"
+ "dist/css/tether.css"
],
"scripts": [
- "tether.js"
+ "dist/js/tether.js"
]
}
View
@@ -1,2 +1,90 @@
-require('coffee-script')
-require('./gulpfile.coffee')
+var del = require('del');
+var gulp = require('gulp');
+var babel = require('gulp-babel');
+var bump = require('gulp-bump');
+var concat = require('gulp-concat');
+var filter = require('gulp-filter');
+var header = require('gulp-header');
+var prefixer = require('gulp-autoprefixer');
+var rename = require('gulp-rename');
+var uglify = require('gulp-uglify');
+var sass = require('gulp-sass');
+var tagVersion = require('gulp-tag-version');
+var umd = require('gulp-wrap-umd');
+
+// Variables
+var distDir = './dist';
+var pkg = require('./package.json');
+var banner = ['/*!', pkg.name, pkg.version, '*/\n'].join(' ');
+var umdOptions = {
+ exports: 'Drop',
+ namespace: 'Drop'
+};
+
+
+// Clean
+gulp.task('clean', function() {
+ del.sync([distDir]);
+});
+
+
+// Javascript
+gulp.task('js', function() {
+ gulp.src([
+ './src/js/utils.js',
+ './src/js/tether.js',
+ './src/js/constraint.js',
+ './src/js/abutment.js',
+ './src/js/shift.js'
+ ])
+ .pipe(babel())
+ .pipe(umd(umdOptions))
+ .pipe(header(banner))
+
+ // Original
+ .pipe(gulp.dest(distDir + '/js'))
+
+ // Minified
+ .pipe(uglify())
+ .pipe(rename({suffix: '.min'}))
+ .pipe(gulp.dest(distDir + '/js'));
+});
+
+
+// CSS
+gulp.task('css', function() {
+ gulp.src('./src/css/**/*.sass')
+ .pipe(sass())
+ .pipe(prefixer())
+ .pipe(gulp.dest(distDir + '/css'));
+});
+
+
+// Version bump
+var VERSIONS = ['patch', 'minor', 'major'];
+for (var i = 0; i < VERSIONS.length; ++i){
+ (function(version) {
+ var pkgFilter = filter('package.json');
+ gulp.task('version:' + version, function() {
+ gulp.src(['package.json', 'bower.json', 'component.json'])
+ .pipe(bump({type: version}))
+ .pipe(pkgFilter)
+ .pipe(tagVersion())
+ .pipe(pkgFilter.restore())
+ .pipe(gulp.dest('.'))
+ });
+ })(VERSIONS[i]);
+}
+
+
+// Watch
+gulp.task('watch', ['js', 'css'], function() {
+ gulp.watch('./src/js/**/*', ['js']);
+ gulp.watch('./src/css/**/*', ['css']);
+});
+
+
+// Defaults
+gulp.task('build', ['js', 'css'])
+gulp.task('default', ['build'])
+
View
@@ -1,23 +1,32 @@
{
"name": "tether",
- "version": "0.7.2",
+ "version": "1.0.0",
"description": "A client-side library to make absolutely positioned elements attach to elements in the page efficiently.",
- "main": "tether.js",
"authors": [
"Zack Bloom <zackbloom@gmail.com>",
"Adam Schwartz <adam.flynn.schwartz@gmail.com>"
],
+ "maintainers": [
+ "Nicholas Hwang <nick.joosung.hwang@gmail.com>"
+ ],
+ "scripts": {
+ "build": "gulp build"
+ },
"license": "MIT",
+ "main": "dist/js/tether.js",
"devDependencies": {
- "coffee-script": "~1.6.3",
- "gulp": "~3.3.0",
- "gulp-autoprefixer": "^2.2.0",
- "gulp-coffee": "~1.2.5",
- "gulp-concat": "~2.1.7",
- "gulp-header": "~1.0.2",
- "gulp-rename": "~0.2.1",
- "gulp-sass": "^2.0.0",
- "gulp-uglify": "~0.1.0",
- "gulp-wrap-umd": "~0.1.0"
+ "del": "^1.1.1",
+ "gulp": "^3.8.11",
+ "gulp-autoprefixer": "^2.3.0",
+ "gulp-babel": "^5.1.0",
+ "gulp-bump": "^0.3.0",
+ "gulp-concat": "^2.5.2",
+ "gulp-filter": "^2.0.2",
+ "gulp-header": "^1.2.2",
+ "gulp-rename": "^1.2.2",
+ "gulp-sass": "^2.0.1",
+ "gulp-tag-version": "^1.2.1",
+ "gulp-uglify": "^1.2.0",
+ "gulp-wrap-umd": "^0.2.1"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit d223f63

Please sign in to comment.