core(fr): add base config#11915
Merged
Merged
Conversation
202073f to
d750427
Compare
patrickhulce
commented
Jan 5, 2021
| * @param {Object<string, any>|Array<any>} extension | ||
| * @param {boolean=} overwriteArrays | ||
| */ | ||
| function _mergeConfigFragment(base, extension, overwriteArrays = false) { |
Collaborator
Author
There was a problem hiding this comment.
logic here was untouched but comment and name are new
| function expandAuditShorthand(audits) { | ||
| if (!audits) { | ||
| return null; | ||
| function expandAuditShorthand(audit) { |
Collaborator
Author
There was a problem hiding this comment.
changed to operate on an individual audit instead of an array for consistency with gatherers, otherwise untouched
| implementation = auditDefn.implementation; | ||
| } else { | ||
| // See if the audit is a Lighthouse core audit. | ||
| const auditPathJs = `${audit.path}.js`; |
Collaborator
Author
There was a problem hiding this comment.
extracted this into requireAudit for structural consistency with resolveGathererToDefn
| function requireAudits(audits, configDir) { | ||
| const expandedAudits = expandAuditShorthand(audits); | ||
| if (!expandedAudits) { | ||
| function resolveAuditsToDefns(audits, configDir) { |
Collaborator
Author
There was a problem hiding this comment.
I stopped short of converting this one to individual because of the minor annoyance of the Runner.getAuditList call, but if everyone would prefer that final step for more complete consistency, I'm game
| @@ -0,0 +1,107 @@ | |||
| /** | |||
| * @license Copyright 2020 The Lighthouse Authors. All Rights Reserved. | |||
Collaborator
Author
There was a problem hiding this comment.
I did write this file in 2020, before anyone asks :P
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Base config logic for the new Fraggle Rock config. It's lots of lines, but mostly a move + adding missing tests.
config.jstoconfig-helpers.jsmergewas fairly generic when it has some highly specific config logic it it, renamed tomergeConfigFragmentresolveThingis the new nomenclature used for converting from config input to config output (i.e.thingJsontothingDefn). This was previously some mixture ofrequireThing/initializeThingrequireThingis now just the logic to actually require an individualThingfraggle-rock/config/config.jsto contain new config logic.Related Issues/PRs
ref #11313
Design Doc