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:VERSIONto check a given package in a clone of thetypst/packagesrepository. This command should be run from thepackagessub-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 serverto 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 checkYou can also run it with Nix:
nix run github:typst/package-check -- checkFinally a Docker image is available:
docker run -v .:/data ghcr.io/typst/package-check checkWhen 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/packagesGITHUB_APP_IDENTIFIER, the ID of the GitHub app submitting reviews. This app should have thechecks:writepermission.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.envfile for multi-line variables.