Skip to content

Commit 72a1e2a

Browse files
committed
docs, spec
part of #41
1 parent 085a0ca commit 72a1e2a

File tree

2 files changed

+38
-27
lines changed

2 files changed

+38
-27
lines changed

README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ It's a (very) limited subset of NPM's `package.json` that allows any project to
55

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

8-
## Example
8+
See [/docs](https://github.com/neovim/packspec/tree/main/docs) for full documentation.
9+
10+
## TL;DR
911

1012
```
1113
{
@@ -26,20 +28,6 @@ The initial use-case is for Vim and Emacs plugins (which can be downloaded from
2628
}
2729
```
2830

29-
## Overview
30-
31-
- `pkg.json` is just a way to declare dependencies on URLs and versions
32-
- Decentralized ("federated", omg)
33-
- Subset of `package.json`
34-
- Upstream dependencies don't need a `pkg.json` file.
35-
- No client spec (yet)
36-
- No official client (yet)
37-
- TODO: support conflicting dependencies using git worktree.
38-
- Useful for: vim, nvim, emacs, (others?)
39-
- Used by:
40-
- [lazy.nvim](https://github.com/folke/lazy.nvim/)
41-
- TBD
42-
4331
## Build
4432

4533
brew install luarocks
@@ -63,8 +51,8 @@ LuaRocks is a natural choice as the Nvim plugin manager, but defining a "federat
6351
- LuaRocks + Nvim is starting to see [progress](https://github.com/nvim-neorocks), but momentum will take time.
6452
A decentralized, lowest-common-denominator, "infectious" approach can be tried without losing much time or effort.
6553
- There's no central _asset registry_, just a bunch of URLs. (Though "aggregators" are possible and welcome.)
66-
- LuaRocks has 10x more scope than `pkg.json` and 100x more [unresolved edge cases](https://github.com/luarocks/luarocks/issues/905).
67-
`pkg.json` side-steps all of that by punting the ecosystem-dependent questions to the ecosystem-dependent package manager client.
54+
- LuaRocks has 10x more scope than `pkg.json` and [unresolved edge cases](https://github.com/luarocks/luarocks/issues/905).
55+
`pkg.json` side-steps that by punting the ecosystem-dependent questions to the client.
6856

6957
## Release
7058

docs/README.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,49 @@
11
# pkg.json
22

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.
65

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+
```
1028

1129
# Features
1230

1331
- `pkg.json` is just a way to declare dependencies on URLs and versions
1432
- Decentralized ("federated", omg)
1533
- Subset of `package.json`
1634
- 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+
1744
- No client spec (yet): only the format is specified, not client behavior.
1845
- No official client (yet)
1946
- 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
2447

2548
# Package requirements
2649

0 commit comments

Comments
 (0)