Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Update Gulp packages. #2005

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 23 additions & 41 deletions web/themes/joinup/prototype/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var gulp = require('gulp'),
concat = require('gulp-concat'),
watch = require('gulp-watch'),
sass = require('gulp-sass'),
styleguide = require('sc5-styleguide'),
// styleguide = require('sc5-styleguide'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no this will be updated, we had confirmation that we could remove styleguide task.

livereload = require('gulp-livereload');
mustache = require('gulp-mustache');

Expand Down Expand Up @@ -36,9 +36,8 @@ gulp.task('scripts', function(){
.pipe(gulp.dest('js'));
});


// Define SASS compiling task
gulp.task('sass', function () {
gulp.task('sass', function (done) {
gulp.src('sass/app.sass')
.pipe(sass(
{outputStyle: 'compressed'}
Expand All @@ -47,66 +46,49 @@ gulp.task('sass', function () {
.pipe(gulp.dest('../css'))
.pipe(gulp.dest('css'))
.pipe(livereload());
done();
});


// Define Mustache compiling task
gulp.task('mustache', function() {
gulp.task('mustache', function(done) {
return gulp.src("./html-prototype-sandbox/*.html")
.pipe(mustache())
.pipe(gulp.dest("./html-prototype"));
});


// Define rendering styleguide task
// https://github.com/SC5/sc5-styleguide#build-options
gulp.task('styleguide:generate', function() {
return gulp.src(paths.sassStyleguide)
.pipe(styleguide.generate({
extraHead: [
'<script src="/js/material.min.js"></script>',
'<script src="/js/jquery.min.js"></script>',
'<script src="/js/styleguide.js"></script>',
],
disableEncapsulation: true,
title: 'Joinup styleguide',
server: true,
sideNav: true,
rootPath: paths.styleguide,
overviewPath: 'README.md',
commonClass: 'body'
}))
.pipe(gulp.dest(paths.styleguide));
});
gulp.task('styleguide:applystyles', function() {
return gulp.src(paths.sassStyleguide)
.pipe(sass({
errLogToConsole: true
}))
.pipe(styleguide.applyStyles())
.pipe(gulp.dest(paths.styleguide));
});
gulp.task('styleguide', ['styleguide:generate', 'styleguide:applystyles']);
// Define copying images for styleguide task
gulp.task('images', function() {
gulp.task('images', function(done) {
gulp.src(['../images/**'])
.pipe(gulp.dest(paths.styleguide + '/images'))
.pipe(gulp.dest('images'));
done();
});

// Define copying fonts for styleguide task
gulp.task('fonts', function() {
gulp.task('fonts', function(done) {
gulp.src(['../fonts/**'])
.pipe(gulp.dest(paths.styleguide + '/fonts'))
.pipe(gulp.dest('fonts'));
done();
});

// Define copying javascript for styleguide task
gulp.task('js', function() {
gulp.task('js', function(done) {
gulp.src(['js/**', '../vendor/material-design-lite/material.min.js', '../../../../web/core/assets/vendor/jquery/jquery.min.js'])
.pipe(gulp.dest(paths.styleguide + '/js'));
done();
});

// Listen folders for changes and apply defined tasks
gulp.task('default', ['styleguide', 'sass', 'images', 'fonts', 'js', 'mustache'], function() {
// Define watch tasks
gulp.task('watch', function(done) {
livereload.listen(45729);
gulp.watch([paths.sass, paths.html, paths.mustache], ['styleguide', 'sass', 'images', 'fonts', 'js', 'mustache']);
gulp.watch(paths.sass, gulp.series('sass'));
gulp.watch(paths.html, gulp.series('images', 'fonts', 'js'));
gulp.watch(paths.mustache, gulp.series('mustache'));
done();
});

// Listen folders for changes and apply defined tasks
gulp.task('default', gulp.parallel('sass', 'images', 'fonts', 'js', 'mustache'), function(done) {
done();
});
15 changes: 6 additions & 9 deletions web/themes/joinup/prototype/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
"name": "bootmacss",
"version": "0.1.0",
"devDependencies": {
"bootstrap-sass": "~3.3.7",
"flexboxgrid": "~6.3.1",
"gulp": "~3.9.0",
"gulp-rename": "~1.2.2",
"gulp": "^4.0.2",
"gulp-concat": "~2.6.0",
"gulp-sass": "~2.1.1",
"gulp-watch": "~4.3.5",
"sc5-styleguide": "~0.3.41",
"gulp-livereload": "~3.8.1",
"gulp-mustache": "~2.2.0"
"gulp-livereload": "^4.0.2",
"gulp-mustache": "~2.2.0",
"gulp-rename": "~1.2.2",
"gulp-sass": "^4.0.2",
"gulp-watch": "^5.0.1"
},
"engines": {
"node": ">=0.10.0"
Expand Down