-
Notifications
You must be signed in to change notification settings - Fork 39
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
Dependency enforcement #544
Comments
It could be sufficient to add the dependency explicitly along, like this: "dependencies": {
"@codingame/monaco-vscode-api": "~11.1.2",
"vscode": "npm:@codingame/monaco-vscode-api@~11.1.2",
} |
I'm sorry, I've read your message 3 times without understanding what you meant I don't know how using an alias has any consequence on the version management. I'm not sure either what is the problem you are referring to 🤔
Won't you end up with |
@CGNonofr I may have found a way. I need to verify this and explain after lunch. Yes, this was confusing. I hope to clear things up later... |
@CGNonofr sorry I missed to linkt the issue: TypeFox/monaco-languageclient#789 TIL if you specify a The proposed solution above ⬆️ does not make sense. But due to the hard wiring of What works is to define all @codingame/monaco-vscode packages as peerDependency but mark only some of them to be non-optional, see client package.json, then a downstream project like this that uses such dependencies: "dependencies": {
"@codingame/monaco-vscode-extensions-service-override": "^10",
"monaco-editor-wrapper": "~6.0.0-next.13"
} now provokes the following error when npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: @typefox/[email protected]
npm error Found: @codingame/[email protected]
npm error node_modules/@codingame/monaco-vscode-extensions-service-override
npm error @codingame/monaco-vscode-extensions-service-override@"^10" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @codingame/monaco-vscode-extensions-service-override@"~11.1.2" from [email protected]
npm error node_modules/monaco-languageclient
npm error peer monaco-languageclient@"~9.0.0-next.13" from [email protected]
npm error node_modules/monaco-editor-wrapper
npm error monaco-editor-wrapper@"~6.0.0-next.13" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution. It works, because every possible package is covered that all the monaco-vscode packages depend on. |
This approach seems to work with yarn and pnpm as well. I am performing final test with -next.14 build. Closing this issue. We can discuss further in TypeFox/monaco-languageclient#809 |
Hello @CGNonofr I may have found the reason why dependency enforcement does not work properly. All your packages refer to
vscode
like this:This is syntactically correct and it resolves the dependency, but in dependent projects (like
monaco-languageclient
) the package@codingame/monaco-vscode-api
is not seen as an independent package with a version. The downstream dependency resolution by npm is unable to understand"@codingame/monaco-vscode-java-default-extension": "~10.0.0"
and"@codingame/monaco-vscode-model-service-override": "~11.1.2"
should be deduped. It is not done correctly, because the resolution mechanism only seesvscode
and not@codingame/monaco-vscode-api
and its version.I hope this makes sense. At least this explains why my peerDependency definitions were completely ineffective in the past.
The text was updated successfully, but these errors were encountered: