nvim-tree / nvim-web-devicons

lua `fork` of vim-web-devicons for neovim
MIT License
2.02k stars 182 forks source link

feat: luarocks support #196

Closed mrcjkb closed 8 months ago

mrcjkb commented 1 year ago

nvim-web-devicons is a common dependency across Neovim plugins. Using luarocks may alleviate the need for users to specify their plugins' dependencies in their plugin manager (e.g., vim-plug or packer). See also this blog post for details.

This PR adds a release workflow that publishes this plugin to LuaRocks whenever a tag is pushed, as well as a rockspec that can be used to release to the dev channel.

For the release workflow to work, someone with a LuaRocks account will have to add their API key to this repo's secrets.

Note that I have added a shield to the readme that assumes the existence of an nvim-tree LuaRocks account.

github-add-luarocks-api-key

mrcjkb commented 1 year ago

@alex-courtis @gegoune I've bumped the version of the action (it now auto-detects plugin directories) and removed the rockspec, since it's a redundant second source of truth.

What's the status on this from your side?

gegoune commented 1 year ago

I guess missing bit still is

For the release workflow to work, someone with a LuaRocks account will have to add their API key to this repo's secrets.

@alex-courtis Have you got an account there?

alex-courtis commented 1 year ago

I guess missing bit still is

For the release workflow to work, someone with a LuaRocks account will have to add their API key to this repo's secrets.

@alex-courtis Have you got an account there?

This rock is managed by an organisation of some sort: https://luarocks.org/modules/openresty/lua-cjsone

It's the same (except case) name of the github organisation.

We can't log in to github as an organisation and I can't register github at luarocks as anything but myself.

Email is required for non-github registration.

Possibilities:

  1. create an nvim-tree github user
  2. create a luarocks user
  3. use a personal github account

1 seems manageable, although we'd need a few email addresses for password resets etc.

mrcjkb commented 1 year ago

@alex-courtis I don't think it's possible to create a github user of the same name as an existing organisation.

@teto how did you do this with the neovim and nvim-treesitter accounts on LuaRocks? I guess it was a non-github registration?

teto commented 1 year ago

so IIRC I've created a "neovim" user and then I've generated several LUAROCKS_API_KEY, one for neovim and one for nvim-treesitter

alex-courtis commented 1 year ago

so IIRC I've created a "neovim" user and then I've generated several LUAROCKS_API_KEY, one for neovim and one for nvim-treesitter

That sounds reasonable. Is this the neovim user? https://luarocks.org/modules/neovim

How do you manage the user and its API keys? How are that user's credentials maintained? Considering a "5 years time" situation when, say, a new key is needed.

teto commented 1 year ago

the neovim user is meant to provide API keys for "official" packages, ie., maintained by the neovim core team (or close, like nvim-treesitter's team). In your case you would need to register yourself on luarocks.org (github account works) and create the LUAROCKS_API_KEY yourself.

alex-courtis commented 8 months ago

This is not practical until we get a deployment strategy that is not tied to an individual.

Please reopen if you have any further ideas.

mrcjkb commented 8 months ago

@alex-courtis So creating a nvim-tree luarocks.org account that is not linked to a GitHub account would not be an option for you?

Asking, because we have been working on rocks.nvim, which facilitates using luarocks to manage plugins.

alex-courtis commented 8 months ago

@alex-courtis So creating a nvim-tree luarocks.org account that is not linked to a GitHub account would not be an option for you?

Asking, because we have been working on rocks.nvim, which facilitates using luarocks to manage plugins.

rocks.nvim looks incredible! Thank you for all your work.

A username/password account does indeed allow an API key.

Unfortunately we still have the problem of authentication in the far future: if the password is lost or the API key expires we cannot recover it via, say, email.

Is there prior art other nvim itself and nvim-treesitter? Is there another plugin we could emulate?

alex-courtis commented 8 months ago

Pragmatic but fragile solution:

In the event of credential loss or expiration luarocks.org would need to manually recreate or reactivate the account based on the claim of an organisation member.

@gegoune @Akmadan23 what are your thoughts?

Akmadan23 commented 8 months ago

Pragmatic but fragile solution:

  • create a luarocks account for nvim-tree organisation with a username/password
  • an email must be provided, none@example.com works
  • record the credentials in a secure location inside the organisation
  • retrieve / generate API keys as needed via luarocks.org

Seems a good idea... We could create an email account for the nvim-tree organization so that we can all access any important email from luarocks and even recover/recreate the password if we lost it.

alex-courtis commented 8 months ago

An email and luarocks.org account nvim-tree has been created.

All details recorded in the private nvim-tree repository, including recoveries etc.

alex-courtis commented 8 months ago

Done: pushed changes to master and manually ran for v0.99 tag

https://luarocks.org/modules/nvim-tree/nvim-web-devicons

Unfortunately the label was not set; I've done it manually.

Is there anything else we need to do here @mrcjkb ?

mrcjkb commented 8 months ago

Done: pushed changes to master and manually ran for v0.99 tag

🚀🌘 Thanks for all the effort!

Unfortunately the label was not set; I've done it manually.

Yes, that's a shortcoming that needs to be fixed.

Is there anything else we need to do here

Looks all good to me. I'll close this PR 😃