This is a private sample package, showing the basics on contributing a HIG component.
This component accepts Text-Link
& Typography
as its child nodes, and displays them in a "breadcrumbs" style.
- Clone the repository
- Copy the
sample-component
folder topackages
folder - Change directory to
packages/storybook
and runyarn storybook
to preview the component
HIG components should implement similar package.json
file as showning in this sample component, to get the consistent configrations, building, testing processes in HIG.
Each package should have at least one export of the component, in this sample package, we export component SampleComponentBreadcrumbs
in src/index.js
. We can also have more exports for constants, sub-components, etc.
HIG uses storybook to preview components. Each component package should put its stories in *.stories.js
file in src/__stories__/
folder, and the stories will be included in storybook automatically.
Jest along with Enzyme is used to run the unit testing. In this sample package, we implement the unit test in SampleComponentBreadcrumbs.test.js
, and snapshots are stored in src/__snapshots__
.
HIG runs visual regression tests via Gemini. Each component package should put the gemini test files in src/__gemini__
folder, and the tests will be included in HIG visual tests suite automatically.