Skip to content

Commit 4d44b48

Browse files
committed
A number of small changes
Docs ==== - Add Standards and Guidelines Back end ======== - Move Char out of Utilities to separate file - Artnet in: use channelsPerLight
1 parent 35c0dbf commit 4d44b48

File tree

13 files changed

+13035
-12935
lines changed

13 files changed

+13035
-12935
lines changed

docs/develop/development.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
* Make changes
88
* Document your change
99
* Submit a pull request
10-
* Develop principles: Checklist before submitting a request.
10+
11+
[Standards and Guidelines](https://moonmodules.org/MoonLight/develop/standardsguidelines/). Check before submitting a request!
1112

1213
## Create a branch
1314

@@ -123,14 +124,3 @@ There are 3 files to consider when making a ESP32-device definition.
123124
boards/BOARD_NAME.csv
124125
boards/BOARD_NAME.JSON
125126
firmware/BOARD_TYPE_NAME.ini (e.g. esp32dev, esp32-s3), contains different boards
126-
127-
## Develop principles
128-
129-
* One firmware per board containing everything, to keep management of firmware simple - for everybody. 3MB flash space to allow for this.
130-
* Clang-format and Prettier for unified layout of code (right click format document in VSCode)
131-
* Part of submitting a change via a pull request is updated documentation. Functionality and documentation should be in one Pull Request
132-
* Make minimal changes in upstream (Sveltekit) code, as we need to stay in sync as easy as possible. Add // 🌙 to show a change has been made.
133-
* The main branch is the source to branch and merge to, no direct code commits to the main branch. As the main branch docs folder is the source for the website, doc changes can be made directly to main.
134-
* The dev branch is used for latest updates between releases. Optionally branch from dev if latest updates are needed for a change.
135-
* The src folder is for all MoonBase and MoonLight Nodes and Modules development. No need for UI changes as that is generated for Nodes and Modules. The lib folder is for upstream (Sveltekit). The interface folder is for UI, mainly Sveltekit and Modules and Nodes generic functions.
136-
* A pull request should contain compilable code and tested to not crash the system at minimal and support also boards without PSRAM, e.g. ESP32-D0. Code may be work in progress.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
# Standards and Guidelines
3+
4+
## Develop principles
5+
6+
* One firmware per board containing everything, to keep management of firmware simple - for everybody. 3MB flash space to allow for this.
7+
* Part of submitting a change via a pull request is updated documentation. Functionality and documentation should be in one Pull Request
8+
* Make minimal changes in upstream (Sveltekit) code, as we need to stay in sync as easy as possible. Add // 🌙 to show a change has been made.
9+
* The main branch is the source to branch and merge to, no direct code commits to the main branch. As the main branch docs folder is the source for the website, doc changes can be made directly to main.
10+
* The dev branch is used for latest updates between releases. Optionally branch from dev if latest updates are needed for a change.
11+
* The src folder is for all MoonBase and MoonLight Nodes and Modules development. No need for UI changes as that is generated for Nodes and Modules. The lib folder is for upstream (Sveltekit). The interface folder is for UI, mainly Sveltekit and Modules and Nodes generic functions.
12+
* A pull request should contain compilable code and tested to not crash the system at minimal and support also boards without PSRAM, e.g. ESP32-D0. Code may be work in progress.
13+
14+
## Describe your PR
15+
16+
Please add a description of your proposed code changes. It does not need to be an exhaustive essay, however a PR with no description or just a few words might not get accepted, simply because very basic information is missing.
17+
18+
A good description helps us to review and understand your proposed changes. For example, you could say a few words about
19+
* what you try to achieve (new feature, fixing a bug, refactoring, security enhancements, etc.)
20+
* how your code works (short technical summary - focus on important aspects that might not be obvious when reading the code)
21+
* testing you performed, known limitations, open ends you possibly could not solve.
22+
* any areas where you like to get help from an experienced maintainer
23+
24+
## Your Pull Request (PR)
25+
26+
### Target branch for pull requests
27+
28+
Please make all PRs against the `main` branch.
29+
30+
### Updating your code
31+
32+
While the PR is open - and under review by maintainers - you may be asked to modify your PR source code.
33+
You can simply update your own branch, and push changes in response to reviewer recommendations.
34+
Github will pick up the changes so your PR stays up-to-date.
35+
36+
> [!CAUTION]
37+
> Do not use "force-push" while your PR is open!
38+
> It has many subtle and unexpected consequences on our github reposistory.
39+
> For example, we regularly lost review comments when the PR author force-pushes code changes. So, pretty please, do not force-push.
40+
41+
You can find a collection of very useful tips and tricks here: https://github.com/wled-dev/WLED/wiki/How-to-properly-submit-a-PR
42+
43+
44+
## Source Code from an AI agent or bot
45+
> [!IMPORTANT]
46+
> Its OK if you took help from an AI for writing your source code.
47+
>
48+
> However, we expect a few things from you as the person making a contribution to MoonLight:
49+
* Make sure you really understand the code suggested by the AI, and don't just accept it because it "seems to work".
50+
* Don't let the AI change existing code without double-checking by you as the contributor. Often, the result will not be complete. For example, previous source code comments may be lost.
51+
* Remember that AI are still "Often-Wrong" ;-)
52+
* If you don't feel very confident using English, you can use AI for translating code comments and descriptions into English. AI bots are very good at understanding language. However, always check if the results is correct. The translation might still have wrong technical terms, or errors in some details.
53+
54+
### best practice with AI:
55+
* As the person who contributes source code to MoonLight, make sure you understand exactly what the AI generated code does
56+
* best practice: add a comment like ``'// below section of my code was generated by an AI``, when larger parts of your source code were not written by you personally.
57+
* always review translations and code comments for correctness
58+
* always review AI generated source code
59+
* If the AI has rewritten existing code, check that the change is necessary and that nothing has been lost or broken. Also check that previous code comments are still intact.
60+
61+
## Code style
62+
63+
### Code
64+
65+
We use Clang-format for c-files (see .clang-format in the repo for the definition) and Prettier for front end files.
66+
67+
Right click Format Document on each file you edit before committing.
68+
69+
### Comments
70+
71+
Comments are used for technical documentation, always document your changes, each function must have a comment describing what it does, including its arguments. Comments are also formatted using Clang-format and Prettier.
72+
(Functional documentation must be done on the MoonLight website, see above)
73+
74+
Examples:
75+
```
76+
// This is a comment.
77+
78+
/* This is a CSS inline comment */
79+
80+
/*
81+
* This is a comment
82+
* wrapping over multiple lines,
83+
* used in MoonLight for file headers and function explanations
84+
*/
85+
86+
<!-- This is an HTML comment -->
87+
```
88+
89+
There is no set character limit for a comment within a line, though as a rule of thumb you should wrap your comment if it exceeds the width of your editor window.
90+
91+
Inline comments are OK if they describe that line only and are not exceedingly wide.
92+
93+
(modified version from WLED-MM, 🙏 to @softhack007)

interface/src/routes/moonbase/monitor/Monitor.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
// let offsetRed:number;
5858
// let offsetGreen:number;
5959
// let offsetBlue:number;
60-
// let offsetWhite:number;
6160
6261
const handleHeader = (header: Uint8Array) => {
6362
console.log('Monitor.handleHeader', header);

0 commit comments

Comments
 (0)