I'm curious why we cannot re-use dependent modules' generated types. Is this something that is potentially going to work in the future?
I'm exploring a monorepo use case where a module provides a find-projects function that returns []Project, with Project having further chainable methods, so you can do e.g. dagger call -m my-module find-projects --source . build publish --token=env:TOKEN.
I was pleasantly surprised that dagger call would see that find-project returns a list, and therefore execute the build -> publish chain for each Project. However, then I noticed it doesn't seem to do so in parallel, so I thought I'll just do a PublishAll in my source code (parent) module where I parallelize it, e.g.:
projects := dag.MyModule().Projects(dagger.MyModuleProjectsOpts { Source: source })
published := make([]dagger.MyModuleProject, len(projects))
wg := sync.WaitGroup{}
for i, p := range projects {
wg.Add(1)
go func() {
published[i] = p.Build().Publish(token)
wg.Done()
}
}
wg.Wait()
But there are still some useful getters on dagger.MyModuleProject (e.g. the ref of the image that was just published), so ideally I'd want to just return published in this local-module function and be able to dagger call publish-all ref (with ref being a function on dagger.MyModuleProject for example. The only way to do that right now is to make my own local copy of the type and map to it.