The projects you see around the web that use USB on ESP are for debugging only. Once the project is finished it depends on where it will be positioned and you decide which power supply to use. For example, the Shelly modules have a reduced esp and on-board power supply, because they are designed for that specific function. We instead use esp8266/32 with many pins for I2C, Uart..etc... so the circuit is very large. We can do it too but we need to know how to use a soldering iron and understand how voltage regulators work, and then create a printed circuit for this purpose.
(sry googl. trad)
I just want to understand why no project suggest to use the converter which is actually cheap.
Just put the photo of how the final project will look like. I just think a project should be simple, less wires, less "moving parts".
The final size of the project is not a concern here but showing just a usb connection is hiding the real thing. It is connected to another adapter which requires a power socket/source.
I know, we may also choose to use 2x 1.5V AA or LiPo battery for production.
The logic is since the thing is using main power why not utilise it?
This can help us to understand how the smart switch in the market works.
Of course, I think the ESP8266 can also be replaced by other smaller version of ESP such as 01 or 32.