var lazypipe = require('lazypipe');
var fs = require('fs');
var yargs = require('yargs');
+var sass = require('gulp-sass');
+
+sass.compiler = require('node-sass');
// Configuration for the documentation generator
supercollider
});
});
-gulp.task('sass', ['sass:docs', 'sass:foundation']);
// Compiles documentation-specific CSS
gulp.task('sass:docs', function() {
return gulp.src('docs/assets/scss/docs.scss')
- .pipe($.sass({ includePaths: [process.cwd()] }).on('error', $.sass.logError))
- .pipe($.autoprefixer({
- browsers: ['last 2 versions', 'ie >= 9']
- }))
+ .pipe(sass.sync({ includePaths: [process.cwd()] }).on('error', sass.logError))
+ .pipe($.autoprefixer())
.pipe(gulp.dest('_build/assets/css'));
});
// Compiles Foundation-specific CSS
gulp.task('sass:foundation', function() {
return gulp.src('scss/foundation-emails.scss')
- .pipe($.sass().on('error', $.sass.logError))
+ .pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.dest('_build/assets/css'));
});
+gulp.task('sass', gulp.series('sass:docs', 'sass:foundation'));
+
// Compiles documentation JavaScript
gulp.task('javascript:docs', function() {
return gulp.src(['node_modules/foundation-docs/js/*.js', 'docs/assets/js/**/*.js'])
.pipe($.sassLint.failOnError());
});
+// Runs the entire build process
+gulp.task('build', gulp.series('clean', 'copy', 'copy-inky', 'html', 'sass', 'javascript:docs', function(cb){
+ cb();
+}));
+
// Creates a BrowserSync server
-gulp.task('server', ['build'], function() {
- browser.init({
- server: './_build',
- port: yargs.argv.port || 3001
- });
-});
+gulp.task('server', gulp.series('build', function(){
+ browser.init({server: './_build', port: yargs.argv.port||3001});
+}));
// Uploads the documentation to the live server
-gulp.task('deploy:docs', ['build'], function() {
+gulp.task('deploy:docs', gulp.series('build'), function() {
return gulp.src('./_build/**')
.pipe($.prompt.confirm('Make sure everything looks right before you deploy.'))
.pipe($.rsync({
}));
});
-// Runs the entire build process
-gulp.task('build', function(cb) {
- sequence('clean', ['copy', 'copy-inky', 'html', 'sass', 'javascript:docs'], cb);
-});
// Runs the build process, spins up a server, and watches for file changes
-gulp.task('default', ['server'], function() {
+gulp.task('default', gulp.series('server', function() {
gulp.watch('docs/**/*', ['html', browser.reload]);
gulp.watch(['docs/assets/scss/**/*', 'node_modules/foundation-docs/scss/**/*'], ['sass:docs', browser.reload]);
gulp.watch('scss/**/*.scss', ['sass:foundation', browser.reload]);
-});
-
-gulp.task('test', ['sass', 'test:compile'], function() {
- browser.init({ server: 'test/visual/_build', directory: true });
- gulp.watch('scss/**/*.scss', ['sass:foundation', browser.reload]);
- gulp.watch('test/visual/pages/*.html', ['test:compile', browser.reload]);
-});
+}));
gulp.task('test:compile', function() {
gulp.src('test/visual/pages/*.html')
.pipe(gulp.dest('test/visual/_build'));
});
+gulp.task('test', gulp.series('sass', 'test:compile', function() {
+ browser.init({ server: 'test/visual/_build', directory: true });
+ gulp.watch('scss/**/*.scss', ['sass:foundation', browser.reload]);
+ gulp.watch('test/visual/pages/*.html', ['test:compile', browser.reload]);
+}));
+
gulp.task('templates', function() {
return gulp.src('templates/*.html')
.pipe($.wrap({ src: 'test/visual/_template.html' }))
.pipe(gulp.dest('.download'));
});
-gulp.task('download:build:templates', ['templates'], function() {
+gulp.task('download:build:templates', gulp.series('templates', function() {
return gulp.src('.templates/*.html')
.pipe(gulp.dest('.download/templates'));
-});
+}));
-gulp.task('download:build:css', ['sass:foundation'], function() {
+gulp.task('download:build:css', gulp.series('sass:foundation', function() {
return gulp.src('_build/assets/css/foundation-emails.css')
.pipe(gulp.dest('.download/css'));
-})
+}));
-gulp.task('download:build', ['download:build:index', 'download:build:templates', 'download:build:css'], function() {
+gulp.task('download:build', gulp.series('download:build:index', 'download:build:templates', 'download:build:css', function() {
return gulp.src('.download/**/*')
.pipe($.zip('foundation-emails.zip'))
.pipe(gulp.dest('.'));
-});
+}));
-gulp.task('download', ['download:build'], function(done) {
+gulp.task('download', gulp.series('download:build', function(done) {
return gulp.src('foundation-emails.zip')
.pipe($.rsync({
hostname: 'deployer@72.32.134.77',
destination: '/home/deployer/sites/foundation-sites-6-marketing/downloads/'
}));
-});
+}));
-gulp.task('dist', ['sass:foundation'], function() {
+gulp.task('dist', gulp.series('sass:foundation', function() {
return gulp.src('_build/assets/css/foundation-emails.css')
.pipe(gulp.dest('dist'))
.pipe($.cssnano())
.pipe($.rename('foundation-emails.min.css'))
.pipe(gulp.dest('dist'));
-});
+}));
function inliner(css) {
css = fs.readFileSync(css).toString();
resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.2.2.tgz#bf69aea2972982675f00865342b982986f6b8dd9"
integrity sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==
-foundation-docs@zurb/foundation-docs:
+foundation-docs@foundation/foundation-docs:
version "0.2.2"
- resolved "https://codeload.github.com/zurb/foundation-docs/tar.gz/b951a97bb0e5ee94d74050590aa179bf15181a4b"
+ resolved "https://codeload.github.com/foundation/foundation-docs/tar.gz/b951a97bb0e5ee94d74050590aa179bf15181a4b"
dependencies:
cheerio "^1.0.0-rc.2"
handlebars "^4.1.2"
lodash.isstring "^2.4.1"
through2 "^0.6.1"
-gulp-sass-lint@^1.1.1:
+gulp-sass-lint@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/gulp-sass-lint/-/gulp-sass-lint-1.4.0.tgz#6f7096c5abcbc0ce99ddf060c9e1a99067a47ebe"
integrity sha512-XerYvHx7rznInkedMw5Ayif+p8EhysOVHUBvlgUa0FSl88H2cjNjaRZ3NGn5Efmp+2HxpXp4NHqMIbOSdwef3A==
sass-lint "^1.12.0"
through2 "^2.0.2"
-gulp-sass@^4.0.2:
+gulp-sass@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/gulp-sass/-/gulp-sass-4.1.0.tgz#486d7443c32d42bf31a6b1573ebbdaa361de7427"
integrity sha512-xIiwp9nkBLcJDpmYHbEHdoWZv+j+WtYaKD6Zil/67F3nrAaZtWYN5mDwerdo7EvcdBenSAj7Xb2hx2DqURLGdA==
dependencies:
glogg "^1.0.0"
-handlebars@^4.0.5, handlebars@^4.1.2, handlebars@^4.5.3:
+handlebars@^4.0.5, handlebars@^4.1.2:
version "4.7.6"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e"
integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-8.9.1.tgz#b8a9c5493212a9392f0222b649c9611497ebfb88"
integrity sha1-uKnFSTISqTkvAiK2SclhFJfr+4g=
-highlight.js@^9.16.2:
+highlight.js@^9.0.0:
version "9.18.1"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.1.tgz#ed21aa001fe6252bb10a3d76d47573c6539fe13c"
integrity sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg==
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.59.tgz#4d648330641cec704bff10f8e4fe28e453ab8e8e"
integrity sha512-H3JrdUczbdiwxN5FuJPyCHnGHIFqQ0wWxo+9j1kAXAzqNMAHlo+4I/sYYxpyK0irQ73HgdiyzD32oqQDcU2Osw==
-node-sass@^4.8.3:
+node-sass@^4.14.1, node-sass@^4.8.3:
version "4.14.1"
resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.14.1.tgz#99c87ec2efb7047ed638fb4c9db7f3a42e2217b5"
integrity sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==