ff-stream-web

git clone git://archive.git.mtrnord.blog/MTRNord/ff-stream-web.git
Log | Files | Refs | README | LICENSE

commit 3bb716eafc3453c1ba89597d951208f53eef6574
parent d9f147c05cae65bb34e4e7d9d9b1e7592e021edd
Author: Konstantin Tarkus <hello@tarkus.me>
Date:   Sun,  6 Jul 2014 09:02:19 +0400

Update npm packages, gulp configuration

Diffstat:
MREADME.md | 8+++-----
Dbower.json | 17-----------------
Mconfig/webpack.config.js | 11+++++++++--
Mgulpfile.js | 80++++++++++++++++++++++++++++++++++++++++++-------------------------------------
Mpackage.json | 27+++++++++++++++------------
Dsrc/app.less | 56--------------------------------------------------------
Msrc/index.html | 2+-
Asrc/styles/.csscomb.json | 297+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/styles/.csslintrc | 19+++++++++++++++++++
Asrc/styles/bootstrap.less | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10 files changed, 444 insertions(+), 130 deletions(-)

diff --git a/README.md b/README.md @@ -34,7 +34,6 @@ │ ├── /services/ │ ├── /404.html │ ├── /app.jsx -│ ├── /app.less │ └── /index.html ├── /test/ # Unit, integration and load tests │ ├── /e2e/ # End-to-end tests @@ -50,22 +49,21 @@ To get started you can simply clone the repo and install the dependencies: > git clone https://github.com/kriasoft/React-Seed MyApp && cd MyApp > npm install -g gulp # Install Gulp task runner globally > npm install # Install Node.js components listed in ./package.json -> bower install # Install Bower components listed in ./bower.json ``` To compile the application and start a dev server just run: ```shell -> gulp # or, `gulp --production` +> gulp # or, `gulp --release` ``` To build the project, without starting a web server run: ```shell -> gulp build # or, `gulp build --production` +> gulp build # or, `gulp build --release` ``` -Now browse to the app at [http://localhost:8080/](http://localhost:8080/) +Now browse to the app at [http://localhost:3000/](http://localhost:3000/) ### Authors diff --git a/bower.json b/bower.json @@ -1,17 +0,0 @@ -{ - "name": "react-seed", - "version": "0.0.0", - "homepage": "https://github.com/kriasoft/React-Seed", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test" - ], - "dependencies": { - "jquery": "~2.1.1" - }, - "devDependencies": { - "bootstrap": "~3.1.1" - } -} diff --git a/config/webpack.config.js b/config/webpack.config.js @@ -1,5 +1,12 @@ -// Webpack Configuration -// http://webpack.github.io/docs/configuration.html +/*! + * Facebook React Starter Kit | https://github.com/kriasoft/React-Seed + * Copyright (c) KriaSoft, LLC. All rights reserved. See LICENSE.txt + */ + +/* + * Webpack Configuration + * http://webpack.github.io/docs/configuration.html + */ var webpack = require('webpack'); diff --git a/gulpfile.js b/gulpfile.js @@ -1,30 +1,37 @@ -// For more information on how to configure Gulp.js build system, please visit: -// https://github.com/gulpjs/gulp/blob/master/docs/API.md +/*! + * Facebook React Starter Kit | https://github.com/kriasoft/React-Seed + * Copyright (c) KriaSoft, LLC. All rights reserved. See LICENSE.txt + */ -var es = require('event-stream'); +/* + * For more information on how to configure Gulp, please visit: + * https://github.com/gulpjs/gulp/blob/master/docs/API.md + */ + +// Include Gulp & other tools for build automation var gulp = require('gulp'); -var changed = require('gulp-changed'); -var embedlr = require('gulp-embedlr'); -var htmlmin = require('gulp-htmlmin'); -var jshint = require('gulp-jshint'); -var less = require('gulp-less'); -var minifyCSS = require('gulp-minify-css'); -var plumber = require('gulp-plumber'); -var uglify = require('gulp-uglify'); -var gutil = require('gulp-util'); +var $ = require('gulp-load-plugins')(); +var es = require('event-stream'); var path = require('path'); var rimraf = require('rimraf'); var webpack = require('webpack'); +var argv = require('minimist')(process.argv.slice(2)); // Settings -var isDebug = !require('minimist')(process.argv.slice(2)).production; -var compiler = webpack(require('./config/webpack.config.js')(isDebug)); +var DEBUG = !argv.release; +var WATCH = Boolean(argv.watch); + +var pkgs = require('./package.json').dependencies; +Object.keys(pkgs).forEach(function (key) { return pkgs[key] = pkgs[key].substring(1); }); +var bundler = webpack(require('./config/webpack.config.js')(DEBUG)); + // A cache for Gulp tasks. It is used as a workaround for Gulp's dependency resolution // limitations. It won't be needed anymore starting with Gulp 4. var task = {}; // Clean up +// ----------------------------------------------------------------------------- gulp.task('clean', function (cb) { rimraf('./build', cb); }); @@ -32,11 +39,10 @@ gulp.task('clean', function (cb) { // Copy vendor files // ----------------------------------------------------------------------------- gulp.task('vendor', task.vendor = function () { - var pkg = require('./bower.json').dependencies; - return es.concat( - gulp.src('./bower_components/jquery/dist/**') - .pipe(gulp.dest('./build/vendor/jquery-' + pkg.jquery.substring(1))), - gulp.src('./bower_components/bootstrap/dist/fonts/**') + return es.merge( + gulp.src('./node_modules/jquery/dist/**') + .pipe(gulp.dest('./build/vendor/jquery-' + pkgs.jquery)), + gulp.src('./node_modules/bootstrap/dist/fonts/**') .pipe(gulp.dest('./build/fonts')) ); }); @@ -45,18 +51,18 @@ gulp.task('vendor:clean', ['clean'], task.vendor); // Copy static files / assets // ----------------------------------------------------------------------------- gulp.task('assets', task.assets = function () { - return es.concat( + return es.merge( gulp.src('./src/assets/**') .pipe(gulp.dest('./build')), gulp.src('./src/images/**') .pipe(gulp.dest('./build/images/')), gulp.src('./src/*.html') - .pipe(isDebug ? gutil.noop() : htmlmin({ + .pipe(DEBUG ? $.util.noop() : $.htmlmin({ removeComments: true, collapseWhitespace: true, minifyJS: true })) - .pipe(isDebug ? embedlr() : gutil.noop()) + .pipe(DEBUG ? $.embedlr() : $.util.noop()) .pipe(gulp.dest('./build')) ); }); @@ -65,32 +71,32 @@ gulp.task('assets:clean', ['clean'], task.assets); // CSS stylesheets // ----------------------------------------------------------------------------- gulp.task('styles', task.styles = function () { - return gulp.src('./src/app.less') - .pipe(plumber()) - .pipe(less({sourceMap: isDebug, sourceMapBasepath: __dirname})) - .on('error', gutil.log) - .pipe(isDebug ? gutil.noop() : minifyCSS()) - .pipe(gulp.dest('./build')); + return gulp.src('./src/styles/bootstrap.less') + .pipe($.plumber()) + .pipe($.less({sourceMap: DEBUG, sourceMapBasepath: __dirname})) + .on('error', $.util.log) + .pipe(DEBUG ? $.util.noop() : $.minifyCss()) + .pipe(gulp.dest('./build/css')); }); gulp.task('styles:clean', ['clean'], task.styles); // Create JavaScript bundle // ----------------------------------------------------------------------------- gulp.task('bundle', ['clean'], function (cb) { - compiler.run(function (err, stats) { + bundler.run(function (err, stats) { if (err) { - throw new gutil.PluginError('webpack', err); + throw new $.util.PluginError('webpack', err); } - gutil.log('[webpack]', stats.toString({colors: true})); + $.util.log('[webpack]', stats.toString({colors: true})); cb(); }); }); gulp.task('bundle:watch', ['clean'], function (cb) { - compiler.watch(200, function (err, stats) { + bundler.watch(200, function (err, stats) { if (err) { - throw new gutil.PluginError('webpack', err); + throw new $.util.PluginError('webpack', err); } - gutil.log('[webpack]', stats.toString({colors: true})); + $.util.log('[webpack]', stats.toString({colors: true})); if (cb) { cb(); cb = null; @@ -108,7 +114,7 @@ gulp.task('build:watch', ['vendor:clean', 'assets:clean', 'styles:clean', 'bundl gulp.task('run', ['build:watch'], function (next) { var url = require('url'); var server = require('ecstatic')({root: './', cache: 'no-cache', showDir: true}); - var port = 8080; + var port = 3000; require('http').createServer() .on('request', function (req, res) { @@ -129,7 +135,7 @@ gulp.task('run', ['build:watch'], function (next) { server(req, res); }) .listen(port, function () { - gutil.log('Server is listening on ' + gutil.colors.magenta('http://localhost:' + port + '/')); + $.util.log('Server is listening on ' + $.util.colors.magenta('http://localhost:' + port + '/')); next(); }); }); @@ -147,7 +153,7 @@ gulp.task('watch', ['run'], function () { // Watch for changes in 'compiled' files gulp.watch('./build/**', function (file) { var relPath = 'build\\' + path.relative('./build', file.path); - gutil.log('File changed: ' + gutil.colors.magenta(relPath)); + $.util.log('File changed: ' + $.util.colors.magenta(relPath)); lr.changed(file.path); }); diff --git a/package.json b/package.json @@ -5,30 +5,33 @@ "description": "Facebook React Starter Kit", "repository": "https://github.com/kriasoft/react-seed", "dependencies": { + "bootstrap": "^3.2.0", + "jquery": "^2.1.1", "react": "^0.10.0" }, "devDependencies": { - "ecstatic": "^0.5.3", + "ecstatic": "^0.5.4", "event-stream": "^3.1.5", - "gulp": "^3.8.0", + "gulp": "^3.8.5", "gulp-changed": "^0.4.0", "gulp-embedlr": "^0.5.2", - "gulp-htmlmin": "^0.1.2", - "gulp-jshint": "^1.6.2", - "gulp-less": "^1.2.3", + "gulp-htmlmin": "^0.1.3", + "gulp-jshint": "^1.6.4", + "gulp-less": "^1.3.1", "gulp-livereload": "^2.1.0", - "gulp-minify-css": "^0.3.4", - "gulp-plumber": "^0.6.2", - "gulp-uglify": "^0.3.0", - "gulp-util": "^2.2.16", + "gulp-load-plugins": "^0.5.3", + "gulp-minify-css": "^0.3.6", + "gulp-plumber": "^0.6.3", + "gulp-uglify": "^0.3.1", + "gulp-util": "^2.2.19", "jshint-stylish": "^0.2.0", "jsx-loader": "^0.10.2", "karma": "^0.12.16", - "minimist": "^0.1.0", - "protractor": "^0.24.1", + "minimist": "^0.2.0", + "protractor": "^1.0.0-rc2", "rimraf": "^2.2.8", "url-loader": "^0.5.5", - "webpack": "^1.3.0-beta5" + "webpack": "^1.3.1-beta6" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/src/app.less b/src/app.less @@ -1,56 +0,0 @@ -/* ========================================================================== - Bootstrap CSS + Custom Styles and overrides - ========================================================================== */ - -// Core variables and mixins -@import "..\bower_components\bootstrap\less\variables.less"; -@import "styles\variables.less"; -@import "..\bower_components\bootstrap\less\mixins.less"; - -// Reset -@import "..\bower_components\bootstrap\less\normalize.less"; -@import "..\bower_components\bootstrap\less\print.less"; - -// Core CSS -@import "..\bower_components\bootstrap\less\scaffolding.less"; -@import "..\bower_components\bootstrap\less\type.less"; -@import "..\bower_components\bootstrap\less\code.less"; -@import "..\bower_components\bootstrap\less\grid.less"; -@import "..\bower_components\bootstrap\less\tables.less"; -@import "..\bower_components\bootstrap\less\forms.less"; -@import "..\bower_components\bootstrap\less\buttons.less"; -@import "styles\base.less"; - -// Components -@import "..\bower_components\bootstrap\less\component-animations.less"; -@import "..\bower_components\bootstrap\less\glyphicons.less"; -@import "..\bower_components\bootstrap\less\dropdowns.less"; -@import "..\bower_components\bootstrap\less\button-groups.less"; -@import "..\bower_components\bootstrap\less\input-groups.less"; -@import "..\bower_components\bootstrap\less\navs.less"; -@import "..\bower_components\bootstrap\less\navbar.less"; -@import "styles\navbar.less"; -@import "..\bower_components\bootstrap\less\breadcrumbs.less"; -@import "..\bower_components\bootstrap\less\pagination.less"; -@import "..\bower_components\bootstrap\less\pager.less"; -@import "..\bower_components\bootstrap\less\labels.less"; -@import "..\bower_components\bootstrap\less\badges.less"; -@import "..\bower_components\bootstrap\less\jumbotron.less"; -@import "..\bower_components\bootstrap\less\thumbnails.less"; -@import "..\bower_components\bootstrap\less\alerts.less"; -@import "..\bower_components\bootstrap\less\progress-bars.less"; -@import "..\bower_components\bootstrap\less\media.less"; -@import "..\bower_components\bootstrap\less\list-group.less"; -@import "..\bower_components\bootstrap\less\panels.less"; -@import "..\bower_components\bootstrap\less\wells.less"; -@import "..\bower_components\bootstrap\less\close.less"; - -// Components w/ JavaScript -@import "..\bower_components\bootstrap\less\modals.less"; -@import "..\bower_components\bootstrap\less\tooltip.less"; -@import "..\bower_components\bootstrap\less\popovers.less"; -@import "..\bower_components\bootstrap\less\carousel.less"; - -// Utility classes -@import "..\bower_components\bootstrap\less\utilities.less"; -@import "..\bower_components\bootstrap\less\responsive-utilities.less"; diff --git a/src/index.html b/src/index.html @@ -6,7 +6,7 @@ <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> - <link rel="stylesheet" href="app.css"> + <link rel="stylesheet" href="css/bootstrap.css"> </head> <body> <!--[if lt IE 8]> diff --git a/src/styles/.csscomb.json b/src/styles/.csscomb.json @@ -0,0 +1,297 @@ +{ + "always-semicolon": true, + "block-indent": 2, + "colon-space": [0, 1], + "color-case": "lower", + "color-shorthand": true, + "combinator-space": true, + "element-case": "lower", + "eof-newline": true, + "leading-zero": false, + "remove-empty-rulesets": true, + "rule-indent": 2, + "stick-brace": " ", + "strip-spaces": true, + "unitless-zero": true, + "vendor-prefix-align": true, + "sort-order": [ + [ + "position", + "top", + "right", + "bottom", + "left", + "z-index", + "display", + "float", + "width", + "min-width", + "max-width", + "height", + "min-height", + "max-height", + "-webkit-box-sizing", + "-moz-box-sizing", + "box-sizing", + "-webkit-appearance", + "padding", + "padding-top", + "padding-right", + "padding-bottom", + "padding-left", + "margin", + "margin-top", + "margin-right", + "margin-bottom", + "margin-left", + "overflow", + "overflow-x", + "overflow-y", + "-webkit-overflow-scrolling", + "-ms-overflow-x", + "-ms-overflow-y", + "-ms-overflow-style", + "clip", + "clear", + "font", + "font-family", + "font-size", + "font-style", + "font-weight", + "font-variant", + "font-size-adjust", + "font-stretch", + "font-effect", + "font-emphasize", + "font-emphasize-position", + "font-emphasize-style", + "font-smooth", + "-webkit-hyphens", + "-moz-hyphens", + "hyphens", + "line-height", + "color", + "text-align", + "-webkit-text-align-last", + "-moz-text-align-last", + "-ms-text-align-last", + "text-align-last", + "text-emphasis", + "text-emphasis-color", + "text-emphasis-style", + "text-emphasis-position", + "text-decoration", + "text-indent", + "text-justify", + "text-outline", + "-ms-text-overflow", + "text-overflow", + "text-overflow-ellipsis", + "text-overflow-mode", + "text-shadow", + "text-transform", + "text-wrap", + "-webkit-text-size-adjust", + "-ms-text-size-adjust", + "letter-spacing", + "-ms-word-break", + "word-break", + "word-spacing", + "-ms-word-wrap", + "word-wrap", + "-moz-tab-size", + "-o-tab-size", + "tab-size", + "white-space", + "vertical-align", + "list-style", + "list-style-position", + "list-style-type", + "list-style-image", + "pointer-events", + "cursor", + "visibility", + "zoom", + "flex-direction", + "flex-order", + "flex-pack", + "flex-align", + "table-layout", + "empty-cells", + "caption-side", + "border-spacing", + "border-collapse", + "content", + "quotes", + "counter-reset", + "counter-increment", + "resize", + "-webkit-user-select", + "-moz-user-select", + "-ms-user-select", + "-o-user-select", + "user-select", + "nav-index", + "nav-up", + "nav-right", + "nav-down", + "nav-left", + "background", + "background-color", + "background-image", + "-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient", + "filter:progid:DXImageTransform.Microsoft.gradient", + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader", + "filter", + "background-repeat", + "background-attachment", + "background-position", + "background-position-x", + "background-position-y", + "-webkit-background-clip", + "-moz-background-clip", + "background-clip", + "background-origin", + "-webkit-background-size", + "-moz-background-size", + "-o-background-size", + "background-size", + "border", + "border-color", + "border-style", + "border-width", + "border-top", + "border-top-color", + "border-top-style", + "border-top-width", + "border-right", + "border-right-color", + "border-right-style", + "border-right-width", + "border-bottom", + "border-bottom-color", + "border-bottom-style", + "border-bottom-width", + "border-left", + "border-left-color", + "border-left-style", + "border-left-width", + "border-radius", + "border-top-left-radius", + "border-top-right-radius", + "border-bottom-right-radius", + "border-bottom-left-radius", + "-webkit-border-image", + "-moz-border-image", + "-o-border-image", + "border-image", + "-webkit-border-image-source", + "-moz-border-image-source", + "-o-border-image-source", + "border-image-source", + "-webkit-border-image-slice", + "-moz-border-image-slice", + "-o-border-image-slice", + "border-image-slice", + "-webkit-border-image-width", + "-moz-border-image-width", + "-o-border-image-width", + "border-image-width", + "-webkit-border-image-outset", + "-moz-border-image-outset", + "-o-border-image-outset", + "border-image-outset", + "-webkit-border-image-repeat", + "-moz-border-image-repeat", + "-o-border-image-repeat", + "border-image-repeat", + "outline", + "outline-width", + "outline-style", + "outline-color", + "outline-offset", + "-webkit-box-shadow", + "-moz-box-shadow", + "box-shadow", + "filter:progid:DXImageTransform.Microsoft.Alpha(Opacity", + "-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha", + "opacity", + "-ms-interpolation-mode", + "-webkit-transition", + "-moz-transition", + "-ms-transition", + "-o-transition", + "transition", + "-webkit-transition-delay", + "-moz-transition-delay", + "-ms-transition-delay", + "-o-transition-delay", + "transition-delay", + "-webkit-transition-timing-function", + "-moz-transition-timing-function", + "-ms-transition-timing-function", + "-o-transition-timing-function", + "transition-timing-function", + "-webkit-transition-duration", + "-moz-transition-duration", + "-ms-transition-duration", + "-o-transition-duration", + "transition-duration", + "-webkit-transition-property", + "-moz-transition-property", + "-ms-transition-property", + "-o-transition-property", + "transition-property", + "-webkit-transform", + "-moz-transform", + "-ms-transform", + "-o-transform", + "transform", + "-webkit-transform-origin", + "-moz-transform-origin", + "-ms-transform-origin", + "-o-transform-origin", + "transform-origin", + "-webkit-animation", + "-moz-animation", + "-ms-animation", + "-o-animation", + "animation", + "-webkit-animation-name", + "-moz-animation-name", + "-ms-animation-name", + "-o-animation-name", + "animation-name", + "-webkit-animation-duration", + "-moz-animation-duration", + "-ms-animation-duration", + "-o-animation-duration", + "animation-duration", + "-webkit-animation-play-state", + "-moz-animation-play-state", + "-ms-animation-play-state", + "-o-animation-play-state", + "animation-play-state", + "-webkit-animation-timing-function", + "-moz-animation-timing-function", + "-ms-animation-timing-function", + "-o-animation-timing-function", + "animation-timing-function", + "-webkit-animation-delay", + "-moz-animation-delay", + "-ms-animation-delay", + "-o-animation-delay", + "animation-delay", + "-webkit-animation-iteration-count", + "-moz-animation-iteration-count", + "-ms-animation-iteration-count", + "-o-animation-iteration-count", + "animation-iteration-count", + "-webkit-animation-direction", + "-moz-animation-direction", + "-ms-animation-direction", + "-o-animation-direction", + "animation-direction" + ] + ] +} diff --git a/src/styles/.csslintrc b/src/styles/.csslintrc @@ -0,0 +1,19 @@ +{ + "adjoining-classes": false, + "box-sizing": false, + "box-model": false, + "compatible-vendor-prefixes": false, + "floats": false, + "font-sizes": false, + "gradients": false, + "important": false, + "known-properties": false, + "outline-none": false, + "qualified-headings": false, + "regex-selectors": false, + "shorthand": false, + "text-indent": false, + "unique-headings": false, + "universal-selector": false, + "unqualified-attributes": false +} diff --git a/src/styles/bootstrap.less b/src/styles/bootstrap.less @@ -0,0 +1,57 @@ +/* ========================================================================== + Bootstrap CSS + Custom Styles and overrides + ========================================================================== */ + +// Core variables and mixins +@import "../../node_modules/bootstrap/less/variables.less"; +@import "../../node_modules/bootstrap/less/mixins.less"; +@import "variables.less"; + +// Reset and dependencies +@import "../../node_modules/bootstrap/less/normalize.less"; +@import "../../node_modules/bootstrap/less/print.less"; +@import "../../node_modules/bootstrap/less/glyphicons.less"; + +// Core CSS +@import "../../node_modules/bootstrap/less/scaffolding.less"; +@import "../../node_modules/bootstrap/less/type.less"; +@import "../../node_modules/bootstrap/less/code.less"; +@import "../../node_modules/bootstrap/less/grid.less"; +@import "../../node_modules/bootstrap/less/tables.less"; +@import "../../node_modules/bootstrap/less/forms.less"; +@import "../../node_modules/bootstrap/less/buttons.less"; +@import "base.less"; + +// Components +@import "../../node_modules/bootstrap/less/component-animations.less"; +@import "../../node_modules/bootstrap/less/dropdowns.less"; +@import "../../node_modules/bootstrap/less/button-groups.less"; +@import "../../node_modules/bootstrap/less/input-groups.less"; +@import "../../node_modules/bootstrap/less/navs.less"; +@import "../../node_modules/bootstrap/less/navbar.less"; +@import "../../node_modules/bootstrap/less/breadcrumbs.less"; +@import "../../node_modules/bootstrap/less/pagination.less"; +@import "../../node_modules/bootstrap/less/pager.less"; +@import "../../node_modules/bootstrap/less/labels.less"; +@import "../../node_modules/bootstrap/less/badges.less"; +@import "../../node_modules/bootstrap/less/jumbotron.less"; +@import "../../node_modules/bootstrap/less/thumbnails.less"; +@import "../../node_modules/bootstrap/less/alerts.less"; +@import "../../node_modules/bootstrap/less/progress-bars.less"; +@import "../../node_modules/bootstrap/less/media.less"; +@import "../../node_modules/bootstrap/less/list-group.less"; +@import "../../node_modules/bootstrap/less/panels.less"; +@import "../../node_modules/bootstrap/less/responsive-embed.less"; +@import "../../node_modules/bootstrap/less/wells.less"; +@import "../../node_modules/bootstrap/less/close.less"; +@import "navbar.less"; + +// Components w/ JavaScript +@import "../../node_modules/bootstrap/less/modals.less"; +@import "../../node_modules/bootstrap/less/tooltip.less"; +@import "../../node_modules/bootstrap/less/popovers.less"; +@import "../../node_modules/bootstrap/less/carousel.less"; + +// Utility classes +@import "../../node_modules/bootstrap/less/utilities.less"; +@import "../../node_modules/bootstrap/less/responsive-utilities.less";