Skip to content
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

feat: set up npm publish for standalone server executable #411

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

llllvvuu
Copy link
Contributor

@llllvvuu llllvvuu commented Jul 29, 2023

resolves #282

The only thing I didn't do is change the package.json name, since that would also change the VSCode extension name. But solidity is taken on NPM, so you'll need to temporarily change the name each time you run npm publish and then change it back. This can be done in a GitHub Action.

Publish to NPM: npm publish.

Users:

npm install -g @juanfranblanco/vscode-solidity-server
vscode-solidity-server --stdio

The changes:

  • adds "files", "bin", and "prepublishOnly" to package.json to use tsup
  • updates server.ts to read the default config from package.json so that even if the client doesn't send a config, they'll still get the default behavior. This is because if the non-VSCode client has to keep manually copying the client config from package.json, it's hard to keep it up-to-date.
  • chore: remove unused packages so they don't get downloaded unnecessarily
  • the big-looking diff in server.ts is just me moving the onDidChangeConfiguration logic into a separate function so that it can be run in both onInitialize and onDidChangeConfiguration.

The only thing I didn't do is change the `package.json` `name`, since
that would also change the VSCode extension name. But `solidity` is
taken on NPM, so you'll need to temporarily change the name each time
you run `npm publish` and then change it back.

Publish to NPM: `npm publish`

Users:
```
npm install -g @juanfranblano/vscode-solidity-server
vscode-solidity-server --stdio
```

This PR does two things to make this possible:
- adds "files" and "prePublishOnly" to `package.json` to use `tsup`
- updates `server.ts` to read the default config from `package.json` so
  that even if the client doesn't send a config, they'll still get the
  default behavior. This is because if the non-VSCode client has to keep
  manually copying the client config from `package.json`, it's hard to keep it
  up-to-date.
@juanfranblanco
Copy link
Owner

Wow thanks this is great!

@juanfranblanco juanfranblanco merged commit cdadf27 into juanfranblanco:master Aug 1, 2023
@llllvvuu
Copy link
Contributor Author

llllvvuu commented Sep 7, 2023

@juanfranblanco did you want to set up an npm account? or I can publish an independent version

@PierrickGT
Copy link

@llllvvuu is there any guide available to set this up in Neovim?

@llllvvuu
Copy link
Contributor Author

llllvvuu commented Nov 2, 2023

@llllvvuu is there any guide available to set this up in Neovim?

I forked nvim-lspconfig: llllvvuu/nvim-lspconfig@08664bf

I will make that a PR if/when the npm release becomes available from @juanfranblanco (#429)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standalone language server
3 participants