Workflows - dotherightthing/generator-wpdtrt-plugin-boilerplate GitHub Wiki
Summary
Status
- Up to date @ 0.9.0
Workflows
Install the generator dependencies
- Composer
- Node.js & NPM
- Yeoman:
$ sudo npm install -g yo
This process is also automated by Github Actions CI via DTRT NPM Scripts.
Install the generator
git clone https://github.com/dotherightthing/generator-wpdtrt-plugin-boilerplate.git
cd generator-wpdtrt-plugin-boilerplate
npm install
cd generators/app
(if required)sudo npm link
This process is also automated by Github Actions CI via ./github/workflows/scaffold-plugin.yml
.
Scaffold a plugin via Github Actions
Note: executable files have appropriate permissions.
./scripts/yo.sh
creates a directory for the generated plugin./scripts/yo.sh
switches to the generated plugin directory./scripts/yo.sh
launches./scripts/expect.sh
./scripts/expect.sh
runsyo wpdtrt-plugin-generator
./generators/app/index.js
runs (the Yeoman script)./scripts/expect.sh
accepts the default answer to each of the generator customisation prompts./generators/app/index.js
scaffolds a plugin./generators/app/index.js
runs the install script inpackage.json
Scaffold a plugin manually
mkdir wpdtrt-pluginname
cd wpdtrt-pluginname
yo wpdtrt-plugin-generator
runs the Yeoman script./generators/app/index.js
- Push
ENTER
to accept the default answer to each of the generator customisation prompts - The Yeoman script scaffolds a plugin and runs the install script in
package.json
Reinstall plugin dependencies manually
cd wpdtrt-pluginname
npm install
Migrate a legacy generated plugin to the latest boilerplate
- Backup the existing plugin folder to
old
- Generate a
new
plugin using the information inold/readme.txt
- Delete
new/node_modules
- Delete
new/vendor
- DiffMerge: File > Open Folder Diff
- Left folder:
new
- Right folder:
old
- OK
- Double click each result in the list (in red)
- Check whether
wpdtrt-plugin-boilerplate
now handles this code. This could be the case with config files, where the config in the generated plugin links to a more comprehensive config in the boilerplate - Decide whether any remaining differences are generic or plugin specific. If they are generic, add them to
wpdtrt-plugin-boilerplate
if possible, otherwise togenerator-wpdtrt-plugin-boilerplate
- TO FINISH