Description
(Note: all feedback is captured in this description + the first comment.)
To add some momentum to this effort, I suggest:
- Supporting
all Lua-supporting versions of Vim/Nvimall "assets" or "artifacts" of any kind in the spec should be a requirement.- No need for Vim/Nvim to have a different package spec, plus this adds legitimacy and weight to the idea.
- No need for this spec to be specific to vim or text editors. What's needed is simply a way to define artifacts that depend on other artifacts.
- Shrink the scope by at least 2x.
Only support one format, Lua (because it allows comments). Vim must be compiled with+lua
or must havelua
available on $PATH.- Only support one format, JSON. Because:
- ubiquitous
- "machine readable" (sandboxed by design): can recursively download an entire dependency tree before executing any code, including hooks. Aggregators such as https://neovimcraft.com/ can consume it.
- Turing-complete formats invite endless special-case features (nvim-lspconfig is a living example).
- Remove any fields that are not immediately, obviously needed.
- Remove any fields that are provided by git. Git is a client requirement.
- But keep anything that is needed to ensure forward-compatible enhancements.
- (optional) use identical field names from npm's
package.json
, where possible (assuming this reduces confusion rather than increasing it) - Strict "no side-effects" requirement:
pkg.json
should be totally sandboxed (evaluating it must have no side-effects, only input and output).(Does #7 address this?) - Transfer this repo to https://github.com/neovim/ ?
Client requirements
git
(packages can live at any git URL)- json parser
Package server requirements
- the package URL must be a
git
repo
Why NPM package.json?
NPM is special because it's ubiquitous--and lots of discussion hasn't yielded a strong case for a novel format. Using things that are ubiquitous means you gain their tooling, docs, validators (and possibly even... infrastructure).
node and NPM aren't perfect, but that doesn't matter. Choosing to be a subset of that ecosystem provides optionality: it's almost entirely upside with limited downside. We could also choose PHP's package format.
The point is to surf on something massive and immortal.
What about LuaRocks?
I've advocated for LuaRocks as the Nvim plugin manager, but defining a "plugin spec" "federated package spec" also makes sense because:
- There is no "federated" plugin spec (corrections welcome!). LuaRocks is a "centralized" approach.
- LuaRocks + Nvim is starting to see real progress in the form of https://github.com/nvim-neorocks , but thus far has not gained momentum. A decentralized, lowest-common-denominator, "infectious" approach is high-leverage, while work continues on the centralized LuaRocks approach at its own pace.
- There's no central asset registry, just a bunch of URLs.
- Could have a central list of plugins, but not assets.
- We can do both, at low cost.
pkg.json
is a fairly "cheap" approach. LuaRocks - Luarocks itself is a somewhat complex dependency. Nvim removed it from its own build:
References
- https://json-schema.org/
- lazy.nvim pkg.json impl