-
Notifications
You must be signed in to change notification settings - Fork 19
feat(202): support angular generator #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @tomflenner, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the OpenFeature CLI by integrating robust Angular code generation capabilities. It allows developers to automatically create type-safe Angular services and structural directives directly from their feature flag manifests. This not only improves developer experience by reducing boilerplate and ensuring type safety but also promotes consistent and idiomatic usage of OpenFeature within Angular applications, mirroring patterns established by existing React generators. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
- Add GeneratedFeatureFlagService with typed methods for each flag - Add structural directives using hostDirectives pattern - Support domain parameter for provider scoping - Generate FlagKeys constant and FlagKey type - Export GeneratedFeatureFlagDirectives array for easy imports Signed-off-by: backtrack5r3 <flennertom@gmail.com>
- Register angular generator in generate command - Add documentation for openfeature generate angular Signed-off-by: backtrack5r3 <flennertom@gmail.com>
- Add golden file test for angular generation - Add custom template test for angular - Update .gitignore to exclude generated test files Signed-off-by: backtrack5r3 <flennertom@gmail.com>
- Add Vitest-based test setup for Angular 19 - Add compilation tests for generated exports - Add service tests for GeneratedFeatureFlagService - Add directive tests for all flag types (boolean, string, number, object) - Use domain isolation with uuid for test independence Signed-off-by: backtrack5r3 <flennertom@gmail.com>
- Add Dagger-based Angular integration test runner - Register angular test in main integration test runner Signed-off-by: backtrack5r3 <flennertom@gmail.com>
97d8aab to
4df24f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces comprehensive support for Angular code generation within the OpenFeature CLI. It includes the addition of a new angular command, the implementation of the generator logic in Go, and a detailed template for generating type-safe Angular services and structural directives. Furthermore, a robust integration test suite has been added, leveraging Dagger, Vitest, and Angular's testing utilities to ensure the correctness and functionality of the generated code. The changes are well-structured and align with the existing patterns in the CLI. No issues were found that require immediate attention or fall into the critical, high, or medium severity categories.
Signed-off-by: backtrack5r3 <flennertom@gmail.com>
Signed-off-by: backtrack5r3 <flennertom@gmail.com>
bb103a7 to
8fd2aa9
Compare
Signed-off-by: backtrack5r3 <flennertom@gmail.com>
Signed-off-by: backtrack5r3 <flennertom@gmail.com>
Remove old generated interface that was not used Signed-off-by: backtrack5r3 <flennertom@gmail.com>
See angular/angular#50510 Signed-off-by: backtrack5r3 <flennertom@gmail.com>
1e6c866 to
0cd3256
Compare
This PR
Related Issues
Fixes #202
Notes
This implementation follows the existing pattern established by the React generator, leveraging the official @openfeature/angular-sdk rather than reimplementing core functionality.
Structural Directives Approach:
The generated directives use Angular's
hostDirectivesfeature to wrap the SDK's built-in directives (BooleanFeatureFlagDirective,StringFeatureFlagDirective, etc.) with pre-configured flag keys and default values. This approach:*enableFeatureAdirective automatically configures the underlyingBooleanFeatureFlagDirectiveThis design choice prioritizes developer experience (pre-configured, type-safe directives) while maintaining flexibility through the underlying SDK's input parameters.
Acknowledgments:
Follow-up Tasks
How to test
make test-integration