This is part of configuration management. It’s a discipline to control the state of a system from its hardware to its software and how it interacts with other systems. It maintains a library to document what was used to build the system. How it works. And what changes have been made to it. In some shops it’s a title and a full time job.
Such a library would include every line of code regardless of language and every piece of 3rd party software used to create the system. Also the requirements, the design documents, the code reviews…
A configuration managers job is to ensure all such things exist, are organized, and retrievable on demand.