-
Notifications
You must be signed in to change notification settings - Fork 504
Extraction of the majority of the utilities from the config singleton #816
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
Conversation
This will simplify some work to split up lib/config.js
This is to make space for unravelling the mess that is the singleton into some functional components that may be useful individually. This also deprecates some functions that probably should never have been exposed. This refactor is as commit-history-preserving as I could manage. Subsequent commits will involve rearranging more of the code to extricate things from config.js
This will preserve edit history on both original files.
Also contains workaround for node-config#815 - which pops up due to running extendDeep in strict mode.
In retrospect we should have perhaps called 4.0.0 3.5.0 as this change is more of a 4.x change than the deprecations we removed. |
config.js can shrink by around 400 lines once we start removing Config.util methods that are marked deprecated and have trampolines to lib/util.js. The duplicate jsdoc entries are about 40% of the moved code and are retained for documentation purposes. |
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.
Makes sense to me.
QA Log
- Noted that the PR seems to pass existing tests, while adding more test coverage.
This PR contains a good deal of code to maintain feature and bug parity with the existing Config.util behavior while also extracting code that can be run either statically or as part of a separate workflow.
This is designed with elements of #569 in mind in addition to a number of other issues
Providing workarounds for some and fixing a few outright.
This PR also includes code from #808 which this PR leverages.
These changes also include:
getOption()
require('config')
call - which substantially complicated the plumbing and necessitated the LoadInfo vs Env split.To the best of my knowledge this contains no breaking changes, But it contains a number of TODOs that would be good candidates for a 4.1
Note that these commits also include
git mv
trickery to maintain commit history on both sides of the split files, to support forensics on future bug-vs-feature triage.