[codegen/nodejs] - Don't import types for functions if they don't exist (#8038)
* Add failing test * Fix * Update changelog * Existing tests are sufficient
This commit is contained in:
parent
c9b719c6c0
commit
41b8882fe8
|
@ -7,3 +7,6 @@
|
|||
|
||||
- [codegen/schema] Revert #7938
|
||||
[#8035](https://github.com/pulumi/pulumi/pull/8035)
|
||||
|
||||
- [codegen/nodejs] Correctly determine imports for functions.
|
||||
[#8038](https://github.com/pulumi/pulumi/pull/8038)
|
||||
|
|
|
@ -143,7 +143,7 @@ type SDKCodegenOptions struct {
|
|||
Language string
|
||||
|
||||
// Language-aware code generator; such as `GeneratePackage`.
|
||||
// from `codgen/dotnet`.
|
||||
// from `codegen/dotnet`.
|
||||
GenPackage GenPkgSignature
|
||||
|
||||
// Extra checks for all the tests. They keys of this map are
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs } from "./types";
|
||||
import * as utilities from "./utilities";
|
||||
|
||||
import * as pulumiRandom from "@pulumi/random";
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs } from "./types";
|
||||
import * as utilities from "./utilities";
|
||||
|
||||
import {Resource} from "./index";
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs } from "./types";
|
||||
import * as utilities from "./utilities";
|
||||
|
||||
import {Resource} from "./index";
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs, enums } from "./types";
|
||||
import * as utilities from "./utilities";
|
||||
|
||||
import {Resource} from "./index";
|
||||
|
|
|
@ -1162,10 +1162,14 @@ func (mod *modContext) getImportsForResource(member interface{}, externalImports
|
|||
case *schema.Function:
|
||||
needsTypes := false
|
||||
if member.Inputs != nil {
|
||||
needsTypes = mod.getTypeImports(member.Inputs, false, externalImports, imports, seen) || needsTypes
|
||||
for _, p := range member.Inputs.Properties {
|
||||
needsTypes = mod.getTypeImports(p.Type, false, externalImports, imports, seen) || needsTypes
|
||||
}
|
||||
}
|
||||
if member.Outputs != nil {
|
||||
needsTypes = mod.getTypeImports(member.Outputs, false, externalImports, imports, seen) || needsTypes
|
||||
for _, p := range member.Outputs.Properties {
|
||||
needsTypes = mod.getTypeImports(p.Type, false, externalImports, imports, seen) || needsTypes
|
||||
}
|
||||
}
|
||||
return needsTypes
|
||||
case []*schema.Property:
|
||||
|
|
Loading…
Reference in a new issue