Alias gulp tasks for child plugins
Closed this issue · 3 comments
dotherightthing commented
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
dotherightthing commented
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?
dotherightthing commented
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:
npm run build
/yarn run build
npm run install
/yarn run install
npm run package
/yarn run package
npm run test
/yarn run test
npm run version
/yarn run version
npm run watch
/yarn run watch
These tasks can also be discovered by running:
npm run
/yarn run
dotherightthing commented