Skip to content

Latest commit

 

History

History
87 lines (59 loc) · 2.3 KB

contributing.md

File metadata and controls

87 lines (59 loc) · 2.3 KB

Contributing 💙

Thank you 😄 for contributing to huetiful-js!

On this page you'll find information on how to setup the project and navigate the file structure.

The project structure is as follows:

  • www/ - Where the documentation site lives
  • lib/ - This is where the source code is located
  • tests/ This is where the test files for the publicly accessible symbols live.

Requirements

  • Supported version of Node (LTS or higher)
  • Git
  • Bun (for testing)

Setup⛳

To quickly get the development environment ready you can run the following command, you can replace npm with any package manager :

git clone https://github.com/prjctimg/huetiful && cd huetiful 

# Package manager of your choice
npm i -D

Documentation

The API documentation is written as JSDoc comments and is compiled from the source files using TypeDoc and typedoc-plugin-markdown.

The site is generated using Docusaurus.

You can edit the other pages by going to the www/docs/ directory.

Adding/Running tests 🧪

The project uses bun:test for unit testing. In order to run and create tests you need to have a working version of bun installed.

bun test

Each module with publicly exported symbols has a corresponding *.test.ts file. The specs are defined as an object with the following structure:

export type Spec = {
  description?: string;

  matcher?: string;
  callback: any;
  params: any[];
  result: any;
};

and then iterated using a helper function, run which takes an array of the Spec objects as its only parameter.

Pull Requests

  1. Fork the project
  2. Clone your fork
  3. Create a pr/feature branch replacing feature with what you're working on.

Not necessarily a requirement but it makes understanding the context of the pull request easier.

git checkout -b pr/feature
  1. Commit your changes. Follow the prompts asked to complete your commit.

npx cz


5. And then push your changes

```sh
git push origin pr/feature
  1. Open a pull request

Happy hacking 🚀!