Skip to content

Commit

Permalink
Merge branch 'main' into feat/named-documents
Browse files Browse the repository at this point in the history
  • Loading branch information
BCsabaEngine committed Aug 13, 2024
2 parents 655adb5 + 2404192 commit eb984ae
Show file tree
Hide file tree
Showing 43 changed files with 744 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ dist

# dotenv environment variables file
.env

# generated c++ header file
*.h
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DS_Store
node_modules
dist
svelte
demo
.env
.env.*
!.env.example
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ void setup()
}
```
You can find a minimal buildable example platformio project in [demo/esp32](demo/esp32) folder.
The content of **generated file** (do not edit, just use)
```c
Expand Down
5 changes: 5 additions & 0 deletions demo/esp32/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
10 changes: 10 additions & 0 deletions demo/esp32/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
9 changes: 9 additions & 0 deletions demo/esp32/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Example platformio project

This folder contains a buildable minimalistic project. An example shows how to use the header file in a platformio project. It also works as a native Arduino project.

It can be built on both web servers with the following command (if platformio is installed).

```bash
~/.platformio/penv/bin/pio run -d ./demo/esp32
```
82 changes: 82 additions & 0 deletions demo/esp32/include/svelteesp32async.h

Large diffs are not rendered by default.

92 changes: 92 additions & 0 deletions demo/esp32/include/svelteesp32psychic.h

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions demo/esp32/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[env]
platform = espressif32
board = wemos_d1_mini32
framework = arduino

[env:async]
build_flags = -D ASYNC
lib_deps = https://github.com/me-no-dev/ESPAsyncWebServer

[env:psychic]
build_flags = -D PSYCHIC
lib_deps = hoeken/PsychicHttp
31 changes: 31 additions & 0 deletions demo/esp32/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#ifdef ASYNC
/* ESPAsyncWebServer example */

#include <ESPAsyncWebServer.h>
#include "svelteesp32async.h"

AsyncWebServer server(80);
void setup()
{
initSvelteStaticFiles(&server);
server.begin();
}
void loop() {}

#elif PSYCHIC
/* PsychicHttp example */

#include <PsychicHttp.h>
#include "svelteesp32psychic.h"

PsychicHttpServer server;
void setup()
{
server.listen(80);
initSvelteStaticFiles(&server);
}
void loop() {}

#else
#error Unknown platform
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default [
'**/node_modules',
'**/bin',
'**/dist',
'**/svelte',
'**/demo',
'**/.env',
'**/.env.*',
'!**/.env.example',
Expand Down
Loading

0 comments on commit eb984ae

Please sign in to comment.