Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
… updates.
- Loading branch information
1 parent
acf103f
commit e12725d
Showing
10 changed files
with
2,297 additions
and
501 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module" | ||
|
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
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 |
---|---|---|
@@ -1,21 +1,39 @@ | ||
module.exports = { | ||
|
||
SASS_BUILD_FILES: [ | ||
'scss/*.scss' | ||
], | ||
|
||
SASS_LINT_FILES: [ | ||
'scss/**/*.scss' | ||
], | ||
|
||
VERSIONED_FILES: [ | ||
'package.json', | ||
'README.md', | ||
'docs/getting-started.md' | ||
], | ||
|
||
TEST_BUILD_FILES: [ | ||
'test/**/*.html' | ||
], | ||
|
||
paths: { | ||
sass: { | ||
src: [ 'scss/*.scss' ], | ||
dest: [ './dist' ], | ||
lint: [ 'scss/**/*.scss' ], | ||
}, | ||
test: { | ||
src: [ 'test/**/*.html' ], | ||
dest: [ 'test/' ], | ||
clean: [ | ||
'test/**/*.html', | ||
'!test/**/*-source.html', | ||
], | ||
watch: [ | ||
'scss/**/*.scss', | ||
'test/**/*-source.html', | ||
], | ||
}, | ||
release: { | ||
versionedFiles: [ | ||
'package.json', | ||
'README.md', | ||
'docs/getting-started.md', | ||
], | ||
assets: { | ||
src: [ './dist/*' ], | ||
dest: [ './release-assets' ], | ||
} | ||
}, | ||
examples: { | ||
src: [ | ||
'test/**/*.html', | ||
'!test/**/*-source.html' | ||
], | ||
dest: [ 'docs/examples' ], | ||
}, | ||
}, | ||
}; |
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,20 @@ | ||
var gulp = require( 'gulp' ); | ||
var del = require( 'del' ); | ||
|
||
// Require main configuration file | ||
var config = require( '../config.js' ); | ||
|
||
// Export functions | ||
exports.clean = clean; | ||
exports.move = move; | ||
|
||
// Remove existing example files | ||
function clean() { | ||
return del( config.paths.examples.dest ); | ||
} | ||
|
||
// Move new example files to documentation folder | ||
function move() { | ||
return gulp.src( config.paths.examples.src ) | ||
.pipe( gulp.dest( config.paths.examples.dest ) ); | ||
} |
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
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,41 @@ | ||
var gulp = require( 'gulp' ); | ||
var sass = require( 'gulp-sass' ); | ||
var styleLint = require( 'gulp-stylelint' ); | ||
var combineMq = require( 'gulp-combine-mq' ); | ||
var rename = require( 'gulp-rename' ); | ||
|
||
// Require main configuration file | ||
var config = require( '../config.js' ); | ||
|
||
// Export functions | ||
exports.lint = lint; | ||
exports.build = build; | ||
|
||
// Lint SASS | ||
function lint() { | ||
return gulp.src( config.paths.sass.lint ) | ||
.pipe( styleLint( { | ||
configFile: './.stylelintrc', | ||
reporters: [ | ||
{ | ||
formatter: 'string', | ||
console: true, | ||
} | ||
], | ||
syntax: 'scss', | ||
} ) ); | ||
} | ||
|
||
// Build SASS dist. files | ||
function build() { | ||
return gulp.src( config.paths.sass.src ) | ||
.pipe( sass( { outputStyle: 'expanded' } ) | ||
.on( 'error', sass.logError ) ) | ||
.pipe( combineMq() ) | ||
.pipe( gulp.dest( config.paths.sass.dest ) ) | ||
.pipe( sass( { outputStyle: 'compressed' } ) | ||
.on( 'error', sass.logError ) ) | ||
.pipe( combineMq( { beautify: false } ) ) | ||
.pipe( rename( { suffix: '.min' } ) ) | ||
.pipe( gulp.dest( config.paths.sass.dest ) ); | ||
} |
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 |
---|---|---|
@@ -1,36 +1,36 @@ | ||
var gulp = require( 'gulp' ); | ||
var del = require( 'del' ); | ||
var juice = require( '@akzhan/gulp-juice' ); | ||
var rename = require( 'gulp-rename' ); | ||
var del = require( 'del' ); | ||
|
||
var CONFIG = require( '../config.js' ); | ||
// Require main configuration file | ||
var config = require( '../config.js' ); | ||
|
||
// Export functions | ||
exports.clean = clean; | ||
exports.build = build; | ||
|
||
// Remove dist test files | ||
function clean() { | ||
return del( config.paths.test.clean ); | ||
} | ||
|
||
// Build test files | ||
gulp.task( 'test:build', [ 'test:clean' ], function() { | ||
return gulp.src( CONFIG.TEST_BUILD_FILES ) | ||
.pipe( | ||
juice( { | ||
applyHeightAttributes: false, | ||
applyWidthAttributes: false, | ||
xmlMode: true, | ||
webResources: { | ||
images: false, | ||
svgs: false, | ||
scripts: false, | ||
links: false, | ||
}, | ||
} ) | ||
) | ||
function build() { | ||
return gulp.src( config.paths.test.src ) | ||
.pipe( juice( { | ||
applyHeightAttributes: false, | ||
applyWidthAttributes: false, | ||
xmlMode: true, | ||
webResources: { | ||
images: false, | ||
svgs: false, | ||
scripts: false, | ||
links: false, | ||
}, | ||
} ) ) | ||
.pipe( rename( function( path ) { | ||
path.basename = path.basename.replace( '-source', '' ); | ||
} ) ) | ||
.pipe( gulp.dest( 'test/' ) ); | ||
} ); | ||
|
||
// Remove dist test files | ||
gulp.task( 'test:clean', function() { | ||
return del( [ | ||
'test/**/*.html', | ||
'!test/**/*-source.html', | ||
] ); | ||
} ); | ||
.pipe( gulp.dest( config.paths.test.dest ) ); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,64 @@ | ||
var gulp = require( 'gulp' ); | ||
var requireDir = require( 'require-dir' ); | ||
|
||
requireDir( './gulp/tasks' ); | ||
// Require main configuration file | ||
var config = require( './gulp/config.js' ); | ||
|
||
// Require tasks | ||
var sass = require( './gulp/tasks/sass.js' ); | ||
var test = require( './gulp/tasks/test.js' ); | ||
var examples = require( './gulp/tasks/examples.js' ); | ||
var release = require( './gulp/tasks/release.js' ); | ||
|
||
// SASS build task | ||
gulp.task( | ||
'sass', | ||
gulp.series( [ | ||
sass.lint, | ||
sass.build, | ||
] ) | ||
); | ||
|
||
// Test build task | ||
gulp.task( | ||
'test', | ||
gulp.series( [ | ||
test.clean, | ||
test.build, | ||
] ) | ||
); | ||
|
||
// Test watch task | ||
gulp.task( | ||
'test:watch', | ||
function() { | ||
gulp.watch( | ||
config.paths.test.watch, | ||
gulp.series( [ | ||
'sass', | ||
'test', | ||
] ) | ||
); | ||
} | ||
); | ||
|
||
// Examples build and migration task | ||
gulp.task( | ||
'examples', | ||
gulp.series( [ | ||
'test', | ||
examples.clean, | ||
examples.move, | ||
] ) | ||
); | ||
|
||
// Release main task | ||
gulp.task( | ||
'release', | ||
gulp.series( [ | ||
release.prompt, | ||
release.version, | ||
'sass', | ||
'examples', | ||
release.assets, | ||
] ) | ||
); |
Oops, something went wrong.