Skip to content

Commit bfb8fd3

Browse files
committed
Merge remote-tracking branch 'theelims/main' into DaisyUI5andTailwind4upgrade
1 parent a8f61b9 commit bfb8fd3

36 files changed

+700
-2374
lines changed

CHANGELOG.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## Upcoming [Main] - tbd
5+
## Upcoming [0.6.0] - tbd
66

77
> [!CAUTION]
88
> This update has breaking changes!
@@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
1313
- Added compatibility with ESP32-C6
1414
- Added getIP() function to WiFiSettingsService.
1515
- Added Arduino Log Colors
16+
- Added linker optimization `-O3`, saving a few kb flash memory.
1617
- Possibility to add a loop callback to ESP32-Sveltekit to leverage its loop threat. Meant to include custom services so no separate task is needed for them.
1718
- Change wake-up pin in SleepService during runtime. It is also possible to use the internal pull-up or pull-down resistors now.
1819
- Get current connection status from ESP32-SvelteKit. Useful for status LED or displays.
@@ -41,9 +42,9 @@ All notable changes to this project will be documented in this file.
4142
- MQTT library updated
4243
- Analytics task was refactored into a loop() function which is called by the ESP32-sveltekit main task.
4344
- Updated PsychicHttp to v1.2.1 incl. patches.
44-
- Updated DaisyUI
45+
- Updated to DaisyUI 5 and Tailwind CSS 4
4546
- Updated Svelte 5 --> see [Svelte 5 Migration Guide](https://svelte.dev/docs/svelte/v5-migration-guide)
46-
- Changed platform to [PIO Arduino](https://github.com/pioarduino/platform-espressif32)
47+
- Changed platform to [PIO Arduino](https://github.com/pioarduino/platform-espressif32) using Arduino 3 Core. Also upgrades ESP-IDF to v5.
4748
- ESPD_LOGx: replace first argument with TAG and define TAG as 🐼 [#85](https://github.com/theelims/ESP32-sveltekit/pull/85)
4849
- Replace rtc_get_reset_reason(0) with esp_reset_reason() [#86](https://github.com/theelims/ESP32-sveltekit/pull/86)
4950

@@ -63,6 +64,8 @@ All notable changes to this project will be documented in this file.
6364

6465
#### PIO Arduino & ESP-IDF 5
6566

67+
The firmware is based on the community maintained fork [PIO Arduino](https://github.com/pioarduino/platform-espressif32) of Arduino 3 for ESP32. Which is based on ESP-IDF 5. Please make sure all your dependencies and application code is compatible with ESP-IDF 5.
68+
6669
#### Frontend
6770

6871
SvelteKit was updated to v2 and Svelte to v5. Please check the migration guides for [SvelteKit 2](https://svelte.dev/docs/kit/migrating-to-sveltekit-2) and the [Svelte 5 Migration Guide](https://svelte.dev/docs/svelte/v5-migration-guide) for the changes required on your frontend code.
@@ -74,6 +77,16 @@ npm install --force
7477
npx sv migrate svelte-5
7578
```
7679

80+
Also DaisyUI and Tailwind CSS have been updated to their last major versions. Run the official Tailwind upgrade tool:
81+
82+
```
83+
npx @tailwindcss/upgrade
84+
```
85+
86+
This will migrate some of your svelte files to the new naming convention of Tailwind. For DaisyUI follow this [guide](https://daisyui.com/docs/upgrade/#changes-from-v4). Likely you'll need to redo all forms, as the components behave differently. Forms will need the `fieldset` class. Inputs will need an additional `w-full` to have the same behavior as before. And [labels](https://daisyui.com/components/label/) have a different syntax, too.
87+
88+
The themes are to be found in `app.css` now. Add them back if they had been changed from the default.
89+
7790
## [0.5.0] - 2024-05-06
7891

7992
Changes the Event Socket System to use a clearer message structure and MessagePack. Brings breaking changes to the `EventSocket.h` API.

docs/restfulapi.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ The back end exposes a number of API endpoints which are referenced in the table
3030
| GET | /rest/generateToken?username={username} | `IS_ADMIN` | `{"token": "734cb5bb-5597b722"}` | Generates a new JWT token for the user from username |
3131
| POST | /rest/sleep | `IS_AUTHENTICATED` | none | Puts the device in deep sleep mode |
3232
| POST | /rest/downloadUpdate | `IS_ADMIN` | `{"download_url": "https://github.com/theelims/ESP32-sveltekit/releases/download/v0.1.0/firmware_esp32s3.bin"}` | Download link for OTA. This requires a valid SSL certificate and will follow redirects. |
33+
| GET | /rest/coreDump | `IS_AUTHENTICATED` | Text | Core dump of the last crash. |

docs/sveltekit.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,12 @@ Also the Svelte Logo can be replaced with your own. It is located under [interfa
6363

6464
### Daisy UI Themes
6565

66-
The overall theme of the front end is defined by [DaisyUI](https://daisyui.com/docs/themes/) and can be easily changed according to their documentation. Either by selecting one of the standard themes of DaisyUI, or creating your own. By default the `corporate` and `business` for dark are defined in [tailwind.config.cjs](https://github.com/theelims/ESP32-sveltekit/blob/main/interface/tailwind.config.cjs):
66+
The overall theme of the front end is defined by [DaisyUI](https://daisyui.com/docs/themes/) and can be easily changed according to their documentation. Either by selecting one of the standard themes of DaisyUI, or creating your own. By default the `corporate` and `business` for dark are defined in [app.css](https://github.com/theelims/ESP32-sveltekit/blob/main/interface/src/app.css):
6767

6868
```js
69-
daisyui: {
70-
themes: ['corporate', 'business'],
71-
darkTheme: 'business'
72-
}
69+
@plugin "daisyui" {
70+
themes: corporate --default, business --prefersdark;
71+
}
7372
```
7473

7574
#### Opinionated use of Shadows
@@ -78,13 +77,13 @@ The front end makes some use of colored shadows with the `shadow-primary` and `s
7877

7978
#### Color Scheme Helper
8079

81-
Some JS modules do not accept DaisyUI/TailwindCSS color class names. A small helper function can be imported and used to convert any CSS variable name for a DaisyUI color into HSLA. That way modules like e.g. Charts.js can be styled in the current color scheme in a responsive manner.
80+
Some JS modules do not accept DaisyUI/TailwindCSS color class names. A small helper function can be imported and used to convert any CSS variable name for a DaisyUI color into OKCHL. That way modules like e.g. Charts.js can be styled in the current color scheme in a responsive manner.
8281

8382
```js
8483
import { daisyColor } from "$lib/DaisyUiHelper";
8584

86-
borderColor: daisyColor('--p'),
87-
backgroundColor: daisyColor('--p', 50),
85+
borderColor: daisyColor('--color-primary'),
86+
backgroundColor: daisyColor('--color-primary', 50),
8887
```
8988

9089
## TS Types Definition

interface/README.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)