diff --git a/.gitignore b/.gitignore index a088b6f..8a490dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -bower_components +prepared +archive.zip diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 34997a7..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,115 +0,0 @@ -module.exports = function(grunt) { - - require('load-grunt-tasks')(grunt); - - grunt.initConfig({ - bump: { - options: { - files: ['package.json', 'bower.json'], - commitFiles: ['package.json', 'bower.json'], - pushTo: 'origin' - } - }, - copy: { - prepare: { - files: [{ - src: [ - '**', - '!node_modules/**', - '!bower_components/**', - '!CONTRIBUTING.md', - '!Gruntfile.js', - '!LICENSE.md', - '!README.md', - '!bower.json', - '!package.json' - ], - dest: 'temp/pres/' - },{ - expand: true, - cwd: 'node_modules/shower-core/', - src: [ - '**', - '!package.json', - '!README.md' - ], - dest: 'temp/pres/shower/' - },{ - expand: true, - cwd: 'node_modules/shower-ribbon/', - src: [ - '**', - '!package.json', - '!README.md' - ], - dest: 'temp/pres/shower/themes/ribbon/' - },{ - expand: true, - cwd: 'node_modules/shower-material/', - src: [ - '**', - '!package.json', - '!README.md' - ], - dest: 'temp/pres/shower/themes/material/' - }] - } - }, - replace: { - core: { - src: 'temp/pres/index.html', - overwrite: true, - replacements: [{ - from: /(node_modules|bower_components)\/shower-core/g, - to: 'shower' - },{ - from: /(node_modules|bower_components)\/shower-(ribbon|material)/g, - to: 'shower/themes/$2' - }] - }, - themes: { - src: 'temp/pres/shower/themes/*/index.html', - overwrite: true, - replacements: [{ - from: '../shower-core', to: '../..' - }] - } - }, - 'gh-pages': { - options: { - base: 'temp/pres', - clone: 'temp/clone' - }, - src: ['**'] - }, - compress: { - shower: { - options: { - archive: 'archive.zip' - }, - files: [{ - expand: true, - cwd: 'temp/pres/', - src: '**', - dest: '.' - }] - } - }, - clean: ['temp'] - }); - - grunt.registerTask('publish', [ - 'copy', - 'replace', - 'gh-pages', - 'clean' - ]); - - grunt.registerTask('archive', [ - 'copy', - 'replace', - 'compress', - 'clean' - ]); - -}; diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..34b25d8 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,101 @@ +const del = require('del'); +const fs = require('fs'); +const gulp = require('gulp'); +const merge = require('merge-stream'); +const rename = require('gulp-rename'); +const replace = require('gulp-replace'); +const rsync = require('gulp-rsync'); +const sequence = require('run-sequence'); +const zip = require('gulp-zip'); +const pages = require('gulp-gh-pages'); + +gulp.task('prepare', () => { + + const shower = gulp.src([ + '**', + '!node_modules{,/**}', + '!CONTRIBUTING.md', + '!LICENSE.md', + '!README.md', + '!gulpfile.js', + '!package.json' + ]) + .pipe(replace( + /()/g, + '$1shower/themes/ribbon/$3', { skipBinary: true } + )) + .pipe(replace( + /(