macos-setup
🐱 Source ☕️ Java SampleGo Sample Angular Sample
  • Mac Setup
  • Getting Started
    • Xcode
    • Homebrew
    • System Preferences
    • Essentials
    • Dotfiles
  • Applications
    • Ghostty
    • Sublime-text
    • JetBrains
    • VSCode
    • Xcode
    • Marta
    • Benthos
    • OrbStack
    • Traefik
    • n8n
  • Platforms
    • Java
    • Node
      • Bub
      • NPM
      • PNPM
      • Turborepo
    • GoLang
    • Rust
    • Python
      • Agno AI
  • DevOps
    • Development Workflow
      • Git
        • GitHub CLL
      • GitOps
      • Documentation
      • mkcert
      • YubiKey
    • Monorepo
    • dnsmasq
    • Docker
    • Skaffold
    • Kubernetes
    • Helm
    • Kustomize
    • kustomizer
    • Terraform
    • Security
    • Cloud
      • gcloud
      • azure
      • aws
  • Tips
    • Git
    • MacOS
Powered by GitBook
On this page
  • What's inside?
  • Apps and Packages
  • Utilities
  • Prerequisite
  • Setup
  • Create sveltekit turborepo
  • Setup Remote Caching for Turborepo on Vercel
  • Usage
  • Environment
  • App Environment Variables
  • Run
  • Test
  • Build
  • Maintenance
  • Docker Build
  • Guides

Was this helpful?

Edit on GitHub
  1. Platforms
  2. Node

Turborepo

PreviousPNPMNextGoLang

Last updated 2 months ago

Was this helpful?

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

enable managing deployable apps and associated in single git repo. Sharing Code cab be either or

Internal packages are 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 web app to play with new ideas.

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

    • web: a sample landing page web app build with

    • console: a sample dashboard web app build with

  • 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

pnpm add -g turbo@latest
code --install-extension alberto-varela.monorepo-focus-workspace

Setup

Create sveltekit turborepo

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

pnpx create-turbo@latest -e with-svelte
# bunx create-turbo@latest -e with-svelte

Setup Remote Caching for Turborepo on Vercel

pnpx turbo login
pnpx turbo link
# bunx turbo login

Usage

Environment

App Environment Variables

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

Run

turbo dev --filter=playground
turbo dev --filter=web
turbo dev --filter=docs

Test

turbo test --filter=helpers

Build

turbo build --filter=playground...
turbo build --filter=playground... --summarize
turbo build --filter=playground... --dry
turbo build --filter=playground... --graph

Maintenance

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

pnpx  @turbo/codemod migrate

Docker Build

# for dockerfile
turbo prune --scope=playground --docker

Guides

turbo build
turbo dev
turbo dev  --filter=playground
turbo lint
turbo run generate
pnpx turbo login

turbo prune --scope=playground --docker

for static type checking

for code linting

for code formatting

VS Code monorepo plugin:

Turbo is working on to load dotEnv files. Meanwhile we recommend using a library called to solve this problem.

monorepo.tools
Turborepo
Sharing Code
Internal Packages
External Packages
packages
svelte-kit
starlight
astro
svelte-kit
TypeScript
ESLint
Prettier
Monorepo Focus Workspace
first-class solution
dotenv-run