Monorepo tooling
Checkstack uses a set of shared configurations and scripts to maintain consistency and reduce boilerplate across all packages and plugins.
1. Shared TypeScript Configurations
Section titled “1. Shared TypeScript Configurations”Instead of defining full TypeScript configurations in every package, we use @checkstack/tsconfig, which exports specialized base configurations.
Available Configurations
Section titled “Available Configurations”| Config | Path | Usage |
|---|---|---|
| Base | @checkstack/tsconfig/base.json | Common settings for all packages |
| Backend | @checkstack/tsconfig/backend.json | For backend plugins and core (includes Bun types) |
| Frontend | @checkstack/tsconfig/frontend.json | For React-based frontend plugins (React, Vite) |
| Common | @checkstack/tsconfig/common.json | For platform-agnostic common packages |
In your package’s tsconfig.json, simply extend the appropriate configuration:
{ "extends": "@checkstack/tsconfig/backend.json", "include": ["src"]}2. Shared Scripts and Synchronization
Section titled “2. Shared Scripts and Synchronization”To avoid redundant script definitions in package.json, we use the @checkstack/scripts package along with a synchronization tool.
Standard Scripts
Section titled “Standard Scripts”The following scripts should be consistent across all plugins:
typecheck: Runstsc --noEmitusing the shared configuration.lint: Runs our standard code linting suite.lint:code: Runs ESLint with predefined rules and strict error reporting.
Synchronization Tool
Section titled “Synchronization Tool”We provide a tool to automatically keep all package.json and tsconfig.json files in sync with the project’s standards.
How to run synchronization:
# From the root of the monorepobun run core/scripts/src/sync.tsThis tool will:
- Add
@checkstack/scriptstodevDependenciesif missing. - Standardize
typecheckandlintscripts. - Ensure the correct
tsconfig.extendsis used based on the package type. - Auto-repair common configuration issues.
3. Creating a New Package
Section titled “3. Creating a New Package”Use the interactive CLI to create new packages or plugins:
# From the root of the monorepobun run cli createThe CLI will guide you through:
- Location choice:
core/(core components) orplugins/(replaceable providers) - Package type: backend, frontend, common, node, or react
- Package name: Base name for your package (e.g., “auth” for “auth-backend”)
- Description: Optional description for your package
Package Location Guidelines
Section titled “Package Location Guidelines”| Location | Use For |
|---|---|
core/ | Core platform components that are essential and non-replaceable |
plugins/ | Replaceable providers that can be swapped (auth providers, queue backends) |
See Packages vs Plugins Architecture for detailed decision criteria.
Manual Setup Alternative
Section titled “Manual Setup Alternative”If the CLI doesn’t work in your environment:
- Create a minimal
package.jsonwith anameandversion. - Create a minimal
tsconfig.json. - Run the synchronization tool:
Terminal window bun run core/scripts/src/sync.ts - Run
bun installto link the new dependencies.
This ensures your new package immediately follows all Checkstack architecture and code style rules.