The best place to put a component is inside a package...in the same file as the entity. So if you have an entity called 'Widget', the entity would be...
However, an even better way is to not even bother with components. They provide value in only a few specialized cases, for the most part they are just a near duplicate of the entity which then you need to manually make sure they stay the same (i.e. change a signal type, do it in both places; add or subtract a signal, do it in both places). While keeping the component and entity in the same file facilitates making the changes it is still unneeded work. Same example, but this time no component definition, you would instantiate it like this...