|
1 | 1 | # pkg.json |
2 | 2 |
|
3 | | -`pkg.json` allows artifacts to depend on other artifacts, by URLs. |
4 | | -You can think of it as a "federated package spec": it's just a JSON file that |
5 | | -lists URLs in a simple format that is dead simple to write a client for. |
| 3 | +`pkg.json` is a wild-west "package" format for defining packages without a package system. |
| 4 | +It's a (very) limited subset of NPM's `package.json` that allows any project to declare dependencies on arbitrary URLs. |
6 | 5 |
|
7 | | -The initial use-case is for Vim and Emacs plugins (which can be downloaded from |
8 | | -anywhere). But the format is designed to be ecosystem-agnostic: it's just |
9 | | -a formalized way to list dependencies by URL. |
| 6 | +The initial use-case is for Vim and Emacs plugins (which can be downloaded from anywhere), but the format is designed to be generic. |
| 7 | + |
| 8 | +# TL;DR |
| 9 | + |
| 10 | +``` |
| 11 | +{ |
| 12 | + "name" : "lspconfig", // OPTIONAL cosmetic name, not used for resolution nor filesystem locations. |
| 13 | + "description" : "Quickstart configurations for the Nvim-lsp client", // OPTIONAL |
| 14 | + "engines": { |
| 15 | + "nvim": "^0.10.0", |
| 16 | + "vim": "^9.1.0" |
| 17 | + }, |
| 18 | + "repository": { // REQUIRED |
| 19 | + "type": "git", // reserved for future use |
| 20 | + "url": "https://github.com/neovim/nvim-lspconfig" |
| 21 | + }, |
| 22 | + "dependencies" : { // OPTIONAL |
| 23 | + "https://github.com/neovim/neovim" : "0.6.1", |
| 24 | + "https://github.com/lewis6991/gitsigns.nvim" : "0.3" |
| 25 | + }, |
| 26 | +} |
| 27 | +``` |
10 | 28 |
|
11 | 29 | # Features |
12 | 30 |
|
13 | 31 | - `pkg.json` is just a way to declare dependencies on URLs and versions |
14 | 32 | - Decentralized ("federated", omg) |
15 | 33 | - Subset of `package.json` |
16 | 34 | - Upstream dependencies don't need a `pkg.json` file. |
| 35 | +- Gives aggregators a way to find plugins for their `engine`. |
| 36 | + |
| 37 | +# Used by: |
| 38 | + |
| 39 | +- [lazy.nvim](https://github.com/folke/lazy.nvim/) |
| 40 | +- TBD |
| 41 | + |
| 42 | +# Limitations |
| 43 | + |
17 | 44 | - No client spec (yet): only the format is specified, not client behavior. |
18 | 45 | - No official client (yet) |
19 | 46 | - TODO: support conflicting dependencies using git worktree. |
20 | | -- Useful for: vim, nvim, emacs, (others?) |
21 | | -- Used by: |
22 | | - - [lazy.nvim](https://github.com/folke/lazy.nvim/) |
23 | | - - TBD |
24 | 47 |
|
25 | 48 | # Package requirements |
26 | 49 |
|
|
0 commit comments