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.
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.
Having trouble? We'd love to help you out!
-
π€ Join our Discord for a quick chat.
-
π For broader topics, head over to Github discussions.
-
Get the Code: New to Github? Here's a guide to help you fork the repository.
-
Go Local: Clone your fork and jump into the the project:
git clone git@github.com:bangle-io/nalanda.git
cd nalanda- Dependencies: Make sure you've got
pnpmset up. If not, check the instructions here.
pnpm install- Build:
pnpm run build-packages
# or to build in watch mode
pnpm run build-packages:watch- Test:
pnpm run test
# lint
pnpm run lint
# to run tests in watch mode
pnpm run test:watch- Documentation:
# make sure pnpm run build-packages is run before this
pnpm run build-docs:watchThe 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.
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! β€οΈ
-
Make sure you PR titles are prefixed with one of the following:
breaking-change: for breaking changesfeat: for new featuresdocs: for documentation changesfix: for bug fixesrefactor: for code refactoringtest: for adding testsperf: for performance improvementsci: for CI/CD related changesbuild: for build related changestypes: for type related changes
The above convention helps us produce a changelog automatically.
-
Make sure your PRs are rebased on top of the
devbranch. -
When merging a PR to
dev, make sure to squash all commits into one.
-
ensure you are in
devbranch and upto date with dev (git pull origin dev). -
Figure out older version and what version you wanna release.
-
Run
pnpm -r --filter misc set-version x.y.zto bump the version. -
Go to github and create a new release with the tag that was created in the previous step.
-
Run
pnpm publish-alpha --otp=123456orpublish-latestto publish the packages to npm.
-
If you did an alpha/beta release, you don't need to do update docs.
-
After doing a release, you need to update the documentation site.
-
If you did a latest release, you need to update the documentation site manually.
-
Ensure you are in
devbranch and upto date with dev (git pull origin dev). -
Make sure the documentation site builds locally with
pnpm run build-docs:netlify. -
Push changes to
mainbranch. -
This will trigger a build on netlify and the documentation site will be updated at https://nalanda.bangle.io .
- Report Issues: Open an issue for bugs or feature requests.
- Join Discussions: For broader topics, head over to Github discussions.
- Chat With Us: Prefer real-time conversations? Here's our Discord link.
Thank you for contributing to Nalanda!. π