Skip to content

Commit 00de0bd

Browse files
committed
better generated typescript types
1 parent cdd103b commit 00de0bd

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

scripts/apitypings/main.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ func main() {
3232
// Serpent has some types referenced in the codersdk.
3333
// We want the referenced types generated.
3434
referencePackages := map[string]string{
35-
"github.com/coder/serpent": "Serpent",
36-
"tailscale.com/derp": "",
35+
"github.com/coder/preview": "",
36+
"github.com/coder/serpent": "Serpent",
37+
"github.com/hashicorp/hcl/v2": "Hcl",
38+
"tailscale.com/derp": "",
3739
// Conflicting name "DERPRegion"
3840
"tailscale.com/tailcfg": "Tail",
3941
"tailscale.com/net/netcheck": "Netcheck",
@@ -88,7 +90,8 @@ func TypeMappings(gen *guts.GoParser) error {
8890
gen.IncludeCustomDeclaration(map[string]guts.TypeOverride{
8991
"github.com/coder/coder/v2/codersdk.NullTime": config.OverrideNullable(config.OverrideLiteral(bindings.KeywordString)),
9092
// opt.Bool can return 'null' if unset
91-
"tailscale.com/types/opt.Bool": config.OverrideNullable(config.OverrideLiteral(bindings.KeywordBoolean)),
93+
"tailscale.com/types/opt.Bool": config.OverrideNullable(config.OverrideLiteral(bindings.KeywordBoolean)),
94+
"github.com/hashicorp/hcl/v2.Expression": config.OverrideLiteral(bindings.KeywordUnknown),
9295
})
9396

9497
err := gen.IncludeCustom(map[string]string{

site/src/api/typesGenerated.ts

+39-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)