This repository has been archived by the owner on Jan 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d9bae59
Showing
48 changed files
with
2,095 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = tab | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[{*.json,*.yml}] | ||
indent_size = 2 | ||
indent_style = space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
.sass-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"boss": true, | ||
"browser": true, | ||
"curly": true, | ||
"debug": true, | ||
"devel": true, | ||
"eqeqeq": true, | ||
"expr": true, | ||
"forin": true, | ||
"immed": true, | ||
"noarg": true, | ||
"node": true, | ||
"noempty": true, | ||
"nonew": true, | ||
"strict": true, | ||
"trailing": true, | ||
"undef": true, | ||
"unused": true, | ||
"predef": [ | ||
"Prism" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
.sass-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Boilerplate Toolkit | ||
|
||
The Boilerplate Toolkit UI toolkit is a highly-modular design system for rapid web page development. It contains different materials that can be assembled into more complex page layouts. | ||
|
||
## Getting Started | ||
|
||
Boilerplate Toolkit requires [node.js](http://nodejs.org). Make sure your have `v0.10` or higher installed before proceeding. | ||
|
||
**Start the local development environment:** | ||
|
||
``` | ||
$ npm start | ||
``` | ||
|
||
### Development Environment Features | ||
|
||
- Live preview sever (using [BrowserSync](http://www.browsersync.io/)) | ||
- CSS Autoprefixing | ||
- Sass compilation | ||
- Browserify bundling | ||
- Image optimization | ||
|
||
## Build | ||
|
||
**Build for release:** | ||
|
||
``` | ||
$ npm run build | ||
``` | ||
|
||
Fabricator builds both a static documentation site and optimized CSS and JS toolkit files. | ||
|
||
The build artifacts output to the `dist` directory. This can be deployed to any static hosting environment - no language runtime or database is required. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
'use strict'; | ||
|
||
// modules | ||
var assemble = require('fabricator-assemble'); | ||
var browserify = require('browserify'); | ||
var browserSync = require('browser-sync'); | ||
var concat = require('gulp-concat'); | ||
var csso = require('gulp-csso'); | ||
var del = require('del'); | ||
var gulp = require('gulp'); | ||
var gutil = require('gulp-util'); | ||
var gulpif = require('gulp-if'); | ||
var imagemin = require('gulp-imagemin'); | ||
var prefix = require('gulp-autoprefixer'); | ||
var rename = require('gulp-rename'); | ||
var reload = browserSync.reload; | ||
var runSequence = require('run-sequence'); | ||
var sass = require('gulp-sass'); | ||
var source = require('vinyl-source-stream'); | ||
var streamify = require('gulp-streamify'); | ||
var uglify = require('gulp-uglify'); | ||
|
||
|
||
// configuration | ||
var config = { | ||
dev: gutil.env.dev, | ||
src: { | ||
scripts: { | ||
fabricator: [ | ||
'src/assets/fabricator/scripts/prism.js', | ||
'src/assets/fabricator/scripts/fabricator.js' | ||
], | ||
toolkit: './src/assets/toolkit/scripts/toolkit.js' | ||
}, | ||
styles: { | ||
fabricator: 'src/assets/fabricator/styles/fabricator.scss', | ||
toolkit: 'src/assets/toolkit/styles/toolkit.scss' | ||
}, | ||
images: 'src/assets/toolkit/images/**/*', | ||
views: 'src/toolkit/views/*.html' | ||
}, | ||
dest: 'dist' | ||
}; | ||
|
||
|
||
// clean | ||
gulp.task('clean', function (cb) { | ||
del([config.dest], cb); | ||
}); | ||
|
||
|
||
// styles | ||
gulp.task('styles:fabricator', function () { | ||
return gulp.src(config.src.styles.fabricator) | ||
.pipe(sass({ | ||
errLogToConsole: true | ||
})) | ||
.pipe(prefix('last 1 version')) | ||
.pipe(gulpif(!config.dev, csso())) | ||
.pipe(rename('f.css')) | ||
.pipe(gulp.dest(config.dest + '/assets/fabricator/styles')) | ||
.pipe(gulpif(config.dev, reload({stream:true}))); | ||
}); | ||
|
||
gulp.task('styles:toolkit', function () { | ||
return gulp.src(config.src.styles.toolkit) | ||
.pipe(sass({ | ||
errLogToConsole: true | ||
})) | ||
.pipe(prefix('last 1 version')) | ||
.pipe(gulpif(!config.dev, csso())) | ||
.pipe(gulp.dest(config.dest + '/assets/toolkit/styles')) | ||
.pipe(gulpif(config.dev, reload({stream:true}))); | ||
}); | ||
|
||
gulp.task('styles', ['styles:fabricator', 'styles:toolkit']); | ||
|
||
|
||
// scripts | ||
gulp.task('scripts:fabricator', function () { | ||
return gulp.src(config.src.scripts.fabricator) | ||
.pipe(concat('f.js')) | ||
.pipe(gulpif(!config.dev, uglify())) | ||
.pipe(gulp.dest(config.dest + '/assets/fabricator/scripts')); | ||
}); | ||
|
||
gulp.task('scripts:toolkit', function () { | ||
return browserify(config.src.scripts.toolkit) | ||
.bundle() | ||
.on('error', function (error) { | ||
gutil.log(gutil.colors.red(error)); | ||
this.emit('end'); | ||
}) | ||
.pipe(source('toolkit.js')) | ||
.pipe(gulpif(!config.dev, streamify(uglify()))) | ||
.pipe(gulp.dest(config.dest + '/assets/toolkit/scripts')); | ||
}); | ||
|
||
gulp.task('scripts', ['scripts:fabricator', 'scripts:toolkit']); | ||
|
||
|
||
// images | ||
gulp.task('images', ['favicon'], function () { | ||
return gulp.src(config.src.images) | ||
.pipe(imagemin()) | ||
.pipe(gulp.dest(config.dest + '/assets/toolkit/images')); | ||
}); | ||
|
||
gulp.task('favicon', function () { | ||
return gulp.src('./src/favicon.ico') | ||
.pipe(gulp.dest(config.dest)); | ||
}); | ||
|
||
|
||
// assemble | ||
gulp.task('assemble', function (done) { | ||
assemble(); | ||
done(); | ||
}); | ||
|
||
|
||
// server | ||
gulp.task('serve', function () { | ||
|
||
var reload = browserSync.reload; | ||
|
||
browserSync({ | ||
server: { | ||
baseDir: config.dest | ||
}, | ||
notify: false, | ||
logPrefix: 'FABRICATOR' | ||
}); | ||
|
||
gulp.watch('src/**/*.{html,md,json,yml}', ['assemble']).on('change', reload); | ||
gulp.watch('src/assets/fabricator/styles/**/*.scss', ['styles:fabricator']); | ||
gulp.watch('src/assets/toolkit/styles/**/*.scss', ['styles:toolkit']); | ||
gulp.watch('src/assets/fabricator/scripts/**/*.js', ['scripts:fabricator']).on('change', reload); | ||
gulp.watch('src/assets/toolkit/scripts/**/*.js', ['scripts:toolkit']).on('change', reload); | ||
gulp.watch(config.src.images, ['images']).on('change', reload); | ||
}); | ||
|
||
|
||
// default build task | ||
gulp.task('default', ['clean'], function () { | ||
|
||
// define build tasks | ||
var tasks = [ | ||
'styles', | ||
'scripts', | ||
'images', | ||
'assemble' | ||
]; | ||
|
||
// run build | ||
runSequence(tasks, function () { | ||
if (config.dev) { | ||
gulp.start('serve'); | ||
} | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"name": "fabricator", | ||
"version": "1.0.0", | ||
"description": "A tool for building website UI toolkits", | ||
"homepage": "http://fbrctr.github.io/", | ||
"main": "README.md", | ||
"scripts": { | ||
"gulp": "gulp", | ||
"prestart": "npm install", | ||
"build": "npm install && gulp", | ||
"start": "gulp --dev", | ||
"test": "npm run build" | ||
}, | ||
"keywords": [ | ||
"toolkit", | ||
"styleguide", | ||
"framework", | ||
"scaffold", | ||
"patterns", | ||
"library" | ||
], | ||
"author": "Luke Askew", | ||
"licenses": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/fbrctr/fabricator.git" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0", | ||
"npm": ">=2.0.0" | ||
}, | ||
"devDependencies": { | ||
"browser-sync": "^2.5.3", | ||
"browserify": "^9.0.7", | ||
"del": "^1.1.1", | ||
"fabricator-assemble": "^1.0.0", | ||
"gulp": "^3.8.11", | ||
"gulp-autoprefixer": "^2.1.0", | ||
"gulp-concat": "^2.5.2", | ||
"gulp-csso": "^1.0.0", | ||
"gulp-if": "^1.2.5", | ||
"gulp-imagemin": "^2.2.1", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-sass": "^1.3.3", | ||
"gulp-streamify": "0.0.5", | ||
"gulp-uglify": "^1.1.0", | ||
"gulp-util": "^3.0.4", | ||
"run-sequence": "^1.0.2", | ||
"vinyl-source-stream": "^1.1.0" | ||
} | ||
} |
Oops, something went wrong.