-
Notifications
You must be signed in to change notification settings - Fork 3
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
Cache Typst packages (2) #17
Conversation
This might not make sense because whenever your typst file changes, it will invalidate all cache.
I start to understand this. |
you're right. it is "append-only" where future changes don't impact the previous stuff. i think that could go in the RUNNER_TOOL_CACHE then instead of actions/cache? ill try it. |
@yusancky this is a version that i got working
changes from #16 are:
using https://bun.sh instead of vite. you're absolutely right that vite didn't seem to work. there were some spurious "require()"s where they should have been converted to imports. bun seems to handle things better. 🤷♀️
mirrored the https://github.com/actions/setup-node/blob/d86ebcd40b3cb50b156bfa44dd277faf38282d12/src/cache-restore.ts#L15 for restoring the cache (but simpler) and https://github.com/actions/setup-node/blob/d86ebcd40b3cb50b156bfa44dd277faf38282d12/src/cache-save.ts#L34 for saving the cache in post (but simpler)
switched to bun as package manager and primary dev tool (instead of node/npm) and bundler (instead of vite)
using example from https://github.com/typst/packages/tree/main/packages/preview/droplet/0.2.0 as test.typ
bun doesn't work on windows so the compilation step to create the bundle cannot happen on a windows runner. the regular
using: node20
actual runtime can work on windows. its just theres currently no test-action.yml for windows-latest. it's easiest just to wait until Windows Support oven-sh/bun#43using
cache: true
instead ofpackages-id
. dependant on the hashFiles() of the**/*.typ
files in the current workspace so that theres a new cache every time the dependencies needed by the workspace change (since#import
could be in any .typ file, not just a common lockfile liketypst.lock
or something).TODO: allow users to specify a
cache-dependency-path
input just like https://github.com/actions/setup-node does so that users can override the overly cautious**/*.typ
glob with their own custom files/globs.TODO: change the readme to reflect ☝️ all those changes
this pr is currently targeting @yusancky 's original pr #16 and when merged will merge into that branch