We welcome contributions to improve Swarmakit. This guide outlines the steps to follow when contributing, adhering to the feature-based branching principle, which helps keep the codebase clean and organized.
If you found an issue and you want to report it, please follow these steps:
-
Search Existing Issues: Before reporting a bug, check the Issues to see if the problem has already been reported or is being addressed.
-
Create a new Bug report: If no issue matches, open a new issue using the provided bug report template. Include:
- Detailed steps to reproduce the bug.
- The expected and actual behavior.
- Screenshots, logs, or other helpful information.
If you have an idea for a new feature, please:
-
Search Existing Features: Review existing issues to see if the feature has already been requested.
-
Submit a New Feature Request: If not, create a new issue using the feature request template. Provide:
- A clear description of the feature.
- Its potential use cases and benefits to the project.
To suggest improvements to existing features:
-
Search Existing Issues: Make sure the enhancement hasn’t already been proposed.
-
Create an Enhancement Request: If not, submit an issue with the enhancement request template. Describe:
- The current functionality.
- The proposed improvements and how they enhance the project.
-
Fork The Repository:
Start by creating your own copy of the Swarmakit repository:
- Navigate to the Swarmakit repository
- Click the Fork button in the upper right corner to create a personal copy under your GitHub account.
-
Clone Your Forked Repository:
Once you've forked the repository, clone it to your local machine:
git clone https://github.com/<your-username>/swarmakit.git cd swarmakit
Replace
<your-username>
with your GitHub username. -
Set Up Your Development Environment:
-
Ensure you have Node.js and npm installed.
-
Install dependencies
npm install
-
-
Navigate to Your Desired Library:
-
Change into the directory you want to work on. For example:
cd libs/vue
-
Replace
vue
withreact
orsvelte
as needed.
-
-
Create a New Feature Branch:
-
Before making any changes to the codebase, create a new branch of your feature:
git checkout -b feature/<your-feature-name>
-
Replace
<your-feature-name>
with a descriptive name for the feature you’re implementing. This naming convention helps identify the purpose of the branch.
-
-
Pull the Latest Changes:
-
Before making any modifications, ensure your local repository is up to date with the latest changes from GitHub:
git pull
-
This command ensures you have the latest code before starting your work.
-
-
Make Your Changes:
-
With your new branch created and the library selected, implement your changes:
- Ensure your code follows existing coding standards.
- Write clear, concise commit messages describing your changes.
- Consider adding tests or documentation if applicable.
-
-
Test Your Changes:
-
Run the build command to check for any errors:
npm run build
-
If you’ve added new features, ensure they work correctly by testing manually where necessary.
-
-
Commit Your Changes:
-
Once you are satisfied with your changes, commit them to your feature branch:
git commit -m "feat: add new component to Vue library for improved user interface"
-
Follow the conventional commit format for commit messages, starting with feat: for new features, fix: for bug fixes, and other relevant prefixes.
-
-
Push Your Changes:
-
After committing, push your changes to your forked repository:
git push origin feature/<your-feature-name>
-
-
Write Tests:
- Ensure each new feature has an associated test file.
- Tests should cover:
- Component Type: Verify the component is of the expected type.
- Resource Handling: Validate inputs/outputs and dependencies.
- Serialization: Ensure data is properly serialized and deserialized.
- Access Method: Test component accessibility within the system.
- Functionality: Confirm the feature meets the project requirements.
-
Open a Pull Request:
-
Navigate back to the original Swarmakit repository on GitHub:
- Click the Pull Requests tab.
- Click the New Pull Request button.
- Select your feature branch from the dropdown menu and provide a clear title and description for your pull request, explaining the changes made and their purpose.
- Click Create Pull Request.
-
-
Review and Address Feedback:
- After submitting your pull request, maintainers will review your changes. Be open to feedback:
-
- Make any requested changes by committing them to your feature branch.
- Push the updates, and the pull request will automatically update.
-
Merge and Celebrate:
-
Keep Your Branch Updated: Regularly pull updates from the main repository to keep your feature branch up to date:
- Once your pull request is approved, it will be merged into the main branch. Congratulations on contributing to Swarmakit!
-
-
Run Tests with GitHub Actions:
- GitHub Actions will automatically run tests for your changes.
- Check the Actions tab to verify if your changes pass the tests.
-
Enabling GitHub Actions on Your Fork:
- Check for Workflow Files: Ensure
.yml
workflow files are present under.github/workflows
in your fork. - Enable Actions:
- Go to the "Settings" tab of your fork.
- Under "Actions" in the left sidebar, ensure Actions are enabled. If not, enable them.
- Check for Workflow Files: Ensure
This project is licensed under the Project License.
Please ensure that your contributions comply with the terms of the license.