chore(codersdk): move all tailscale imports out of codersdk (#12735)

Currently, importing `codersdk` just to interact with the API requires
importing tailscale, which causes builds to fail unless manually using
our fork.
This commit is contained in:
Colin Adler
2024-03-26 12:44:31 -05:00
committed by GitHub
parent 0bea8906d4
commit 4d5a7b2d56
68 changed files with 3425 additions and 3310 deletions
+3 -3
View File
@@ -28,7 +28,7 @@ import (
var (
// baseDirs are the directories to introspect for types to generate.
baseDirs = [...]string{"./codersdk"}
baseDirs = [...]string{"./codersdk", "./codersdk/healthsdk"}
// externalTypes are types that are not in the baseDirs, but we want to
// support. These are usually types that are used in the baseDirs.
// Do not include things like "Database", as that would break the idea
@@ -357,7 +357,7 @@ type Maps struct {
// objName prepends the package name of a type if it is outside of codersdk.
func objName(obj types.Object) string {
if pkgName := obj.Pkg().Name(); pkgName != "codersdk" {
if pkgName := obj.Pkg().Name(); pkgName != "codersdk" && pkgName != "healthsdk" {
return cases.Title(language.English).String(pkgName) + obj.Name()
}
return obj.Name()
@@ -879,7 +879,7 @@ func (g *Generator) typescriptType(ty types.Type) (TypescriptType, error) {
return TypescriptType{ValueType: "HealthMessage"}, nil
case "github.com/coder/coder/v2/coderd/healthcheck/health.Severity":
return TypescriptType{ValueType: "HealthSeverity"}, nil
case "github.com/coder/coder/v2/codersdk.HealthSection":
case "github.com/coder/coder/v2/healthsdk.HealthSection":
return TypescriptType{ValueType: "HealthSection"}, nil
case "github.com/coder/coder/v2/codersdk.ProvisionerDaemon":
return TypescriptType{ValueType: "ProvisionerDaemon"}, nil