Skip to content

Latest commit

 

History

History
89 lines (55 loc) · 2.19 KB

CONTRIBUTING.md

File metadata and controls

89 lines (55 loc) · 2.19 KB

Contributing to React Images Selector

PRs accepted in the the Github repository. Please include a few words about what it is you're trying to add or fix. Refer to an existing issue from the Issues section.

Cloning and Dependency Installation

Clone the repository from Github. Click on the green "Code" button at that link and then follow the instructions.

Then run either:

yarn

or

npm install

in a terminal window to install the component's dependencies.

So something like this:

git clone git@github.com:brownieboy/react-images-selector.git
cd react-images-selector
yarn

Component Source

The source code for the component is the /src/components/react-images-selector/react-images-selector folder, split between the files react-images-selector.tsx and image.tsx.

Running in Storybook

To see the component in Storybook, run either

yarn storybook

or

npm run storybook

from a terminal. This will open the Story in a browser on port 6006.

Storybook imports directly from the source code, and the browser Story will update immediately you change that code.

The Storybook story source for React Images Selector is in file src/stories/react-images-selector.stories.mdx. If you're not familiar with MDX then you might want to read up on it before editing that file.

Tests

Run

yarn test

or

npm run test

in a terminal to run the unit tests.

These will tie up a terminal tab/window as the tests run continuously and will run every time you change the component source code. 💡 I like to keep this running in the Terminal tab in VSCode.

The tests themselves are in the file src/components/react-images-selector/react-images-selector.test.tsx. They use the React Testing Library (@testing-library/react).

Building a Distribution Version

To build a distribution version of the component, it's:

yarn build

or

npm run build

The built version wil be put in the /dist folder.