Hello!, I am very excited that you are interested in contributing with Interlay UI. However, before submitting your contribution, be sure to take a moment and read the following guidelines.
- PNPM to manage packages and dependencies
- Tsup to bundle packages
- Storybook for rapid UI component development and testing
- Testing Library for testing components and hooks
- Changeset for changes documentation, changelog generation, and release management.
Before you create a Pull Request, please check whether your commits comply with the commit conventions used in this repository.
When you create a commit we kindly ask you to follow the convention
category(scope or module): message
in your commit message while using one of
the following categories:
-
feat / feature
: all changes that introduce completely new code or new features -
fix
: changes that fix a bug (ideally you will additionally reference an issue if present) -
refactor
: any code related change that is not a fix nor a feature -
docs
: changing existing or creating new documentation (i.e. README, docs for usage of a lib or cli usage) -
build
: all changes regarding the build of the software, changes to dependencies or the addition of new dependencies -
test
: all changes regarding tests (adding new tests or changing existing ones) -
ci
: all changes regarding the configuration of continuous integration (i.e. github actions, ci system) -
chore
: all changes to the repository that do not fit into any of the above categoriese.g.
feat(components): add new prop to the avatar component
If you are interested in the detailed specification you can visit https://www.conventionalcommits.org/ or check out the Angular Commit Message Guidelines.
- The
main
branch is basically a snapshot of the latest stable version. All development must be done in dedicated branches. - Make sure that Github Actions are green
- It is good to have multiple small commits while working on the PR. We'll let GitHub squash it automatically before the merge.
- If you add a new feature:
- Add the test case that accompanies it.
- Provide a compelling reason to add this feature in a issue, which you should link to your PR (# xxxx).
- If you correct an error:
- If you are solving a special problem, add (fix #xxxx [, # xxx]) (# xxxx is the problem identification) in your PR title for a better launch record, for example fix button style (fix # 3899).
- Provide a detailed description of the error in the PR. Favorite live demo.
- Add the appropriate test coverage, if applicable.
-
Fork of the repository and clone your fork
-
Create a new branch out of the
main
branch. We follow the convention[type/scope]
. For examplefix/dropdown-hook
ordocs/menu-typo
.type
can be eitherdocs
,fix
,feat
,build
, or any other conventional commit type.scope
is just a short id that describes the scope of work. -
Make and commit your changes following the commit convention. As you develop, you can run
pnpm build --filter=<module>
andpnpm test packages/<pkg>
e.g.pnpm build --filter=components & pnpm test packages/components
to make sure everything works as expected.To know more about the
--filter
option, please check the turborepo docs. -
Run
pnpm changeset
to create a detailed description of your changes. This will be used to generate a changelog when we publish an update. Learn more about Changeset. Please note that you might have to rungit fetch origin main:main
(where origin will be your fork on GitHub) beforepnpm changeset
works.You can also create the changeset through you github PR. We have a github changeset-bot that will provide you with status on the changetset and provide you with the action to create one (in case is necessary).
If you made minor changes like CI config, prettier, etc, you can run
pnpm changeset add --empty
to generate an empty changeset file to document your changes. If you use the github bot, you can just procced ignoring the bot and to merge the PR.
After cloning the repository, execute the following commands in the root folder:
- Install dependencies
pnpm i
#or
pnpm install
We use Turbo Repo for the project management.
- If you will be working on the components source code, you can use the following command to start the storybook dev server:
## Start the storybook of core components
pnpm dev
- Create a branch for your feature or fix:
# Move into a new branch for your feature
git checkout -b feat/thing
# Move into a new branch for your fix
git checkout -b fix/something
- If your code passes all the tests, then push your feature/fix branch:
All commits that fix bugs or add features need a test. You can run the nest command for component specific tests.
- Be sure the package builds.
# Build current code
pnpm build # or npm run build
Note: ensure your version of Node is 18 or higher to run scripts
- Send your pull request:
- Send your pull request to the
main
branch - Your pull request will be reviewed by the maintainers and the maintainers will decide if it is accepted or not
- Once the pull request is accepted, the maintainers will merge it to the
main
branch
Breaking changes should be accompanied with deprecations of removed functionality. The deprecated APIs themselves should not be removed until the minor release after that.