Skip to content

Monorepo tooling

Checkstack uses a set of shared configurations and scripts to maintain consistency and reduce boilerplate across all packages and plugins.

Instead of defining full TypeScript configurations in every package, we use @checkstack/tsconfig, which exports specialized base configurations.

ConfigPathUsage
Base@checkstack/tsconfig/base.jsonCommon settings for all packages
Backend@checkstack/tsconfig/backend.jsonFor backend plugins and core (includes Bun types)
Frontend@checkstack/tsconfig/frontend.jsonFor React-based frontend plugins (React, Vite)
Common@checkstack/tsconfig/common.jsonFor platform-agnostic common packages

In your package’s tsconfig.json, simply extend the appropriate configuration:

{
"extends": "@checkstack/tsconfig/backend.json",
"include": ["src"]
}

To avoid redundant script definitions in package.json, we use the @checkstack/scripts package along with a synchronization tool.

The following scripts should be consistent across all plugins:

  • typecheck: Runs tsc --noEmit using the shared configuration.
  • lint: Runs our standard code linting suite.
  • lint:code: Runs ESLint with predefined rules and strict error reporting.

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:

Terminal window
# From the root of the monorepo
bun run core/scripts/src/sync.ts

This tool will:

  1. Add @checkstack/scripts to devDependencies if missing.
  2. Standardize typecheck and lint scripts.
  3. Ensure the correct tsconfig.extends is used based on the package type.
  4. Auto-repair common configuration issues.

Use the interactive CLI to create new packages or plugins:

Terminal window
# From the root of the monorepo
bun run cli create

The CLI will guide you through:

  1. Location choice: core/ (core components) or plugins/ (replaceable providers)
  2. Package type: backend, frontend, common, node, or react
  3. Package name: Base name for your package (e.g., “auth” for “auth-backend”)
  4. Description: Optional description for your package
LocationUse 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.

If the CLI doesn’t work in your environment:

  1. Create a minimal package.json with a name and version.
  2. Create a minimal tsconfig.json.
  3. Run the synchronization tool:
    Terminal window
    bun run core/scripts/src/sync.ts
  4. Run bun install to link the new dependencies.

This ensures your new package immediately follows all Checkstack architecture and code style rules.