tools: refactor build-addons.js to ESM
Changes
- convert
build-addons.js
to ESM - remove the main function and use top-level await which ESM bring us
Motivation
- make
tools
directory's js file format more consistent - shifting towards ESM which is the official standard.