You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/develop/development.md
+15-25Lines changed: 15 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,40 +7,41 @@
7
7
* Make changes
8
8
* Document your change
9
9
* 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!
11
12
12
13
## Create a branch
13
14
14
-
* Want to make changes: fork the repo (see installation)and submit pull requests, see [creating-a-pull-request-from-a-fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork):
15
+
* Want to make changes: fork the repo (see installation)and submit pull requests, see [creating-a-pull-request-from-a-fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork):
15
16
16
-
* Press Branches, press New Branch, give it a name e.g. background-script and press Create new Branch, click on background-script
17
+
* Only branch from the main branch! Press Branches, press New Branch, give it a name e.g. background-script and press Create new Branch, click on background-script
* interface/src/routes/moonbase for MoonBase and MoonLight (modules)
26
27
* see [Prepare for development](https://moonmodules.org/MoonLight/develop/installation/#prepare-for-development) about nodejs, npm install
27
28
28
-
```
29
+
```markdown
29
30
npm install
30
31
npm run dev
31
32
```
32
33
33
34
* see [Troubleshooting](https://moonmodules.org/MoonLight/develop/installation/#troubleshooting) about WWWData.h
34
35
35
-
### Back End (Server)
36
+
### Back-end (Server)
36
37
37
38
There are 3 levels to add functionality:
38
39
39
-
***Standard ESP32-Sveltekit code**, e.g. Connections, Wifi and System. MoonBase files is also made using standard sveltekit as example but contains a few components used in MoonLight modules. Might be rewriteen as MoonLight Module in the future.
40
-
* lib folder for Sveltekit backend
40
+
***Standard ESP32-Sveltekit code**, e.g. Connections, Wifi and System. MoonBase files are also made using standard SvelteKit as examples but contain a few components used in MoonLight modules. Might be rewritten as a MoonLight Module in the future.
41
+
* lib folder for Sveltekit back-end
41
42
* Read the [ESP32 Sveltekit docs](https://moonmodules.org/MoonLight/esp32sveltekit/)
42
43
*[MoonLight Modules](https://moonmodules.org/MoonLight/moonbase/modules/) e.g. Lights Control, Effects, Info, Channels. They are subclasses of Modules.h/cpp and implement setupDefinition, onUpdate and optional loop. New modules need to be defined in main.cpp and added to menu.svelte. All further UI is generated by Module.svelte.
43
-
* src folder for MoonBase and MoonLight backend
44
+
* src folder for MoonBase and MoonLight back-end
44
45
***MoonLight Nodes**: the easiest and recommended way. See Effects.h, Layouts.h, Modifiers.h and Drivers.h for examples. They match closest WLED usermods. Each node has controls, a setup and a loop and can be switched on and off. For specific purposes hasOnLayout() and hasModifier() can return true.
45
46
* src/MoonLight/nodes
46
47
@@ -49,7 +50,7 @@ There are 3 levels to add functionality:
49
50
* Go to the file(s) you want to change press edit and make the changes.
50
51
* ☑️ and ➡️ to build and or upload
51
52
* Changes made to the UI are not always visible in the browser, clear the browser cache to see latest UI (see [connect to MoonLight](https://moonmodules.org/MoonLight/gettingstarted/installation/#connect-moonlight)).
52
-
* MoonLight uses clang-format for c/c++ code and prettier for Svelte, javascript etc. Format your code before submitting! (rightclick Format Document on each page you change)
53
+
* MoonLight uses clang-format for c/c++ code and prettier for Svelte, javascript etc. Format your code before submitting! (right-click Format Document on each page you change)
53
54
* Press Commit Changes..., enter a commit message and an extended description, Press Commit Changes
54
55
55
56
## Document your changes
@@ -66,7 +67,7 @@ See [Documentation](https://moonmodules.org/MoonLight/develop/documentation/)
66
67
67
68
* The upstream MoonLight repo can now process this PR
68
69
69
-
## Addtional info
70
+
## Additional info
70
71
71
72
### Emoji coding
72
73
@@ -87,9 +88,9 @@ See [Documentation](https://moonmodules.org/MoonLight/develop/documentation/)
87
88
88
89
### UI development server
89
90
90
-
To ease the frontend development you can deploy the backend code on an ESP32 board and pass the websocket and REST API calls through the development server's proxy running on your computer.
91
+
To ease the front-end development you can deploy the back-end code on an ESP32 board and pass the websocket and REST API calls through the development server's proxy running on your computer.
91
92
92
-
This very much speeds up UI development as no flashing to ESP32 is required to test updated UI. Svaing an UI file is enough to see the results!!!
93
+
This very much speeds up UI development, as no flashing to the ESP32 is required to test updated UI. Saving a UI file is enough to see the results.
93
94
94
95
See [Setup Proxy for Development](https://moonmodules.org/MoonLight/gettingstarted/#setup-proxy-for-development) and [development-server](https://moonmodules.org/MoonLight/gettingstarted/#development-server) how to setup.
95
96
@@ -123,14 +124,3 @@ There are 3 files to consider when making a ESP32-device definition.
123
124
boards/BOARD_NAME.csv
124
125
boards/BOARD_NAME.JSON
125
126
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.
* The main branch will be checked out per default. To run / test latest developments, switch to the dev branch
41
+
* The main branch will be checked out per default. Latest development will be done in branches from main, merged back into main when done.
42
42
43
43
## Install and setup VSCode
44
44
@@ -110,7 +110,7 @@ Before changing code, test if the current download of MoonLight is running fine.
110
110
111
111
* If you are developing or updating existing MoonLight installations MoonLight might be outdated or not show up correctly in the browser or not even appear. Two reasons
112
112
113
-
* Sometimes the latest frontend code is not generated yet (WWWData.h). This is how to set it right:
113
+
* Sometimes the latest front-end code is not generated yet (WWWData.h). This is how to set it right:
114
114
* Open platformIO new terminal (>_)
115
115
* touch ./interface/src/app.html so the build process will be triggered to create a new WWWData.h
116
116
* build the project (✔) - if nodejs is not installed (yet) you will get errors. See troubleshooting
@@ -180,7 +180,7 @@ Before changing code, test if the current download of MoonLight is running fine.
180
180
181
181
### Install nodejs
182
182
183
-
nodejs is needed if changes on the frontend (UI) are made (interface folder). On each file change, ☑️ or ➡️ will rebuild the UI using nodejs.
183
+
nodejs is needed if changes on the front-end (UI) are made (interface folder). On each file change, ☑️ or ➡️ will rebuild the UI using nodejs.
184
184
185
185
* Windows: if nodejs is not on your system you will get this error:
0 commit comments