-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing to DSA Toolbox
We welcome contributions to DSA Toolbox! Here's a guide to help you get started:
Start by forking the repository and cloning it to your local machine. This will allow you to make changes and contribute back.
Once you've cloned the repo, install the necessary dependencies by running:
pnpm install
Below are some important npm scripts you can use during development:
-
update-docs
: Cleans up thedocs
folder and regenerates documentation using Typedoc.pnpm update-docs
-
build
: Compiles the TypeScript files and outputs them in thedist
folder.pnpm build
-
bench-ds
: Benchmarks data structures and watches changes.pnpm bench-ds
-
bench-algo
: Benchmarks algorithms and watches changes.pnpm bench-algo
-
lint
: Runs the linter to check your code for style and consistency.pnpm lint
-
lint:fix
: Automatically fixes linting issues in the code.pnpm lint:fix
-
format
: Formats the codebase using Prettier.pnpm format
-
test
: Runs tests with coverage using Vitest.pnpm test
-
test:watch
: Watches and runs tests continuously while developing.pnpm test:watch
-
test:ui
: Opens the Vitest UI to interactively run and debug tests.pnpm test:ui
-
prepare
: Runs Husky to set up git hooks for pre-commit and pre-push.pnpm prepare
We use GitHub Actions to automate the process of building and deploying the documentation.
- The documentation is built using Typedoc and automatically deployed to GitHub Pages on the
gh-pages
branch. - You can view the documentation here: DSA Toolbox Docs.
The workflow files .github/workflows/npm-publish.yml
and .github/workflows/static.yml
takes care of:
- Building the documentation with the
update-docs
script. - Deploying the
docs
folder to GitHub Pages.
Once you've made your changes, follow these steps to contribute:
- Commit your changes: Write clear, concise commit messages explaining what you've changed.
-
Create a Pull Request (PR): Push your changes to your fork and open a PR against the
main
branch. - Check CI status: Ensure that all tests pass and the CI workflows (build, lint, test) are successful before merging.