vscode-stylelint icon indicating copy to clipboard operation
vscode-stylelint copied to clipboard

Publish server part as a separate stylelint-language-server

Open rchl opened this issue 5 years ago • 10 comments

What is the problem you're trying to solve?

LSP servers by definition should be easy to reuse in various editors, without being locked-in to any specific one. A stylelint server was created for this extension but it's locked-in to the vscode extension only.

What solution would you like to see?

Extract the server part into a separate repo and publish as a npm package (for example stylelint-language-server). That would make it easy for both this extension to depend on it and for other editors to start using it.

(I've adapted this server to work with Sublime Text editor (see related PR at https://github.com/sublimelsp/LSP-vscode-stylelint/pull/1) but it requires some extra work that shouldn't be necessary.)

rchl avatar May 07 '20 17:05 rchl

It sounds good to me. But I don't know what work is needed. Can you help? If you want to publish a new package, I think we need help from @jeddy3.

ota-meshi avatar Aug 19 '20 01:08 ota-meshi

The first step would be separating the server into a separate repo. Or use monorepo. Whatever is a personal preference.

Then:

  • optionally add bin property to package.json
  • add files property to exclude some unnecessary files (if there are any)
  • publish to npm
  • update extension to depend on the new package

rchl avatar Aug 19 '20 08:08 rchl

I think it's difficult to separate the repo, because I think it's probably difficult to separate test codes. So I think it's better to use monorepo.

ota-meshi avatar Aug 23 '20 10:08 ota-meshi

Personally I think working with monorepos is a pain.

I think another option is to just put server code in a separate directory (like server) that would have its own package.json and could be released to npm from that directory. One example of such setup is https://github.com/microsoft/vscode-eslint which is also a VS extension and language server in one repo

rchl avatar Aug 23 '20 10:08 rchl

If you want to publish a new package, I think we need help from @jeddy3.

I've added you to the stylelint npm org so that you can publish packages under the @stylelint scope. If you publish an unscoped package, invite jeddy3, ntwb and hudochenkov to it. (Preference would be for a scoped package.)

I think another option is to just put server code in a separate directory (like server) that would have its own package.json and could be released to npm from that directory.

That approach must have merit if the Microsoft team do for their ESLint extension.

jeddy3 avatar Aug 28 '20 15:08 jeddy3

I've kick-started the progress with https://github.com/stylelint/vscode-stylelint/pull/141

rchl avatar Aug 28 '20 21:08 rchl

#265 refactors the project from the ground up into a new modular architecture that makes it way easier to split off the server into its own package. I'd like to get some traction on this issue once the v1 release has had time for the dust to settle and we've spent whatever time we may need to spend squashing bugs.

adalinesimonian avatar Oct 22 '21 00:10 adalinesimonian

I'm considering splitting the language server into a proper package in v1.2 since the refactored codebase in v1.2 makes it much easier to do this. However, I'm not certain yet, as I already have a lot of work cut out for me. If it makes it into v1.2, this issue will be added to the v1.2 project.

adalinesimonian avatar Nov 06 '21 22:11 adalinesimonian

Thank you for the update.

rchl avatar Nov 07 '21 19:11 rchl