Documentation
¶
Overview ¶
Package project owns trbconfig.jsonc discovery, validation, and persistence.
Index ¶
Constants ¶
const ( ManagedPackages = "managed" ExternalPackages = "external" TypeScriptRuntimeBrowser = "browser" TypeScriptRuntimeBun = "bun" TypeScriptRuntimeNode = "node" )
const ConfigName = "trbconfig.jsonc"
const DefaultGoVersion = "1.27"
DefaultGoVersion is the current Go toolchain supported by TypeRB.
const DefaultRubyVersion = "4.0.6"
DefaultRubyVersion is the current Ruby toolchain supported by TypeRB.
const DefaultSqldefVersion = "3.11.19"
const DefaultTypeScriptRuntime = TypeScriptRuntimeNode
DefaultTypeScriptRuntime preserves the runtime used by TypeScript projects created before runtime selection became explicit.
const DefaultTypeScriptVersion = "^6.0.0"
DefaultTypeScriptVersion follows the latest compatible TypeScript 6 patch.
Variables ¶
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"`
Packages map[string]PackageRequirement `json:"packages,omitempty"`
Dependencies map[string]string `json:"dependencies,omitempty"`
DevDependencies map[string]string `json:"devDependencies,omitempty"`
LocalPackages map[string]string `json:"localPackages,omitempty"`
PackageOptions map[string]json.RawMessage `json:"packageOptions,omitempty"`
Ruby *RubyConfig `json:"ruby,omitempty"`
Go *GoConfig `json:"go,omitempty"`
TypeScript *TypeScriptConfig `json:"typescript,omitempty"`
Database *DatabaseConfig `json:"db,omitempty"`
Jobs *JobsConfig `json:"jobs,omitempty"`
Root string `json:"-"`
Path string `json:"-"`
}
func (*Config) ManagesPackages ¶
func (*Config) OutputPath ¶
func (*Config) ShouldCopyFiles ¶
func (*Config) SourcePath ¶
type DBSqldefConfig ¶ added in v0.2.1
type DatabaseConfig ¶ added in v0.2.1
type DatabaseConfig struct {
Adapter string `json:"adapter"`
Database *DatabaseSource `json:"database,omitempty"`
Schema string `json:"schema,omitempty"`
Lock string `json:"lock,omitempty"`
Sqldef *DBSqldefConfig `json:"sqldef,omitempty"`
}
type DatabaseSource ¶ added in v0.2.1
func (DatabaseSource) MarshalJSON ¶ added in v0.2.1
func (s DatabaseSource) MarshalJSON() ([]byte, error)
func (DatabaseSource) Resolve ¶ added in v0.2.1
func (s DatabaseSource) Resolve(root, adapter string) (string, error)
func (*DatabaseSource) UnmarshalJSON ¶ added in v0.2.1
func (s *DatabaseSource) UnmarshalJSON(data []byte) error
type JobsConfig ¶ added in v0.2.3
type JobsConfig struct {
Configuration string `json:"configuration"`
}
type PackageRequirement ¶ added in v0.2.3
type PackageRequirement struct {
Source string `json:"source,omitempty"`
Version string `json:"version,omitempty"`
Path string `json:"path,omitempty"`
}
PackageRequirement identifies one TypeRB package. A package name is an import alias in the current dependency graph; Source selects an explicit Git origin and Path selects an explicitly local development package.
func (PackageRequirement) MarshalJSON ¶ added in v0.2.3
func (r PackageRequirement) MarshalJSON() ([]byte, error)
func (*PackageRequirement) UnmarshalJSON ¶ added in v0.2.3
func (r *PackageRequirement) UnmarshalJSON(data []byte) error