Salatim is our component library, made with 🥑 and ❤️.
Please have a look on its storybook for each components.
Don't forget to add an empty NPM_TOKEN in your bash_profile, zsh, etc.. and reload it.
export NPM_TOKEN=''
Branches | Functions | Lines | Statements |
---|---|---|---|
Use yarn dev
Use yarn build
Before each change, please update CHANGELOG.md
with a new version using the following template:
**major.minor.patch**
* Commit message
OR
**BREAKING CHANGE** Commit message
- Fix: patch
- Component / Feature: minor
- Everything which can bring changes in the different projects: major
When changelog is updated, don't forget to bump the package.json
version with:
$ yarn version --major | --minor | --patch
Pushing a new version in the master
branch automatically trigger a new release of the NPM package.
If you have to backport something to an old version of salatim :
- go to the old version's branch (for example:
v15
before the rebranding) - add your commit(s), and don't forget to bump the version in
package.json
andCHANGELOG.md
(if you fix something and the previous version was15.2.3
, bump to15.2.4
) - push the branch, don't forget it!
- run
yarn clean && yarn build
locally to make the package ready to be published - run
yarn publish --access=public --non-interactive --tag 15.2.4
locally. Don't forget the--tag
argument to prevent overriding the latest version.
You can then bump your project with this new version of salatim. ;)
We cannot accept every phone numbers in the application, mainly due to some optimization (Metadata JSON is a big file).
When an error is triggered on AppSales (Failed to parse phone number +XXXX
), we need to update the phone Metadata to accept it.
- Find the country calling code, to do so:
- Go to Phone.tsx, change
PhoneInput
import to'react-phone-number-input'
and remove metadata attribute in JSX (like this we're accepting every possible phone numbers) - Start locally Storybook and copy / paste your troublesome phone number to find the country calling code.
- Go to Phone.tsx, change
- Go to CountryCode.org and find your country calling code.
- Use the 2 digit ISO found to update the script generate-phone-metadata, then run this script (Metadata will be automatically generated).
- We also need to update the Phone component to accept this new option, go to constants and add this 2 digit ISO in both constants.
- Do not forget to rollback your changes in
PhoneInput.tsx
, then update Changelog.md and package.json version and you're up to go.