Components Definitions

How does components definitions are being generated?
Is all of them are written then populate to the database or Is there a way generate them?

Meshery has this component generation workflow that runs nightly everyday to generate components using this script.
Internally, it lookup this spreadsheet that has metadata for each component/model that meshery supports. Only those with publish==true (in the spreadsheet column) are generated.

This doc can give more inner insights.

Moreover, policy/relationships work differently and those are not generated rather hand written.