.. The neovim package specification consists of three components:
- Guidelines which provide guidance to package authors,
- the
packspec
file format, and. - guidelines for
packspec
-compatible plugin manager implementers
This specification is an effort to improve the consistency and reliability of Neovim packages.
All Neovim packages should be semantically versioned. While other versioning schema have uses, semver allows for plugin managers to provide smart dependency resolution.
The Neovim package specification supports a single, top-level package metadata file. This file can be either 'packspec.lua' or 'packspec.json'. The format is loosely based on the Rockspec Format and can contain the following fields:
-
package
(String) the name of the package -
version
(String) the version of the package. Should obey semantic versioning conventions, for example0.1.0
. Plugins should have a git commit with atag
matching this version. For all version identifiers, implementation should check for aversion
prefixed withv
in the git repository, as this is a common convention. -
packspec
(String) the current specification version. (0.1.0) at this time. -
source
(String) The URL of the package source archive. Examples: "http://github.com/downloads/keplerproject/wsapi/wsapi-1.3.4.tar.gz", "git://github.com/keplerproject/wsapi.git". Different protocols are supported:file://
- for URLs in the local filesystem (note that for Unix paths, the root slash is the third slash, resulting in paths like "file:///full/path/filename"git://
- for the Git source control managergit+https://
- for the Git source control manager when using repositories that need https:// URLsgit+ssh://
- for the Git source control manager when using repositories that need SSH login, such as git@example.com/myrepohttp://
- for HTTP URLshttps://
- for HTTPS URLsluarocks://
- for Luarocks packages
-
description
(Table) the description is a table that includes the following nested fields:summary
(String) a short description of the package, typically less than 100 character long.detailed
(String) a long-form description of the package, this should convey the package's principal functionality to the user without being as detailed as the package readme.homepage
(String) This is the homepage of the package, which in most cases will be the GitHub URL.author
(Table) information about the author of the package.name
: author name if there are multiple one can use e. 'plugin team'email
: author email
license
(String) This is SPDX license identifier. Dual licensing is indicated via joining the relevant licenses via/
.
-
dependencies
(List[Table]) A list of tables describing the package dependencies. Each entry in the table has the following, onlysource
is mandatory:-
version
(String) The version constraints on the package.- Accepted operators are the relational operators of Lua: == ~= < > <= >= , as well as a special operator, ~>, inspired by the "pessimistic operator" of RubyGems ("~> 2" means ">= 2, < 3"; "~> 2.4" means ">= 2.4, < 2.5"). No operator means an implicit == (i.e., "lfs 1.0" is the same as "lfs == 1.0"). "lua" is an special dependency name; it matches not a rock, but the version of Lua in use. Multiple version constraints can be joined with a
comma
, e.g."neovim >= 5.0, < 7.0"
. - If no version is specified, then HEAD is assumed valid.
- If no upper bound is specified, then any commit after the tag corresponding to the lower bound is assumed valid. The commit chosen is up to the plugin manager's discretion, but implementers are strongly encouraged to always use the latest valid commit.
- If an upper bound is specified, then the the tag corresponding to that upper bound is the latest commit that is valid
- Accepted operators are the relational operators of Lua: == ~= < > <= >= , as well as a special operator, ~>, inspired by the "pessimistic operator" of RubyGems ("~> 2" means ">= 2, < 3"; "~> 2.4" means ">= 2.4, < 2.5"). No operator means an implicit == (i.e., "lfs 1.0" is the same as "lfs == 1.0"). "lua" is an special dependency name; it matches not a rock, but the version of Lua in use. Multiple version constraints can be joined with a
-
source
(String) The source of the dependency. See previoussource
description. -
releases_only
(Boolean) Whether the package manager should only resolve version constraints to include tagged releases.
-
-
external_dependencies
(Table) Like dependencies, this specifies packages which are required for the package but should not be managed by the Neovim package manager, such asgcc
orcmake
. Package managers are encouraged to provide a notification to the user if the dependency is not available.version
(String) same asdependencies
package = "lspconfig"
version = "0.1.2"
packspec = "0.1.0"
source = "git://github.com/neovim/nvim-lspconfig.git"
description = {
summary = "Quickstart configurations for the Nvim-lsp client",
detailed = [[
lspconfig is a set of configurations for language servers for use with Neovim's built-in language server client. Lspconfig handles configuring, launching, and attaching language servers.
]],
homepage = "git://github.com/neovim/nvim-lspconfig/",
license = "Apache-2.0",
author = {
name = "Neovim team",
email = "neovim@neovim.io",
}
}
dependencies = {
neovim = {
version = ">= 0.6.1",
source = "git://github.com/neovim/neovim.git",
},
gitsigns = {
version = "> 0.3",
source = "git://github.com/lewis6991/gitsigns.nvim.git",
}
}
external_dependencies = {
git = {
version = ">= 1.6.0",
},
}
And in json format
{
"package" : "lspconfig",
"version" : "0.1.2",
"packspec": "0.1.0",
"$schema": "https://raw.githubusercontent.com/nvim-lua/nvim-package-specification/master/schema/packspec_schema.json",
"source" : "git://github.com/neovim/nvim-lspconfig.git",
"description" : {
"summary" : "Quickstart configurations for the Nvim-lsp client",
"detailed" : "lspconfig is a set of configurations for language servers for use with Neovim's built-in language server client. Lspconfig handles configuring, launching, and attaching language servers",
"homepage" : "https://github.com/neovim/nvim-lspconfig/",
"license" : "Apache-2.0",
"author": {
"name": "Neovim team",
"email": "neovim@neovim.io"
}
},
"dependencies" : {
"neovim" : {
"version" : ">= 0.6.1",
"source" : "git://github.com/neovim/neovim.git"
},
"gitsigns" : {
"version" : "> 0.3",
"source" : "git://github.com/lewis6991/gitsigns.nvim.git"
}
},
"external_dependencies" : {
"git" : {
"version" : ">= 1.6.0"
}
}
}
The main features that must be implemented to be considered packspec
-compatible are:
- Must be able to fetch and parse
packspec.json
files - Must be able to use
git
to retrieve and manipulate package sources - Must be able to fetch tagged commits for specified package versions
- Must be able to check for updated
packspec.json
files
- Must be able to check the current version of
Neovim
and warn on incompatibility - Must be able to retrieve and manage the specified versions of dependencies transitively, starting from user-specified packages
- Must either be able to solve for compatible versions of dependency packages across all dependency relationships, or warn users if using a potentially inconsistent version resolution strategy (e.g. picking the first specified version of a dependency).
- [optional] remove dependencies when they are no longer required (transitively) by any user-specified packages
- Must be able to check for the existence of a corresponding executable on the user's system
- [optional] check the version constraints and warn the user if the external dependency are incompatible