Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish as Typst Package #7

Open
8 of 10 tasks
TimeTravelPenguin opened this issue Aug 13, 2024 · 8 comments · Fixed by #12, #18 or #22
Open
8 of 10 tasks

Publish as Typst Package #7

TimeTravelPenguin opened this issue Aug 13, 2024 · 8 comments · Fixed by #12, #18 or #22
Assignees
Labels
enhancement New feature or request

Comments

@TimeTravelPenguin
Copy link
Member

TimeTravelPenguin commented Aug 13, 2024

Is there an existing issue outlining your problem?

  • I have searched the existing issues and they do not solve my problem.

Describe your issue.

As mentioned in catppuccin/catppuccin#2491 (comment),

For the current time, it appears that they accept packages via a PR on the repo in the previous link.

Packages are currently accepted into the Typst packaging ecosystem via a pull request on their repository.

Consideration needs to be given as to whether Catppuccin for Typst is a regular package, or if it classifies as a template package, which can serve as both a template and a package.

It is likely the case that this package can classify as a template:

In most cases, the template files should not include the styling code for the template. Instead, the template's entrypoint file should import a function from the package. Then, this function is used with a show rule to apply it to the rest of the document.

As such, a minor refactor is required before publishing.

Pre-publish tasks

Before v0.1.0 is officially published, there are several tasks to be completed

Template Package

Package Refactor

Repository Prep

  • The Typst package repository recommends using typos to check for spelling errors. This would be a good CI addition -- especially once docs are completed.
  • Update README to link to docs and show installation for the use of the @preview namespace.

Publish Repository

  • Tag version 0.1.0
  • Open pull request on package repo
@TimeTravelPenguin TimeTravelPenguin added the enhancement New feature or request label Aug 13, 2024
@TimeTravelPenguin TimeTravelPenguin changed the title Publish to Typst Publish as Typst Package Aug 13, 2024
@TimeTravelPenguin TimeTravelPenguin linked a pull request Aug 18, 2024 that will close this issue
@TimeTravelPenguin TimeTravelPenguin self-assigned this Aug 19, 2024
@TimeTravelPenguin
Copy link
Member Author

@sgoudham I was thinking about what the process might be when I eventually finish my work and decide it is ready to publish.

Would it be sufficient to make an orphaned branch, pull the typst package repo, add this package, and then make a pull request for that branch?

Or do you have any better suggestions?

@TimeTravelPenguin
Copy link
Member Author

For now, I have implemented a private Just recipe to create an orphaned branch and prepare the package for publishing.

It is less than ideal, as repository changes can break this script. But it is all I have the time to manage.

@sgoudham
Copy link
Contributor

Hey. I don't really see the point in an orphaned branch. We don't really do that elsewhere in the organisation, why would we not just tag the commit on the main branch?

@TimeTravelPenguin
Copy link
Member Author

Thanks for your reply,

I am not sure how to do that. Could you link me some docs to read up on?

My experience with git isn't overly advanced, so I apologise for any inexperience in this area.

@TimeTravelPenguin
Copy link
Member Author

However, to answer your question, the Typst package repository requires a certain layout and a subset of the repository's files. I am unaware of any other way to make a pull request on their repository, with the required changes, without making another branch somewhere.

An orphaned branch just allows me to pull their repo, add this repo to theirs in the way that they want it, and then make a pull request.

@sgoudham
Copy link
Contributor

No need to apologise. I might create an issue later regarding the (in my opinion) unnecessary complexity of this repository and suggest some changes.

I suppose this is a nice introduction to tagging: https://www.freecodecamp.org/news/git-tag-explained-how-to-add-remove/

I'd also just recommend reading the git documentation for it.

I'm really not a fan of how typst includes packages. I've looked at the justfile and an orphaned branch is unfortunately probably the best thing here for tracking what assets are upstream.

Do you know if typst have any plans to change this?

@TimeTravelPenguin
Copy link
Member Author

TimeTravelPenguin commented Aug 21, 2024

Thanks for the link! I will certainly be reading this :)

I might create an issue later regarding the (in my opinion) unnecessary complexity of this repository and suggest some changes.

Please do! I really do enjoy learning, and this has been interesting stuff that I have not done before.

This kind of development is very much outside my normal experience, so there has been a lot of learning on how to keep my work neatly together and how to prepare it for when I add more advanced features in future versions of the package. I will admit that I am a bit of a stickler for "doing things correctly", but things here have admittedly gotten a little messy (with that being said, a cleanup is certainly planned! University has just made that hard to do right now).

I'm really not a fan of how typst includes packages. I've looked at the justfile and an orphaned branch is unfortunately probably the best thing here for tracking what assets are upstream.

Do you know if typst have any plans to change this?

I am not a fan, either. It is rather annoying. Their README says that it is experimental, but there is no indication of how things will adapt, otherwise.

The only other alternative is that I make a private fork and do the pull request from there. However, that sounds even less ideal to me, and hence I have avoided that.

Edit: I may try to get in contact with someone and ask about this. I'll check out their community discord when I get the chance!

@sgoudham
Copy link
Contributor

I may try to get in contact with someone and ask about this. I'll check out their community discord when I get the chance!

It'd be great if you could. Also please feel free to join our discord if you'd like to collaborate outside of GitHub notifications (which is usually much faster!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants