aws-amplify / aws-amplify/amplify-cli
extend FeatureFlags class to include flags' documentation, export for external consumption
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
### Is this feature request related to a new or existing Amplify category?
_No response_
### Is this related to another service?
_No response_
### Describe the feature you'd like to request
Extend the [`FeatureFlags`](https://github.com/aws-amplify/amplify-cli/blob/dev/packages/amplify-cli-core/src/feature-flags/featureFlags.ts#L26) class to include [documentation](https://github.com/aws-amplify/docs/blob/main/src/components/FeatureFlags/feature-flags.json) for each flag. Additionally, export the `FeatureFlags` instance for external consumption (suggestion is as follows)
```tsx
import * as cli from '@aws-amplify/cli-internal'
// get the JSON structure of feature flags
// approach is similar to `Response.json()` https://developer.mozilla.org/en-US/docs/Web/API/Response/json
const featureFlags = await cli.featureFlags.json()
// sample React page to generate FF docs
export function FeatureFlagsPage() {
return (
{featureFlags.map(flag => (
{flag.name}
{ /* ... */ }
))}
)
}
```
This will remove the need for maintaining this documentation separately, and enables us to automate regenerating the documentation on CLI release.
### Describe the solution you'd like
see above
### Describe alternatives you've considered
n/a
### Additional context
_No response_
### Is this something that you'd be interested in working on?
- [X] 👋 I may be able to implement this feature request
### Would this feature include a breaking change?
- [ ] ⚠️ This feature might incur a breaking change
Contributor guide
Assessment
This issue has not been assessed yet.