npm run release
npm run build
npm run example
Why the directory structure?
We are going to have a lot of nesting in our folders. And right now, node packages don't really have a way to specify an alias for deeply nested importing.
That is the only way. You cannot alias it to something shorter for ease of use in dev(There is
main but no
mainDirs in package.json definition ). So keeping it flat will help for projects like ours which has exports throughout the project and the source code is compiled on the fly before release. Unlike projects like Nextjs which only have a handful (~20) exports.
The other reason is that, babel is configured in this project to recompile files on change. When we have a flat structure like this, the number of recompiles while developing is lesser, which means it is faster to work with this project. For eg: if you change a component inside folder A, only folder A is recompiled and not the other folders.