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

Commit

Permalink
Merge pull request #28 from mobify/bellows-2.0
Browse files Browse the repository at this point in the history
Bellows 2.0
  • Loading branch information
scalvert committed Aug 26, 2014
2 parents 5a8df33 + a63c266 commit 691f064
Show file tree
Hide file tree
Showing 131 changed files with 16,831 additions and 897 deletions.
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.DS_Store
node_modules/
localConfig.json
build/bellows.zip
build/bellows-style.css
build/bellows.css
build/bellows.js
bower_components/
.DS_Store
/.sass-cache/
149 changes: 47 additions & 102 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,110 +1,55 @@
'use strict'

var path = require('path');

module.exports = function(grunt) {
var _ = grunt.util._;

// By default, we load all local tasks from the tasks directory.
grunt.file.expand('tasks/*').forEach(function(task) {
grunt.loadTasks(task);
});

// Populate the config object
var config = {};
grunt.file.expand('tasks/config/*').forEach(function(configPath) {
// Get the grunt-task name to put in the config which is based on the
// name of the config file
var configName = configPath.match(/\/([^\/]*)\.js/)[1];
var option = require(path.join(__dirname + '/' + configPath))(grunt);
config[configName] = _.extend(config[configName] || {}, option);
});

// Project configuration.
grunt.initConfig({
grunt.initConfig(_.extend({
pkg: grunt.file.readJSON('package.json'),
localConfig: (function(){
try {
return grunt.file.readJSON('localConfig.json')
} catch(e) {
return {};
}
})(),
releaseName: '<%= pkg.name %>-<%= pkg.version %>',
releaseMessage: '<%= pkg.name %> release <%= pkg.version %>',
clean: {
buildProducts: "build/"
},
connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 3000,
base: '.'
}
}
},
watch: {
files: ["src/**/*"],
tasks: ['build']
},
copy: {
main: {
files: [
{expand: true, flatten: true, src: ['src/**'], dest: 'build/', filter: 'isFile'}
]
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'src/bellows.js',
dest: 'build/bellows.min.js'
}
},
cssmin: {
core: {
src: 'src/bellows.css',
dest: 'build/bellows.min.css'
},
style: {
src: 'src/bellows-style.css',
dest: 'build/bellows-style.min.css'
}
},
zip: {
"build/bellows.zip": ["src/bellows.js", "src/bellows.css",
"src/bellows-style.css"]
},
s3: {
key: '<%= localConfig.aws.key %>',
secret: '<%= localConfig.aws.secret %>',
bucket: '<%= localConfig.aws.bucket %>',
access: "public-read",
headers: { "Cache-Control": "max-age=1200" },
upload: [
{ // build
src: "build/*",
dest: "modules/bellows/<%= pkg.version %>/",
rel: "build"
}
]
},
release: {
options: {
folder: '.',
npm: false,
bump: false,
add: false,
commit: false,
file: 'bower.json',
github: {
repo: 'mobify/bellows',
usernameVar: 'GITHUB_USERNAME',
passwordVar: 'GITHUB_TOKEN'
}
}
}
});
releaseMessage: '<%= pkg.name %> release <%= pkg.version %>'
}, config));

// Load the task plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-css');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-zip');
grunt.loadNpmTasks('grunt-s3');
grunt.loadNpmTasks('grunt-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-release');
// load npm tasks
var npmTasks = [
'grunt-contrib-uglify',
'grunt-contrib-watch',
'grunt-contrib-connect',
'grunt-css',
'grunt-shell',
'grunt-contrib-clean',
'grunt-contrib-copy',
'grunt-autoprefixer',
'grunt-contrib-sass',
'grunt-mocha-phantomjs'
];

// Default task(s).
grunt.registerTask('serve', ['connect', 'watch']);
grunt.registerTask('build', ['copy', 'uglify', 'cssmin', 'zip']);
grunt.registerTask('publish', ['build', 'release', 's3'])
grunt.registerTask('default', 'build');
npmTasks.forEach(function(taskName) {
if (!grunt.task._tasks[taskName]) {
grunt.loadNpmTasks(taskName);
}
});

grunt.registerTask('serve', ['build-dist', 'connect:server', 'watch']);
grunt.registerTask('build-dist', ['copy', 'uglify', 'sass', 'autoprefixer', 'cssmin']);
grunt.registerTask('release', ['test', 'shell:tagRelease']);
grunt.registerTask('test', ['build-dist', 'connect:test', 'mocha_phantomjs']);
grunt.registerTask('test:browser', ['build-dist', 'connect:test:keepalive']);
grunt.registerTask('default', 'build-dist');
};
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013 Mobify Research &amp; Development Inc.
Copyright (c) 2014 Mobify Research &amp; Development Inc.

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
Expand Down
Loading

0 comments on commit 691f064

Please sign in to comment.