diff options
author | Dan Allen <dan@opendevise.com> | 2018-12-27 04:58:37 -0700 |
---|---|---|
committer | Dan Allen <dan@opendevise.com> | 2018-12-28 08:19:21 +0000 |
commit | 12493e37c9f8f49c52afd6b166f9048083466121 (patch) | |
tree | 0f69250a7845b963a54b7d4a2fc3885680afd170 | |
parent | 260cc89833c82ba5c6e05d6734a32e6ae0caee11 (diff) | |
download | alpine-antora-theme-12493e37c9f8f49c52afd6b166f9048083466121.tar.bz2 alpine-antora-theme-12493e37c9f8f49c52afd6b166f9048083466121.tar.xz |
move gulpfile.js into gulpfile.js folder
-rw-r--r-- | gulpfile.js/build.js (renamed from tasks/build.js) | 0 | ||||
-rw-r--r-- | gulpfile.js/format.js (renamed from tasks/format.js) | 0 | ||||
-rw-r--r-- | gulpfile.js/index.js (renamed from gulpfile.js) | 8 | ||||
-rw-r--r-- | gulpfile.js/lib/export-tasks.js (renamed from tasks/lib/export-tasks.js) | 0 | ||||
-rw-r--r-- | gulpfile.js/lib/gulp-prettier-eslint.js (renamed from tasks/lib/gulp-prettier-eslint.js) | 0 | ||||
-rw-r--r-- | gulpfile.js/lib/task.js (renamed from tasks/lib/task.js) | 0 | ||||
-rw-r--r-- | gulpfile.js/lint-css.js (renamed from tasks/lint-css.js) | 0 | ||||
-rw-r--r-- | gulpfile.js/lint-js.js (renamed from tasks/lint-js.js) | 0 | ||||
-rw-r--r-- | gulpfile.js/pack.js (renamed from tasks/pack.js) | 0 | ||||
-rw-r--r-- | gulpfile.js/preview-pages.js (renamed from tasks/preview-pages.js) | 42 | ||||
-rw-r--r-- | gulpfile.js/preview-serve.js (renamed from tasks/preview-serve.js) | 0 | ||||
-rw-r--r-- | gulpfile.js/remove.js | 8 |
12 files changed, 31 insertions, 27 deletions
diff --git a/tasks/build.js b/gulpfile.js/build.js index 8db878d..8db878d 100644 --- a/tasks/build.js +++ b/gulpfile.js/build.js diff --git a/tasks/format.js b/gulpfile.js/format.js index c95d506..c95d506 100644 --- a/tasks/format.js +++ b/gulpfile.js/format.js diff --git a/gulpfile.js b/gulpfile.js/index.js index d769ad5..9b9bd91 100644 --- a/gulpfile.js +++ b/gulpfile.js/index.js @@ -2,9 +2,9 @@ const { parallel, series, tree } = require('gulp') const camelcase = (name) => name.replace(/[-]./g, (m) => m.substr(1).toUpperCase()) -const exportTasks = require('./tasks/lib/export-tasks') -const task = require('./tasks/lib/task') -const taskFns = require('require-directory')(module, './tasks', { recurse: false, rename: camelcase }) +const exportTasks = require('./lib/export-tasks') +const task = require('./lib/task') +const taskFns = require('require-directory')(module, '.', { recurse: false, rename: camelcase }) const path = require('path') const bundleName = 'ui' @@ -16,7 +16,7 @@ const destDir = path.join(previewSiteDestDir, '_') const { reload: livereload } = process.env.LIVERELOAD === 'true' ? require('gulp-connect') : {} const cssFileGlobs = path.join(srcDir, 'css/**/*.css') -const jsFileGlobs = ['gulpfile.js', 'tasks/**/*.js', path.join(srcDir, '{helpers,js}/**/*.js')] +const jsFileGlobs = ['gulpfile.js/**/*.js', path.join(srcDir, '{helpers,js}/**/*.js')] const { remove, lintCss, lintJs, format, build, pack, previewPages, previewServe } = taskFns diff --git a/tasks/lib/export-tasks.js b/gulpfile.js/lib/export-tasks.js index 834cd9e..834cd9e 100644 --- a/tasks/lib/export-tasks.js +++ b/gulpfile.js/lib/export-tasks.js diff --git a/tasks/lib/gulp-prettier-eslint.js b/gulpfile.js/lib/gulp-prettier-eslint.js index dca0a74..dca0a74 100644 --- a/tasks/lib/gulp-prettier-eslint.js +++ b/gulpfile.js/lib/gulp-prettier-eslint.js diff --git a/tasks/lib/task.js b/gulpfile.js/lib/task.js index aa4f9d1..aa4f9d1 100644 --- a/tasks/lib/task.js +++ b/gulpfile.js/lib/task.js diff --git a/tasks/lint-css.js b/gulpfile.js/lint-css.js index 5cad763..5cad763 100644 --- a/tasks/lint-css.js +++ b/gulpfile.js/lint-css.js diff --git a/tasks/lint-js.js b/gulpfile.js/lint-js.js index ef4f3c9..ef4f3c9 100644 --- a/tasks/lint-js.js +++ b/gulpfile.js/lint-js.js diff --git a/tasks/pack.js b/gulpfile.js/pack.js index 7c9d3ae..7c9d3ae 100644 --- a/tasks/pack.js +++ b/gulpfile.js/pack.js diff --git a/tasks/preview-pages.js b/gulpfile.js/preview-pages.js index d2e7fc9..abc8b98 100644 --- a/tasks/preview-pages.js +++ b/gulpfile.js/preview-pages.js @@ -9,29 +9,25 @@ const vfs = require('vinyl-fs') const yaml = require('js-yaml') module.exports = (src, dest, siteSrc, siteDest, onComplete) => () => - Promise.all([ - loadSampleUiModel(siteSrc), - compileLayouts(src), - registerPartials(src), - registerHelpers(src), - ]).then(([uiModel, layouts]) => - vfs - .src('**/*.html', { base: siteSrc, cwd: siteSrc }) - .pipe( - map((file, enc, next) => { - const compiledLayout = layouts[file.stem === '404' ? '404.hbs' : 'default.hbs'] - const siteRootPath = path.relative(path.dirname(file.path), path.resolve(siteSrc)) - uiModel.env = process.env - uiModel.siteRootPath = siteRootPath - uiModel.siteRootUrl = path.join(siteRootPath, 'index.html') - uiModel.uiRootPath = path.join(siteRootPath, '_') - uiModel.page.contents = file.contents.toString().trim() - file.contents = Buffer.from(compiledLayout(uiModel)) - next(null, file) - }) - ) - .pipe(vfs.dest(siteDest)) - .pipe(onComplete ? onComplete() : map((file, enc, next) => next())) + Promise.all([loadSampleUiModel(siteSrc), compileLayouts(src), registerPartials(src), registerHelpers(src)]).then( + ([uiModel, layouts]) => + vfs + .src('**/*.html', { base: siteSrc, cwd: siteSrc }) + .pipe( + map((file, enc, next) => { + const compiledLayout = layouts[file.stem === '404' ? '404.hbs' : 'default.hbs'] + const siteRootPath = path.relative(path.dirname(file.path), path.resolve(siteSrc)) + uiModel.env = process.env + uiModel.siteRootPath = siteRootPath + uiModel.siteRootUrl = path.join(siteRootPath, 'index.html') + uiModel.uiRootPath = path.join(siteRootPath, '_') + uiModel.page.contents = file.contents.toString().trim() + file.contents = Buffer.from(compiledLayout(uiModel)) + next(null, file) + }) + ) + .pipe(vfs.dest(siteDest)) + .pipe(onComplete ? onComplete() : map((file, enc, next) => next())) ) function loadSampleUiModel (siteSrc) { diff --git a/tasks/preview-serve.js b/gulpfile.js/preview-serve.js index 9dcf39e..9dcf39e 100644 --- a/tasks/preview-serve.js +++ b/gulpfile.js/preview-serve.js diff --git a/gulpfile.js/remove.js b/gulpfile.js/remove.js new file mode 100644 index 0000000..3f71eec --- /dev/null +++ b/gulpfile.js/remove.js @@ -0,0 +1,8 @@ +'use strict' + +const fs = require('fs-extra') +const { obj: map } = require('through2') +const vfs = require('vinyl-fs') + +module.exports = (files) => () => + vfs.src(files, { allowEmpty: true }).pipe(map((file, enc, next) => fs.remove(file.path, next))) |