1.0.37 • Published 1 year ago
reporting-poc-test v1.0.37
CitrusAd React Component Library
🚀 Get Up and Running
Install the dependencies
Once you have cloned the repository:
- Open your terminal
- Run
yarn
to install the dependencies
Start Storybook
Once dependencies have been installed:
- Start the project by running
yarn storybook
- Once completed, the shared component library should open automatically. Otherwise navigate to http://localhost:6006/ (if using the default settings)
Add .npmrc file
- Create a new file
.npmrc
in the project root folder - Generate a Personal Access Token (PAT) from Github https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
- Add the following to the new
.npmrc
file:
@citrus-international:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<YOUR_TOKEN>
🤝 Contributing
Creating a release
Once you have added or edited a component in the library:
- Update the version number in
package.json
. For now this is a manual process, but this will be automated eventually. - Run
yarn isready
to make sure the project is ready for PR (formatting, linting, tests, etc.) - Create a PR with your changes, and complete the PR process to merge your changes with main.
- Create a release via Github
https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
Note: Please use the same version number for the
tag
as the version you updated inpackage.json
, the description should contain any major changes you've made since the last release.
Creating a Package
- Once you have created the release, a workflow will automatically be run in the background. This can be viewed via the
Actions
tab in github (this can also be used for debugging if your new package doesn't appear) - Once the workflow is complete, your new package should appear in Github https://github.com/orgs/citrus-international/packages?repo_name=react-component-library
Using a Package
- Copy your
.npmrc
file from this project to the project you wish to use the component library in. - Install your package via the preferred command shown on Github within your latest release
- Import and use your required component
Unit tests
- To run unit tests run
yarn test
- If any tests fail due to a mis-matched snapshot, try running
yarn test -u
.