A tool to report common errors in Typst packages.
This tool can be used in three ways:
typst-package-check check
, to check a single package, in the current directory.typst-package-check check @preview/NAME:VERSION
to check a given package in a clone of thetypst/packages
repository. This command should be run from thepackages
sub-directory. In that configuration, imports will be resolved in the local clone of the repository, nothing will be fetched from the network.typst-package-check server
to start a HTTP server that listen for GitHub webhooks, and run checks when a PR is opened againsttypst/packages
(or any repository with a similar structure).
You can install this tool with Cargo:
cargo install --git https://github.com/typst/package-check.git
cd my-package
typst-package-check check
You can also run it with Nix:
nix run github:typst/package-check -- check
Finally a Docker image is available:
docker run -v .:/data ghcr.io/typst/package-check check
When running with Docker, /data
is the directory in which the tool will look for files to check.
The following environment variables are used for configuration.
They are all mandatory when running the server that handles webhook.
.env
is supported.
PACKAGES_DIR
, path to a local clone oftypst/packages
GITHUB_APP_IDENTIFIER
, the ID of the GitHub app submitting reviews. This app should have thechecks:write
permission.GITHUB_WEBHOOK_SECRET
, the secret provided by GitHub when enabling webhook handling.GITHUB_PRIVATE_KEY
, the private key of the GitHub app, in PEM format. Directly in the environment variable, not a path to an external file. Note that you can (and should probably) use double-quotes in the.env
file for multi-line variables.