Contributions
Following are some guidelines to adding your own package as a @dnb library package for everyone to use.
Best practices
What practices to follow depends on what type of package you are adding:
dnb-components/
are for React UI components.dnb-capabilities/
are for other libraries that you can import in your app.tools/
are mainly for scripts and code ment to be outside of a production build.
Guidelines
Write modular, maintainable code. Try to split the code into clean modular components parts.
- Use shared libraries for common code
- Write unit tests with React Testing Library and Jest.
- Everything should be written in TypeScript
- Use the Prettier formatting that is defined in the monorepository root
- Write documentation for your new package.
- "How to use"
- "Props"
- "Roadmap" / "Version history"
- "Future work"
- "Contributors"
- Create demos in Storybook showing off the component in various settings.
Bonus: Add the package to a framework demo app to demonstrate how it should be used inside an app.
Web Framework approval
For all new shared libraries, it will have to go through an approval process in the Web Core team which quality assures all shared code in the monorepository.
Check out who the default reviewers are in PR reviewers.