codeflash-internal/.claude/rules/js-packages.md
Kevin Turcios c13835963c docs: restructure CLAUDE.md files into modular rules
Slim down CLAUDE.md files and move content into path-scoped
.claude/rules/ files to reduce context bloat.
2026-02-14 19:36:21 -05:00

1.1 KiB

paths
js/**

JS/TS Packages

NEVER start, restart, or manage dev servers (npm run dev, node, nohup, background processes). The developer will run services manually.

All use ESLint + Prettier. Run commands from each package directory.

Prisma

Schema lives in common/prisma/schema.prisma, shared by cf-api and cf-webapp. common is CommonJS — use require-style imports when working with it directly. Published as @codeflash-ai/common to GitHub Packages.

Package Gotchas

cf-api

  • Webhook routes MUST be registered before body parser (raw body needed for signature verification)
  • instrument.ts must be imported first in entry point (Sentry init)
  • Tests use dependency injection: setXxxDependencies() / resetXxxDependencies()

VSC-Extension

  • Different prettier config: 80 width + semicolons (vs 100/no-semi elsewhere)
  • npm workspaces for local @codeflash/* packages
  • Sidebar is a separate Vite/React app embedded via webview postMessage
  • acquireVsCodeApi() called once per session — store and reuse
  • esbuild excludes vscode module (provided by runtime)