Closed jeremiah-blezing closed 1 year ago
Hi @jeremiah-blezing I have released an new next version: monaco-editor-wrapper@2.0.0-next.6
.
But the problem persists with yarn. I don't know why yarn behaves differently then npm with regard to binary execution. Is there a way to enforce peer dependency installation with yarn?
The only way I currently see is to add @codingame/monaco-vscode-api
and monaco-editor
first and add "postinstall": "monaco-treemending"
and afterwards remove the script and use --ignore-scripts
when you add the missing packages.
Btw, there is currently an issue when you run the treemeding script twice, see open PR
Is it possible for you to use npm instead of yarn as a workaround?
Hi @kaisalmen ,
The only way I currently see is to add @codingame/monaco-vscode-api and monaco-editor first and add "postinstall": "monaco-treemending" and afterwards remove the script and use --ignore-scripts when you add the missing packages.
Yes, this is working. I guess this won't work in CI build.
Is it possible for you to use npm instead of yarn as a workaround?
Our Codebase is a little big, will be difficult to switch the package manager. It's fine for now. We wrote a custom wrapper with monaco-languageclient@5.0.1
and used the appropriate versions of monaco-editor and vscode-ws-jsonrpc.
Is there a way to enforce peer dependency installation with yarn?
I guess (not sure) that this is not an issue with Peer Dependency Installation but with bin file resolution of Peer Dependency that has a package alias that is being used in monaco-languageclient ( here ) . That's my guess when playing around with multiple installation scenarios.
Btw, there is currently an issue when you run the treemeding script twice, see open https://github.com/CodinGame/monaco-vscode-api/pull/115
Saw that, I think even after that, this issue will be still there.
Our Codebase is a little big, will be difficult to switch the package manager.
@jeremiah-blezing I was expecting that. 🙂
I guess (not sure) that this is not an issue with Peer Dependency Installation but with bin file resolution of Peer Dependency that has a package alias that is being used in monaco-languageclient ( here ) That's my guess when playing around with multiple installation scenarios.
I have released a next version of monaco-languageclient that defines the dependencies as such:
"dependencies": {
"vscode": "npm:@codingame/monaco-vscode-api@~1.78.6",
"vscode-jsonrpc": "~8.1.0",
"vscode-languageclient": "~8.1.0"
},
"peerDependencies": {
"vscode": "npm:@codingame/monaco-vscode-api@~1.78.6"
},
"peerDependenciesMeta": {
"vscode": {
"optional": false
}
}
In the past we defined monaco-vscode-api
as regular and peer dependency. Defining it only as peerDependency works fine with npm 7+, but yarn seems to have problems with it.
If you add monaco-editor
as additional dependency with the new next version it seems to work without needing the above workaround. Are you able to test that? I could also add monaco-editor@0.37.1
as direct dependency in an upcoming 6.0.2 release.
Saw that, I think even after that, this issue will be still there.
We need to discuss way forward regarding dependency/peerDependency declaration in monaco-vscode-api
/monaco-languageclient
together with the patch process improvement this should solve all install level problems.
Hi @kaisalmen ,
"dependencies": {
"@codingame/monaco-vscode-api": "1.78.6",
"monaco-editor": "0.37.1",
"monaco-languageclient": "6.0.2-next.0"
},
With the above, I am able to install it in yarn without any issues :ok_hand:
We will soon migrate to the latest once everything is stable. Love what you guys are doing. This issue can be closed.
Thank you :slightly_smiling_face:
Hi @jeremiah-blezing good to know. I will announce when the new monaco-languageclient
version is available and then close this issue.
The new version of monaco-languageclient is now available: https://www.npmjs.com/package/monaco-languageclient/v/6.0.2
It contains both monaco-vscode-api
and monaco-editor
as dependency.
Description
When installing![image](https://github.com/TypeFox/monaco-components/assets/111459189/9d40afa5-4c00-4fbc-a462-0b3f8591ba4b)
monaco-editor-wrapper@2.0.0-next.5
with yarn, apostinstall : monaco-treemending
script is run and it shows the command is not found.It seems the latest commit removed
postinstall : monaco-treemending
script in this repository, but the changes are not released yet.Peer Dependency Issue
When I traced the Peer Dependencies of
monaco-editor-wrapper@2.0.0-next.5
to themonaco-treemending
script, it went likemonaco-editor-wrapper@2.0.0-next.5
:point_right:monaco-languageclient@6.0.1
:point_right:@codingame/monaco-vscode-api@~1.78.6
I could see the actual
monaco-treemending
js script is present only in the@codingame/monaco-vscode-api@~1.78.6
package, not in any of the other packages.Now coming to the issue, when installing
monaco-editor-wrapper
,npm
is somehow looking into the peer dependencies and executing thebin
scripts from @codingame/monaco-vscode-api@~1.78.6 , but this is not the case foryarn
. Yarn is only looking in that package and avoiding the peer dependencies(I guess).Because of this, yarn becomes unusable with the latest monaco-languageclient packages.
To Reproduce
yarn create vite
Choose any Framework and try the below command
yarn add monaco-editor-wrapper@2.0.0-next.5
(or)
yarn add monaco-languageclient@6.0.1
Question
Do we need
postinstall : monaco-treemending
script inmonaco-languageclient
package? As it is already taken care of by@codingame/monaco-vscode-api
and only that package has the js script to run...Thanks.