From 8fcaa3f415c4595354ff3910a251545f079359a6 Mon Sep 17 00:00:00 2001 From: BCsabaEngine Date: Tue, 13 Aug 2024 22:00:49 +0200 Subject: [PATCH] feat: example esp32 platformio project --- .prettierignore | 2 +- demo/esp32/.gitignore | 5 + demo/esp32/.vscode/extensions.json | 10 + demo/esp32/platformio.ini | 12 + demo/esp32/src/main.cpp | 31 ++ {svelte => demo/svelte}/.eslintignore | 0 {svelte => demo/svelte}/.eslintrc.cjs | 0 {svelte => demo/svelte}/.gitignore | 0 {svelte => demo/svelte}/.npmrc | 0 {svelte => demo/svelte}/.prettierignore | 0 {svelte => demo/svelte}/.prettierrc | 0 {svelte => demo/svelte}/.vscode/launch.json | 0 {svelte => demo/svelte}/.vscode/settings.json | 0 {svelte => demo/svelte}/README.md | 0 .../svelte}/dist/assets/index-B4xhKHXE.css | 0 .../svelte}/dist/assets/index-CvL0GDnk.js | 0 {svelte => demo/svelte}/dist/favicon.png | Bin {svelte => demo/svelte}/dist/index.html | 0 .../svelte}/dist/roboto_regular.json | 0 {svelte => demo/svelte}/index.html | 0 {svelte => demo/svelte}/package-lock.json | 0 {svelte => demo/svelte}/package.json | 0 {svelte => demo/svelte}/postcss.config.cjs | 0 {svelte => demo/svelte}/public/favicon.png | Bin .../svelte}/public/roboto_regular.json | 0 {svelte => demo/svelte}/src/App.svelte | 0 {svelte => demo/svelte}/src/app.d.ts | 0 {svelte => demo/svelte}/src/app.postcss | 0 {svelte => demo/svelte}/src/main.ts | 0 .../svelte}/src/vite-environment.d.ts | 0 {svelte => demo/svelte}/svelte.config.js | 0 {svelte => demo/svelte}/tailwind.config.cjs | 0 {svelte => demo/svelte}/tsconfig.json | 0 {svelte => demo/svelte}/tsconfig.node.json | 0 {svelte => demo/svelte}/vite.config.ts | 0 eslint.config.mjs | 2 +- package-lock.json | 492 ++++++++++++++++++ package.json | 11 +- 38 files changed, 559 insertions(+), 6 deletions(-) create mode 100644 demo/esp32/.gitignore create mode 100644 demo/esp32/.vscode/extensions.json create mode 100644 demo/esp32/platformio.ini create mode 100644 demo/esp32/src/main.cpp rename {svelte => demo/svelte}/.eslintignore (100%) rename {svelte => demo/svelte}/.eslintrc.cjs (100%) rename {svelte => demo/svelte}/.gitignore (100%) rename {svelte => demo/svelte}/.npmrc (100%) rename {svelte => demo/svelte}/.prettierignore (100%) rename {svelte => demo/svelte}/.prettierrc (100%) rename {svelte => demo/svelte}/.vscode/launch.json (100%) rename {svelte => demo/svelte}/.vscode/settings.json (100%) rename {svelte => demo/svelte}/README.md (100%) rename {svelte => demo/svelte}/dist/assets/index-B4xhKHXE.css (100%) rename {svelte => demo/svelte}/dist/assets/index-CvL0GDnk.js (100%) rename {svelte => demo/svelte}/dist/favicon.png (100%) rename {svelte => demo/svelte}/dist/index.html (100%) rename {svelte => demo/svelte}/dist/roboto_regular.json (100%) rename {svelte => demo/svelte}/index.html (100%) rename {svelte => demo/svelte}/package-lock.json (100%) rename {svelte => demo/svelte}/package.json (100%) rename {svelte => demo/svelte}/postcss.config.cjs (100%) rename {svelte => demo/svelte}/public/favicon.png (100%) rename {svelte => demo/svelte}/public/roboto_regular.json (100%) rename {svelte => demo/svelte}/src/App.svelte (100%) rename {svelte => demo/svelte}/src/app.d.ts (100%) rename {svelte => demo/svelte}/src/app.postcss (100%) rename {svelte => demo/svelte}/src/main.ts (100%) rename {svelte => demo/svelte}/src/vite-environment.d.ts (100%) rename {svelte => demo/svelte}/svelte.config.js (100%) rename {svelte => demo/svelte}/tailwind.config.cjs (100%) rename {svelte => demo/svelte}/tsconfig.json (100%) rename {svelte => demo/svelte}/tsconfig.node.json (100%) rename {svelte => demo/svelte}/vite.config.ts (100%) diff --git a/.prettierignore b/.prettierignore index 4486884..cf00567 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,7 +1,7 @@ .DS_Store node_modules dist -svelte +demo .env .env.* !.env.example diff --git a/demo/esp32/.gitignore b/demo/esp32/.gitignore new file mode 100644 index 0000000..89cc49c --- /dev/null +++ b/demo/esp32/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/demo/esp32/.vscode/extensions.json b/demo/esp32/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/demo/esp32/.vscode/extensions.json @@ -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" + ] +} diff --git a/demo/esp32/platformio.ini b/demo/esp32/platformio.ini new file mode 100644 index 0000000..d69e5c8 --- /dev/null +++ b/demo/esp32/platformio.ini @@ -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 diff --git a/demo/esp32/src/main.cpp b/demo/esp32/src/main.cpp new file mode 100644 index 0000000..5275c9b --- /dev/null +++ b/demo/esp32/src/main.cpp @@ -0,0 +1,31 @@ +#ifdef ASYNC +/* ESPAsyncWebServer example */ + +#include +#include "svelteesp32async.h" + +AsyncWebServer server(80); +void setup() +{ + initSvelteStaticFiles(&server); + server.begin(); +} +void loop() {} + +#elif PSYCHIC +/* PsychicHttp example */ + +#include +#include "svelteesp32psychic.h" + +PsychicHttpServer server; +void setup() +{ + server.listen(80); + initSvelteStaticFiles(&server); +} +void loop() {} + +#else +#error Unknown platform +#endif \ No newline at end of file diff --git a/svelte/.eslintignore b/demo/svelte/.eslintignore similarity index 100% rename from svelte/.eslintignore rename to demo/svelte/.eslintignore diff --git a/svelte/.eslintrc.cjs b/demo/svelte/.eslintrc.cjs similarity index 100% rename from svelte/.eslintrc.cjs rename to demo/svelte/.eslintrc.cjs diff --git a/svelte/.gitignore b/demo/svelte/.gitignore similarity index 100% rename from svelte/.gitignore rename to demo/svelte/.gitignore diff --git a/svelte/.npmrc b/demo/svelte/.npmrc similarity index 100% rename from svelte/.npmrc rename to demo/svelte/.npmrc diff --git a/svelte/.prettierignore b/demo/svelte/.prettierignore similarity index 100% rename from svelte/.prettierignore rename to demo/svelte/.prettierignore diff --git a/svelte/.prettierrc b/demo/svelte/.prettierrc similarity index 100% rename from svelte/.prettierrc rename to demo/svelte/.prettierrc diff --git a/svelte/.vscode/launch.json b/demo/svelte/.vscode/launch.json similarity index 100% rename from svelte/.vscode/launch.json rename to demo/svelte/.vscode/launch.json diff --git a/svelte/.vscode/settings.json b/demo/svelte/.vscode/settings.json similarity index 100% rename from svelte/.vscode/settings.json rename to demo/svelte/.vscode/settings.json diff --git a/svelte/README.md b/demo/svelte/README.md similarity index 100% rename from svelte/README.md rename to demo/svelte/README.md diff --git a/svelte/dist/assets/index-B4xhKHXE.css b/demo/svelte/dist/assets/index-B4xhKHXE.css similarity index 100% rename from svelte/dist/assets/index-B4xhKHXE.css rename to demo/svelte/dist/assets/index-B4xhKHXE.css diff --git a/svelte/dist/assets/index-CvL0GDnk.js b/demo/svelte/dist/assets/index-CvL0GDnk.js similarity index 100% rename from svelte/dist/assets/index-CvL0GDnk.js rename to demo/svelte/dist/assets/index-CvL0GDnk.js diff --git a/svelte/dist/favicon.png b/demo/svelte/dist/favicon.png similarity index 100% rename from svelte/dist/favicon.png rename to demo/svelte/dist/favicon.png diff --git a/svelte/dist/index.html b/demo/svelte/dist/index.html similarity index 100% rename from svelte/dist/index.html rename to demo/svelte/dist/index.html diff --git a/svelte/dist/roboto_regular.json b/demo/svelte/dist/roboto_regular.json similarity index 100% rename from svelte/dist/roboto_regular.json rename to demo/svelte/dist/roboto_regular.json diff --git a/svelte/index.html b/demo/svelte/index.html similarity index 100% rename from svelte/index.html rename to demo/svelte/index.html diff --git a/svelte/package-lock.json b/demo/svelte/package-lock.json similarity index 100% rename from svelte/package-lock.json rename to demo/svelte/package-lock.json diff --git a/svelte/package.json b/demo/svelte/package.json similarity index 100% rename from svelte/package.json rename to demo/svelte/package.json diff --git a/svelte/postcss.config.cjs b/demo/svelte/postcss.config.cjs similarity index 100% rename from svelte/postcss.config.cjs rename to demo/svelte/postcss.config.cjs diff --git a/svelte/public/favicon.png b/demo/svelte/public/favicon.png similarity index 100% rename from svelte/public/favicon.png rename to demo/svelte/public/favicon.png diff --git a/svelte/public/roboto_regular.json b/demo/svelte/public/roboto_regular.json similarity index 100% rename from svelte/public/roboto_regular.json rename to demo/svelte/public/roboto_regular.json diff --git a/svelte/src/App.svelte b/demo/svelte/src/App.svelte similarity index 100% rename from svelte/src/App.svelte rename to demo/svelte/src/App.svelte diff --git a/svelte/src/app.d.ts b/demo/svelte/src/app.d.ts similarity index 100% rename from svelte/src/app.d.ts rename to demo/svelte/src/app.d.ts diff --git a/svelte/src/app.postcss b/demo/svelte/src/app.postcss similarity index 100% rename from svelte/src/app.postcss rename to demo/svelte/src/app.postcss diff --git a/svelte/src/main.ts b/demo/svelte/src/main.ts similarity index 100% rename from svelte/src/main.ts rename to demo/svelte/src/main.ts diff --git a/svelte/src/vite-environment.d.ts b/demo/svelte/src/vite-environment.d.ts similarity index 100% rename from svelte/src/vite-environment.d.ts rename to demo/svelte/src/vite-environment.d.ts diff --git a/svelte/svelte.config.js b/demo/svelte/svelte.config.js similarity index 100% rename from svelte/svelte.config.js rename to demo/svelte/svelte.config.js diff --git a/svelte/tailwind.config.cjs b/demo/svelte/tailwind.config.cjs similarity index 100% rename from svelte/tailwind.config.cjs rename to demo/svelte/tailwind.config.cjs diff --git a/svelte/tsconfig.json b/demo/svelte/tsconfig.json similarity index 100% rename from svelte/tsconfig.json rename to demo/svelte/tsconfig.json diff --git a/svelte/tsconfig.node.json b/demo/svelte/tsconfig.node.json similarity index 100% rename from svelte/tsconfig.node.json rename to demo/svelte/tsconfig.node.json diff --git a/svelte/vite.config.ts b/demo/svelte/vite.config.ts similarity index 100% rename from svelte/vite.config.ts rename to demo/svelte/vite.config.ts diff --git a/eslint.config.mjs b/eslint.config.mjs index e138d85..9105ca7 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -24,7 +24,7 @@ export default [ '**/node_modules', '**/bin', '**/dist', - '**/svelte', + '**/demo', '**/.env', '**/.env.*', '!**/.env.example', diff --git a/package-lock.json b/package-lock.json index bd21ef8..73c4e2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "nodemon": "^3.1.4", "prettier": "^3.3.3", "ts-node": "^10.9.2", + "tsx": "^4.17.0", "typescript": "^5.5.4" }, "engines": { @@ -167,6 +168,414 @@ "node": ">=12" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", + "integrity": "sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.0.tgz", + "integrity": "sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.0.tgz", + "integrity": "sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.0.tgz", + "integrity": "sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.0.tgz", + "integrity": "sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.0.tgz", + "integrity": "sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.0.tgz", + "integrity": "sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.0.tgz", + "integrity": "sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.0.tgz", + "integrity": "sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.0.tgz", + "integrity": "sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.0.tgz", + "integrity": "sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.0.tgz", + "integrity": "sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.0.tgz", + "integrity": "sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.0.tgz", + "integrity": "sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.0.tgz", + "integrity": "sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.0.tgz", + "integrity": "sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.0.tgz", + "integrity": "sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.0.tgz", + "integrity": "sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.0.tgz", + "integrity": "sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.0.tgz", + "integrity": "sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.0.tgz", + "integrity": "sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.0.tgz", + "integrity": "sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.0.tgz", + "integrity": "sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz", + "integrity": "sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -1290,6 +1699,46 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/esbuild": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz", + "integrity": "sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.0", + "@esbuild/android-arm": "0.23.0", + "@esbuild/android-arm64": "0.23.0", + "@esbuild/android-x64": "0.23.0", + "@esbuild/darwin-arm64": "0.23.0", + "@esbuild/darwin-x64": "0.23.0", + "@esbuild/freebsd-arm64": "0.23.0", + "@esbuild/freebsd-x64": "0.23.0", + "@esbuild/linux-arm": "0.23.0", + "@esbuild/linux-arm64": "0.23.0", + "@esbuild/linux-ia32": "0.23.0", + "@esbuild/linux-loong64": "0.23.0", + "@esbuild/linux-mips64el": "0.23.0", + "@esbuild/linux-ppc64": "0.23.0", + "@esbuild/linux-riscv64": "0.23.0", + "@esbuild/linux-s390x": "0.23.0", + "@esbuild/linux-x64": "0.23.0", + "@esbuild/netbsd-x64": "0.23.0", + "@esbuild/openbsd-arm64": "0.23.0", + "@esbuild/openbsd-x64": "0.23.0", + "@esbuild/sunos-x64": "0.23.0", + "@esbuild/win32-arm64": "0.23.0", + "@esbuild/win32-ia32": "0.23.0", + "@esbuild/win32-x64": "0.23.0" + } + }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", @@ -1757,6 +2206,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.6.tgz", + "integrity": "sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", @@ -2869,6 +3331,16 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -3300,6 +3772,26 @@ } } }, + "node_modules/tsx": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.17.0.tgz", + "integrity": "sha512-eN4mnDA5UMKDt4YZixo9tBioibaMBpoxBkD+rIPAjVmYERSG0/dWEY1CEFuV89CgASlKL499q8AhmkMnnjtOJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.23.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 7ee15b8..4d87122 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,12 @@ }, "homepage": "https://github.com/BCsabaEngine/svelteesp32", "scripts": { - "dev:psychic": "nodemon src/index.ts -- -e psychic -s ./svelte/dist -o ../../../Arduino/SvelteEsp32/svelteesp32.h --etag", - "dev:psychic:local": "nodemon src/index.ts -- -e psychic -s ./svelte/dist -o ./svelteesp32.h --etag", - "dev:async": "nodemon src/index.ts -- -e async -s ./svelte/dist -o ../../../Arduino/SvelteEsp8266/svelteesp32.h --etag", - "dev:async:local": "nodemon src/index.ts -- -e async -s ./svelte/dist -o ./svelteesp32.h --etag", + "dev:async": "nodemon src/index.ts -- -e async -s ./demo/svelte/dist -o ./demo/esp32/include/svelteesp32async.h --etag", + "dev:psychic": "nodemon src/index.ts -- -e psychic -s ./demo/svelte/dist -o ./demo/esp32/include/svelteesp32psychic.h --etag", + "run:async": "tsx src/index.ts -e async -s ./demo/svelte/dist -o ./demo/esp32/include/svelteesp32async.h --etag", + "run:psychic": "tsx src/index.ts -e psychic -s ./demo/svelte/dist -o ./demo/esp32/include/svelteesp32psychic.h --etag", + "run:all": "npm run run:async && npm run run:psychic", + "run:all:build": "npm run run:all && ~/.platformio/penv/bin/pio run -d ./demo/esp32", "clean": "tsc --build --clean", "build": "tsc --build --clean && tsc --build --force", "format:check": "prettier --check .", @@ -63,6 +65,7 @@ "nodemon": "^3.1.4", "prettier": "^3.3.3", "ts-node": "^10.9.2", + "tsx": "^4.17.0", "typescript": "^5.5.4" }, "dependencies": {