-
Notifications
You must be signed in to change notification settings - Fork 440
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
Consider making MirageJS a peer dependency #2416
Comments
this makes sense! Similar to what projects like https://github.com/adopted-ember-addons/ember-moment are doing |
We can do similar thing, reference https://github.com/adopted-ember-addons/ember-moment/blob/master/src/index.js |
I will put together a PR. |
What they are doing here is choosing between two different packages What we want to do is more like this https://github.com/emberjs/ember-qunit/blob/master/package.json#L74 (moment does it as well https://github.com/adopted-ember-addons/ember-moment/blob/master/package.json#L105) |
that's correct. however my point is: on top of that (choose to use Def not something we have to do, but I prefer to completely delegate to the app the version of miragejs being used. |
As as I get a little time Ill do the PR |
After trying several variations, the reason the check here https://github.com/adopted-ember-addons/ember-moment/blob/master/src/index.js#L21 works is because everythere in the addon they use In order to do something similiar to this we would have to change everywhere we import from mirageJS to a wrapper function like If the user does not include mirageJS they should see something similiar to the following
If the docs say, you have to add |
Another interesting point is that if I do not include |
@cah-brian-gantzler I think the repo probably needs to migrate away from yarn@v1 before peers will behave correctly. |
Didnt realize that thanks. Doesnt it really matter what tool is being used in the app that the is including this addon? as that is the one that will be using the package.json. It doesnt matter what this repo is using when its built does it? I think that would also apply to a V2 addon but not sure. Tried to go to pnpm (on other projects) but was having difficulty with my work VPN. |
mostly correct, but yarn@v1 kind of accidentally allows for a bunch of sloppiness which makes libraries using yarn not-as-good-of-a-steward-of-the-ecosystem. if, for example,
the broader ecosystem, webpack, vite, etc require package.jsons to be correct, so in the way that libraries are required to correctly declare their dependencies, in matters how they're set up and managed, which is an extension, I suppose, of the package manager used to develop the project.
want to sync on discord? |
Would love to, pretty busy at work at the moment, can I get back with you when I have the time. |
Currently MirageJS is a dependency.
With the recent changes that require users to import from MirageJS directly ie
import { createServer } from 'miragejs';
, I believe the applications package.json should include mirageJS in the devDependencies to indicate its direct use.In my application I do have MirageJS in my package.json. MirageJS just release ^0.1.44. Updating my application package.json to ^0.1.44, I get the following error when building.
I suggest we make MirageJS a peer dependency. Then make a blueprint that adds MirageJS to the applications package.json and/or update the installation documentation to instruct the consumer to also install MirageJS.
This will allow the consumer to specify which version of MirageJS it wishes to use similar to what ember-qunit has done.
The text was updated successfully, but these errors were encountered: