lastcall-gulp-drupal-tasks
v4.0.4
Published
Gulp Drupal Tasks
Downloads
142
Readme
Gulp Drupal Tasks
This library provides a set of common Gulp tasks for working with PHP/Drupal. The goals are:
- Provide a single point of management for updating the Gulp tasks across all of LCM's Drupal builds.
- Have excellent test coverage to make sure everything (still) works.
- Reduce the install time and speed up the Gulp boot process by providing lighter weight alternatives to heavier Gulp plugins.
Usage:
- Install this package using NPM
- Create a gulpfile that looks similar to this:
var gulp = require('gulp'); var Registry = require('lastcall-gulp-drupal-tasks'); var config = require('./gulpconfig'); // Register common tasks. Use `gulp --tasks` to get a current list. gulp.registry(new Registry(config)); // Set the default task. gulp.task('default', gulp.series('build:watch'));
- Create a
gulpconfig.js
file.
Upgrading from 2.0.0:
To update from 2.0, simply update your gulpfile.js
to the above snippet.
Important changes from 2.x:
- Just running
gulp
no longer gives you a nicely formatted task list - it now executes thebuild:watch
command by default. To get a task list, usegulp --tasks
to get a listing.
Guidelines for development:
- Tasks should be small and composable.
- All tasks should be asynchronous to take advantage of Gulp parallelization.
- All tasks should fail predictably (no plugin failures that don't also fail the build).
- Task configuration should be explicitly checked as quickly as possible.
- Don't put slow calls into the critical path. Gulp boot should be as fast as possible. Delay slow requires or file existence checks until the task is actually executed.
Publishing on NPM
When you are ready to release a new version, run npm version X.X.X
. This will update the version in package.json, and create a new tagged commit. Just push it to github using git push origin master --follow-tags
, and CircleCI will deploy it to NPM.