-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Make ajv a peer dependency #15
Make ajv a peer dependency #15
Conversation
Pull Request Test Coverage Report for Build 624953550
💛 - Coveralls |
This PR broke ajv-formats@^1 support with npm@6 and npm@7 with Reproducible by:
Should be fixed by setting both:
|
so it has to be patched in both v1 and v2 then... |
@mshima would it not bring back the original problem though? |
@epoberezkin I don't think so, but not sure about yarn and pnpm.
output:
|
I understand that it is broken with this option, I do not fully understand why it is important to support it with this option. Why cannot you use it without |
Also, the example above is not representative of real life use cases - there is no use case when you would be installing ajv-formats without also installing ajv. |
@mshima I am looking for some additional information and/or additional opinions to decide whether this change should be made. For example, what is the setup (and how common it is) when running npm without Would it work if you run in with I will create a separate issue. |
Our generated project is What about npm@6? Which is included in every node lts versions.
Same output
You should at least update the package.json engines version to require npm >= 7.8.0 since you don't support npm@6 anymore. We reverted the conf package to a version that doesn't depends on ajv-format at jhipster/generator-jhipster#14531. Thanks for your time. |
need to test the proposed change. |
@mshima I've tested and it does look like the original problem does not re-occur after this change - thank you! @drtyh2o can you please test that it is still working ok with your setup? It is now released as v1.6.1 and v2.0.2 |
v2.0.2 seems to work fine for me. Thanks. |
Thank you @drtyh2o. The problem is that with this change I cannot run ajv tests (at least not locally on Mac - they do run on GitHub CI) - the tests use ajv-formats - it's dev dependency for ajv... Before the test I need to do
@mshima - any idea how it can be fixed? |
@epoberezkin dev dependency on ajv should be dropped from ajv-formats, it's a prod dependency already.
Some of this can be help:
I use some cross dependencies too, but test with released versions (normal tests) or install using GitHub link (option 2 for integration tests testing both sides). |
The whole point of |
That's not true. peerDependency takes precedency (at least for npm@7), so the dependencies entry is just ignored. Installing with
Using npm@6 or npm@7 with Using npm@7 without
|
I actually did test the scenario of the update, by first having ajv: 7.2.2 in package.json, and then changing it to ajv: ^7.2.4 and running upgrade - it did not break (same for v8). Also, for unrelated reason, I've published ajv 8.0.4 and then 8.0.5 - did it break the dependency in ajv-format in your case @drtyh2o? I was hoping you'd be able to test the update scenario in a similar way... We can just wait till the next update and see if something breaks. |
@mshima thanks for the suggestions
indeed, but I don't think it's what causes the issue
most likely - I was going to add printing version to the test...
it didn't change anything - it still fails on
I don't understand - ajv-formats is in node-modules, I am linking Anyway, for now I've downgraded local npm to v6. |
Making
ajv
a peer dependency ofajv-formats
resolves issue #13 that is causing TypeScript version mismatch errors on every ajv upgrade.