project

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package project owns trbconfig.jsonc discovery, validation, and persistence.

Index

Constants

View Source
const (
	ManagedPackages  = "managed"
	ExternalPackages = "external"
)
View Source
const ConfigName = "trbconfig.jsonc"
View Source
const DefaultRubyVersion = "4.0.6"

DefaultRubyVersion is the current Ruby toolchain supported by TypeRB.

View Source
const DefaultTypeScriptVersion = "latest"

DefaultTypeScriptVersion tracks the current TypeScript release.

Variables

View Source
var ErrConfigNotFound = errors.New(ConfigName + " not found")

ErrConfigNotFound reports that discovery reached the filesystem root.

Functions

This section is empty.

Types

type Config

type Config struct {
	Schema            string            `json:"$schema,omitempty"`
	Name              string            `json:"name"`
	Version           string            `json:"version,omitempty"`
	Mode              string            `json:"mode"`
	SourceDir         string            `json:"sourceDir,omitempty"`
	OutDir            string            `json:"outDir,omitempty"`
	CopyFiles         *bool             `json:"copyFiles,omitempty"`
	PackageManagement string            `json:"packageManagement,omitempty"`
	Dependencies      map[string]string `json:"dependencies,omitempty"`
	DevDependencies   map[string]string `json:"devDependencies,omitempty"`
	LocalPackages     map[string]string `json:"localPackages,omitempty"`
	Ruby              *RubyConfig       `json:"ruby,omitempty"`
	Go                *GoConfig         `json:"go,omitempty"`
	TypeScript        *TypeScriptConfig `json:"typescript,omitempty"`
	Root              string            `json:"-"`
	Path              string            `json:"-"`
}

func Find

func Find(start string) (*Config, error)

func Load

func Load(path string) (*Config, error)

func New

func New(root, mode string) *Config

func (*Config) ManagesPackages

func (c *Config) ManagesPackages() bool

func (*Config) OutputPath

func (c *Config) OutputPath() string

func (*Config) Save

func (c *Config) Save() error

func (*Config) ShouldCopyFiles

func (c *Config) ShouldCopyFiles() bool

func (*Config) SourcePath

func (c *Config) SourcePath() string

func (*Config) Validate

func (c *Config) Validate() error

type GoConfig

type GoConfig struct {
	Module               string            `json:"module,omitempty"`
	Version              string            `json:"version,omitempty"`
	RootPackage          string            `json:"rootPackage,omitempty"`
	IndirectDependencies map[string]string `json:"indirectDependencies,omitempty"`
	Sqldef               *SqldefConfig     `json:"sqldef,omitempty"`
}

type RubyConfig

type RubyConfig struct {
	Source  string `json:"source,omitempty"`
	Version string `json:"version,omitempty"`
	Loader  string `json:"loader,omitempty"`
}

type SqldefConfig

type SqldefConfig struct {
	Command   string   `json:"command"`
	Arguments []string `json:"arguments,omitempty"`
	Database  string   `json:"database"`
	Schema    string   `json:"schema"`
}

type TypeScriptConfig

type TypeScriptConfig struct {
	PackageManager string            `json:"packageManager,omitempty"`
	ModuleType     string            `json:"moduleType,omitempty"`
	Scripts        map[string]string `json:"scripts,omitempty"`
}

Jump to

Keyboard shortcuts

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