Workflows - dotherightthing/generator-wpdtrt-plugin-boilerplate GitHub Wiki

Summary

Status

  • Up to date @ 0.9.0

Workflows

Install the generator dependencies

  1. Composer
  2. Node.js & NPM
  3. Yeoman: $ sudo npm install -g yo

This process is also automated by Github Actions CI via DTRT NPM Scripts.

Install the generator

  1. git clone https://github.com/dotherightthing/generator-wpdtrt-plugin-boilerplate.git
  2. cd generator-wpdtrt-plugin-boilerplate
  3. npm install
  4. cd generators/app (if required)
  5. 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.

  1. ./scripts/yo.sh creates a directory for the generated plugin
  2. ./scripts/yo.sh switches to the generated plugin directory
  3. ./scripts/yo.sh launches ./scripts/expect.sh
  4. ./scripts/expect.sh runs yo wpdtrt-plugin-generator
  5. ./generators/app/index.js runs (the Yeoman script)
  6. ./scripts/expect.sh accepts the default answer to each of the generator customisation prompts
  7. ./generators/app/index.js scaffolds a plugin
  8. ./generators/app/index.js runs the install script in package.json

Scaffold a plugin manually

  1. mkdir wpdtrt-pluginname
  2. cd wpdtrt-pluginname
  3. yo wpdtrt-plugin-generator runs the Yeoman script ./generators/app/index.js
  4. Push ENTER to accept the default answer to each of the generator customisation prompts
  5. The Yeoman script scaffolds a plugin and runs the install script in package.json

Reinstall plugin dependencies manually

  1. cd wpdtrt-pluginname
  2. npm install

Migrate a legacy generated plugin to the latest boilerplate

  1. Backup the existing plugin folder to old
  2. Generate a new plugin using the information in old/readme.txt
  3. Delete new/node_modules
  4. Delete new/vendor
  5. DiffMerge: File > Open Folder Diff
  6. Left folder: new
  7. Right folder: old
  8. OK
  9. Double click each result in the list (in red)
  10. 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
  11. Decide whether any remaining differences are generic or plugin specific. If they are generic, add them to wpdtrt-plugin-boilerplate if possible, otherwise to generator-wpdtrt-plugin-boilerplate
  12. TO FINISH