@privy-eng/privy-components
v1.0.6
Published
Component library for Privy
Downloads
2
Keywords
Readme
Privy Component Library:
Setup steps:
- SETUP YOUR MACHINE:
- Make sure you have yarn installed in your machine.
- Follow this link to
install yarn
: https://linuxize.com/post/how-to-install-yarn-on-ubuntu-18-04/
- Follow this link to
- Install NVM to manage the versions of node.
- Follow this link to
install NVM
: https://www.liquidweb.com/kb/how-to-install-nvm-node-version-manager-for-node-js-on-ubuntu-12-04-lts/
- Follow this link to
- Clone the repo to your local machine.
git clone {ssh/https}
- Select the right the version of
yarn
forprivy-components
by specifying it tonvm
:- Check the
node
version.node --version
- Change nvm to use the node version
nvm run {node_version}
- Check the
- Make sure you have yarn installed in your machine.
- SETUP PRIVY-COMPONENT REPO:
- In order to run
Storybook
you will have to runyarn start
. - You may get an error that says you need to add the private
NPM_TOKEN
, either login to npm with privy's engineering account saved in last pass, or create an account and let the admin invite you to the project. - Once you have the
NPM_TOKEN
follow these steps: https://docs.npmjs.com/using-private-packages-in-a-ci-cd-workflow. - Don't forget to exit and reopen the terminal.
- Run
yarn start
and it should work!
CLI commands:
- In order to run
- To generate a new component boilerplate run
yarn gernerate:component component-name
.- The name of the component should always be lower-dashcase (e.g
loading-component
as opposed toLoadingComponent
). The generator will automatically turncomponent-name
intoconst ComponentName = (props) {..}
- The generator automatically creates a webpack.config.js with proper entry and output paths.
- Adds
@babel/preset-react @babel/core webpack webpack-cli
topackage.json
and runsyarn install
- The generator creates a
packages/component-name/lib/ComponentName.stories.js
file for use with storybook. - The generator creates a functional react component boilerplate code in
packages/component-name/lib/ComponentName.js
- this is where you will build your component.
- The name of the component should always be lower-dashcase (e.g
TODO:
- fill in Lerna commands.
Create new package
Publishing
To publish a new package, or an update that was made to an existing package you will need to do the following:
cd
into the package you want to publish- run
yarn publish
- When prompted, enter a new patch/minor/major version increment that matches the update being made (modelled after semver)
- If publishing a beta feature just for testing, it is recommended to use the
--canary
flag