packspec
packspec copied to clipboard
Access to dependency versions at runtime
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
I think this is a duplicate of https://github.com/nvim-lua/nvim-package-specification/issues/3
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.