Yarn resolutions
See original GitHub issueI’m working on an addon that adds functionality to Ember Data and I’ve found myself in a situation where the wrong version of data ends up in my final build. My ember-try config looks something like this…
// ...
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0',
'ember-data': '~2.12.0'
}
}
},
// ...
{
name: 'ember-3.1',
npm: {
devDependencies: {
'ember-source': '~3.1.0',
'ember-data': '~3.1.0'
}
}
},
// ...
And this was working great! But then I installed addon docs, which has a direct dependency on ember data: https://github.com/ember-learn/ember-cli-addon-docs/blob/v0.5.3/package.json#L48
When my Ember application is built, my build ends up with the addon docs version of Ember data. So, my tests get run against data version 2.18, regardless of what’s in my try config. Yikes!
Yarn has the option to supply resolutions for overriding a dependency of a dependency. This would allow my addon to override addon docs data dependency. I tried this, and it works on the command line, but it looks like ember-try does not support the resolutions hash. This was my config…
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0',
'ember-data': '~2.12.0'
},
resolutions: {
'ember-data': '~2.12.0'
}
}
},
But the resolutions
did not end up in my package.json when running ember try
.
I wanted to see if you would be open to having ember-try support resolutions?
PS: I opened an issue for addon docs as well.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top GitHub Comments
Released with #231 in v1.2.0
Great Katie, that made it a lot easier.
I opened a PR here: https://github.com/ember-cli/ember-try/pull/231