Is there a dry-run mode for the Typst CLI?

The use-case would be for writing a Makefile for when the document depends on an externally-generated image.

main.pdf: main.typ $(shell typst --dry-run main.typ | stuff)
    typst main.typ

If the document contained #image("build/diagram.svg"), typst --dry-run --deps would show that the compilation depends on build/diagram.svg without attempting to actually build the file. Make would then build all of the dependencies before returning for a non-dry-run invocation of typst.

The current behavior fails on the first missing file which causes two problems: if you had two diagrams, only the first is written to the deps file; you can’t tell from the exit-code if there was a syntax-error or a missing file. Keeping around last-run’s diagram.svg is inelegant, because compiled outputs shouldn’t be kept in the source tree, and the compilation should work from a freshly-cloned source tree.

But I am unable to find a --dry-run mode or equivalent flag for typst. Is this a problem that other people run in to?

Not sure if it’s applicable for you, but when I don’t want any artifacts, just to compile and see that no errors occured, I write directly to /dev/null:

typst compile main.typ -f pdf /dev/null