Update readme and add myself to the licence

This commit is contained in:
2025-04-23 15:12:48 -05:00
parent c29395004d
commit 2267d17d25
2 changed files with 36 additions and 37 deletions

View File

@ -1,6 +1,7 @@
MIT License
Copyright (c) 2021 chiya.dev
Copyright (c) 2023 squibid
Copyright (c) 2021-2023 chiya.dev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,27 +1,26 @@
# dep
[![License](https://img.shields.io/github/license/chiyadev/dep)](LICENSE)
[![Maintainer](https://img.shields.io/badge/maintainer-luaneko-pink)][4]
[![Issues](https://img.shields.io/github/issues/chiyadev/dep.svg)][8]
[![Contributors](https://img.shields.io/github/contributors/chiyadev/dep.svg)][9]
> This readme is a work in progress.
A versatile, declarative and correct [neovim][2] package manager in [Lua][3].
Originally written for personal use by [luaneko][4].
Originally written for personal use by [luaneko][4]. Adapted by [squibid][5] for
general use.
What does that mean?
1. `versatile` - packages can be declared in any Lua file in any order of your liking.
1. `versatile` - packages can be declared in any Lua file in any order of your
liking.
2. `declarative` - packages are declared using simple Lua tables.
3. `correct` - packages are always loaded in a correct and consistent order.
See also luaneko's [neovim-configs][10] for an example of how dep can be used in practice.
See also squibid's [neovim-configs][11] for an example of how dep can be used in
practice.
## Requirements
- [Neovim][2] 0.6+
- [Git][5]
> Needs checking not sure which version this requires
- [Git][6]
## Setup
@ -54,9 +53,7 @@ require "dep" {
cleans removed packages and reloads packages as necessary.
- `:DepClean` - cleans removed packages.
- `:DepReload` - reloads all packages.
- `:DepList` - prints the package list, performance metrics and dependency graphs.
- `:DepLog` - opens the log file.
- `:DepConfig` - opens the file that called dep, for convenience.
## Package specification
@ -109,9 +106,9 @@ A package must be declared in the following format.
-- [boolean] Prevents the package from being updated.
pin = true,
-- [string|array] Specifies dependencies that must be loaded before the package.
-- [string|array] Specifies requirements that must be loaded before the package.
-- If given a string, it is wrapped into an array.
requires = {...},
reqs = {...},
-- [string|array] Specifies dependents that must be loaded after the package.
-- If given a string, it is wrapped into an array.
@ -137,7 +134,7 @@ combined into one. This is useful when declaring dependencies, which is explored
require "dep" {
{
"user/package",
requires = "user/dependency",
reqs = "user/dependency",
disabled = true,
config = function()
print "my config hook"
@ -158,7 +155,7 @@ require "dep" {
require "dep" {
{
"user/package",
requires = { "user/dependency", "user/another_dependency" },
reqs = { "user/dependency", "user/another_dependency" },
deps = "user/dependent",
disabled = true,
config = function()
@ -179,10 +176,10 @@ they are combined into one just like normal package specifications.
require "dep" {
{
"user/package",
requires = {
reqs = {
{
"user/dependency1",
requires = "user/dependency2"
reqs = "user/dependency2"
}
}
}
@ -205,7 +202,7 @@ require "dep" {
require "dep" {
{
"user/dependency1",
requires = "user/dependency2",
reqs = "user/dependency2",
deps = "user/package"
}
}
@ -214,11 +211,11 @@ require "dep" {
require "dep" {
{
"user/dependency1",
requires = "user/dependency2"
reqs = "user/dependency2"
},
{
"user/package",
requires = "user/dependency1"
reqs = "user/dependency1"
}
}
@ -245,11 +242,11 @@ instead of hanging or crashing.
require "dep" {
{
"user/package1",
requires = "user/package2"
reqs = "user/package2"
},
{
"user/package2",
requires = "user/package1"
reqs = "user/package1"
}
}
```
@ -265,12 +262,12 @@ require "dep" {
{
"user/package1",
disabled = true, -- implied
requires = "user/dependency"
reqs = "user/dependency"
},
{
"user/package2",
disabled = true, -- implied
requires = "user/dependency"
reqs = "user/dependency"
}
}
```
@ -281,14 +278,14 @@ If a dependency fails to load for some reason, all of its dependents are guarant
require "dep" {
{
"user/problematic",
function()
load = function()
error("bad hook")
end
},
{
"user/dependent",
requires = "user/problematic",
function()
load = function()
print "unreachable"
end
}
@ -298,14 +295,14 @@ require "dep" {
## Separating code into modules
Suppose you split your `init.lua` into two files `packages/search.lua` and
`packages/vcs.lua`, which declare the packages [telescope.nvim][6] and [vim-fugitive][7] respectively.
`packages/vcs.lua`, which declare the packages [telescope.nvim][7] and [vim-fugitive][8] respectively.
```lua
-- ~/.config/nvim/lua/packages/search.lua:
return {
{
"nvim-telescope/telescope.nvim",
requires = "nvim-lua/plenary.nvim"
reqs = "nvim-lua/plenary.nvim"
}
}
```
@ -353,7 +350,7 @@ require("dep")(packages)
require "dep" {
{
"nvim-telescope/telescope.nvim",
requires = "nvim-lua/plenary.nvim"
reqs = "nvim-lua/plenary.nvim"
},
"tpope/vim-fugitive"
}
@ -370,7 +367,7 @@ return {
{
"user/package",
disabled = true, -- implied by module
requires = {
reqs = {
{
"user/dependency",
-- disabled = true -- not implied
@ -419,9 +416,10 @@ dep is licensed under the [MIT License](LICENSE).
[2]: https://neovim.io/
[3]: https://www.lua.org/
[4]: https://github.com/luaneko
[5]: https://git-scm.com/
[6]: https://github.com/nvim-telescope/telescope.nvim
[7]: https://github.com/tpope/vim-fugitive
[8]: https://GitHub.com/chiyadev/dep/issues
[9]: https://github.com/chiyadev/dep/graphs/contributors
[10]: https://github.com/luaneko/neovim-config
[5]: https://squi.bid
[6]: https://git-scm.com/
[7]: https://github.com/nvim-telescope/telescope.nvim
[8]: https://github.com/tpope/vim-fugitive
[9]: https://GitHub.com/chiyadev/dep/issues
[10]: https://github.com/chiyadev/dep/graphs/contributors
[11]: https://git.squi.bid/nvim