# Contribution guidelines -

Preferably use vscode as your editor. Install all the plugins recommended by vscode.

## Setup instructions

- Clone the repo to your local using SSH - git clone git@bitbucket.org:cloudwick-labs/astral-ui.git
- Install Yarn if you don't have it already
- Create a feature branch from 'develop'
- Run `yarn` from the root directory to install all the dependencies
- Start the App using - `yarn storybook`

## Common scripts

```
yarn build

- Generates a production build

yarn build-types

- Generates the type definition files

yarn link

- Generates symlink so that you don't have to publish the package each time you want to consume the updated package

yarn publish

- Publish the package to npmjs

yarn storybook

- Starts storybook on your local

yarn build-storybook

- Build storybook if you want to host it

yarn lint

- lints the codebase using eslint and stylelint

yarn fix-lint

- lints the codebase using eslint and stylelint and fixes auto-fixable issues
```

## Creating a new component

Follow the following guidelines while developing a new component -

- All components go under ./src/components
- Tests need to written using the exported stories [Unit testing with Storybook](https://storybook.js.org/docs/react/workflows/unit-testing)
- All files need to use typescript and proper types need to be defined for each file [Everyday types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html)
- Use JSDoc to document your props so that we can support vscode intellisense [JSDoc](https://jsdoc.app/tags-param.html)
- Anything that needs to be exported from astral-ui should be exported from `./src/index.ts`
