diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..e6143e729 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,228 @@ +Welcome to Stream’s Flutter repository! Thank you for taking the time to contribute to our codebase. 🎉. + +This document outlines a set of guidelines for contributing to Stream and our packages. These are mostly guidelines, not necessarily a fixed set of rules. Please use your best judgment and feel free to propose changes to this document in a pull request. + +--- + +# If I have a question, do I need to read this guide? 💬 + +Probably not. Most questions can be answered by looking at our Frequently Asked Questions (FAQ) or Flutter Cookbook. + +If you are still having doubts around a specific API, please create an issue on your repository with the label "Question". Community members or team members would be happy to assist. + +In cases where developers suspect the issue may be a defect or bug, please use one of our pre-made templates to file an issue. Be sure to include as many details as possible to help our team reproduce the error. A good bug report should have clear and consistent instructions for reproducing, screenshots or videos of the bug if applicable, and information on your environment setup and Flutter version. + +You can include the output of `flutter doctor --verbose` when filing an issue. + +🔗: [https://github.com/GetStream/stream-chat-flutter/issue](https://github.com/GetStream/stream-chat-flutter/issues) + +--- + +# What should I know before diving into code? 🤔 + +Stream's Flutter code is kept in a single mono-repository consisting of multiple packages. Source code for each package can be found under the top-level `/packages` directory. + +![https://s3.us-west-2.amazonaws.com/secure.notion-static.com/b1a202d3-44c8-4d1a-a5c3-583e7a3c4106/Screen_Shot_2021-03-31_at_4.13.52_PM.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAT73L2G45O3KS52Y5%2F20210423%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210423T075243Z&X-Amz-Expires=86400&X-Amz-Signature=0582138dc957b784d4d505f6591cd3566cede2137fdf48ac546768822f344cab&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Screen_Shot_2021-03-31_at_4.13.52_PM.png%22](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/b1a202d3-44c8-4d1a-a5c3-583e7a3c4106/Screen_Shot_2021-03-31_at_4.13.52_PM.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAT73L2G45O3KS52Y5%2F20210423%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210423T075243Z&X-Amz-Expires=86400&X-Amz-Signature=0582138dc957b784d4d505f6591cd3566cede2137fdf48ac546768822f344cab&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Screen_Shot_2021-03-31_at_4.13.52_PM.png%22) + +### Project Structure 🧱 + +`.github` - GitHub files including issue templates, pull request templates, and Github Action scripts. + +`images` - Static images used in our README and elsewhere. + +`package` - Directory containing Stream's Flutter source code. Each sub-directory represents a Flutter (or Dart) project. + +`.gitignore` - Listing of files and file extensions ignored for this project. + +`CODE_OF_CONDUCT` - Our values, approach to writing code, and expectations for Stream developers and contributors. + +`LICENSE` - Legal. Feast your eyes on the fine print. + +`README` - Project overview. + +`melos.yaml` - Configuration file used to control [Melos](https://pub.dev/packages/melos), our mono-repo management tool of choice. + +### Current Stream Packages + +`stream_chat` - Stream Chat is a low-level wrapper around Stream's REST API and web sockets. It contains minimal external dependencies and does not rely on Flutter. It is possible to use this package on most platforms supported by Dart. + +`stream_chat_flutter_core` - This package provides business logic to fetch common things required to integrate Stream Chat into your application. The core package allows more customization, providing business logic but no UI components. + +`stream_chat_flutter` - This library includes both a low-level chat SDK and a set of reusable and customizable UI components. + +`stream_chat_persistence` - This package provides a persistence client for fetching and saving chat data locally. Stream Chat Persistence uses Moor as a disk cache. + +### Local Setup + +Congratulations! 🎉. You've successfully cloned our repo, and you are ready to make your first contribution. Before you can start making code changes, there are a few things to configure. + +**Melos Setup** + +Stream uses `melos` to manage our mono-repository. For those unfamiliar, Melos is used to split up large code bases into separate independently versioned packages. To install melos, developers can run the following command: + +```bash +pub global activate melos +``` + +Once activated, users can now "bootstrap" their local clone by running the following: + +```bash +melos bootstrap +``` + +Bootstrap will automatically fetch and link dependencies for all packages in the repo. It is the melos equivalent of running `flutter pub get`. + +Bonus Tip: Did you know it is possible to define and run custom scripts using Melos? Our team uses custom scripts for all sorts of actions like testing, lints, and more. + +To run a script, use `melos run