Skip to content
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

Fetch and load extended presets during create #74

Merged
merged 4 commits into from
Oct 4, 2019
Merged

Conversation

DanielSanudo
Copy link
Contributor

Summary

Fetch and load extended presets during create. This would allow extended presets which define createContext or config to be used during the create process.

Changelog

Changelog entry added.

Test Plan

Unit tests updated and added.

Copy link
Contributor

@kinetifex kinetifex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid, just a small change that may have been my fault 😉

presetInfos = presetInfos.concat(localPreset(context));

const presets = presetInfos.map(p => presetIdentifier(p.rawName).shortName);
const presets = flattenPresets(presetInfos).map(p => presetIdentifier(p.rawName).shortName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have mis-spoke on our zoom. These should not be flattened before placed on context. We want to preserve the original hierarchy here, however, the flatten utility is available for downstream cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that if I don't flatten presetInfos the presets that are dependencies won't be included in the presets list. The presetInfos added into context will keep the same tree format.

Also right now rawPresets and localPresets don't have the extended presets included in the list because these 2 lists come from the json file. I thought that I didn't have to include the extended presets on these lists, only on presets. What do you think?

Copy link
Contributor

@kinetifex kinetifex Oct 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extended presets will be available by reaching in from context (i.e. context.presets[0].presets). It's important to not lose this hierarchy, and only have the top-level presets sitting on context. This lets the CLI know which presets to add the gasket.config for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wanted to mean context.presetInfos[0].presets right?

@DanielSanudo DanielSanudo merged commit ae9907b into master Oct 4, 2019
@DanielSanudo DanielSanudo deleted the GX-17954-re branch October 4, 2019 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants