summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Allen <dan@opendevise.com>2018-12-27 12:52:57 -0700
committerDan Allen <dan@opendevise.com>2018-12-28 08:19:21 +0000
commit5c982221c90b0a476597f7131d17fb0178270b56 (patch)
treecacc5e91e3049eb7c88998ea8bc9d83a767f2866
parent12493e37c9f8f49c52afd6b166f9048083466121 (diff)
downloadalpine-antora-theme-5c982221c90b0a476597f7131d17fb0178270b56.tar.bz2
alpine-antora-theme-5c982221c90b0a476597f7131d17fb0178270b56.tar.xz
rename then arg to exec in task definition function
-rw-r--r--gulpfile.js/index.js30
-rw-r--r--gulpfile.js/lib/task.js2
2 files changed, 17 insertions, 15 deletions
diff --git a/gulpfile.js/index.js b/gulpfile.js/index.js
index 9b9bd91..79047b3 100644
--- a/gulpfile.js/index.js
+++ b/gulpfile.js/index.js
@@ -23,73 +23,73 @@ const { remove, lintCss, lintJs, format, build, pack, previewPages, previewServe
const cleanTask = task({
name: 'clean',
desc: 'Clean files and folders generated by build',
- then: remove(['build', 'public']),
+ exec: remove(['build', 'public']),
})
const lintCssTask = task({
name: 'lint:css',
desc: 'Lint the CSS source files using stylelint (standard config)',
- then: lintCss(cssFileGlobs),
+ exec: lintCss(cssFileGlobs),
})
const lintJsTask = task({
name: 'lint:js',
desc: 'Lint the JavaScript source files using eslint (JavaScript Standard Style)',
- then: lintJs(jsFileGlobs),
+ exec: lintJs(jsFileGlobs),
})
const lintTask = task({
name: 'lint',
desc: 'Lint the CSS and JavaScript source files',
- then: parallel(lintCssTask, lintJsTask),
+ exec: parallel(lintCssTask, lintJsTask),
})
const formatTask = task({
name: 'format',
desc: 'Format the JavaScript source files using prettify (JavaScript Standard Style)',
- then: format(jsFileGlobs),
+ exec: format(jsFileGlobs),
})
const buildTask = task({
name: 'build',
desc: 'Build and stage the UI assets for bundling',
- then: build(srcDir, destDir, tree().nodes.some((name) => ~name.indexOf('preview'))),
+ exec: build(srcDir, destDir, tree().nodes.some((name) => ~name.indexOf('preview'))),
})
const bundleBuildTask = task({
name: 'bundle:build',
desc: 'Lint the source files and build and stage the UI assets for bundling',
- then: series(cleanTask, lintTask, buildTask),
+ exec: series(cleanTask, lintTask, buildTask),
})
const bundlePackTask = task({
name: 'bundle:pack',
desc: 'Create a bundle of the staged UI assets for publishing',
- then: pack(destDir, buildDir, bundleName),
+ exec: pack(destDir, buildDir, bundleName),
})
const bundleTask = task({
name: 'bundle',
desc: 'Clean, lint, build, and bundle the UI for publishing',
- then: series(bundleBuildTask, bundlePackTask),
+ exec: series(bundleBuildTask, bundlePackTask),
})
const previewPagesTask = task({
name: 'preview:pages',
desc: 'Generate pages for the preview by applying the specified layout template',
- then: previewPages(srcDir, destDir, previewSiteSrcDir, previewSiteDestDir, livereload),
+ exec: previewPages(srcDir, destDir, previewSiteSrcDir, previewSiteDestDir, livereload),
})
const previewBuildTask = task({
name: 'preview:build',
desc: 'Process and stage the UI assets and generate pages for the preview',
- then: parallel(buildTask, previewPagesTask),
+ exec: parallel(buildTask, previewPagesTask),
})
const previewServeTask = task({
name: 'preview:serve',
desc: 'Launch server to preview UI',
- then: previewServe(previewSiteDestDir, {
+ exec: previewServe(previewSiteDestDir, {
port: 5252,
livereload,
watch: { src: [srcDir, previewSiteSrcDir], onChange: previewBuildTask },
@@ -99,11 +99,13 @@ const previewServeTask = task({
const previewTask = task({
name: 'preview',
desc: 'Generate a preview site and launch a server to view it',
- then: series(previewBuildTask, previewServeTask),
+ exec: series(previewBuildTask, previewServeTask),
})
+const defaultTask = task({ name: 'default', desc: `(${bundleTask.displayName})`, exec: series(bundleTask) })
+
module.exports = exportTasks(
- task({ name: 'default', desc: `(${bundleTask.displayName})`, then: series(bundleTask) }),
+ defaultTask,
cleanTask,
lintTask,
formatTask,
diff --git a/gulpfile.js/lib/task.js b/gulpfile.js/lib/task.js
index aa4f9d1..9878f27 100644
--- a/gulpfile.js/lib/task.js
+++ b/gulpfile.js/lib/task.js
@@ -2,7 +2,7 @@
const metadata = require('undertaker/lib/helpers/metadata')
-module.exports = ({ name, desc, anon, then: fn }) => {
+module.exports = ({ name, desc, exec: fn }) => {
if (name) {
const displayName = fn.displayName
if (displayName === '<series>' || displayName === '<parallel>') {