Turborepo

A monorepo is a single repository containing multiple distinct projects, with well-defined relationships. learn more at monorepo.tools

Turborepoenable managing deployable apps and associated Sharing Code in single git repo. Sharing Code cab be either Internal Packages or External Packages

Internal packages are packages which are only intended to be used inside your monorepo. They're extremely useful for sharing code between apps in closed-source monorepos. External packages run their files through a bundler before putting them on a package registry.

What's inside?

This Turborepo includes the following packages/apps:

Apps and Packages

  • WebApps

    • playground: an experimental svelte-kit web app to play with new ideas.

    • docs: a sample documentation web app build with astro's starlight

    • web: a sample landing page web app build with astro

    • console: a sample dashboard web app build with svelte-kit

  • Packages

    • ui: a stub Svelte component library shared by both web and docs applications

    • eslint-config: eslint configurations (includes eslint-plugin-svelte and eslint-config-prettier)

    • prettier-config: shared prettier configurations (plugins etc...)

    • typescript-config: shared tsconfig files

    • utils: utility functions used throughout the monorepo

Utilities

This Turborepo has some additional tools already setup for you:

Prerequisite

  1. Turbo CLI

  1. VS Code monorepo plugin: Monorepo Focus Workspace

Setup

Create sveltekit turborepo

to create a new sveltekit turborepo, Run the following command:

Setup Remote Caching for Turborepo on Vercel

Usage

Environment

App Environment Variables

Turbo is working on first-class solution to load dotEnv files. Meanwhile we recommend using a library called dotenv-run to solve this problem.

turbo automatically include environment variables from .env , .secrets as we set them at globalDotEnv in turbo.json

Run

Test

Build

Maintenance

migrate command which both upgrades your repo to the specified version (latest by default) of turbo, and runs any codemods required.

Docker Build

Guides

Last updated

Was this helpful?