catppuccin / typst

🪶 Soothing pastel theme for Typst
MIT License
7 stars 1 forks source link

Publish as Typst Package #7

Open TimeTravelPenguin opened 2 months ago

TimeTravelPenguin commented 2 months ago

Is there an existing issue outlining your problem?

Describe your issue.

As mentioned in https://github.com/catppuccin/catppuccin/issues/2491#issuecomment-2270270376,

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

Publish Repository

TimeTravelPenguin commented 2 months ago

@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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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!)