-
-
Notifications
You must be signed in to change notification settings - Fork 670
feat(asc): Add options merge algorithm for use by asconfig #1343
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
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.
Wow this does the job. And it looks way more professional. Does this try to resolve asconfig files yet?
Should we have also array of booleans? case "B": {
if (!Array.isArray(value)) value = [ value ];
return value.map(Boolean);
} |
We don't have these in other code paths, and I suspect that these won't be useful. At least I can't imagine an option where a |
🎉 This PR is included in version 0.12.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This is an attempt to solve the reconciliation problems encountered during #1238 by extending the existing options parser with a backtracking merge algorithm.
With this, we'd essentially start by parsing command line arguments, obtaining an initial set of options, then merge the project's
asconfig.json
if applicable and continue by merging parent projectasconfig.json
s until we reach the end. Once done, we can add option defaults that we so far omitted.The options
enable
anddisable
now have an additionalmutuallyExclusive
key indicating that whatever is newer in the respective other equalizes what's older. Does not affect the same level, but only merging a previous level.There is a basic test in
tests/cli/options.js
, containing the following full usage test:@jtenner Does this look like it'd help / work in all scenarios?