targetconfig

package
v2.937.10 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package targetconfig implements the static configuration types supplied to the generator from a target by calling its config.ts getGeneratorConfig().

Refer to the configuration package for functionality relating to the target-specific configurations that are available to customers. Generally referred to as the "LangCfg".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompileConfiguration

type CompileConfiguration struct {
	// Dependencies and processes for running generated code compilation.
	Runner *processrunner.Runner
}

Represents target-specific configuration for compiling generated code.

type Configuration

type Configuration struct {
	// Processes and dependencies necessary to compile the generated target
	// code. If unset, the target does not implement code compilation.
	Compile *CompileConfiguration

	// Processes and dependencies necessary to perform static analysis of the
	// generated target code. If unset, the target does not implement code
	// linting.
	Lint *LintConfiguration

	// Configuration for target testing.
	Testing *TestingConfiguration
}

Represents the target implementation configuration presented to the generator from the target.

func NewConfiguration

func NewConfiguration(ctx context.Context, target types.Target, genConfig GeneratorInitialConfiguration) (*Configuration, error)

Creates a Configuration by calling into the target config.ts file getGeneratorConfig function.

type GeneratorInitialConfiguration

type GeneratorInitialConfiguration struct {
	// Runtime environment variables, e.g. UNITY_ROOT.
	Env map[string]string

	// Target-specific configuration passed by customer.
	LangCfg map[string]any

	// Generation output directory.
	OutDir string

	// Runtime platform, e.g. GOOS environment variable.
	Platform string

	// Enabled when the generation includes publishing.
	Publish bool

	// URL of the repository for the generated code.
	RepoURL string

	// Enabled when the generation includes testing.
	Tests bool
}

Represents the initial generator configuration presented to the target to fetch the target configuration.

type GojaCompileConfiguration

type GojaCompileConfiguration struct {
	Runner *GojaRunnerConfiguration
}

Represents a CompileConfiguration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.

func (*GojaCompileConfiguration) Convert

Converts the GojaCompileConfiguration into its CompileConfiguration form for the generator.

type GojaConfiguration

type GojaConfiguration struct {
	Compile *GojaCompileConfiguration
	Lint    *GojaLintConfiguration
	Testing *GojaTestingConfiguration
}

Represents the entire target configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.

func NewGojaConfiguration

func NewGojaConfiguration(value any) (*GojaConfiguration, error)

Creates a GojaConfiguration from a (goja.Value).Export() value.

func (*GojaConfiguration) Convert

func (c *GojaConfiguration) Convert(ctx context.Context) (*Configuration, error)

Converts the GojaConfiguration into its Configuration form for the generator.

type GojaLintConfiguration

type GojaLintConfiguration struct {
	Runner *GojaRunnerConfiguration
}

Represents a LintConfiguration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.

func (*GojaLintConfiguration) Convert

Converts the GojaLintConfiguration into its LintConfiguration form for the generator.

type GojaRunnerCommand

type GojaRunnerCommand struct {
	Command               string
	Args                  []string
	EnvironmentVariables  map[string]string
	IgnoreCommandNotFound bool
	StdoutDiscard         bool
	Parallel              bool
}

Represents a processrunner.Command configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.

func (GojaRunnerCommand) Convert

Converts the GojaRunnerCommand into its processrunner.Command form for the generator.

type GojaRunnerCommandDependency

type GojaRunnerCommandDependency struct {
	Command              string
	InstallDocumentation string
	Version              *GojaRunnerCommandDependencyVersion
}

Represents a processrunner.CommandDependency configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.

func (GojaRunnerCommandDependency) Convert

Converts the GojaRunnerCommandDependency into its processrunner.CommandDependency form for the generator.

type GojaRunnerCommandDependencyVersion

type GojaRunnerCommandDependencyVersion struct {
	Args       []string
	Regex      string
	MinVersion string
}

Represents a processrunner.CommandVersionDependency configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.

func (*GojaRunnerCommandDependencyVersion) Convert

Converts the GojaRunnerCommandDependencyVersion into its processrunner.CommandVersionDependency form for the generator.

type GojaRunnerConfiguration

type GojaRunnerConfiguration struct {
	Commands     []GojaRunnerCommand
	Dependencies *GojaRunnerDependencies
}

Represents a processrunner.Runner configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.

func (*GojaRunnerConfiguration) Convert

Converts the GojaRunnerConfiguration into its processrunner.Runner form for the generator.

type GojaRunnerDependencies

type GojaRunnerDependencies struct {
	ArgVariables         map[string]string
	Commands             []GojaRunnerCommandDependency
	EnvironmentVariables map[string]string
}

Represents a processrunner.Dependencies configuration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.

func (GojaRunnerDependencies) Convert

Converts the GojaRunnerDependencies into its processrunner.Dependencies form for the generator.

type GojaTestingConfiguration

type GojaTestingConfiguration struct {
	Compile *GojaCompileConfiguration
	Runner  *GojaRunnerConfiguration
}

Represents a TestingConfiguration in primitive Go types for simplifying the conversion from goja. Use the Convert method to finish the conversion for generator usage.

func (*GojaTestingConfiguration) Convert

Converts the GojaTestingConfiguration into its TestingConfiguration form for the generator.

type LintConfiguration

type LintConfiguration struct {
	// Dependencies and processes for running generated code linting.
	Runner *processrunner.Runner
}

Represents target-specific configuration for performing static analysis of generated code.

type TestingConfiguration

type TestingConfiguration struct {
	// Processes and dependencies for compiling generated target testing.
	Compile *CompileConfiguration

	// Processes and dependencies for running generated target testing.
	Runner *processrunner.Runner
}

Represents target-specific testing configuration.

Jump to

Keyboard shortcuts

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