Skip to content

Commit

Permalink
fix: all modules should have stubs generated (#4050)
Browse files Browse the repository at this point in the history
Even modules without any dependancies should have stubs generated so
that the user can easily import them.
  • Loading branch information
matt2e authored Jan 15, 2025
1 parent 9139877 commit eebf549
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions internal/buildengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ func (e *Engine) buildWithCallback(ctx context.Context, callback buildCallback,
return err
}
errCh := make(chan error, 1024)
for idx, group := range topology {
for _, group := range topology {
knownSchemas := map[string]*schema.Module{}
err := e.gatherSchemas(builtModules, knownSchemas)
if err != nil {
Expand Down Expand Up @@ -889,12 +889,9 @@ func (e *Engine) buildWithCallback(ctx context.Context, callback buildCallback,
newSchemas = append(newSchemas, sch)
}

// Generate stubs for all but the last group
if idx < (len(topology) - 1) {
err = GenerateStubs(ctx, e.projectConfig.Root(), newSchemas, metasMap)
if err != nil {
return err
}
err = GenerateStubs(ctx, e.projectConfig.Root(), newSchemas, metasMap)
if err != nil {
return err
}

moduleNames := []string{}
Expand Down

0 comments on commit eebf549

Please sign in to comment.