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.
This Turborepo includes the following packages/apps:
- WebApps
playground
: an experimental svelte-kit web app to play with new ideas.docs
: a sample documentation web app build with astro's starlightweb
: a sample landing page web app build with astroconsole
: a sample dashboard web app build with svelte-kit
- Packages
ui
: a stub Svelte component library shared by bothweb
anddocs
applicationseslint-config
:eslint
configurations (includeseslint-plugin-svelte
andeslint-config-prettier
)prettier-config
: sharedprettier
configurations (plugins etc...)typescript-config
: sharedtsconfig
filesutils
: utility functions used throughout the monorepo
This Turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
- Turbo CLI
pnpm add -g turbo@latest
- VS Code monorepo plugin: Monorepo Focus Workspace
code --install-extension alberto-varela.monorepo-focus-workspace
to create a new sveltekit turborepo, Run the following command:
pnpx create-turbo@latest -e with-svelte
# bunx create-turbo@latest -e with-svelte
npx turbo login
npx turbo link
# bunx turbo login
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
turbo dev --filter=playground
turbo dev --filter=web
turbo dev --filter=docs
turbo test --filter=helpers
turbo build --filter=playground...
turbo build --filter=playground... --summarize
turbo build --filter=playground... --dry
turbo build --filter=playground... --graph
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
# for dockerfile
turbo prune --scope=playground --docker
turbo build
turbo dev
turbo dev --filter=playground
turbo lint
turbo run generate
pnpx turbo login
turbo prune --scope=playground --docker