Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cometkim/turbocache
Cloudflare Workers as a custom remote cache for Turborepo
https://github.com/cometkim/turbocache
cloudflare cloudflare-workers monorepo turborepo
Last synced: 3 months ago
JSON representation
Cloudflare Workers as a custom remote cache for Turborepo
- Host: GitHub
- URL: https://github.com/cometkim/turbocache
- Owner: cometkim
- License: mit
- Created: 2021-12-24T18:12:37.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T20:24:09.000Z (about 1 year ago)
- Last Synced: 2024-05-01T15:35:24.439Z (9 months ago)
- Topics: cloudflare, cloudflare-workers, monorepo, turborepo
- Language: TypeScript
- Homepage:
- Size: 1.66 MB
- Stars: 63
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# turborcache
Simple and Fast [custom remote cache](https://turborepo.org/docs/features/remote-caching#custom-remote-caches) for [Turborepo](https://turborepo.org/) on the [Cloudflare Workers & KV](https://workers.cloudflare.com/)
## 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.
```bash
# to create a KV namespace and put the id in wrangler.toml
yarn wrangler kv:namespace create STORAGE# to create a KV preview_id and put the preview_id in wrangler.toml
yarn wrangler kv:namespace create STORAGE --preview# to provide a secret key
yarn wrangler secret put SECRET_KEY
# then enter a special text to restrict access to your cache
```Next, deploy the worker. If you are deploying from CI, you will need an API token, you can create from [here](https://dash.cloudflare.com/profile/api-tokens) and the minimum permissions required for the API token are `Workers KV Storage:Edit`, `Workers Scripts:Edit`.
```
yarn deploy# In case when deploying from CI
CLOUDFLARE_API_TOKEN=xxxx yarn deploy
```Finally, you can use turbo repo with your own remote cache!
```bash
turbo run build --team="whatever" --api="https://turbocache.YOUR-ACCOUNT.workers.dev/" --token=""
```## 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