@brickblock/ui-components
v1.56.1
Published
Brickblock Common UI Components
Downloads
26
Keywords
Readme
Brickblock UI & Core Components
This repo is a private npm package that gets consumed by other projects as an npm dependency.
NOTE: Please make sure to read through our Developer Handbook before committing code to this repo. It contains information about coding styleguides, deployment documentation etc.
How to use Components and CSS from this repo in other projects
Components
Install the npm package:
```sh
yarn add @brickblock/ui-components
Import components with:
import { Button } from '@brickblock/ui-components'
Use components as you would use any other react component:
<Button someCustomProp="someValue">Launch Rocket to Mars</Button>
CSS
TODO: This is not done, yet. First we need to create CSS exports and then describe how to use them here.
How to run
This is a react-storybook project that doesn't have a normal dev server.
Instead, yarn start
will fire up react-storybook
on http://localhost:8081
0) Prerequisites
Chronic
Chronic runs a command quietly unless it fails to suppress overly verbose output It's part of moreutils and can be installed:
- macOS:
$ brew install moreutils
- Debian: https://packages.debian.org/sid/utils/moreutils
- Ubuntu: https://packages.ubuntu.com/search?keywords=moreutils
- Alpine: https://pkgs.alpinelinux.org/package/edge/testing/x86/moreutils
Node.js
Yarn
1) Setup
yarn
2a) Run locally
yarn start
2b) Run with docker
yarn build:docker
yarn start:docker
How to run tests & other healthchecks
Quickstart: Run yarn healthcheck
to execute all of the below in one go!
Tests & Coverage
Runs all tests, generates a coverage report and checks our test coverage is above the threshold specified in jest-config.js
yarn test
Hint: in Windows Git Bash flag --no-watchman
must be added
Linters
Runs eslint
on JavaScript files and stylelint
on styles
yarn lint
Flow
Checks for typing errors with flow
yarn flow
List open TODOs and FIXMEs
Parses all *.js
, *.css
and *.sol
files for the keywords TODO
& FIXME
and prints them out in a list
yarn todo
How to release a new version
Via CI
Every merge into master automatically releases a new version. You don't need to do anything 🔮🧙♂️✨
From Your Local Machine
In case CI is acting up and you need to urgently release a new version to npm, you can always do it manually:
- Make sure you're up to date
git pull origin master
- Create new release
yarn release
standard-version will figure out the right version number for us based on the conventional commits standard. It will automatically bump the version number, create a new git tag and update the CHANGELOG.md.
- Release to npm
npm publish
For this to work, make sure the shell environment variable $SECRET_NPM_TOKEN
is properly set from wherever you run this command.
- Use in other projects
cd whatever-project-you-want-to-update
yarn upgrade @brickblock/ui-components --latest