{
"name" : "lspconfig", // OPTIONAL cosmetic name, not used for resolution nor filesystem locations.
"description" : "Quickstart configurations for the Nvim-lsp client", // OPTIONAL
"engines": {
"nvim": "^0.10.0",
"vim": "^9.1.0"
},
"repository": { // REQUIRED
"type": "git", // reserved for future use
"url": "https://github.com/neovim/nvim-lspconfig"
},
"dependencies" : { // OPTIONAL
"https://github.com/neovim/neovim" : "0.6.1",
"https://github.com/lewis6991/gitsigns.nvim" : "0.3"
},
}
pkg.json
file. Only required for the “leaf nodes”.
pkg.json
can declare a dependency on any random artifact fetchable by URL. The upstream dependency doesn’t need a pkg.json
.dependencies
follow the NPM version range spec vim.version.range()
."HEAD"
means git HEAD. (npm version spec defines ""
and "*"
as latest stable version.)pkg.json
is decentralized. Publishing a package means pushing it to a git repo with a top-level pkg.json
.Packages SHOULD be semantically versioned. While other versioning schema have uses, semver allows for plugin managers to provide smart dependency resolution.
Packages MUST have a single, top-level package metadata file named pkg.json
.
This may be relaxed in the future.
pkg.json
allows arbitrary user-defined fields at any nesting level, as long as they don’t conflict with specification-owned fields.
package.json
, this makes the format easy to extend. But application fields should be chosen to avoid potential conflict with fields added to future versions of the spec. For example, devDependencies
may be added to the spec so applications SHOULD NOT extend the format with that field.package
(String) the name of the packageversion
(String) the version of the package. SHOULD obey semantic versioning conventions. Plugins SHOULD have a git tag matching this version. For all version identifiers, implementation should check for a version
prefixed with v
in the git repository, as this is a common convention.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”dependencies
(List[Table]
) Object whose keys are URLs and values are version specifiers.
packspec.json
to pkg.json
deps.json
package.json
)"version" : "0.1.2",
because package version is provided by the .git
repo infoexternal_dependencies
specification_version
. The lack of a “spec version” field means the spec version is 1.0.0
. If breaking changes are ever needed then we could introduce a “spec version” field."source" : "git:…",
to repository.url
package
to name
(to align with NPM)description
from object to string (to align with NPM)dependencies
shape to align with NPM. Except the keys are URLs.
client
, user
, metadata
, …?) for use by clients (package managers)?
pkg.json
allows arbitrary application-defined fields, as package.json
does.pkg.json
is redundant. pkg.json
is only useful for ecosystems that don’t have centralized package management.git
commands instead of editing a json file)engines
field: how will aggregators build a package list?version
field mean that a manifest file always tracks HEAD of the git repo?
pkg.json
to repeat that information. The reason that package.json
and other package formats need a version
field is because they don’t require a .git
repo to be present.repository.type
is available for future use if we want to deal with that.dependencies
could look like { "dependencies": { "plenary.nvim": "1.0.0" } }
name
be removed? Because repository.url
already defines the “name” (which can be prettified in UIs).
name
as OPTIONAL and strictly cosmetic (not used for programmatic decisions or filesystem paths).package.json
has an engines
field that declares what software can run the package. Example:
```
“engines”: {
“vscode”: “^1.71.0”
},pkg.json
support “fallback” URLs?
package.json
pkg.json
be a strict subset of NPM package.json
? The ability to validate it with https://www.npmjs.com/package/read-package-json is attractive…"https://www.leonerd.org.uk/code/libvterm/libvterm-0.3.2.tar.gz": { "type": "tar+gzip", "version": "…" }
scripts
and “build-time” tasks (lifecycle)
preinstall
install
postinstall
https://github.com/.../foo
and https://sr.ht/.../foo
are in the dependency tree?
.local/share/nvim/site/pack/github.com/start/
.local/share/nvim/site/pack/sr.ht/start/