diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fc515c7 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,189 @@ +# Contributing to Matrix.Core.Workspace + +Thank you for your interest in contributing to Matrix.Core.Workspace! This document provides guidelines and instructions for contributing. + +## Code of Conduct + +Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md) to keep our community approachable and respectable. + +## How Can I Contribute? + +### Reporting Bugs + +Before creating bug reports, please check existing issues to avoid duplicates. When creating a bug report, include as many details as possible: + +- **Use a clear and descriptive title** +- **Describe the exact steps to reproduce the problem** +- **Provide specific examples to demonstrate the steps** +- **Describe the behavior you observed and what you expected** +- **Include screenshots or code samples if applicable** +- **Specify which version you're using** +- **Include environment details** (OS, .NET version, etc.) + +### Suggesting Enhancements + +Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion: + +- **Use a clear and descriptive title** +- **Provide a detailed description of the suggested enhancement** +- **Explain why this enhancement would be useful** +- **List any alternative solutions you've considered** + +### Pull Requests + +1. **Fork the repository** and create your branch from `main` +2. **Follow the coding style** used in the project +3. **Write clear commit messages** following conventional commits format: + - `feat:` for new features + - `fix:` for bug fixes + - `docs:` for documentation changes + - `style:` for formatting changes + - `refactor:` for code refactoring + - `test:` for adding tests + - `chore:` for maintenance tasks + +4. **Update documentation** if you've made changes to functionality +5. **Add tests** if applicable +6. **Ensure all tests pass** before submitting +7. **Submit your pull request** + +## Working with Submodules + +Since this is a workspace repository managing multiple submodules: + +### Making Changes to Submodules + +1. Navigate to the submodule directory +2. Create a feature branch +3. Make your changes +4. Commit and push to the submodule repository +5. Return to the workspace root +6. Update the submodule reference +7. Create a PR in the workspace repository + +### Example Workflow + +```bash +# Navigate to submodule +cd Matrix.Core + +# Create feature branch +git checkout -b feature/my-new-feature + +# Make changes +# ... edit files ... + +# Commit changes +git add . +git commit -m "feat: add new feature" + +# Push to submodule repository +git push origin feature/my-new-feature + +# Return to workspace root +cd .. + +# Update submodule reference +git add Matrix.Core +git commit -m "chore: update Matrix.Core submodule reference" + +# Push workspace changes +git push origin your-workspace-branch +``` + +## Development Workflow + +### Setup Development Environment + +1. Clone the repository with submodules: + ```bash + git clone --recursive https://github.com/codenamelab/Matrix.Core.Workspace.git + cd Matrix.Core.Workspace + ``` + +2. Install required tools (refer to individual submodule READMEs) + +3. Ensure you can build all submodules successfully + +### Branch Naming Convention + +- Feature branches: `feature/description` +- Bug fix branches: `fix/description` +- Documentation: `docs/description` +- Refactoring: `refactor/description` + +### Commit Message Guidelines + +Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification: + +``` +[optional scope]: + +[optional body] + +[optional footer(s)] +``` + +Examples: +- `feat: add new authentication module` +- `fix: resolve null reference in data layer` +- `docs: update README with build instructions` +- `refactor: simplify repository pattern implementation` + +## Coding Standards + +### General Guidelines + +- Write clean, readable, and maintainable code +- Follow SOLID principles +- Keep methods small and focused +- Use meaningful variable and method names +- Add comments for complex logic +- Remove commented-out code before committing +- Avoid premature optimization + +### C# Specific Guidelines + +- Follow [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions) +- Use PascalCase for class names and method names +- Use camelCase for local variables and parameters +- Use `_camelCase` for private fields +- Use `async`/`await` for asynchronous operations +- Dispose of resources properly using `using` statements +- Prefer `var` when the type is obvious + +### Documentation + +- Add XML documentation comments for public APIs +- Keep documentation up to date with code changes +- Include examples in documentation where helpful +- Document complex algorithms or business logic + +## Testing + +- Write unit tests for new features +- Ensure existing tests pass +- Aim for meaningful test coverage +- Use descriptive test names +- Follow the Arrange-Act-Assert pattern + +## Review Process + +1. All submissions require review +2. Reviewers may request changes +3. Address review comments promptly +4. Once approved, maintainers will merge your PR + +## Questions? + +Feel free to open an issue with your question or reach out to the maintainers. + +## License + +By contributing, you agree that your contributions will be licensed under the MIT License. + +## Recognition + +Contributors will be recognized in the project's release notes and documentation. + +Thank you for contributing to Matrix.Core.Workspace! 🎉 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8c5ef66 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 CodenameLab + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8c13b77 --- /dev/null +++ b/README.md @@ -0,0 +1,174 @@ +# Matrix.Core.Workspace + +A workspace repository that brings together all Matrix.Core related projects using Git submodules. + +## Overview + +This repository serves as a centralized workspace for managing the Matrix.Core ecosystem, which includes: + +- **Matrix.Core** - Core functionality and base implementations +- **Matrix.Core.Data** - Data access layer and repository patterns +- **Matrix.Core.Models** - Domain models and data transfer objects +- **Matrix.Core.Shared** - Shared utilities and common code + +## Prerequisites + +- Git 2.13 or higher +- .NET SDK (check individual submodule requirements) + +## Getting Started + +### Cloning the Repository + +To clone this repository with all submodules: + +```bash +git clone --recursive https://github.com/codenamelab/Matrix.Core.Workspace.git +``` + +If you've already cloned the repository without the `--recursive` flag, initialize the submodules: + +```bash +git submodule update --init --recursive +``` + +### Updating Submodules + +To update all submodules to their latest commits: + +```bash +git submodule update --remote --merge +``` + +To update a specific submodule: + +```bash +git submodule update --remote --merge Matrix.Core +``` + +### Working with Submodules + +Each submodule is a separate Git repository. To make changes to a submodule: + +1. Navigate to the submodule directory: + ```bash + cd Matrix.Core + ``` + +2. Create a new branch: + ```bash + git checkout -b feature/your-feature-name + ``` + +3. Make your changes and commit them: + ```bash + git add . + git commit -m "Your commit message" + ``` + +4. Push to the submodule's repository: + ```bash + git push origin feature/your-feature-name + ``` + +5. Return to the workspace root and update the submodule reference: + ```bash + cd .. + git add Matrix.Core + git commit -m "Update Matrix.Core submodule reference" + git push + ``` + +## Project Structure + +``` +Matrix.Core.Workspace/ +├── Matrix.Core/ # Core library submodule +├── Matrix.Core.Data/ # Data access layer submodule +├── Matrix.Core.Models/ # Domain models submodule +├── Matrix.Core.Shared/ # Shared utilities submodule +├── .gitignore # Git ignore rules +├── .gitmodules # Submodule configuration +└── README.md # This file +``` + +## Building + +Each submodule contains its own build instructions. Please refer to the README in each submodule directory for specific build steps. + +## Contributing + +Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests. + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +## Submodule Repositories + +- [Matrix.Core](https://github.com/codenamelab/Matrix.Core) +- [Matrix.Core.Data](https://github.com/codenamelab/Matrix.Core.Data) +- [Matrix.Core.Models](https://github.com/codenamelab/Matrix.Core.Models) +- [Matrix.Core.Shared](https://github.com/codenamelab/Matrix.Core.Shared) + +## Support + +For issues related to: +- This workspace repository: Open an issue here +- Individual submodules: Open an issue in the respective submodule repository + +## Useful Commands + +### Check Submodule Status +```bash +git submodule status +``` + +### Pull Latest Changes from All Submodules +```bash +git pull --recurse-submodules +``` + +### Execute Command in All Submodules +```bash +git submodule foreach 'git checkout main && git pull' +``` + +### Remove a Submodule +```bash +git submodule deinit -f +git rm -f +rm -rf .git/modules/ +``` + +## Troubleshooting + +### Submodules Not Initialized + +If you see empty submodule directories, run: +```bash +git submodule update --init --recursive +``` + +### Detached HEAD in Submodules + +Submodules are checked out at specific commits by default. To work on a branch: +```bash +cd +git checkout main # or your desired branch +``` + +### Submodule Update Conflicts + +If you encounter conflicts when updating submodules: +```bash +git submodule update --remote --merge +# Resolve conflicts in the submodule +cd +# Fix conflicts and commit +git add . +git commit -m "Resolve merge conflicts" +cd .. +git add +git commit -m "Update submodule with conflict resolution" +```