Repository navigation
Add typst-kit crate - #4540
Add typst-kit crate#4540
Conversation
778016f to
21a4d46
Compare
6b70d18 to
a2600d7
Compare
|
For the reviewers: I suggest reviewing commit by commit for simplicity. Manifest validation is left out for now, this is only relevant for the package I think, but if it is relevant to other downstream tools we can add it in post. I have added a project crate which should at some point have things like the project locking mentioned in #4452, but I left the feature out as I'm not 100% sure how to implement it in a cross-platform manner. Currently, it only contains recursive project lookup by searching for the manifest file. Regarding package downloads, I initially wanted to abstract this a little more, but it proved difficult. I think this is the feature where it's least clear what should be configurable and what shouldn't, so this can be extended later when the API surface is clearer. It will likely change once we add support for custom registries and git packages, so it's ok that it's not yet fully defined, I think. |
7921cf1 to
5aa22c6
Compare
As I said earlier on discord, utpm will need manifest validation because it will publish directly a PR on typst/packages. We don't need a big validation system, just enough to block malformed |
|
I think the Typst Universe specific checks don't really belong in the compiler repository. Was that the idea or are you talking about some other kind of validation? |
|
I was thinking of this, yeah, but there are other forms like package names being identifiers which are directly tied to how package specs are parsed. But I guess we can leave it out. |
5aa22c6 to
27f592b
Compare
27f592b to
5d74555
Compare
laurmaedje
left a comment
There was a problem hiding this comment.
I left some further minor comments. Other than that, it looks good to merge.
There are some unticked boxes in the PR description. Do you still want to tackle those here? Personally, I think we can merge what's there first and proceed with the rest separately.
For project locking, I was unable to come up with anything cross-platform and safe. I left some notes on #4658 regarding those issues. Regarding manifest validation, we decided to leave this out of |
|
Alright, then we can merge once you've pushed. |
One review comment is left open, do you prefer getters + setters for effectively public fields? |
e9a15c2 to
b241652
Compare
b241652 to
9627100
Compare
9627100 to
690d7d4
Compare
|
Thank you! |
| # Explicitly depend on OpenSSL if applicable, so that we can add the | ||
| # `openssl/vendored` feature to it if `vendor-openssl` is enabled. | ||
| [target.'cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios", target_os = "watchos", target_os = "tvos")))'.dependencies] | ||
| openssl = { workspace = true } |
There was a problem hiding this comment.
I think this should be optional as well and only enabled under downloads.
|
I reviewed this again after the two regressions, this time actually comparing the moved code fragments. Didn't find anything major, but I noticed that typst-kit's OpenSSL dependency is unconditional on Linux, even though it is only needed for downloading. |
|
I left his completely unchanged, this was already the case before. |
|
Yeah, but the CLI uses downloading unconditionally whereas in typst-kit it is optional. |
This PR adds the
typst-kitcrate, which contains various default implementations of things a Typst tool may need, such as:Resolves #4452.