banyan / turbocache

Cloudflare Workers as a custom remote cache for Turborepo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

turborcache

Simple and Fast custom remote cache for Turborepo on the Cloudflare Workers & KV

How to use

Fork this, modify wrangler.toml and deploy to your Cloudflare account.

You should also setup a KV namespace and the secret key.

# to create a KV namspace
yarn wrangler kv:namespace create STORAGE

# to provide a secret key
yarn wrangler secret put SECRET_KEY
# then enter a special text to restrict access to your cache

To link your turborepo with the remote cache,

echo '{"teamId":"_", "apiUrl": "https://turbocache.your-account.workers.dev"}' > .turbo/config.json

Finally, you can use turbo repo with your own remote cache!

turbo run build --team="whatever" --token="<YOUR_SECRET_KEY>"

Roadmap

If I ever actually use this...

  • Auth via GitHub
  • Team Management
  • Clear unused caches
  • Web Client
  • ... What else?

BTW, Turborepo is still in early stage, so there's room for many improvements, but at the same time, its structure is not clean and coupled to Vercel's interface. I assume it's eventually to be rewritten (in Rust?)

LICENSE

MIT

About

Cloudflare Workers as a custom remote cache for Turborepo

License:MIT License


Languages

Language:TypeScript 100.0%