mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-05 21:04:43 +08:00
2.3 KiB
2.3 KiB
Repository Guidelines
Project Structure & Module Organization
This is a Turborepo monorepo with Bun package manager.
apps/builder/- Visual flow editorapps/viewer/- Runtime that executes botsapps/landing-page/- Commercial website landing pageapps/workflows/- Durable workflows serverapps/docs/- Documentationpackages/- All feature-driven modules, shared libs, schemas, UI package.
Commands
We use Turborepo to run tasks across workspaces with caching and dependency-aware ordering. For example:
- Run
bunx turbo run check-typesto run type checking on all packages - Run
bunx turbo run check-types --filter=builderto run type checking on builder package only.
There are global scripts defined on root package.json:
bun format-and-lintruns code format and lintbun lint-reporuns repo packages lint- Both have
*:fixalternative that runs the commands with autofix. bun checkis a convenient helper to run type checking, format, lint (+ auto fix)
IMPORTANT: Never run dev script, assume dev server are already running locally.
Coding style
- Write Effect code whenever possible. Check effect-best-practices before implementing Effect code.
- Rely heavily on type inference, we tend not to declare types.
- Prefer files exporting a single primary function and the file name should match the exported function name. On that file, the main exported function is at the top while local helpers are at the bottom.
- Use very explicit variable names.
- Extract a helper function only if the logic is used at least twice in the main function.
- Declare a variable only if it is used at least twice.
Workflow
- Be eager on web searches and
opensrcuse. - We recommend you always run
bun checkto verify your work.
opensrc
You have access to any package, CLI and Github repo source code using opensrc skill.
To fetch source code for a package or repository you need to understand, run:
bunx opensrc <package> # npm package (e.g., bunx opensrc zod)
bunx opensrc pypi:<package> # Python package (e.g., bunx opensrc pypi:requests)
bunx opensrc crates:<package> # Rust crate (e.g., bunx opensrc crates:serde)
bunx opensrc <owner>/<repo> # GitHub repo (e.g., bunx opensrc vercel/ai)
Source code for dependencies is then available in opensrc/.