Hi, thanks for taking an interest in contributing to the TypeScript SDK repository. We welcome any kind of contribution, from reporting issues or idea to submitting pull requests for bug fixes, improvements, new features, etc.
Please take a moment to review this document in order to make the contribution process straightforward and effective for everyone involved.
The repository primarily contains SDK packages in TypeScript generated from the Composable Commerce API reference.
This repository is managed as a monorepo, meaning it contains multiple (sub)packages located in the packages
directory.
packages/
...
At commercetools we use the following development tools:
We use Yarn workspaces to manage dependencies between multiple packages.
We use Jest as the main framework for testing. Additionally, we take advantage of the Jest runners to run other tasks such as ESLint.
We rely on Prettier to consistently format our code.
We prefer to implement our UI components using TypeScript. This has the benefit of provide packages with type declarations, thus a better developer experience, but also to have the codebase more maintainable and less error-prone.
We rely on Preconstruct to build the packages.
Commit messages should follow a conventional commit format.
In general, it's a good idea to open an issue first, no matter if it's a bug report, a new feature, etc. Doing so allows maintainers and other contributors to be aware of the context when an associated pull request is provided. It also gives a chance to provide early feedback and suggestions on what the pull request should focus on and what the expectations, avoiding unnecessary work during a pull request.
Good pull requests, such as patches, improvements, and new features, are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
If possible, please try to provide a related issue first, where the topic is discussed and agreed upon before starting to work on that. This is helpful for both you and the maintainers to be familiar with the changes beforehand.
- Clone the repository.
- Run
yarn
in the root folder to install the dependencies.
Some useful commands to work with the repository:
yarn test
andyarn test --watch
yarn typecheck
yarn build
Composable Commerce Typescript SDK uses changesets to do versioning and creating changelogs.
As a contributor you need to add a changeset by running yarn changeset
.
The command will prompt to select the packages that should be bumped, their associated semver bump types and some markdown which will be inserted into the changelogs.
When opening a Pull Request, a changeset-bot
checks that the Pull Request contains a changeset. A changeset is NOT required, as things like documentation or other changes in the repository itself generally don't need a changeset.
Composable Commerce Typescript SDK uses changesets to do versioning and publishing a release.
A Changesets release GitHub Action opens a Version Packages
Pull Request whenever there are some changesets that have not been released yet.
When the Version Packages
Pull Request gets merged, the Changesets release GitHub Action will automatically trigger the release.