Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit00de0bd

Browse files
committed
better generated typescript types
1 parentcdd103b commit00de0bd

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

‎scripts/apitypings/main.go

Lines changed: 6 additions & 3 deletions
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

Lines changed: 39 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp