0

Short version of a long story: during a rapid application development / proof of concept project, my group built an unmanaged package that to stand it up needed seven dependencies added to sfdx-project.json. All the building from scratch to a working POC happened in a sandbox, then it was all pulled into version control / DX in one fell swoop, which was when the need for adding the dependency references was found.

I'm in the process of splitting this package back out into two packages to span the two team functional areas it covers, and want to put the right dependencies in the right package. Of course I can just make an educated guess, see if the packages build, and if not, juggle the dependencies back and forth until the right ones go to the right package. I'd prefer to find a way to actually look at why the one giant package needs this-or-that dependency, without having to dump a component list of each dependent package and cross reference it to our new one.

Any ideas on that? Not sure if any of the tables around packaging / versioning can be queried to do this, or if there's a tool out there that basically tells you what in your code needs your listed dependencies.

1 Answer 1

0

You could look at MetadataComponentDependency; you can query individual Tooling API tables to get the ID values of the components you want to identify, then include them in a query to this dependency SOQL. For example:

SELECT MetadataComponentType, MetadataComponentName, 
  RefMetadataComponentType, RefMetadataComponentName
FROM MetadataComponentDependency
WHERE RefMetadataComponentId IN (
  '...', '...', '...'
)

You'll still have to build this query semi-manually, but it should ultimately give you the answers you're looking for.

There's other options, too, like if a dependency is in a namespace package, you can filter by that as well, which may be far easier to get the information you want.

The Metadata* fields refer to the component that has the dependency, and the RefMetadata* fields refer to the component that the former component depends on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .