BCsabaEngine / svelteesp32

Convert Svelte (or React/Angular/Vue) JS application to serve it from ESP32/ESP8266 webserver
43 stars 6 forks source link

Question : how to set up an environment? #6

Closed playmiel closed 7 months ago

playmiel commented 7 months ago

I'd like to know how to configure your svelte environment because I can't export my site with the command npx svelteesp32 -e psychic -s C: \Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\svelte_esp_web\build -o C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\src\svelteesp32. h --etag

BCsabaEngine commented 7 months ago

I think there is a faulty space after -s C: Please remove space and try again

Same problem after svelteesp32. and before h extension.

BCsabaEngine commented 7 months ago

If you install svelteesp32 into your svelte app, just easy to run npx svelteesp32 -s build -o...

playmiel commented 7 months ago

Capture d’écran 2024-02-22 163823 still nothing, I changed my folders and the command: npx svelteesp32 -e psychic -s dist -o 'C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\src\svelteesp32.h' --etag and even with this command: npx svelteesp32 -s 'C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\svelte\dist' -o 'C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\src\svelteesp32.h' --etag it doesn't work in output I just have this

//engine: PsychicHttpServer
//cmdline: -e psychic -s dist -o C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\src\svelteesp32.h --etag
//created: 02/22/2024 16:10:58
//files: 0
//memory: 0

void initSvelteStaticFiles(PsychicHttpServer * server) {
}
BCsabaEngine commented 7 months ago

So the command is ok, file generated but empty. I will try under windows (now I try linux and mac) soon.

BCsabaEngine commented 7 months ago

v1.2.1 available, please try it with same command line. After you try I need a feedback about URLs in the generated header file, these must to be linux path instead of windows path too.

playmiel commented 7 months ago

Thanks

Le jeu. 22 févr. 2024, 19:21, Csaba Balázs @.***> a écrit :

So the command is ok, file generated but empty. I will try under windows (not I try linux and mac) soon.

— Reply to this email directly, view it on GitHub https://github.com/BCsabaEngine/svelteesp32/issues/6#issuecomment-1960013032, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQTNISY24RXRA2FNCBTNXP3YU6ECBAVCNFSM6AAAAABDUZ5OVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGAYTGMBTGI . You are receiving this because you authored the thread.Message ID: @.***>

BCsabaEngine commented 7 months ago

Need a success/failed feedback to close issue. Please give one!

playmiel commented 7 months ago

now it works

npx svelteesp32 -e psychic -s 'C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\svelte\dist' -o 'C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\src\svelteesp32.h' --etag --espmethod 'initSvelteStaticFile'
[SvelteESP32] Generate code for psychic engine
[assets\index-TXZ7TbJQ.css]
✓ gzip used (32273 -> 5335)

[assets\index-sy3ElxBr.js]
✓ gzip used (38850 -> 12547)

[favicon.png]
x gzip unused (33249 -> 33282)

[index.html]
✓ gzip used (472 -> 309)

[roboto_regular.json]
✓ gzip used (363757 -> 93567)

5 files, 458kB original size, 142kB gzip size

I have this as a log file

//engine:   PsychicHttpServer
//cmdline:  -e psychic -s C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\svelte\dist -o C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\src\svelteesp32.h --etag --espmethod initSvelteStaticFile
//created:  23/02/2024 10:11:02
//files:    5
//memory:   145007
playmiel commented 7 months ago

however, I noticed that it doesn't add headers to .h files like

#include <Arduino.h>
#include <PsychicHttp.h>
#include <PsychicHttpsServer.h>
BCsabaEngine commented 7 months ago

It could be an improvement, but the header file should not be compiled alone. It will be included in a project. Next version will solve it, I think.

Is the project compilable? Can you use the generated code?

playmiel commented 7 months ago

yes I can use the generated code everything works fine I just had to add the headers

BCsabaEngine commented 7 months ago

yes I can use the generated code everything works fine I just had to add the headers

https://github.com/BCsabaEngine/svelteesp32/issues/7

BCsabaEngine commented 7 months ago

v1.2.1 available

playmiel commented 7 months ago

Thanks I will try Tuesday on my windows to see if everything works well

playmiel commented 7 months ago

Hello, I can confirm that it works well with this command: npx svelteesp32 -e psychic -s 'C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\svelte\dist' -o 'C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\src\svelteesp32.h' --etag --espmethod 'initSvelteStaticFile'

I have this as output:

//engine : PsychicHttpServer
//cmdline : -e psychic -s C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\svelte\dist -o C:\Users\Geko\Documents\PlatformIO\Projects\scenario_esp32_test\src\svelteesp32.h --etag --espmethod initSvelteStaticFile
//Created : 02/27/2024 17:16:36
//files : 5
//Memory: 145007

#include <Arduino.h>
#include <PsychicHttp.h>
#include <PsychicHttpsServer.h>
...
BCsabaEngine commented 7 months ago

Thank you very much foe your response.