feat: added support for plugin packages by lazy, rockspec and packspec

This commit is contained in:
Folke Lemaitre 2024-06-18 21:54:54 +02:00
parent f1ba2e3d05
commit 3be55a4615
11 changed files with 281 additions and 171 deletions

View file

@ -31,8 +31,19 @@ M.defaults = {
-- increase downloads a lot.
filter = true,
},
pkg = {
enabled = true,
cache = vim.fn.stdpath("state") .. "/lazy/pkg-cache.lua",
versions = true, -- Honor versions in pkg sources
sources = {
"lazy",
"rockspec",
"packspec",
},
},
rocks = {
root = vim.fn.stdpath("data") .. "/lazy-rocks",
server = "https://nvim-neorocks.github.io/rocks-binaries/",
},
dev = {
---@type string | fun(plugin: LazyPlugin): string directory where you store your local plugin projects
@ -182,11 +193,6 @@ M.defaults = {
-- Track each new require in the Lazy profiling tab
require = false,
},
packspec = {
enabled = true,
versions = true, -- Honor dependency versions in packspecs
path = vim.fn.stdpath("state") .. "/lazy/packspec.lua",
},
debug = false,
}
@ -306,9 +312,9 @@ function M.setup(opts)
-- useful for plugin developers when making changes to a packspec file
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "package.lua",
pattern = "lazy.lua",
callback = function()
require("lazy.view.commands").cmd("packspec")
require("lazy.view.commands").cmd("pkg")
end,
})
end,