We welcome contributions to the Ditto Network JS SDK! Please follow the process below to contribute.
- Create a Branch: Create a new branch from the
master
branch. - Develop the Feature: Implement your feature or fix.
- Commit Changes: Ensure commits follow the convention using
npm run commit
.- We use commit conventions and linting commits (via git hooks).
- For convenience, use
npm run commit
for an interactive CLI that allows you to choose the appropriate type and scope for commits (list of scopes and types are incommitlint.config.ts
).
- Push Changes: Push your changes to the remote branch.
- Create a Pull Request: Open a pull request to the
master
branch. - Pass Checks: Ensure all checks pass.
- Review and Approval: Wait for review and approval.
- Merge: Once approved, merge the pull request to the
master
branch.
- Stabilize Master: Ensure the
master
branch is stable and all tests pass. - Run Release Script: Execute
npm run release
to:- Bump the version.
- Update the changelog.
- Commit these changes.
- Tag the commit with the new version.
- Push Changes: Push the changes and the tag to the remote repository.
- A CI/CD pipeline will be triggered by the new tag and will:
- Verify all tests pass.
- Build the packages.
- Publish the packages to npm.
- Create a GitHub release using
GITHUB_TOKEN
.
- Merge any hotfix branches or subsequent feature branches following the same process.
- Ensure the
master
branch remains the source of truth.
This project uses Verdaccio to set up a local npm registry for testing packages before publishing them to a public npm registry. This allows you to test your packages in an isolated environment.
-
Start the Local Registry: Start the Verdaccio server:
npm run local-registry
-
Publish Packages Locally: Once the Verdaccio server is running, publish your packages to the local registry:
npm publish --registry http://localhost:4873
-
Use Packages from Local Registry: Set the npm registry to the local Verdaccio instance to install packages from there:
npm set registry http://localhost:4873
-
Revert to Public Registry: Revert back to the public npm registry after testing:
npm set registry https://registry.npmjs.org