Skip to content

Latest commit

 

History

History
150 lines (94 loc) · 4.68 KB

CONTRIBUTING.md

File metadata and controls

150 lines (94 loc) · 4.68 KB

Welcome to Nalanda's Contribution Guide! 🎉

We are thrilled that you're considering contributing to Nalanda! 🙌 Whether you're a first-time contributor or a seasoned open-source ninja, we appreciate every bit of effort you put in.

📜 Our Code of Conduct

Before you dive in, please take a moment to go through our Code of Conduct. It's essential to keep our community inclusive, supportive, and respectful.

🚀 Getting Started

Having trouble? We'd love to help you out!

🛠 Setting Up Your Local Environment

  1. Get the Code: New to Github? Here's a guide to help you fork the repository.

  2. Go Local: Clone your fork and jump into the the project:

git clone git@github.com:bangle-io/nalanda.git
cd nalanda
  1. Dependencies: Make sure you've got pnpm set up. If not, check the instructions here.
pnpm install
  1. Build:
pnpm run build-packages

# or to build in watch mode
pnpm run build-packages:watch
  1. Test:
pnpm run test

# lint
pnpm run lint

# to run tests in watch mode
pnpm run test:watch
  1. Documentation:
# make sure pnpm run build-packages is run before this
pnpm run build-docs:watch

Project Structure

The Nalanda project is broken into the following directory structure:

  • packages: contains the Nalanda library packages. If you are not sure, more than likely, you'll be making changes here.
    • core: contains the core Nalanda library.
    • react: contains the React bindings for Nalanda.
    • nalanda: currently just rexports the core page.
  • documentation: contains the documentation website built with Nextra and Next.js.
  • config: Holds shared configurations for the entire project, including files like tsconfig.json, .eslintrc, and .prettierrc.
  • misc: contains the scripts to publish the packages to npm.
  • examples: contains the examples for Nalanda.

🔍 Testing Your Changes

Before submitting a PR, make sure to test your changes locally. Here's how:

  • Ensure your changes don't break anything. Run the tests with:

    pnpm run test
  • Check for lint errors with:

    pnpm run lint
  • Add tests for new features or changes. We love tests! ❤️

Submitting PR

  1. Make sure you PR titles are prefixed with one of the following:

    • breaking-change: for breaking changes
    • feat: for new features
    • docs: for documentation changes
    • fix: for bug fixes
    • refactor: for code refactoring
    • test: for adding tests
    • perf: for performance improvements
    • ci: for CI/CD related changes
    • build: for build related changes
    • types: for type related changes

The above convention helps us produce a changelog automatically.

  1. Make sure your PRs are rebased on top of the dev branch.

  2. When merging a PR to dev, make sure to squash all commits into one.

Releasing a new version

  1. ensure you are in dev branch and upto date with dev (git pull origin dev).

  2. Figure out older version and what version you wanna release.

  3. Run pnpm -r --filter misc set-version x.y.z to bump the version.

  4. Go to github and create a new release with the tag that was created in the previous step.

  5. Run pnpm publish-alpha --otp=123456 or publish-latest to publish the packages to npm.

Updating documentation site

  1. If you did an alpha/beta release, you don't need to do update docs.

  2. After doing a release, you need to update the documentation site.

  3. If you did a latest release, you need to update the documentation site manually.

  4. Ensure you are in dev branch and upto date with dev (git pull origin dev).

  5. Make sure the documentation site builds locally with pnpm run build-docs:netlify.

  6. Push changes to main branch.

  7. This will trigger a build on netlify and the documentation site will be updated at https://nalanda.bangle.io .

❓ Questions or Need Help?


Thank you for contributing to Nalanda!. 🚀