typst local package (tlp) manager
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add README

+25
+25
README.md
··· 1 + # `typst-localpkg` 2 + This is a small tool that automates my development workflow for local typst packages. 3 + 4 + In particular, it keeps a git repository under (the equivalent of) `~/.local/share/typst/packages/local/<name>`, 5 + with one `git worktree` for each version, named as the version so that typst can pick it up, 6 + as well as a symlink with the latest version as its name that points back to the directory, 7 + so that you always get the latest development version when writing `#import "@local/<name>:<latest>"` in typst. 8 + 9 + ## Commands 10 + - `typst-localpkg new <name>`: Create a new local package with the given name. 11 + - `typst-localpkg path <name>`: Get the full path to the local package with the given name (in case you forgot, or need it for other automation) 12 + - `typst-localpkg bump <name> [--major|--patch]`: Increase the version of the local package with the given name. 13 + This will create a new git tag for the latest version, 14 + then increase said version by modifying the `typst.toml` and renaming the latest-version symlink, 15 + and finally add a new `git worktree` for the previously latest version. 16 + 17 + All commands support the `--package-path` option (also available via the `TYPST_PACKAGE_PATH` env variable), 18 + which works exactly like it does in `typst` to specify where to look instead of (the equivalent of) `~/.local/share/typst/packages`. 19 + 20 + ## Git 21 + By default, this program will invoke the `git` binary on your system. 22 + If `git` isn't found for some reason, you can use the `--git` option to specify where it is. 23 + 24 + Alternatively, you can compile this program with the `git2` feature; 25 + Then, it will use `libgit2` instead of invoking `git`, so the `--git` option will have no effect.