serve-d icon indicating copy to clipboard operation
serve-d copied to clipboard

Create npm package

Open aminya opened this issue 4 years ago • 5 comments

As discussed, given the complexity of downloading, checking for the versions, building from source, etc., we should look into making an npm package for serve-d

aminya avatar Feb 25 '21 18:02 aminya

npm package for serve-d? I was thinking of moving the download & update code from code-d into an npm package, which downloads releases from GitHub releases like currently done. Otherwise it would be duplicate maintenance effort to publish releases to GitHub and to NPM.

The code for code-d exists and I think abstracting it to be usable in any JS-based editor would be useful and allow updates at runtime.

Do you think it would be worth the effort to publish binaries to NPM when there are already existing GitHub releases?

WebFreak001 avatar Feb 25 '21 18:02 WebFreak001

Most of the language servers are available from npm: https://www.npmjs.com/search?q=language%20server

The issue with GitHub releases is that the installation, updating, etc needs to be done manually instead of relying on npm.

I am fine with any approach as long as this management becomes abstracted.

aminya avatar Feb 25 '21 18:02 aminya

I made a very compact code to manage the binaries. I think we can integrate it into serve-d and publish it as a npm package.

Package time script: https://github.com/Pure-D/atom-ide-d/blob/main/scripts/get-servers.ts

Runtime installer: https://github.com/Pure-D/atom-ide-d/blob/main/src/installation.ts

aminya avatar Feb 27 '21 15:02 aminya

https://github.com/Pure-D/atom-ide-d/blob/84c69caad34be2d441674498e8b83818547487e8/src/installation.ts#L53

does this code work? it's cast to a boolean below which would return true here.

WebFreak001 avatar Feb 27 '21 15:02 WebFreak001

Oh, yeah that should be false instead of -1. Fixed now.

Another thing to improve is to build from source automatically for other operating systems or architectures. https://github.com/Pure-D/atom-ide-d/blob/999dd68672318c6b0584bf095431df5bfd95cbb3/src/installation.ts#L83

aminya avatar Feb 27 '21 15:02 aminya