Skip to content

Commit

Permalink
some updete
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdev27 committed Apr 22, 2017
1 parent 06cb898 commit 99f7e1f
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 88 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#


node_modules/

build/

src/libs/
52 changes: 52 additions & 0 deletions .jsbeautifyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{

"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg"],
"brace_style": "end-expand",
"end_with_newline": false,
"indent_char": " ",
"indent_handlebars": false,
"indent_inner_html": false,
"indent_scripts": "keep",
"indent_size": 2,
"max_preserve_newlines": 0,
"preserve_newlines": true,
"unformatted": ["a", "span", "img", "code", "pre", "sub", "sup", "em", "strong", "b", "i", "u", "strike", "big", "small", "pre", "h1", "h2", "h3", "h4", "h5", "h6"],
"wrap_line_length": 0
},
"css": {
"allowed_file_extensions": ["css", "scss", "sass", "less"],
"end_with_newline": false,
"indent_char": " ",
"indent_size": 4,
"newline_between_rules": true,
"selector_separator": " ",
"selector_separator_newline": true
},
"js": {
"allowed_file_extensions": ["js", "json", "jshintrc", "jsbeautifyrc"],


"brace_style": "collapse-preserve-inline",

"break_chained_methods": false,
"e4x": false,
"end_with_newline": false,
"indent_char": " ",
"indent_level": 0,
"indent_size": 2,
"indent_with_tabs": false,
"jslint_happy": false,
"keep_array_indentation": false,
"keep_function_indentation": false,
"max_preserve_newlines": 0,
"preserve_newlines": true,
"space_after_anon_function": false,
"space_before_conditional": true,
"space_in_empty_paren": false,
"space_in_paren": false,
"unescape_strings": false,
"wrap_line_length": 0
}

}
3 changes: 3 additions & 0 deletions gulp/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module.exports = {
'notify': true // уведомления
},

'jsbeautifier': {
'src' : '.jsbeautifyrc'
},

'styles': {
'src' : './src/style/**/*.scss',
Expand Down
12 changes: 8 additions & 4 deletions gulp/tasks/2_watchTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ var gulp = require('gulp');

gulp.task('watch', ['startDev'] , function() {

/* ПРИ НЕОБХОДИМОСТИ МОЖНО ПРОСТО ЗАКОМЕНТИРОВАТЬ/РАССКОМЕНТИРОВАТЬ
ТАСК,КОТОРЫЙ НЕ БУДЕТ/БУДЕТ ИСПОЛЬЗОВАТЬСЯ */


// gulp.watch( config.images.watch.svgIcons, ['buildSvgSymbol']);

gulp.watch( config.styles.watch, ['sass']);
Expand Down Expand Up @@ -34,15 +38,15 @@ gulp.task('watch', ['startDev'] , function() {
rebuildFiles(e, 'updateImg', 'img');
});

gulp.watch( config.images.watch.pngIconsForSprite )
/*gulp.watch( config.images.watch.pngIconsForSprite )
.on('change', function (e) {
rebuildFiles(e, 'updatePngSprite','buildPngSprite');
})
gulp.watch( config.fonts.watch )
.on('change', function(e){
rebuildFiles(e, 'updateFonts', 'convertFonts');
});
});*/

});

Expand All @@ -55,9 +59,9 @@ function rebuildFiles(event, specialTask, defaultTask) {

/* ПРИ НЕОБХОДИМОСТИ МОЖНО ПРОСТО ЗАКОМЕНТИРОВАТЬ ТАСК,КОТОРЫЙ НЕ БУДЕТ ИСПОЛЬЗОВАТЬСЯ */
gulp.task('startDev',function (cb) {
runSequence('del:build','img', 'buildPngSprite',/*'buildSvgSymbol',*/ [/*'convertFonts',*/'sass', 'html', 'js'], 'webserver', cb)
runSequence('del:build','img', /*'buildPngSprite',*//*'buildSvgSymbol',*/ [/*'convertFonts',*/'sass', 'html', 'js'], 'webserver', cb)
});

gulp.task('prod', function () {
runSequence('del:build', 'clearCache', 'img', 'buildPngSprite',/*'svgIconsToBuild',*/ [/*'buildSvgSymbol', 'convertFonts',*/'sass', 'html', 'js'] );
runSequence('del:build', 'clearCache', 'img', /*'buildPngSprite',*//*'svgIconsToBuild',*/ [/*'buildSvgSymbol', 'convertFonts',*/'sass', 'html', 'js'] );
});
14 changes: 9 additions & 5 deletions gulp/tasks/9_html.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@

var config = require('../config');
var cfg = require('../config');
var p = require('gulp-load-plugins')();
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;

gulp.task('html', function(){

return gulp.src( config.html.src )
return gulp.src( cfg.html.src )

.pipe(p.plumber())
.pipe( p.if( global.notUpdateHtmlTmplt,
p.changed( config.html.dest, {extension: '.html'})) )
p.changed( cfg.html.dest, {extension: '.html'})) )

.pipe(p.fileInclude({
prefix: '@@',
basepath: 'src/html_components/'
}))
.pipe(p.htmlPrettify({indent_char: ' ', indent_size: 2}))
.pipe(gulp.dest( config.html.dest ))
.pipe(p.jsbeautifier({

config: cfg.jsbeautifier.src

}))
.pipe(gulp.dest( cfg.html.dest ))
.pipe(reload({stream: true}))
});
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "sborka3",
"name": "Sborshchik",
"version": "1.0.0",
"description": "",
"description": "frontend builder",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"postinstall" : "bower i"
},
"author": "Khabarovskii",
"license": "ISC",
Expand All @@ -22,9 +22,9 @@
"gulp-cssfont64-fork": "^0.0.2",
"gulp-cssnano": "^2.1.1",
"gulp-file-include": "^1.0.0",
"gulp-html-prettify": "0.0.1",
"gulp-if": "^2.0.2",
"gulp-imagemin": "^2.4.0",
"gulp-jsbeautifier": "^2.1.0",
"gulp-plumber": "^1.1.0",
"gulp-postcss": "^6.2.0",
"gulp-rename": "^1.2.2",
Expand Down
1 change: 0 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<body>
@@include('header.html')
<div class="wrapper">

</div>

@@include('footer.html')
Expand Down
8 changes: 4 additions & 4 deletions src/style/main.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

//@import 'scss_components/_mixins.scss';
@import 'scss_components/_mixins.scss';
// @import '../libs/bourbon/app/assets/stylesheets/_bourbon.scss';

// @import '../fonts/_include_fonts.scss';


// @import '../libs/normalize.css/normalize';
// @import 'scss_components/_variables.scss';
// @import 'scss_components/_global-adjustment.scss';
@import 'scss_components/_variables.scss';
@import 'scss_components/_global-adjustment.scss';




/* MY AWESOME STYLES...*/


.leave-px{
Expand Down
Loading

0 comments on commit 99f7e1f

Please sign in to comment.