typst / typst/package-check

Question: Can this be used for packages with foreign `#import`s?

Open
#39 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
36
Forks
9
Avg merge
1h 46m
Merged PRs (30d)
1

Description

Hello,

today I wanted to apply the package-check linter to one of my new projects. Based on some findings there actually I wanted to post an entirely different issue, but while assembling a few CLI invocations to demonstrate my issue I noticed nothing worked and I ended up with even more questions. I think I'm doing something wrong, so let me show you what I see.

The problem

Fundamentally, it appears I cannot use this linter to check standalone packages that #import other packages. Here's an example if you want to follow along:

git clone --revision 23b9b3350db04e6741cd0fa171c4df3f200ad728 https://gitlab.com/hartang/typst/cloudy
# You never know what symlinks might do to your paths...
cloudy="$(realpath "$PWD/cloudy")"
podman run --rm -it --security-opt label=disable --log-driver none -v "$cloudy:/data" ghcr.io/typst/package-check:0.4.0 check

And we see the following error:

error[compile/error]: The following error was reported by the Typst compiler: package not found (searched for @preview/testyfy:0.2.0)
  ┌─ src/clouds.typ:5:8
  │
5 │ #import "@preview/testyfy:0.2.0"
  │

I can see the package in typst universe and I know for a fact it's in the packages repository.

The question(s)

  • Am I missing something?
  • Is this kind of usage currently supported at all?
  • Why does the bundled typst in this case (apparently) not download the missing dependencies?

Thank you in advance!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the pinned cloudy revision and the documented podman command running package-check:0.4.0 check. Start by examining the package-check check entry point and how the bundled Typst handles the @preview/testyfy:0.2.0 import. Done means either external package imports work in standalone packages or the supported limitation and required usage are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.