Caution
This library has been deprecated in favour of @gathercontent/ui and @gathercontent/icons. No further updates will be made here.
For any local development the contents of this repo have been moved to CSR →
UI component library for all GatherContent components.
🧑🎨 Usage • 💻 Local development • 🎨 Code styling / linting • 🧑🔬 Testing • 🏗 Setting up dependencies
⌨ Useful commands • 🚀 How to deploy • 👥 Code owners • 🔗 Useful links
The library is available on npm.
npm install gather-content-ui
Using the components is just like any other npm module. For e.g.:
// Import the button component
import { Button } from 'gather-content-ui';
// Require once all the CSS directly from the node_modules folder
require('gather-ui/dist/styles.css');- Download the repository and run
npm ci - Make changes to the components living on the
/libfolder - Preview changes by running the live style guide, using
npm run storybookand pointing your browser tohttp://localhost:6006/ - Watch for file changes and rebuild with
npm run build:watch(useful when you link your local version ofgather-uiin the app)
We use both eslint and prettier to lint and format our code. You can run these commands to check your code;
npm run lintIf you would like to prettier to automatically fix the issues you can run:
npm run format:jsFurthermore, as we use TypeScript we also have the TypeScript compiler to check our code. You can run this command to check your code;
npm run type-checkWe also use stylelint to be able to lint and format our CSS. You can run these commands to check your code;
npm run lint:style
npm run format:styleTests live alongside the code within a .specs folder and should be ran using npm run test.
All the project dependencies are listed in the package.json file. You can install them using npm ci.
NPM should have been installed when you ran through the local development in docker-base. However, if you don't have
it installed run brew install node@18 to install it.
You can use npm link to link your local version of this library to the node_modules in your app.
For this to work, you also need to run npm link react in this repository.
Original issue here
To build the components to be consumed by any application, both JavaScript and CSS files need to be generated.
Running npm run build will:
- Generate ES5 compliant versions of each component in
/dist - Generate a
.cssfiles containing all the concatenated component styles. - Copy over Sass configuration files to the
/distfolder in order to be consumed externally.
The best and easiest way to publish this library to npm is to use our GitHub action.
- Head on over to the actions tab
- Select the "publish-npm" workflow
- Click the "Run workflow" dropdown
- Select a branch (this will just be main 99.99% of the time) and a version
- Click "Run workflow"
- Sit back and relax as the robots publish it for you! 🤖