👍🎉 First off, thanks for taking the time to contribute! 🎉👍
This file will guide you through the local setup and contains the guidelines you will need to follow to get your code merged.
While you explore these projects, here are some key points to keep in mind:
- Follow the git workflow, prefix your branches and do not create unnecessary merge commits.
- Be mindful when creating Pull Requests, clearly specify the purpose of your changes and include tests where applicable.
- Device Management Kit is mostly accepting bugfix contributions. Feature contributions are subject to review; they may be declined if they don't align with our roadmap or our long-term objectives.
Before submitting a pull request, please make sure the following is done:
- Fork the repository and create your branch from
develop
(check the git conventions for the naming of the branch). - Follow the main installation steps. (https://github.com/LedgerHQ/device-sdk-ts#getting+started)
- Follow additional installation steps depending on which package you want to contribute to.
- Make your changes.
- If you’ve fixed a bug or added code that should be tested, add tests!
- Add an entry to the changelog (
pnpm changeset
). - Make sure that the code passes linter and type checks (
pnpm lint:fix
andpnpm typecheck
). - Make sure that the code passes the prettier checks.
- Make sure the code passes unit and end to end tests (
pnpm test
). - Cleanup your branch - unless it contains merge commits (perform atomic commits, squash tiny commits…).
We use the following git conventions for the Device Management Kit
monorepo.
Depending on the purpose every git branch should be prefixed.
feat/
/feature/
Add a new feature to the application or librarybugfix/
/bug/
/fix/
Fixing an existing bugsupport/
For any other changes (tests, improvements, CI…) For Ledger Employees:chore/
/core/
For maintenance work on the repodoc/
Add or modify documentationrefacto/
/refactor/
Modify the code organisation
For Ledger Employees only: Add the Jira ticket number DSDK-<number>
(case insensitive) or NO-ISSUE
if not applicable.
If resolving a Github issue (optional and not to be combined with Jira ticket number): add ISSUE-<number>
Followed by a small description.
Examples:
User type | Ticket | Example |
---|---|---|
employee |
yes | feature/dsdk-350-add-sparkles |
employee |
no | refacto/no-issue-remove-sparkles |
contributor |
yes | feat/issue-37-add-new-transport |
contributor |
no | fix/missing-dependencies |
We use changesets to handle the versioning of our libraries and apps. A detailed guide is available on the wiki.
We use the standard Conventional Commits specification and enforce it using commitlint.
The format is similar to gitmoji:
():
- scope is the module/package that is impacted by the update.
<description>
should start with an uppercase.
You should use the pnpm commit
prompt to ensure that your commit messages are valid, as well as the pnpm commitlint --from <target branch>
command to check that every commit on your current branch are valid.
The rule of thumb is to always favour rebasing as long as your branch does not contain merge commits.
For instance:
- bugfix branches that are small and self-contained should always get rebased on top of
develop
. - feature branches should always get rebased on top of
develop
.
Follow the next step to fill the PR template
The description format is similar to gitmoji:
() [NO-ISSUE]:
-
scope is the module/package that is impacted by the update (should be the same than the commit ones).
-
For Ledger Employees:
NO-ISSUE
to be replace byDSDK-<number>
orISSUE-<number>
in case of tracking -
<description>
should start with an uppercase.
- Write a full description of what your pull request is about and why it was needed.
- Add some screenshots or videos if relevant.
- Do not forget to fill the checklist
- Github actions will trigger depending on which part of the codebase is impacted.
- Your PR must pass the required CI actions.
- Your PR must include a changelog (
pnpm changeset
), except for tools and maintenance operations.
For external contributors: a member of the Ledger will be required to validate the execution of the CI for external contributions
Ledger provides the tools and resources you need to build on top of our platform. They are accessible in the Ledger Developer Portal.