Developers
Install Project
A quick start guide for installing the local development tools needed for contributing to the Red Hat Design System.
-
Install Git for your system.
-
Install Node Version Manager for your system.
-
Clone the Red Hat Design System repository from Github.
-
Navigate into your project folder
-
Run Node Version Manager's
use
command to switch to the projects Node version.If prompted, follow the instructions for installing specific version of Node used by this project on your system, which will look similar to the following:
You need to run "nvm install v20.10.0" to install it before using it.
-
Install project dependencies, run
npm ci
Development Servers
-
Start the development servers
npm run start
.Two servers will start, if no other processes are using port
:8000
or:8080
the element development server will load on:8000
and the documentation server will load on:8080
. The element server will auto open a browser window, the documentation server however will not. -
To run these servers independently you can use the commands
npm run dev
andnpm run serve
.
Creating a new element
-
Run the new element generator command
npm run new
-
You will be prompted for a element name. For Red Hat Design System elements use prefix
rh-
followed by the elements name e.g:rh-element-name
. -
A new folder will be created in the
./elements/rh-element-name
directory with the name of the element you chose.The following files will also be created for you:
./elements/rh-element-name/demo/rh-element-name.html
./elements/rh-element-name/demo/rh-element-name.js
Deprecated ./elements/rh-element-name/demo/demo.css
Deprecated ./elements/rh-element-name/docs/rh-element.html
Deprecated - Rename this file to
00-overview.md
- Rename this file to
./elements/rh-element-name/test/rh-element-name.spec.ts
./elements/rh-element-name/test/rh-element-name.e2e.ts
./elements/rh-element-name/rh-element-name.ts
./elements/rh-element-name/rh-element-name.css
./elements/rh-element-name/README.md
-
For more information please read our Wiki page on adding new components
Testing
-
To run all unit tests use command
npm run test
-
To run individual element unit tests use the test command with element test path flag
-
The project uses Mocha and Chai and are run via Web Test Runner
-
For more detailed information about testing and how we write tests please see our Testing Wiki page.
Writing Code
- Please read our Developer Guidelines section of our Wiki
Contributing
- When your code is ready to push to our repository, please open a Pull Request/Merge Request. You may first need to request access. Please reach out to us on Slack
#red-hat-design-system
Internal Red Hat only or open an issue. - Before pushing your code please read our Pull Request Review Guide on our Wiki
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.
Designers
To get started using our design system as a designer, go to the Designers page.