?

Contributing

How to contribute to helpbase: monorepo structure, development workflow, and testing.

contributingdevelopmentopen-source
Edit on GitHub

Contributing

helpbase is open source and welcomes contributions. This guide covers the monorepo structure, development workflow, and testing.

Repository structure

helpbase is a pnpm monorepo with Turborepo:

helpbase/
  apps/
    web/                   # The help center Next.js app
  packages/
    cli/                   # helpbase CLI (generate, audit, new, deploy)
    create-helpbase/       # npx create-helpbase scaffolder
    shared/                # Shared types, schemas, AI prompts
    ui/                    # shadcn/ui components + globals.css
  registry/
    helpbase/              # shadcn registry source (for `shadcn add`)
  scripts/
    sync-templates.mjs     # Syncs apps/web → scaffolder + registry
    smoke-install.sh       # End-to-end scaffolder smoke test
Note

The sync script is the most important piece of infrastructure. It ensures the scaffolder templates and shadcn registry always match the canonical apps/web/ implementation. CI fails if they drift.

Development setup

1

Clone the repo

git clone https://github.com/Codehagen/helpbase.git
cd helpbase
2

Install dependencies

pnpm install
3

Start the dev server

pnpm dev

Opens the help center at http://localhost:3000.

Testing

The test suite covers the CLI, scaffolder, content pipeline, and MDX components:

# Run all tests
pnpm test

# Run tests for a specific package
pnpm --filter cli test
pnpm --filter create-helpbase test
pnpm --filter web test

Smoke test

The install-path smoke test is the most important test. It scaffolds a real project, installs deps, runs the build, and verifies the output:

pnpm smoke:install
Warning

Every PR that changes apps/web/, packages/create-helpbase/, or scripts/sync-templates.mjs should run the smoke test before merging. This catches the class of bugs that unit tests miss: files that exist but don't constitute a buildable project.

Sync workflow

When you change files in apps/web/, the scaffolder templates and registry need updating:

1

Make your changes

Edit files in apps/web/ (components, content, lib, etc.)

2

Run the sync script

pnpm sync:templates

This copies your changes to both packages/create-helpbase/templates/ and registry/helpbase/.

3

Verify

pnpm test && pnpm smoke:install

What to contribute

  1. Create the component in apps/web/components/mdx/
  2. Register it in apps/web/lib/mdx-components.tsx
  3. Add a reference page in apps/web/content/reference/
  4. Update the AI prompt in packages/shared/src/ai-text.ts to use it
  5. Run pnpm sync:templates to update scaffolder + registry
  1. Create the command in packages/cli/src/commands/
  2. Register it in packages/cli/src/index.ts
  3. Add tests in packages/cli/test/
  4. Document it in content/cli/commands.mdx