I've successfully released a Second Generation Unlocked Package that relies on two separate First Generation Managed Packages.
The Second Generation Unlocked Package and First Generation Managed Packages are in separate Developer Hubs.
This dependancy has currently been defined using the 04t IDs for the 1GP Managed Package Versions.
This means that when the 1GP Managed Packages are updated I'll also have to manually update the 2GP to rely on the new version.
Is there are a better way to handle this?
#Unlocked Packages #Second Generation Packages #Package Dependency
There is no automated way to do this but also remember that dependencies are a "minimum version" NOT an exact version. This means you only need to update your dependencies if you are changing your package to directly reference new features/metadata in the 1GP packages that a new to the 1GP package. You can leave you dependencies for a long time but still install the latest 1GP package versions and Salesforce will happily allow installing your 2GP as well.