Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wulechuan/wulechuan-js-gulp-4-classical-task-cycle
Organize gulp tasks as task cycles. And these cycles should run in parallel. Can also build so-called high order tasks, upon multiple task cycles.
https://github.com/wulechuan/wulechuan-js-gulp-4-classical-task-cycle
Last synced: 4 days ago
JSON representation
Organize gulp tasks as task cycles. And these cycles should run in parallel. Can also build so-called high order tasks, upon multiple task cycles.
- Host: GitHub
- URL: https://github.com/wulechuan/wulechuan-js-gulp-4-classical-task-cycle
- Owner: wulechuan
- Created: 2019-09-16T12:08:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T12:08:35.000Z (almost 2 years ago)
- Last Synced: 2024-09-19T22:33:13.312Z (8 days ago)
- Language: JavaScript
- Size: 134 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
# Wulechuan's Tool for Creating Classical Task Cycles for Gulp 4
## Multilingual Editions of this Article
- [简体中文版文档](./ReadMe.zh-hans-CN.md)
## NPM Page
- Package Name
-
[@wulechuan/gulp-classical-task-cycle](https://www.npmjs.com/package/@wulechuan/gulp-classical-task-cycle)
- Author
wulechuan (南昌吴乐川)
## Introduction
Organize gulp tasks as task cycles. And these cycles should run in parallel. Can also build so-called high order tasks, upon multiple task cycles.
## Usage
### Example of the `createATaskCycle` Method
```js
// Import this tool.
const {
createATaskCycle,
} = require('@wulechuan/gulp-classical-task-cycle')
// Import a gulp pipe tool. Could be gulp-stylus, gulp-sass, etc.
const gulpConvertMarkdownToHTML = require('@wulechuan/gulp-markdown-to-html')
const path = require('path')
const joinPathPOSIX = path.posix.join
// Build a task cycle.
const taskCycleForMarkdownConversions = createATaskCycle({
descriptionOfInputsOfCoreTask,
sourceGlobs: {
rootFolderPath: 'documents/ref',
// relativeGlobsSharedWithOtherTaskCycles: [],
relativeGlobsSpecificallyForThisTaskCycle: [ '**/*.md' ],
extraSourceGlobsToWatch: [ 'config/markdown-conversion-options.js' ],
},
outputFiles: {
rootFolderPath: 'dist/documents/htmls',
forBatchOutputFiles: {
relativeGlobsOfAllPossibleOutputs: [ '**/*.html' ],
},
},
compressions: {
shouldNotOutputCompressedVersion: true,
},
firstPipeForProcessingSources: gulpConvertMarkdownToHTML,
})
// Export this task cycle.
module.exports = taskCycleForMarkdownConversions
```
### Example of the `create3HighOrderTasksUponMultipleTaskCycles` Method
```js
// Import this tool.
const {
create3HighOrderTasksUponMultipleTaskCycles
} = require('@wulechuan/gulp-classical-task-cycle')
// See the previous example.
const taskCycleForMarkdownConversions = require(
'../task-cycles/markdown-conversion/to-build-htmls.js'
)
// Assume the task cycle below exists.
const taskCycleForCopyingIllustrates = require(
'../task-cycles/markdown-conversion/to-copy-illustrates.js'
)
module.exports = create3HighOrderTasksUponMultipleTaskCycles({
taskCyclesInPallarel: [
taskCycleForMarkdownConversions,
taskCycleForCopyingIllustrates,
],
beforeBuildingEveryThingOnce: function() {
console.log(`\nConverting all markdown files into HTML files`)
},
})
```
## APIs
- [APIs of `createATaskCycle` Method](./documents/refs/en-US/api-create-a-task-cycle.md)
- [APIs of `create3HighOrderTasksUponMultipleTaskCycles` Method](./documents/refs/en-US/api-create-3-high-order-tasks-upon-multiple-task-cycles.md)
## TODOS
- `options.sourceGlobs.extraSourceGlobsToWatch`
Members of above array are not relative paths to `options.sourceGlobs.rootFolderPath`, so as `gulp.src` process those memebers, I'm not sure what kind of output sub paths would be in the `gulp.dest`.
## License
WTFPL
> NOTE:
>
> I'm not an expert about license types. So I temporarily use WTFPL. But I guess this type of license might conflict with the ones used by those npm packages I'm utilizing.