-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from bamadesigner/1.0.3
Version 1.0.3
- Loading branch information
Showing
13 changed files
with
5,841 additions
and
407 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,4 +1,3 @@ | ||
admin-edit-post.min.css | ||
admin-options-page.min.css | ||
node_modules | ||
vendor | ||
node_modules |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -5,85 +5,69 @@ const mergeMediaQueries = require('gulp-merge-media-queries'); | |
const notify = require('gulp-notify'); | ||
const rename = require('gulp-rename'); | ||
const sass = require('gulp-sass'); | ||
const shell = require('gulp-shell'); | ||
const sort = require('gulp-sort'); | ||
const wp_pot = require('gulp-wp-pot'); | ||
|
||
// Define the source paths for each file type. | ||
const src = { | ||
php: ['**/*.php','!vendor/**','!node_modules/**'], | ||
sass: ['assets/scss/**/*'] | ||
php: ['**/*.php', '!node_modules/**'], | ||
sass: ['assets/css/src/**/*'] | ||
}; | ||
|
||
// Define the destination paths for each file type. | ||
const dest = { | ||
sass: 'assets/css', | ||
translate: 'languages' | ||
sass: 'assets/css', | ||
translate: 'languages' | ||
}; | ||
|
||
// Take care of SASS. | ||
gulp.task('sass', function() { | ||
return gulp.src(src.sass) | ||
.pipe(sass({ | ||
outputStyle: 'expanded' | ||
}).on('error', sass.logError)) | ||
.pipe(mergeMediaQueries()) | ||
.pipe(autoprefixer({ | ||
browsers: ['last 2 versions'], | ||
cascade: false | ||
})) | ||
.pipe(cleanCSS({ | ||
compatibility: 'ie8' | ||
})) | ||
.pipe(rename({ | ||
suffix: '.min' | ||
})) | ||
.pipe(gulp.dest(dest.sass)) | ||
.pipe(notify('wA11y SASS compiled')); | ||
}); | ||
|
||
// "Sniff" our PHP. | ||
gulp.task('php', function() { | ||
// TODO: Clean up. Want to run command and show notify for sniff errors. | ||
return gulp.src('wa11y.php', {read: false}) | ||
.pipe(shell(['composer sniff'], { | ||
ignoreErrors: true, | ||
verbose: false | ||
})) | ||
.pipe(notify('wA11y PHP sniffed'), { | ||
onLast: true, | ||
emitError: true | ||
}); | ||
gulp.task('sass', function (done) { | ||
return gulp.src(src.sass) | ||
.pipe(sass({ | ||
outputStyle: 'expanded' | ||
}).on('error', sass.logError)) | ||
.pipe(mergeMediaQueries()) | ||
.pipe(autoprefixer({ | ||
cascade: false | ||
})) | ||
.pipe(cleanCSS({ | ||
compatibility: 'ie8' | ||
})) | ||
.pipe(rename({ | ||
suffix: '.min' | ||
})) | ||
.pipe(gulp.dest(dest.sass)) | ||
.pipe(notify('wA11y SASS compiled')) | ||
.on('end', done); | ||
}); | ||
|
||
// Create the .pot translation file. | ||
gulp.task('translate', function() { | ||
gulp.src(src.php) | ||
.pipe(sort()) | ||
.pipe(wp_pot({ | ||
domain: 'wa11y', | ||
destFile: 'wa11y.pot', | ||
package: 'wA11y', | ||
bugReport: 'https://github.com/bamadesigner/wa11y/issues', | ||
lastTranslator: 'Rachel Cherry <[email protected]>', | ||
team: 'Rachel Cherry <[email protected]>', | ||
headers: false | ||
})) | ||
.pipe(gulp.dest(dest.translate)) | ||
.pipe(notify('wA11y translated')); | ||
gulp.task('translate', function (done) { | ||
return gulp.src(src.php) | ||
.pipe(sort()) | ||
.pipe(wp_pot({ | ||
domain: 'wa11y', | ||
destFile: 'wa11y.pot', | ||
package: 'wA11y', | ||
bugReport: 'https://github.com/bamadesigner/wa11y/issues', | ||
lastTranslator: 'Rachel Cherry', | ||
team: 'Rachel Cherry', | ||
headers: false | ||
})) | ||
.pipe(gulp.dest(dest.translate)) | ||
.pipe(notify('wA11y translated')) | ||
.on('end', done); | ||
}); | ||
|
||
// Test our files. | ||
gulp.task('test',['php']); | ||
|
||
// Compile all the things. | ||
gulp.task('compile',['sass']); | ||
|
||
// I've got my eyes on you(r file changes). | ||
gulp.task('watch',function() { | ||
gulp.watch(src.sass,['sass']); | ||
gulp.watch(src.php,['php','translate']); | ||
}); | ||
gulp.task('compile', gulp.series('sass')); | ||
|
||
// Let's get this party started. | ||
gulp.task('default',['compile','test','translate']); | ||
gulp.task('default', gulp.series('compile', 'translate')); | ||
|
||
// I've got my eyes on you(r file changes). | ||
gulp.task('watch', gulp.series('default', function (done) { | ||
gulp.watch(src.sass, gulp.series('sass')); | ||
gulp.watch(src.php, gulp.series('translate')); | ||
return done(); | ||
})); |
Oops, something went wrong.