dotherightthing/wpdtrt-plugin-boilerplate

Alias gulp tasks for child plugins

Closed this issue · 3 comments

Is it possible to create a gulp task which runs a shell command which calls the gulp task in wpdtrt-plugin?

// calls gulp bump --gulpfile ./vendor/dotherightthing/wpdtrt-plugin/gulpfile.js --cwd ./      
gulp bump

On the other hand, this would add baggage to the generator - moving reusable functions to a DRY location is a key goal of wpdtrt-plugin.

How about a catch-all which redirects any non-existent gulp task to the parent gulpfile?

Alternatively scripts could be specified and run from package.json:

  "scripts": {
    "build": "gulp --gulpfile ./vendor/dotherightthing/wpdtrt-plugin-boilerplate/gulpfile.js --cwd ./",
    "install": "gulp install_dependencies --gulpfile ./vendor/dotherightthing/wpdtrt-plugin-boilerplate/gulpfile.js --cwd ./ && gulp wpunit_install --gulpfile ./vendor/dotherightthing/wpdtrt-plugin-boilerplate/gulpfile.js --cwd ./",
    "package": "gulp docs --gulpfile ./vendor/dotherightthing/wpdtrt-plugin-boilerplate/gulpfile.js --cwd ./ && gulp release --gulpfile ./vendor/dotherightthing/wpdtrt-plugin-boilerplate/gulpfile.js --cwd ./",
    "test": "gulp lint --gulpfile ./vendor/dotherightthing/wpdtrt-plugin-boilerplate/gulpfile.js --cwd ./ && gulp wpunit_run --gulpfile ./vendor/dotherightthing/wpdtrt-plugin-boilerplate/gulpfile.js --cwd ./",
    "version": "gulp version --gulpfile ./vendor/dotherightthing/wpdtrt-plugin-boilerplate/gulpfile.js --cwd ./",
    "watch": "gulp compile --gulpfile ./vendor/dotherightthing/wpdtrt-plugin-boilerplate/gulpfile.js --cwd ./ && gulp watch --gulpfile ./vendor/dotherightthing/wpdtrt-plugin-boilerplate/gulpfile.js --cwd ./"
  },

This creates 6 syntactically simple tasks:

  1. npm run build / yarn run build
  2. npm run install / yarn run install
  3. npm run package / yarn run package
  4. npm run test / yarn run test
  5. npm run version / yarn run version
  6. npm run watch / yarn run watch

These tasks can also be discovered by running:

  • npm run / yarn run