fdionisi / turborepo-remote-cache

A Turborepo remote cache server written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Turborepo Server

A remote cache backend for Turborepo written in Rust.

Built on top of Hyper

Abstract

As the website states "Turborepo is a high-performance build system for JavaScript and TypeScript codebases".

Out-of-the-box, the Turborepo allows to cache transpilation and build artifact on locally. Turborepo also allow to cache the ouput directly with Vercel, and even pass a custom URL for on-premises caching servers.

Looking around, I found a handful of Turborepo compatible servers, but none writte in Rust. So, I decided to build a barebone Turborepo remote caching server.

This project is also an opportunity to practice and improve my Rust.

Run the server

The server can run through Cargo.

cargo run --release serve \
  --api-port 3000 \
  --bucket "bucket-name" \
  --token "aaa"

By default, the server stores cache in on the local filesystem. To enable AWS S3 caching, the --storage flag must be set to aws as follow.

cargo run --release serve \
  --api-port 3000 \
  --bucket "bucket-name" \
  --token "aaa" \
  --storage aws

Known issues

  • At the moment, --token is required, but is not actually used.
  • AWS upload is not optimised and takes ages (especially for large files).

Inspiration

License

Turborepo Server is distributed under the terms of the MIT license.

See LICENSE for details.

About

A Turborepo remote cache server written in Rust

License:MIT License


Languages

Language:Rust 100.0%