Type: New Feature
Affects Version/s: None
Fix Version/s: PDK 1.3.0
QA Risk Assessment:Needs Assessment
As a module author, I want to be able to run a simple command to make my existing module compatible with the PDK.
As a module author, I want to be able to run a simple command to detect and apply any updates to my module from the module template used to generate it
To make an existing compatible with PDK:
To update the template of a PDK compatible module:
- Determine the appropriate module template to use. If there is no PDK template information in metadata.json (i.e. bringing an existing module into PDK management), use the same logic as `pdk new module` to select the module template (CLI specified -> answer file -> default). If there is PDK template information in metadata.json, use that.
- Reuse the existing template dir and template file logic that is used in `pdk new module` to render the new files into the module, but with a `.pdknew` (or similar) extension rather than overwriting
- Checksum the contents of the `.pdknew` and existing files to eliminate files that have not changed
- Display a diff of the changed files to the user (eventually, we could delegate this to the user's VCS of choice, but until we have VCS integration something like https://github.com/halostatue/diff-lcs should work cross-platform)
- Unless the user provide the `--yes` flag, ask for confirmation before proceeding
- If the user agrees to proceed, rename the `.pdknew` files to remove the extension to apply the updates. If the user does not want to proceed, remove the `.pdknew` files.