Skip to content

Latest commit

 

History

History
102 lines (70 loc) · 3.56 KB

contributing.md

File metadata and controls

102 lines (70 loc) · 3.56 KB

Contribution Guidelines

Overview

Included Utilities

This project is configured with a suite of pre-configured tools to enhance development experience:

  • Monorepo setup with TurboRepo:
    • TurboRepo provides efficient builds and caching, reducing unnecessary rebuilds.
  • TypeScript for static type checking.
  • ESLint for code linting.
  • Prettier for code formatting.
  • A Plop-based code generator for easy component scaffolding.
  • Workflows for testing, documentation, dependency updates, and deployment of docs and packages.
  • Build setup for generating both CJS and ESM builds to support React 18 server and client component exports from the same library.
  • Native support for SCSS modules in lib and packages/shared.

Apps and Packages

This TurboRepo includes the following packages/examples, all in TypeScript:

  • nextjs-themes: The core React component library (published to NPM).
  • @example/app-router: A Next.js example app using the app router/directory.
  • @example/pages-router: A Next.js example app using the pages router.
  • @example/vite: A Vite.js app.
  • @repo/config-eslint: ESLint configurations (includes eslint-config-next and eslint-config-prettier).
  • @repo/config-typescript: tsconfig.json configurations used throughout the monorepo.
  • @repo/shared: An internal library of components used by the examples.

Automated File Generation

To automatically generate a new component along with a test file and dependency linking, run:

yarn plop

Follow the prompts to ensure adherence to best practices.

Build

To build all apps and packages, run:

pnpm build

Development

For developing all apps and packages, use:

pnpm dev

Running Unit Tests

To run unit tests, execute:

pnpm test

Linting and Formatting

Before submitting a PR, ensure your code passes linting and is properly formatted by running:

pnpm lint

and

pnpm format

Useful Resources

Learn more about TurboRepo and Next.js through these links:

Quick tip: Remove all stale branches with:

git branch --merged main | grep -v '^[ *]*main$' | xargs git branch -d

Consider enrolling in our courses or sponsoring our work.


with 💖 by Mayank Kumar Chaudhari