2.6 KiB
2.6 KiB
Repository Guidelines
Project Structure & Module Organization
packages/*— TypeScript packages. Core lives inpackages/tailwindcss; adapters/tools are under@tailwindcss-*.crates/*— Rust crates (e.g.crates/oxide,crates/node). Node bindings are published from here.integrations/— Vitest-based integration tests for CLIs/build tools.scripts/— Release and maintenance utilities (e.g.version-packages.mjs).dist/— Packed artifacts after builds; useful for local installs.playgrounds/*— Sample apps to manually verify changes.
Build, Test, and Development Commands
pnpm install— Install JS deps. Ensure Rust toolchain viarustup default stableand addwasm32-wasip1-threads.pnpm dev— Turbo watch builds; filter example:pnpm dev --filter=tailwindcss.pnpm build— Build all packages (excludes playgrounds). Creates tarballs indist/.pnpm test— Run Rustcargo testand Vitest across the workspace.pnpm test:integrations— Run integration tests (runpnpm buildfirst).pnpm test:ui— Run Playwright UI tests for browser-related behavior.pnpm lint/pnpm format— Check/fix formatting and package-level lint scripts.
Coding Style & Naming Conventions
- Prettier is authoritative:
semi: false,singleQuote: true,printWidth: 100. - Indentation: 2 spaces. TypeScript files prefer
.ts; compatibility shims may use.cts. - Naming: kebab-case file names, camelCase functions/vars, PascalCase types/classes. Rust modules use
snake_case. - Run
pnpm lintlocally before opening a PR.
Testing Guidelines
- Unit tests: Vitest; name files
*.test.tsnear the code they cover or insrc/**/__tests__. - Integration: tests live in
integrations/**; runpnpm build && pnpm test:integrations. - UI: Playwright tests via
pnpm test:ui. - Rust: crate tests run with
cargo test(also covered bypnpm test). Include tests with any behavior change.
Commit & Pull Request Guidelines
- Commit messages: clear, present-tense summaries; reference issues like
#123when relevant. - New features: open a discussion before investing significant work.
- PRs must include: problem summary, rationale, and a test plan (exact commands; screenshots if UI-related). Ensure all tests pass; use
[ci-all]in the description to run all platform suites. - See
.github/CONTRIBUTING.mdand.github/PULL_REQUEST_TEMPLATE.mdfor details.
Security & Configuration Tips
- Do not commit secrets or machine-specific paths. Use
pnpm@9(workspace-managed) and Rust stable. Turbo caches builds; when in doubt, rebuild withpnpm build.