adobe / adobe/aio-cli-plugin-app
add config validation by default
- Dominant language
- JavaScript
- Stars
- 28
- Forks
- 41
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 3
Description
Right now, config validation is not turned on by default and only certain commands turn it on, like the `app pack` command:
https://github.com/adobe/aio-cli-plugin-app/blob/4fb2a25f56050e31d7f444b80c6261ca609d688e/src/commands/app/pack.js#L43
Modify `BaseCommand.getFullConfig` to validate the app config by default - this means that all commands that call `getFullConfig` will validate the config by default, even if they don't use the whole config:
https://github.com/search?q=repo%3Aadobe%2Faio-cli-plugin-app%20getFullConfig&type=code
`BaseCommand.getFullConfig`:
https://github.com/adobe/aio-cli-plugin-app/blob/4fb2a25f56050e31d7f444b80c6261ca609d688e/src/BaseCommand.js#L147
Provide a shared flag in the `BaseCommand` to turn off config validation, just in case there are issues:
- The flag should be called `config-validation` and `allowsNo : true`, `default: true`.
- The `getFullConfig` method should [read the flag directly](https://github.com/adobe/aio-cli-plugin-app/blob/4fb2a25f56050e31d7f444b80c6261ca609d688e/src/BaseCommand.js#L36)
- every command that inherits from BaseCommand *must* [spread the `BaseCommand` flags](https://github.com/adobe/aio-cli-plugin-app/blob/4fb2a25f56050e31d7f444b80c6261ca609d688e/src/commands/app/deploy.js#L305)
Contributor guide
Assessment
This issue has not been assessed yet.