ecosystem

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HiddenDirName = ".typego"
	BinaryName    = "typego-app.exe"
	HandoffEnvVar = "TYPEGO_HANDOFF"
)
View Source
const ConfigFileName = "typego.modules.json"
View Source
const LockFileName = "typego.lock"

Variables

This section is empty.

Functions

func EnsureGitIgnore

func EnsureGitIgnore(cwd string) error

EnsureGitIgnore adds HiddenDirName to .gitignore if it exists and doesn't already contain it

func FindRepoRoot

func FindRepoRoot(startDir string) (string, bool)

FindRepoRoot attempts to find the root of the typego repository by walking up from startDir

func GetConfigHash

func GetConfigHash(cwd string) (string, error)

GetConfigHash returns the SHA256 hash of the typego.modules.json file

func GetJITBinaryPath

func GetJITBinaryPath(cwd string) (string, bool)

GetJITBinaryPath returns the path to the JIT binary if it exists

func IsHandoffRequired

func IsHandoffRequired(cwd string) bool

IsHandoffRequired returns true if we should delegate to the JIT binary

func VerifyChecksum

func VerifyChecksum(cwd string) bool

VerifyChecksum returns true if the current config hash matches the saved checksum

func WriteChecksum

func WriteChecksum(cwd string, hash string) error

WriteChecksum saves the hash to .typego/checksum

Types

type CompilerConfig

type CompilerConfig struct {
	GoVersion string   `json:"goVersion,omitempty"`
	Tags      []string `json:"tags,omitempty"`
}

CompilerConfig holds settings for the Go toolchain

type Lockfile

type Lockfile struct {
	LockfileVersion int                        `json:"lockfileVersion"`
	Resolved        map[string]ResolvedPackage `json:"resolved"`
}

Lockfile captures resolved versions for reproducible builds

func DefaultLockfile

func DefaultLockfile() Lockfile

DefaultLockfile creates an empty lockfile

type ModuleConfig

type ModuleConfig struct {
	Schema       string            `json:"$schema,omitempty"`
	Dependencies map[string]string `json:"dependencies"`
	Replace      map[string]string `json:"replace,omitempty"`
	Compiler     CompilerConfig    `json:"compiler,omitempty"`
}

ModuleConfig represents the schema for typego.modules.json

func DefaultConfig

func DefaultConfig() ModuleConfig

DefaultConfig returns a standard configuration template

func (*ModuleConfig) Validate

func (c *ModuleConfig) Validate() error

Validate checks the configuration for common errors

type ResolvedPackage

type ResolvedPackage struct {
	Version string `json:"version"`
}

ResolvedPackage contains the exact version resolved by go get

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL