Watch
1
0
Fork
You've already forked packspec
0
mirror of https://github.com/neovim/packspec.git synced 2026-11-17 02:30:46 +00:00
ALPHA package dependencies spec
  • Lua 93.2%
  • Makefile 6.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Justin M. Keyes e9fbbe10f7
docs: readme
2026-05-10 07:29:32 -04:00
.github/workflows fixup: remove all packages except for luarocks 2022-02-17 18:14:22 +01:00
docs docs, spec 2023-07-17 03:39:17 +02:00
examples feat: author information in description (#34) 2022-03-28 21:34:29 -07:00
lua feat: author information in description (#34) 2022-03-28 21:34:29 -07:00
schema feat: author information in description (#34) 2022-03-28 21:34:29 -07:00
scripts test: validate json (#29) 2022-02-13 16:54:59 -08:00
spec Add example version parser and basic test suite 2022-02-12 09:40:54 +01:00
.gitignore feat: add jsonschema (#11) 2022-02-11 15:18:39 -08:00
LICENSE Initial commit 2022-02-06 10:53:23 -08:00
Makefile fixup: add : to avoid recursion 2022-02-17 20:12:16 +01:00
README.md docs: readme 2026-05-10 07:29:32 -04:00

pkg.json

The JSON of package specs.

pkg.json is a wild-west "package" format for defining packages without a package system. It's a (very) limited subset of NPM's package.json that allows any project to declare dependencies on arbitrary URLs.

The initial use-case is for Vim and Emacs plugins (which can be downloaded from anywhere), but the format is designed to be generic.

See /docs for full documentation.

tl;dr

{
  "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"
  },
}

Build

brew install luarocks
make
make test

Run tests

cd test-npm/
npm ci
npm run test

What about LuaRocks?

LuaRocks is a natural choice as the Nvim plugin manager, but defining a "federated package spec" also makes sense because:

  • We can do both, at low cost. pkg.json is a fairly "cheap" approach.
  • LuaRocks is a "centralized" approach that requires active participation from many plugins. In contrast, pkg.json is a decentralized, "infectious" approach that is useful at the "leaf nodes": it only requires the consumer to provide a pkg.json, the upstream dependencies don't need to be "compliant" or participate in any way.
  • LuaRocks + Nvim is starting to see progress, but momentum will take time. A decentralized, lowest-common-denominator, "infectious" approach can be tried without losing much time or effort.
  • There's no central asset registry, just a bunch of URLs. (Though "aggregators" are possible and welcome.)
  • LuaRocks has 10x more scope than pkg.json and unresolved edge cases. pkg.json side-steps that by punting the ecosystem-dependent questions to the client.

Release

TBD

TODO

  • specify packspec (above)
  • specify ecosystem-agnostic client behavior (report conflicts, fetch things into pack/ dir, update existing dir, ...)
  • specify what is undefined (i.e. owned by the per-ecosystem "engine", for example vim/nvim packages are fetched into 'packpath')
  • TODO: support other kinds of artifacts, like zip archives or binaries.
  • nested packages in workspace (foo/pkg.json, foo/bar/pkg.json)
  • Nvim: client can support conflicting dependencies by using git worktree.