|
1 | | -### Contribute to the Pi4Micronaut Library |
| 1 | +# Contribute to the Pi4Micronaut Library |
2 | 2 |
|
3 | | -## Get Familiar with the Library |
| 3 | +## General Contribution Guidelines |
4 | 4 |
|
5 | | - # Before making contributions,understand the purpose and functionality of the Pi4Micronaut library. |
| 5 | +### Get Familiar with the Library |
6 | 6 |
|
7 | | - # Review the library documentation, any related articles, or tutorials. |
| 7 | +* Before making contributions, understand the purpose and functionality of the Pi4Micronaut library. |
8 | 8 |
|
9 | | -## Set Up Your Development Environment |
| 9 | +* Review the library documentation, any related articles, or tutorials. |
10 | 10 |
|
11 | | - # Fork the library’s repository from the GitHub. |
| 11 | +Our documentation can be found online at [oss-slu.github.io/Pi4Micronaut](https://oss-slu.github.io/Pi4Micronaut/). Good information and tutorials on Raspberry Pis and electronic components can be found online from [Sunfounder](https://docs.sunfounder.com/en/latest/), [SparkFun](https://learn.sparkfun.com/), or others. |
12 | 12 |
|
13 | | - # Clone your fork locally. |
| 13 | +This file will go over some quick information about our library, but please refer to our documentation webpage for more complete information. |
14 | 14 |
|
15 | | - # Follow setup instructions provided in the repository’s README or ADOC files. |
| 15 | +### Set Up Your Development Environment |
16 | 16 |
|
17 | | -## Understand the Contribution Process |
| 17 | +* Fork the library’s repository from the GitHub. |
18 | 18 |
|
19 | | - # Familiarize yourself with the library’s contribution guidelines. |
| 19 | +* Clone your fork locally. |
20 | 20 |
|
21 | | - # Understand the community guidelines. |
| 21 | +* Follow setup instructions provided in the repository’s README or our online documentation. |
22 | 22 |
|
23 | | - # Find out the preferred method of communication (e.g., issues, mailing list, discord). |
| 23 | +### Understand the Contribution Process |
24 | 24 |
|
25 | | -## Identify a Way to Contribute |
| 25 | +* Familiarize yourself with the library’s contribution guidelines. |
26 | 26 |
|
27 | | - # Bug fixes: Look for open issues tagged as 'bug' or report new ones. |
| 27 | +* Understand the [community guidelines](community-guidelines.md). |
28 | 28 |
|
29 | | - # New features: Discuss new ideas before implementing, to gauge interest and get guidance. |
| 29 | +### Identify a Way to Contribute |
30 | 30 |
|
31 | | - # Documentation: Contribute to the README, ADOC or other documentation. |
| 31 | +* Bug fixes: Look for open issues tagged as 'bug' or report new ones. |
32 | 32 |
|
33 | | - # Testing: Improve or expand the test suite. |
| 33 | +* New features: Discuss new ideas before implementing, to gauge interest and get guidance. |
34 | 34 |
|
35 | | - # Refactoring: Optimize existing code or improve its readability. |
| 35 | +* Documentation: Contribute to the README, ADOC or other documentation. |
36 | 36 |
|
37 | | -## Making Changes |
| 37 | +* Testing: Improve or expand the test suite. |
38 | 38 |
|
39 | | - # Always create a new branch for your changes. |
| 39 | +* Refactoring: Optimize existing code or improve its readability. |
40 | 40 |
|
41 | | - # Follow the library’s coding style and standards. |
| 41 | +### Making Changes |
42 | 42 |
|
43 | | - # Write clean, well-documented code. |
| 43 | +* Always create a new branch for your changes. |
44 | 44 |
|
45 | | - # Add or update tests for your changes, if necessary. |
| 45 | +* Follow the library’s coding style and standards. |
46 | 46 |
|
47 | | - # Commit frequently with meaningful commit messages. |
| 47 | +* Write clean, well-documented code. |
48 | 48 |
|
49 | | -## Test Your Changes |
| 49 | +* Add or update tests for your changes, if necessary. |
50 | 50 |
|
51 | | - # Ensure that all tests pass. |
| 51 | +* Commit frequently with meaningful commit messages. |
52 | 52 |
|
53 | | - # Manually test your changes for unforeseen issues. |
| 53 | +### Test Your Changes |
54 | 54 |
|
55 | | - # Ensure your changes do not introduce regressions. |
| 55 | +* Ensure that all tests pass. |
56 | 56 |
|
57 | | - # Use your own hardware to test the new component integration. |
| 57 | +* Manually test your changes for unforeseen issues. |
58 | 58 |
|
59 | | - # Note: A test suite will be developed in future to test the components without the use of external hardware |
| 59 | +* Ensure your changes do not introduce regressions. |
60 | 60 |
|
61 | | -## Signing the Contributor License Agreement |
| 61 | +* Use your own hardware to test the new component integration. |
62 | 62 |
|
63 | | - # While creating a pull request, you’ll be prompted to sign a Contributor License Agreement. Please do so by logging in with your GitHub account. |
| 63 | +* Note: A test suite will be developed in future to test the components without the use of external hardware |
64 | 64 |
|
65 | | -## Submit a Pull Request (PR) |
| 65 | +### Signing the Contributor License Agreement |
66 | 66 |
|
67 | | - # Push your changes to your forked repository. Create a pull request from your branch to the main library’s main branch. |
| 67 | +* While creating a pull request, you’ll be prompted to sign a Contributor License Agreement. Please do so by logging in with your GitHub account. |
68 | 68 |
|
69 | | - # In the PR description, explain your changes, motivations, and any decisions made. |
| 69 | +### Submit a Pull Request (PR) |
70 | 70 |
|
71 | | - # Link to any related issues or discussions. |
| 71 | +* Push your changes to your forked repository. Create a pull request from your branch to the main library’s main branch. |
72 | 72 |
|
73 | | -## Respond to Feedback |
| 73 | +* In the PR description, explain your changes, motivations, and any decisions made. |
74 | 74 |
|
75 | | - # Maintainers or other contributors might provide feedback. Be open to suggestions and make necessary revisions. |
| 75 | +* Link to any related issues or discussions. |
76 | 76 |
|
77 | | - # Engage in a constructive dialogue to ensure the quality of the contribution. |
| 77 | +### Respond to Feedback |
78 | 78 |
|
79 | | -## Stay Updated |
| 79 | +* Maintainers or other contributors might provide feedback. Be open to suggestions and make necessary revisions. |
80 | 80 |
|
81 | | - # Keep your fork synchronized with the main repository to ease future contributions. |
| 81 | +* Engage in a constructive dialogue to ensure the quality of the contribution. |
82 | 82 |
|
83 | | - # Regularly check for updates or changes in the library’s contribution guidelines. |
| 83 | +### Stay Updated |
84 | 84 |
|
85 | | -## Engage with the Community |
| 85 | +* Keep your fork synchronized with the main repository to ease future contributions. |
86 | 86 |
|
87 | | - # Attend community meetings or join chat groups. |
| 87 | +* Regularly check for updates or changes in the library’s contribution guidelines. |
88 | 88 |
|
89 | | - # Help other contributors or users when you can. |
| 89 | +### Engage with the Community |
90 | 90 |
|
91 | | - # Note: While your contribution is highly valued, there’s no guarantee that all pull requests will be merged. It depends on the library’s direction, quality of the contribution, and decisions of the maintainers. |
| 91 | +* Learn more about Open Source with SLU on the [website](https://oss-slu.github.io/), and join the `#project_pi4micronaut` channel in [the OSS Slack community](https://join.slack.com/t/oswslu/shared_invite/zt-24f0qhjbo-NkSfQ4LOg5wXxBdxP4vzfA). |
92 | 92 |
|
93 | | -Thanks for considering a contribution to the Pi4Micronaut library! Your involvement helps make the project better for everyone. |
94 | | - |
95 | | - |
96 | | -### 3.1. How to Create a New Component |
| 93 | +* Help other contributors or users when you can. |
97 | 94 |
|
98 | | -If its compatible with a Raspberry Pi then it should work well with the Pi4Micronaut. The following steps should encompass how most components are added to the library. Start by creating a new Issue to suggest changes. |
| 95 | +* Note: While your contribution is highly valued, there’s no guarantee that all pull requests will be merged. It depends on the library’s direction, quality of the contribution, and decisions of the maintainers. |
99 | 96 |
|
100 | | -## Determine the communication type for the component which you want to use. For example, Buzzer works with PWM and LCD1602 works with I2C. |
101 | | - |
102 | | -## Setup the circuit. |
103 | | - |
104 | | -## Add Component to the Application yml |
| 97 | +Thanks for considering a contribution to the Pi4Micronaut library! Your involvement helps make the project better for everyone. |
105 | 98 |
|
106 | | - # The new component will need to be added to the application yml found at components/src/main/resources/application.yml. |
| 99 | +## How to Create a New Component |
107 | 100 |
|
108 | | - # More information on the application.yml found in Communicating with a Hardware Component |
| 101 | +If it's compatible with a Raspberry Pi, then it should work well with Pi4Micronaut. The following steps should encompass in brief how most components are added to the library; further details can be found on our documentation webpage. Start by creating a new issue to suggest changes. |
109 | 102 |
|
110 | | -## Create a Helper: |
| 103 | +### Create a Helper |
111 | 104 |
|
112 | | - # A Helper is what the Controller calls to do an action. For example, to change the color of an RGB LED the controller will take the request to change it. The Controller will then call the change color method in the helper. The helper then takes all the actions needed to change the color of the LED. |
| 105 | +A helper communicates directly with the hardware component. These classes form the core of our library, and they define methods for developers to import into and call in their controllers. For example, to change the color of an RGB LED, the controller will receive the API request to change it. The controller will then call the change color method in the helper. The helper then takes all the actions needed to change the color of the LED. |
113 | 106 |
|
114 | | - # See the RBG Helper for an example of a Helper. |
| 107 | +All helpers should be kept here: `pi4micronaut-utils/src/main/java/com/opensourcewithslu/(inputdevices or outputdevices)` |
115 | 108 |
|
116 | | - # All Helpers should be kept here: pi4micronaut-utils\src\main\java\com\opensourcewithslu\(inputdevices or outputdevices) |
| 109 | +### Add Component to the Application YAML |
117 | 110 |
|
118 | | -## Create a Controller: |
| 111 | +Developers using our library will create an `application.yml` file to define necessary configurations for the hardware they are using. To create a controller, the new component will need to be added to the application YAML file found at `components/src/main/resources/application.yml`. More information on the `application.yml` can be found in our online documentation. |
119 | 112 |
|
120 | | - # Controllers define and handle interactions with a given component. The Controller of a component will have a @Controller("/example") right above the class declaration that acts as the endpoint for requests to the component. Instead of "example", you should name the endpoint something that is identifiable to the component. Each method of the Controller should have a @Get("/exampleEndPoint") above the method declaration. The endpoint for the method should have the same name as the method and any parameters should be included in the endpoint /exampleEndPoint/{parameter1},{parameter2}. |
| 113 | +For this, you will need to know the communication type for the component. For example, Buzzer works with PWM and LCD1602 works with I2C. Online documentation for your component will be able to tell you what is best. You will also need an understanding of what the circuit will look like; online resources can similarly be useful here. |
121 | 114 |
|
122 | | - # See the RGB Controller for an example of a Controller. |
| 115 | +### Create a Controller |
123 | 116 |
|
124 | | - # Consult the Micronaut Documentation for more explanation on Controllers. |
| 117 | +A Controller is a special class type in the Micronaut framework, which developers will build to create APIs using our library. We build controllers in this repository as demonstrations for how to interface with our helper classes. These are kept in a separate top-level folder as the helpers, as the controllers are for demonstration purposes, whereas the helpers are the importable portion of our library. |
125 | 118 |
|
126 | | - # All Controllers should be kept here: components\src\main\java\com\opensourcewithslu\components\controllers |
| 119 | +The controller of a component will have `@Controller("/example")` right above the class declaration that acts as the endpoint for requests to the component. Instead of "example", you should name the endpoint something that is identifiable to the component. Each method of the controller should have `@Get("/exampleEndPoint")` above the method declaration. The endpoint for the method should have the same name as the method and any parameters should be included in the endpoint `/exampleEndPoint/{parameter1},{parameter2}`. |
127 | 120 |
|
128 | | -## Thoroughly test: |
| 121 | +All controllers should be kept here: `components/src/main/java/com/opensourcewithslu/components/controllers`. Consult the [Micronaut documentation](https://docs.micronaut.io/) for more explanation on controllers. |
129 | 122 |
|
130 | | - # Contributors should thoroughly test their integrations |
| 123 | +### Thoroughly test |
131 | 124 |
|
132 | | - # When submitting a pull request, make sure to include how you tested the component, any circuits that you may have used, and how to run any examples you may have created. |
| 125 | +Contributors should thoroughly test their integrations. Software unit tests should be written in `pi4micronaut-utils/src/test/java/com/opensourcewithslu/(inputdevices or outputdevices)`. |
133 | 126 |
|
134 | | - # It is important that reviewers are able to replicated your work in order to properly test the implementation. |
| 127 | +Hardware testing should also be done. When submitting a pull request, make sure to include how you tested the component, any circuits that you may have used, and how to run any examples you may have created. Instructions for how to conduct hardware testing, including how to send the files over to the Raspberry Pi device, are on our online documentation. |
135 | 128 |
|
136 | | -## Create documentation for the component: |
| 129 | +It is important that reviewers are able to replicate your work in order to properly test the implementation. |
137 | 130 |
|
138 | | - # Create an .adoc file with the component name as the file name. |
| 131 | +### Create documentation for the component |
139 | 132 |
|
140 | | - # Make sure to include all the information that the other components. Simply copy/paste an existing components documentation and edit as needed. |
| 133 | +We write documentation files for each component, which are compiled and hosted on our online documentation webpage. Create an .adoc file with the component name as the file name. Make sure to include all the information that the other components include. Simply copy/paste an existing component's documentation and edit as needed. Add the file here: `pi4micronaut-utils/src/docs/asciidoc/components/(inputComponents or outputComponents)`. |
141 | 134 |
|
142 | | - # Add the file here: pi4micronaut-utils/src/docs/asciidoc/components under either input or output components. |
| 135 | +Also ensure that the classes you have written have appropriate Javadoc comments. |
0 commit comments