summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Park <thomas@thomaspark.me>2013-02-27 15:53:24 -0800
committerThomas Park <thomas@thomaspark.me>2013-02-27 15:53:24 -0800
commitafbf0c7d1b87854d966491bd8b3362a53d3fcab8 (patch)
treef97bfbec5178f7d051c20636d63bf65452dd9ccf
parent15b09ea98391d919e7722a15133de94d0cd1ac79 (diff)
parentbc38f3978ff4b7225f8aaa91089fd413c2f493cb (diff)
Merge pull request #79 from frapontillo/gh-pages
Added Grunt.js integration for compiling less files and TravisCI for testing the build
-rw-r--r--.gitignore4
-rw-r--r--.travis.yml15
-rw-r--r--CNAME1
-rw-r--r--Gruntfile.js110
-rw-r--r--component.json8
-rw-r--r--global/build-responsive.less3
-rw-r--r--global/build.less5
-rw-r--r--global/global.less2
-rw-r--r--package.json21
9 files changed, 166 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..05aa84c5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+.idea
+components
+node_modules
+build
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..22d78b3a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,15 @@
+branches:
+ only:
+ - master
+ - gh-pages
+
+language: node_js
+
+node_js:
+ - "0.8.11"
+
+before_install:
+ - npm install -g grunt-cli recess bower
+ - bower install bootstrap
+
+script: "grunt swatch" \ No newline at end of file
diff --git a/CNAME b/CNAME
deleted file mode 100644
index cd527f51..00000000
--- a/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-bootswatch.com \ No newline at end of file
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 00000000..8ae69abc
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,110 @@
+module.exports = function (grunt) {
+ grunt.loadNpmTasks('grunt-recess');
+ grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-clean');
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+ builddir: 'build',
+ meta: {
+ banner: '/**\n' +
+ ' * <%= pkg.description %>\n' +
+ ' * @version v<%= pkg.version %> - ' +
+ '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
+ ' * @link <%= pkg.homepage %>\n' +
+ ' * @license <%= pkg.license %>' + ' */'
+ },
+ swatch: {
+ amelia: {}, cerulean:{}, cosmo:{}, cyborg:{}, journal:{}, readable:{},
+ shamrock:{}, simplex:{}, slate:{}, spacelab:{}, spruce:{}, superhero:{},
+ united:{}
+ },
+ clean: {
+ build: {
+ src: ['*/build.less', '*/build-responsive.less',
+ '!global/build.less', '!global/build-responsive.less']
+ }
+ },
+ concat: {
+ dist: {
+ src: [],
+ dest: ''
+ }
+ },
+ recess: {
+ dist: {
+ options: {
+ compile: true,
+ compress: false
+ },
+ files: {}
+ }
+ }
+ });
+
+ grunt.registerTask('none', function() {});
+
+ grunt.registerTask('build', 'build a regular theme', function(theme, compress) {
+ var compress = compress == undefined ? true : compress;
+
+ var concatSrc;
+ var concatDest;
+ var recessDest;
+ var recessSrc;
+ var files = {};
+ var dist = {};
+ concatSrc = 'global/build.less';
+ concatDest = theme + '/build.less';
+ recessDest = '<%=builddir%>/' + theme + '/bootstrap.css';
+ recessSrc = [ theme + '/' + 'build.less' ];
+
+ dist = {src: concatSrc, dest: concatDest};
+ grunt.config('concat.dist', dist);
+ files = {}; files[recessDest] = recessSrc;
+ grunt.config('recess.dist.files', files);
+ grunt.config('recess.dist.options.compress', false);
+
+ grunt.task.run(['concat', 'recess:dist', 'clean:build',
+ compress ? 'compress:'+recessDest+':'+'<%=builddir%>/' + theme + '/bootstrap.min.css':'none']);
+ });
+
+ grunt.registerTask('build-responsive', 'build a responsive theme', function(theme, compress) {
+ var compress = compress == undefined ? true : compress;
+
+ var concatSrc;
+ var concatDest;
+ var recessDest;
+ var recessSrc;
+ var files = {};
+ var dist = {};
+
+ concatSrc = 'global/build-responsive.less';
+ concatDest = theme + '/build-responsive.less';
+ recessDest = '<%=builddir%>/' + theme + '/bootstrap-responsive.css';
+ recessSrc = [ theme + '/' + 'build-responsive.less' ];
+
+ dist = {src: concatSrc, dest: concatDest};
+ grunt.config('concat.dist', dist);
+ files = {}; files[recessDest] = recessSrc;
+ grunt.config('recess.dist.files', files);
+ grunt.config('recess.dist.options.compress', false);
+
+ grunt.task.run(['concat', 'recess:dist', 'clean:build',
+ compress ? 'compress:'+recessDest+':'+'<%=builddir%>/' + theme + '/bootstrap-responsive.min.css':'none']);
+ });
+
+ grunt.registerTask('compress', 'compress a generic css', function(fileSrc, fileDst) {
+ var files = {}; files[fileDst] = fileSrc;
+ grunt.log.writeln('compressing file ' + fileSrc);
+
+ grunt.config('recess.dist.files', files);
+ grunt.config('recess.dist.options.compress', true);
+ grunt.task.run(['recess:dist']);
+ });
+
+ grunt.registerMultiTask('swatch', 'build a theme, both not responsive and responsive', function() {
+ var t = this.target;
+ grunt.task.run('build:'+t, 'build-responsive:'+t);
+ });
+}; \ No newline at end of file
diff --git a/component.json b/component.json
index cf50b43b..8d543857 100644
--- a/component.json
+++ b/component.json
@@ -3,9 +3,13 @@
"description": "Themes for Bootstrap",
"homepage": "http://bootswatch.com",
"author": "Thomas Park",
- "version": "v2.3.0+1",
+ "version": "2.3.0+1",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/thomaspark/bootswatch.git"
+ },
"dependencies": {
- "jquery": "~1.9.0"
+ "bootstrap": "~2.3.0"
},
"licenses": [
{
diff --git a/global/build-responsive.less b/global/build-responsive.less
new file mode 100644
index 00000000..cd978fb3
--- /dev/null
+++ b/global/build-responsive.less
@@ -0,0 +1,3 @@
+@import "../components/bootstrap/less/responsive.less";
+@import "variables.less";
+@import "../global/global.less"; \ No newline at end of file
diff --git a/global/build.less b/global/build.less
new file mode 100644
index 00000000..6d7f3b83
--- /dev/null
+++ b/global/build.less
@@ -0,0 +1,5 @@
+@import "../components/bootstrap/less/bootstrap.less";
+@import "variables.less";
+@import "../global/global.less";
+@import "bootswatch.less";
+@import "../components/bootstrap/less/utilities.less"; \ No newline at end of file
diff --git a/global/global.less b/global/global.less
new file mode 100644
index 00000000..39bd32a0
--- /dev/null
+++ b/global/global.less
@@ -0,0 +1,2 @@
+@iconSpritePath: "../img/glyphicons-halflings.png";
+@iconWhiteSpritePath: "../img/glyphicons-halflings-white.png"; \ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..d1bd12e1
--- /dev/null
+++ b/package.json
@@ -0,0 +1,21 @@
+{
+ "author": "Thomas Park",
+ "name": "bootswatch",
+ "description": "Bootswatch is a collection of free themes for Twitter Bootstrap.",
+ "version": "2.3.0",
+ "homepage": "http://bootswatch.com/",
+ "license": "Apache License, Version 2.0, http://www.apache.org/licenses/LICENSE-2.0",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/thomaspark/bootswatch.git"
+ },
+ "engines": {
+ "node": ">= 0.8.11"
+ },
+ "devDependencies": {
+ "grunt": "~0.4.0",
+ "grunt-recess": "~0.3.1",
+ "grunt-contrib-concat": "~0.1.3",
+ "grunt-contrib-clean": "~0.4.0"
+ }
+}