A collection of components with accessibility built in for use in the different Membean React apps.
This library is published to github. You must configure your environment to authenticate to github so that you can yarn add
or npm install
this private package from the @membean
github organization. The best way to do this is to create a personal access token and store it in ~/.npmrc
as described here.
Once you have completed the previous you should be able to successfully run yarn add @membean/react-uikit
in the same directory as your package.json
file.
The library can be installed via npm/yarn directly from this private github repo with the following line in your projects package.json
dependencies:
git+ssh://git@github.com/membean/react-uikit.git#v0.14.0
Please specify the desired version at the end of the above line.
This assumes that the computer running the yarn/npm install has an ssh key that is valid for our github org.
Once the library is installed, components can be imported using the following:
import { TextInput } from "@membean/react-uikit";
To view demos of all the available components you can run the following to open a test page:
yarn install
yarn start
- Navigate to localhost:3000
Standard-version is a library that helps with standardizing releases. It is responsible for creating the git tag, git release and updating the changelog with the commits since the previous release. Assuming you are authenticated to github packages with a personal access token in ~/.npmrc
as described above you can follow these steps to publish a new version:
- Make sure you are on the
master
branch and all your changes are committed. - Run
npx standard-version --dry-run
to do a dry run and verify the new package looks correct. (If you are prompted to installstandard-version
please do so) - If everything look correct, run
npx standard-version -r minor
. (Replace "minor" with whatever the release is (major|minor|patch)). - After the script runs you will be prompted to finalize the release by running
git push --follow-tags origin master && npm publish
. - You can now check Github and confirm you see the new package in the "packages" section of the repository.
The versions are based on git tags. Once you have made changes to the library that you want to use in another project you will need to cut a new release with the following steps:
- Make sure you are on the
master
branch and all your changes are committed. - Bump the version in the
package.json
. - Make a new commit with ONLY the version bump you just made in
package.json
using a commit message that is only the version number. - Run
git tag vx.x.x.
(make sure to include thev
prefix before the version number on the tag but NOT in the package.json). - Push
master
first, then push the tag withgit push origin vx.x.x
. - It's helpful to create a new release from the github UI describing the changes in the tagged version you just pushed.
- Lastly, update the version number in the dependent project's package.json, remove the node_modules folder, and rerun npm/yarn install to pull in the latest changes.
Yarn link is a tool for locally linking packages using npm. For example, you can have local changes to components in the react-uikit
and have the membean
repository use a symlink in node_modules
to point @membean/react-uikit
to the local version of the library. This is especially useful when you are making a lot of small changes and want to see them reflected in project immediately.
- Make sure you build/rebuild the library after any changes using
yarn build
. - Run
yarn link
in this repository on your machine. - In the membean repository run
yarn link @membean/react-uikit
. - Restart
webpack-dev-server
if it is running. - Whenever you want to see changes update in the UI just re-run
yarn build
in the uikit repositiory. - When finished make sure to run
yarn unlink @membean/react-uikit
to remove the symlink to the local repository.
If you wish to publish beta releases and install them in other packages you can do so with the following steps:
- Update the
version
inpackage.json
to have the following suffix-beta.0
. - Run
yarn build
after you have made the changes. - Run
npm publish --beta
. - You can now run
yarn add @membean/react-uikit@0.14.1-beta.0
in other repositories.