3.0.0 • Published 1 month ago

gulp-cli v3.0.0

Weekly downloads
1,166,615
License
MIT
Repository
github
Last release
1 month ago

gulp-cli

NPM version Downloads Build Status Coveralls Status

Command Line Utility for Gulp

Install

npm install --global gulp-cli

Usage

> gulp [flags] <task> <task>...

Custom Metadata

When listing tasks with the gulp -T command, gulp-cli displays some custom metadata as defined upon task functions. Currently supported properties:

  • task.description - String of the description to display.
function clean() { ... }
clean.description = 'Cleans up generated files.';
  • task.flags - Object with key/value pairs being flag/description to display.
function build() { ... }
build.flags = {
  '--prod': 'Builds in production mode.'
};

Example Usage:

function build() { ... }
build.description = 'Build entire project.';
build.flags = {
  '--prod': 'Builds in production mode (minification, etc).'
};
// gulp 3.x
gulp.task('build', build);
// gulp 4.x
gulp.task(build);

Tasks

The task(s) listed on the command line will be executed. If more than one task is listed, Gulp will execute all of them concurrently, that is, as if they had all been listed as dependencies of a single task.

By default, Gulp does not serialize tasks listed on the command line. If you would like to execute tasks serially, you must specify the --series flag. e.g. gulp clean build --series

Just running gulp will execute the task default. If there is no default task, gulp will error.

Completion

Thanks to the grunt team, specifically Tyler Kellen

To enable tasks auto-completion in shell you should add eval "$(gulp --completion=shell)" in your .shellrc file.

Bash:

Add eval "$(gulp --completion=bash)" to ~/.bashrc.

Zsh:

Add eval "$(gulp --completion=zsh)" to ~/.zshrc.

Powershell:

Add Invoke-Expression ((gulp --completion=powershell) -join [System.Environment]::NewLine) to $PROFILE.

Fish:

Add gulp --completion=fish | source to ~/.config/fish/config.fish.

Compilers

You can find a list of supported JavaScript variant languages in Interpret. If you would like to add support for a new language, send pull requests/open issues on that project.

Environment

The CLI adds process.env.INIT_CWD which is the original cwd it was launched from.

Configuration

Configuration is supported through the use of a .gulp.* file (e.g. .gulp.js, .gulp.ts). You can find a list of supported JavaScript variant languages in Interpret.

A configuration file from the current working directory (cwd) or above are selected before a configuration file from the home directory (~).

Supported configurations properties:

PropertyDescription
descriptionTop-level description of the project/gulpfile (Replaces "Tasks for ~/path/of/gulpfile.js")
gulpfileSet a default gulpfile
preloadAn array of modules to preload before running the gulpfile. Any relative paths will be resolved against the --cwd directory (if you don't want that behavior, use absolute paths)
nodeFlagsAn array of flags used to forcibly respawn the process upon startup. For example, if you always want your gulpfiles to run in node's harmony mode, you can set --harmony here
flags.continueContinue execution of tasks upon failure by default.
flags.compactTasksReduce the output of task dependency tree by default.
flags.tasksDepthSet default depth of task dependency tree.
flags.silentSilence logging by default
flags.seriesRun tasks given on the CLI in series (the default is parallel)
message(data)A function used to translate messages that pass through gulp-cli. Can receive an object like { tag: Symbol(), ...props } where the tag is a symbol from @gulpjs/messages. The string returned from this function will be logged. If false is explicitly returned, no message will be logged.
timestamp(data)A function used to provide timestamps for gulp-cli. Can receive an object like { tag: Symbol(), ...props } where the tag is a symbol from @gulpjs/messages. The string returned from this function will be output before any messages. If false is explicitly returned, no timestamp will be output.

Flags

gulp has very few flags to know about. All other flags are for tasks to use if needed.

Some flags only work with gulp 4 and will be ignored when invoked against gulp 3.

License

MIT

gulpportal-componentssssssssw-news-centerdsy-styleguideadgile-devprotocol-theme-testrmc-pull-to-refresh-mousesdialer-reportsosfe-buildernative_angular_copia1@vchangal/devkitgrch-scriptsmlamp-icons@seansankerjr/next-folderiobroker.tablet-controlssr-base-yfgp_toolsfridays-for-future-bootstrap-4@infinitebrahmanuniverse/nolb-gulp-c@everything-registry/sub-chunk-1805@lupine-software/scrolliris-readability-reflectorkarma-inlinehtml-preprocessordiscord-coc-botrjtempg4rough-multiple-pagesjufdn-gulp-basedemo-components-wangquns-gulp-pagesjeuxuireset-xiaoxi@cyber-tools/component-build-toolsjsbuildsmain-barmake-a-websitemapbox-gl-map-extractsh-react-pickersecformssecforms-buildsimple-parallax-jqueryskraer-starter-kitslush-cmsldx-home-platelayout-xiaoxisocialadministratrmodulelightpick-calendarlifterlms-lib-taskslilacslilalishiminlijiancheng-uispl2sqllucy-clilyj-pagesstats_fulllab3asimply-uimarina6303tailwindfymermertablaotabulator-tables-dotarielnode-multinavgatidyna-linkui_test_platform_fireferretveasy-angular-componentsnoinfo-sockjs-clientelectron-agora-rtc-ngele-open-retail-store-buildernode-red-contrib-ui-colorwheelnode-slatenf-workflow-uimxgraph-js-dtminified-angulartennotvmjolnir.csstylernapolivue-generate-component-gbbmikelibrarytest-npm-epshtainmfan-pagesmawmaw-tempmoffmodular-stylesmooctestcafe-reporter-zapi-reportertestcafe-reporter-timetestcafe-reporter-api-reportertestcafe-reporter-peruntestcafe-reporter-inruptms-scriptsetu_lab3_kea3.0.0@brucearmstrong/sass-librarylayui-custom@sprucelabs/heartwood-components@sogody/experiment-framework@sogody/template-framework@somebuild/build-components-vue3
3.0.0

1 month ago

2.3.0

4 years ago

2.2.1

4 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.0

9 years ago