This repository was archived by the owner on Nov 21, 2025. It is now read-only.
Added ability to specify which module a constant is added to #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows users to specify which module a constant should be attached to, using the following syntax:
In the example above,
CONTANT_ONEandCONSTANT_TWOwill be added to theMainApp.Constantsmodule andANOTHER_CONSTANTwill be added to theMainApp.MoreConstantsmodule. Notice above that x amount of constants can be added to a module, the user is not limited in this respect.To minimise impact I have re-used the exact same approach to calling the resolve functions but wrapped in additional
forEachloops.For simplicity a user can only specify either the standard resolve OR the moduleResolves options. The following would throw an exception whilst checking the config:
I've added a few unit tests for config checking and also to ensure constants get added to the correct modules.
Let me know if this meets the requirements, if not I'll go back to the drawing board.
Cheers