@rootstrap/rs-components-library
v0.3.0
Published
React components library based on the Design System for RS internal projects
Downloads
2
Maintainers
Keywords
Readme
RS Components Library
React components library based on the Design System for RS internal projects
Contributing
Local environment setup
First Start
- Clone the repo
- If you use NVM, run
nvm use
in project's root directory to use expected node version - Run
yarn install
in project's root directory - To start the project, run
yarn dev
. That will start Storybook with hot reload, ready for development
Consuming package locally
Although we use storybook as sandbox and development environment for components, sometimes you want to also test how your changes work from the project consuming the library. The best way to do that is make your consumer project use your local version of the library.
To do this, it depends on the package manager you're using in the consumer project, here's the docs for most common scenarios:
- Npm: npm link docs
- Yarn: yarn link docs (If you are using yarn 1.*, refer to classic docs instead)
TIP: while using your locally linked version, you can test live component changes by running
yarn dev:lib:watch
on the library project.
Troubleshooting
Build fails:
- Make sure you are using expected
node
version by runningnvm use
in project root directory - Run
yarn clean && yarn
to perform a clean install
Package management on NPM
Any updates you do on this repo won't be effective until a new package version is published to NPM. To publish new version you need to:
1. Get access to Rootstrap organization:
- Create an account on NPM
- Provide your account email to any web leader from Rootstrap so they can add you to the organization. (Or just ask for NPM access on the
#react
slack channel)
2. Login to npm cli:
Run npm login
on your terminal and follow the required steps
3. Bump package version:
In order to let NPM know that this is a new version we need to update the "version"
key on the package.json
file.
To do that in a clean way we follow this process:
- Go the project directory and run
git checkout main && git pull
- Run
npm version <update_type>
, replacing<update_type>
with one of the semantic versioning release types (patch
,major
, orminor
). This will updatepackage.json
and create a new commit. - Run
git push
so everyone get this change.
4. Publish to NPM:
Finally, run npm publish --access public
.
NOTE: This publishing process will later be automated by a github action, so things like git releases will be added there.