|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | + |
| 5 | +- `packages/*`: TypeScript libraries and CLIs with `src/`, `tsconfig.project.json`, and `turbo.json`; builds emit to `dist/`. |
| 6 | +- `platform/*`: shared tooling packages (`config-eslint`, `config-typescript`, `superturbo`) used across the workspace. |
| 7 | +- `test/*`: fixture packages (e.g., `test/test-package-for-pkg-consumption-test`) used in integration scenarios. |
| 8 | +- `patches/`: patched dependencies (TypeScript patch referenced in `package.json#pnpm.patchedDependencies`). |
| 9 | +- Root files: `tsconfig.json` references all projects; `turbo.json` coordinates build/lint; `.nvmrc` and `pnpm-workspace.yaml` define runtime and workspace scope. |
| 10 | + |
| 11 | +## Build, Test, and Development Commands |
| 12 | + |
| 13 | +- `pnpm install`: bootstrap with workspace `pnpm` (`package.json#packageManager`) |
| 14 | +- `pnpm build`: run `superturbo build` across packages (turbo cache disabled by design). |
| 15 | +- `pnpm lint` / `pnpm lint:fix`: lint after builds per `turbo.json` dependencies; auto-fix with `lint:fix`. |
| 16 | +- `pnpm format`: apply Prettier across the workspace. |
| 17 | +- `pnpm --filter <pkg> run dev`: package-level watch/compile loop when available (e.g., codemods, pkg-consumption-test). |
| 18 | +- `pnpm --filter <pkg> test`: run package tests. |
| 19 | +- `pnpm nuke`, `pnpm nuke:artifacts`, `pnpm nuke:node-modules`: clean builds, cache folders, and `node_modules`. |
| 20 | + |
| 21 | +## Coding Style & Naming Conventions |
| 22 | + |
| 23 | +- TypeScript-first; follow shared configs from `@patricktree/config-eslint` and `@patricktree/config-typescript`. |
| 24 | +- Format with Prettier |
| 25 | +- Prefer `camelCase` for functions/variables, `PascalCase` for types/classes, and lower-case descriptive filenames under `src/`. |
| 26 | +- Respect each package's module target (CommonJS vs ESM) and keep exports aligned with existing `package.json` fields. |
| 27 | + |
| 28 | +## Testing Guidelines |
| 29 | + |
| 30 | +- Use Vitest where present; co-locate specs alongside source with clear, discoverable names. |
| 31 | +- Create "package consumption scenarios" tests like `packages/typescript-eslint-rules-requiring-type-info/test-pkg-consumption-scenarios` and `test/test-package-for-pkg-consumption-test`. |
| 32 | +- Before PRs, run targeted tests via `pnpm --filter <pkg> test`. |
| 33 | + |
| 34 | +## Commit & Pull Request Guidelines |
| 35 | + |
| 36 | +- Follow Conventional Commits as seen in history (`chore:`, `fix(scope):`, `ci:`, `refactor:`); include scope when useful. |
| 37 | +- Add a Changeset (`pnpm changeset`) for user-facing package changes; omit for tooling-only tweaks unless publishing impact. |
| 38 | +- PRs should describe intent, affected packages, and commands run (`build`, `lint`, relevant tests); link issues and include screenshots/logs for UX/CLI changes when helpful. |
| 39 | +- Avoid updating the TypeScript patch manually; use `pnpm run create-pnpm-patch-via-ts-patch` when bumping versions and keep `patches/typescript@...` in sync. |
0 commit comments