neovim / packspec

ALPHA package dependencies spec
http://packspec.org/
Apache License 2.0
221 stars 2 forks source link

Access to dependency versions at runtime #35

Open ii14 opened 2 years ago

ii14 commented 2 years ago

Maybe plugins should have some standard way of accessing versions of their dependencies to handle differences in API and behavior between versions?

Example:

packspec["telescope"].version
-- returns a string, eg. "1.2.3"

if packspec["telescope"].is("~> 2.0") then -- format reused from "version" field in the spec
  -- ...
else
  -- ...
end
mjlbach commented 2 years ago

I think this is a duplicate of https://github.com/nvim-lua/nvim-package-specification/issues/3

ii14 commented 2 years ago

Not quite, I think the idea there was to have multiple versions of the same plugin at the same time. This is about plugins being able to check the version of their dependencies. I guess this could be a different approach to that problem.