workflow and gulpfile

This commit is contained in:
George Michael Brower 2014-09-02 20:00:52 -04:00
parent 6075486ab1
commit 6bf7a31cbc
6 changed files with 62 additions and 80 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -39,6 +39,10 @@ border-radius = height;
} }
} }
.value-false:hover #switch-knob {
transform: scale( 1.5 );
}
#text { #text {
margin-left: padding; margin-left: padding;
.value-true & { .value-true & {
@ -48,4 +52,3 @@ border-radius = height;
color: light; color: light;
} }
} }

View File

@ -39,9 +39,7 @@
}; };
// How do we kill polymer-ready ... // How do we kill polymer-ready ...
// Gui.ready( function() { Gui.ready( function() {
document.addEventListener( 'polymer-ready', function() {
gui = new Gui(); gui = new Gui();

View File

@ -1,58 +1,41 @@
/*
[ ] build without platform bundled
*/
var gulp = require( 'gulp' ), var gulp = require( 'gulp' ),
stylus = require( 'gulp-stylus' ), stylus = require( 'gulp-stylus' ),
plates = require( 'gulp-plates' ), plates = require( 'gulp-plates' ),
rename = require( 'gulp-rename' ), rename = require( 'gulp-rename' ),
vulcan = require( 'gulp-vulcanize' ), vulcan = require( 'gulp-vulcanize' ),
insert = require( 'gulp-insert' ),
replace = require( 'gulp-replace' ),
clean = require( 'gulp-clean' ),
nib = require( 'nib' ), nib = require( 'nib' ),
fs = require( 'fs' ), fs = require( 'fs' ),
marked = require( 'marked' ), marked = require( 'marked' ),
karma = require( 'karma' ).server; karma = require( 'karma' );
var paths = {
main: 'gui.html',
css: 'elements/**/*.styl',
html: 'elements/**/*.html',
js: 'elements/**/*.js',
};
function css( src, dest ) { function css( src, dest ) {
gulp.src( src ) return gulp.src( src )
.pipe( stylus( { use: [ nib() ] } ) ) .pipe( stylus( { use: [ nib() ] } ) )
.pipe( gulp.dest( dest ) ); .pipe( gulp.dest( dest ) );
} }
gulp.task( 'docs', function() { gulp.task( 'clean', function() {
css( 'docs/*.styl', 'docs' ); return gulp.src( [ 'build/*', '**/*.css' ] )
.pipe( clean() );
var content = {
readme: marked( fs.readFileSync( 'README.md', 'utf8' ) )
}
gulp.src( 'docs/template.html' )
.pipe( plates( content ) )
.pipe( rename( 'index.html' ) )
.pipe( gulp.dest( './' ) );
} ); } );
gulp.task( 'css', function() { gulp.task( 'css', function() {
css( paths.css, 'elements' ); return css( 'elements/*/*.styl', 'elements' );
} ); } );
gulp.task( 'vulcanize', function() { gulp.task( 'vulcanize', [ 'css' ], function() {
gulp.src( paths.main ) return gulp.src( 'gui.html' )
.pipe( vulcan( { .pipe( vulcan( {
dest: 'build', dest: 'build',
inline: true, inline: true,
@ -61,50 +44,45 @@ gulp.task( 'vulcanize', function() {
} ); } );
gulp.task( 'test', function( done ) { gulp.task( 'build', [ 'vulcanize' ], function() {
karma.start( { return gulp.src( 'build/gui.html' )
// browsers: [ 'Chrome' ], .pipe( replace( /\\/g, "\\\\" ) )
.pipe( replace( /'/g, "\\'" ) )
.pipe( replace( /^(.*)$/gm, "'$1'," ) )
.pipe( insert.wrap( 'document.write([', '].join("\\n"))' ) )
.pipe( rename( 'gui.js' ) )
.pipe( gulp.dest( 'build' ) );
} );
gulp.task( 'docs', function() {
css( 'docs/*.styl', 'docs' );
var content = {
readme: marked( fs.readFileSync( 'README.md', 'utf8' ) )
};
gulp.src( 'docs/template.html' )
.pipe( plates( content ) )
.pipe( rename( 'index.html' ) )
.pipe( gulp.dest( './' ) );
} );
gulp.task( 'default', [ 'build' ], function() {
karma.server.start( {
frameworks: [ 'jasmine' ], frameworks: [ 'jasmine' ],
files: [ files: [
'../platform/platform.js', 'build/gui.js',
'build/gui.html',
'tests/*.js' 'tests/*.js'
], ]
// singleRun: true } );
}, done );
} ); gulp.watch( [ 'elements/**/*.styl', 'elements/**/*.html', 'elements/**/*.js' ], [ 'build' ] );
gulp.task( 'build', [
'css',
'vulcanize',
// 'test',
'docs'
] );
gulp.task( 'hypervulcanize', function() {
// - styles from layout.html
// styles
// platform.js
// polymer.html
// - polymer.js
} );
gulp.task( 'default', function() {
gulp.watch( [ paths.css ], [ 'css', 'vulcanize' ] );
gulp.watch( [ paths.js, paths.main, paths.html ], [ 'vulcanize' ] );
// gulp.watch( [ 'build/gui.html', 'tests/*.js' ], [ 'test' ] );
gulp.watch( [ 'README.md', 'docs/*' ], [ 'docs' ] ); gulp.watch( [ 'README.md', 'docs/*' ], [ 'docs' ] );
} ); } );

View File

@ -3,8 +3,11 @@
"version": "0.0.0", "version": "0.0.0",
"devDependencies": { "devDependencies": {
"gulp": "^3.8.7", "gulp": "^3.8.7",
"gulp-clean": "^0.3.1",
"gulp-insert": "^0.4.0",
"gulp-plates": "0.0.5", "gulp-plates": "0.0.5",
"gulp-rename": "^1.2.0", "gulp-rename": "^1.2.0",
"gulp-replace": "^0.4.0",
"gulp-stylus": "^1.3.0", "gulp-stylus": "^1.3.0",
"gulp-vulcanize": "^1.0.0", "gulp-vulcanize": "^1.0.0",
"gulp-watch": "^0.6.9", "gulp-watch": "^0.6.9",