question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kategenglercommented, May 18, 2019

Released with #231 in v1.2.0

0reactions
ryantocommented, Nov 27, 2018

Great Katie, that made it a lot easier.

I opened a PR here: https://github.com/ember-cli/ember-try/pull/231

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selective dependency resolutions
Yarn supports selective version resolutions, which lets you define custom package versions or ranges inside your dependencies through the resolutions field ...
Read more >
Yarn Resolutions To The Rescue
In this tutorial, you will learn a little more about yarn and about package resolution. One benefit of using yarn is that it...
Read more >
Selective dependency resolutions - yarn
Yarn has full support for selective version resolution, this will enable you to define custom package versions or ranges in your ...
Read more >
How Yarn resolutions can save you | Matej Jelluš
Yarn allowes you to override package versions inside your dependencies. So now it is easy to solve this kind of problem. ... This...
Read more >
npm equivalent of yarn resolutions? - package.json
Npm equivalent to yarn resolutions is overrides. After the RFC was accepted now there's an epic to watch the progress of implementation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found