From: AJ ONeal Date: Wed, 17 Jun 2020 05:47:06 +0000 (-0400) Subject: Update README.md X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=02ac5ea751d51222fa74de40bfbeaa70885d8675;p=webi-installers%2F.git Update README.md --- diff --git a/README.md b/README.md index 584bc5b..c49562f 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,53 @@ -# packages +# webinstall/packages -Primary and community-submitted packages for -[webinstall.dev](https://webinstall.dev) +> WebInstall is how developers install their tools -# Guidelines +This repository contains the primary and community-submitted packages for +[webinstall.dev](https://webinstall.dev). -- Should install to `./local/opt/-` +# Installer Guidelines + +- Should install to `$HOME/.local/opt/-` or `$HOME/.local/bin` - Should not need `sudo` (except perhaps for a one-time `setcap`, etc) -- Follow the example of - , - , or - +- Examples: + - Full Packages: + - Node.js: + - Golang: + - PostgreSQL: + - Single-Binary Installers: + - Caddy: + - Ripgrep: + - Gitea: + - Convenience Scripts: + - Prettier: + - Rust-lang: + - Rust-lang: + +# How it works + +- Contacts official release APIs for download URLs +- Selects the appropriate package version and archive format +- Installs to `$HOME/.local/` +- Updates `PATH` via `$HOME/.config/envman/PATH.env` +- Symlinks or copies current selected version + +More technically: + +1. `/releases.js` transforms the package's release API into a common formatt + - (i.e. HTML, CSV, TAB, or JSON into a specific JSON format) + - common release APIs are in `_common/` (i.e. `_common/github.js`) +2. `_webi/bootstrap.sh` is a template that exchanges system information for a correct installer + - contructs a user agent with os, cpu, and utility info (i.e. `macos`, `amd64`, can unpack `tar,zip,xz`) +3. `_webi/template.sh` is the base installer template with common functions for + - checking versions + - downloading & unpacking + - updating PATH + - (re-)linking directories +4. `/install.sh` may provide functions to override `_webi/template.sh` +5. Recap: + - `curl https://webinstall.dev/` => `bootstrap-.sh` + - `bash bootstrap-.sh` => `https://webinstall.dev/api/installers/@.sh?formats=zip,tar` + - `bash install-.sh` => download, unpack, move, link, update PATH ## Creating an Installer @@ -161,7 +198,7 @@ pkg_done_message() {} # Override, pretty print a success message ## Script API -See `webi/template.bash` +See `webi/template.sh` These variables will be set by the server: @@ -202,16 +239,6 @@ webi_post_install # Runs `webi_add_path $pkg_dst_bin` # Roadmap - Wrap release APIs to unify and expose - - [x] Golang - - [x] Node - - [x] Flutter - - - Started at - - - [ ] git - - Note: do all platforms expose tar/zip releases with the same URLs? - - [ ] npm - - [x] github (see ripgrep) - - [x] gitea (see serviceman) -- [ ] Support git urls (i.e. `@github.com/node/node`) +- [ ] Support arbitrary git urls (i.e. `@github.com/node/node`) - (maybe `ghi node/node` for github specifically) +- [ ] Support git as an archive format