1
1
mirror of https://github.com/wez/wezterm.git synced 2024-10-27 08:09:45 +03:00
wezterm/config/Cargo.toml
Wez Furlong e4ae8a844d
Add wezterm.plugin module, allows loading modules from git
Brief usage notes here:

```lua
local wezterm = require 'wezterm'
local a_plugin = wezterm.plugin.require "https://github.com/owner/repo"

local config = wezterm.config_builder()

a_plugin.apply_to_config(config)

return config
```

The referenced repo is expected to have a `plugin/init.lua` file,
and by convention, return a module that exports an `apply_to_config`
function that accepts at least a config builder parameter, but may
pass other parameters, or a lua table with a `config` field that maps
to a config build parameter.

`wezterm.plugin.require` will clone the repo if it doesn't already
exist and store it in the runtime dir under `plugins/NAME` where
`NAME` is derived from the repo URL.  Once cloned, the repo is
NOT automatically updated.

Only HTTP (or local filesystem) repos are allowed for the git URL;
we cannot currently use ssh for this due to conflicting version
requirements that I'll take a look at later.

`wezterm.plugin.require` will then perform `require "NAME"`,
and since the default `package.path` now includes the appropriate
location from the runtime dir, the module should load.

Two other functions are available:

`wezterm.plugin.list()` will list the plugin repos.

`wezterm.plugin.update_all()` will attempt to fast-forward or `pull
--rebase` each of the repos it finds. It doesn't currently do anything
proactive to reload the configuration afterwards; the user will need to
do that themselves.
2023-01-31 20:07:42 -07:00

50 lines
1.4 KiB
TOML

[package]
name = "config"
version = "0.1.0"
authors = ["Wez Furlong <wez@wezfurlong.org>"]
edition = "2018"
build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dev-dependencies]
env_logger = "0.10"
[build-dependencies]
git2 = { version = "0.16", default-features = false }
[features]
distro-defaults = []
[dependencies]
anyhow = "1.0"
bitflags = "1.3"
colorgrad = "0.6"
dirs-next = "2.0"
enum-display-derive = "0.1"
hostname = "0.3"
lazy_static = "1.4"
libc = "0.2"
log = "0.4"
luahelper = { path = "../luahelper" }
mlua = {version="0.8.3", features=["vendored", "lua54", "async", "send"]}
# file change notification
notify = "5.0.0"
ordered-float = { version = "3.0", features = ["serde"] }
portable-pty = { path = "../pty", features = ["serde_support"]}
promise = { path = "../promise" }
serde = {version="1.0", features = ["rc", "derive"]}
shlex = "1.1"
smol = "1.2"
termwiz = { path = "../termwiz", features=["use_serde"] }
toml = "0.7"
umask = { path = "../umask" }
wezterm-config-derive = { version="0.1", path="derive" }
wezterm-dynamic = { path = "../wezterm-dynamic" }
wezterm-bidi = { path = "../bidi" }
wezterm-input-types = { path = "../wezterm-input-types" }
wezterm-term = { path = "../term", features=["use_serde"] }
[target."cfg(windows)".dependencies]
winapi = { version = "0.3", features = ["winuser"]}