One of the most beautiful things of the Salesforce platform is that almost everything can be queried. Lightning components can be queried pretty easily.
Lightning components (aura) can be queried using the AuraDefinitionBundle SObject. For example:
SELECT Id, DeveloperName FROM AuraDefinitionBundle