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

[FEATURE REQUEST] Custom command to find outdated packages #36

Open
1 task done
Anexen opened this issue Aug 9, 2021 · 3 comments
Open
1 task done

[FEATURE REQUEST] Custom command to find outdated packages #36

Anexen opened this issue Aug 9, 2021 · 3 comments
Labels
🤝 Contributions Welcome Not on the roadmap but can be picked up by someone 🙏 Feature Request Feature requests not planned anywhere
Projects
Milestone

Comments

@Anexen
Copy link

Anexen commented Aug 9, 2021

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

It would be useful for user to specify npm options or entirely override npm oudated command.
For example, I have a project where package.json is placed in a subdirectory, so the plugin doesn't work because I need to run npm --prefix <subdirectory> outdated.

I also believe that the plugin could provide some kind of interface and work with other languages / package managers, e.g.
Rust: { filename = "Cargo.toml", command = "cargo outdated -R --format json" }
Python: { filename = "pyproject.toml", command = "poetry show --outdated" }

Help

Yes

Implementation help

No response

@Anexen Anexen changed the title [FEATURE REQUEST] Custom command to find updated packages [FEATURE REQUEST] Custom command to find outdated packages Aug 9, 2021
@vuki656
Copy link
Owner

vuki656 commented Aug 9, 2021

Hey, thanks for opening an issue.

I plan on supporting custom package managers per project in #25, would something similar where you specify the command as well help?

As for the interface, it's a bit tricky since not all package files have the same format, for example, cargo.toml is not in the same format as package.json, so the parsing differs.

It's definitely on the to-do list down the line. I want to provide a great experience for package.json and npm first with deleting/adding/upgrading etc... After that is finished, I'll try to abstract as much functionality as possible and have it work with other languages/package managers. Thanks for the suggestion.

@vuki656 vuki656 self-assigned this Aug 9, 2021
@vuki656 vuki656 added the 🙏 Feature Request Feature requests not planned anywhere label Aug 9, 2021
@vuki656 vuki656 added this to 📋 To do in 📦 Core via automation Aug 9, 2021
@vuki656 vuki656 added this to the 0.3 milestone Aug 9, 2021
@Anexen
Copy link
Author

Anexen commented Aug 9, 2021

I plan on supporting custom package managers per project in #25, would something similar where you specify the command as well help?

Yes, it would be great.

Regarding other languages. I understand that every tool has its own format and now it's hard to support something different from package.json, but we can introduce some abstractions for future use. As soon as there are abstractions for parsing packages and command output, I can help with adding other tools. Here is an example configuration

setup{
   ...
   autostart = true,
   package_managers = {
      ["package.json"] = {
          exe = "npm",
          args = {"--prefix", vim.fn.getcwd() .. "/ui",  "outdated"},
          parser = parsers["package.json"], -- built-in package.json parser
          transformer = transformers["npm"], -- built-in `npm outdated` transformer
      },
      ["Cargo.toml"] = {
          command = "~/.local/bin/cargo"
          args = { "outdated" }, 
          parser = parsers["Cargo.toml"], -- built-in Cargo.toml parser,
          transformer = function ... end -- custom `cargo outdated` transformer
      }
}

@vuki656
Copy link
Owner

vuki656 commented Aug 9, 2021

Cool, thanks for the suggestions. I will likely start with abstractions in 3.0. Not sure yet.

@vuki656 vuki656 removed their assignment Oct 30, 2021
@vuki656 vuki656 added the 🤝 Contributions Welcome Not on the roadmap but can be picked up by someone label Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤝 Contributions Welcome Not on the roadmap but can be picked up by someone 🙏 Feature Request Feature requests not planned anywhere
Projects
📦 Core
  
📋 To do
Development

No branches or pull requests

2 participants