models

package
v0.0.0-...-d6a766c Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	DevDependencies map[string]string      // DevDependencies
	Dependencies    map[string]string      // Dependencies
	Scopes          []ScopedPackageOptions // Options for package scopes
	ExecutorOptions map[string]string      // Options for the executor
	PreSetupFn      func(e Executor) error // Function to run before setup
	EnvVars         map[string]string      // Environment variables to set
}

type CopyOptions

type CopyOptions struct {
	// SkipDirs is a list of directories to skip.
	//
	// If a directory is skipped, all its contents will be skipped as well including AllowPatterns.
	SkipDirs []string
	// AllowPatterns is a list of patterns to allow, SkipDirs will still be respected.
	AllowPatterns []string
	// IgnorePatterns is a list of patterns to ignore. Unless they were allowed by AllowPatterns.
	//
	// Note that golang does not support `**` for recursive matching.
	//
	// See: https://github.com/golang/go/issues/11862
	IgnorePatterns []string
}

type Executor

type Executor interface {
	// Setup configures the executor based on the provided AppConfig and environment variables.
	Setup(ctx context.Context, config AppConfig, envVars map[string]string) error

	// Exec executes the provided main.ts script with the given environment variables.
	Exec(ctx context.Context, mainTS string, envVars map[string]string) error

	// CopyTo retrieves the result from the source path and copies it to the destination within the provided filesystem.
	CopyTo(ctx context.Context, srcDir string, dstFS afero.Fs, dstDir string, options CopyOptions) error

	// CopyFrom copies the source path to the executor workingDir from the provided filesystem.
	CopyFrom(ctx context.Context, srcFS afero.Fs, srcDir, dstDir string, options CopyOptions) error

	// Cleanup cleans up the environment.
	Cleanup(ctx context.Context) error
}

Executor defines the interface for executing the synthesis process.

type NewExecutorFn

type NewExecutorFn func(logger *zap.Logger) (Executor, error)

NewExecutorFn returns an Executor

type ScopedPackageOptions

type ScopedPackageOptions struct {
	// Scape of package
	Scope string

	// URL of the registry for the scoped packages
	RegistryURL string

	// Whether the registry requires authentication
	RequiresAuth bool

	// Env var to pass Auth token to bun install
	AuthTokenEnvVar *string //TODO validate auth token env var is unique
}

Jump to

Keyboard shortcuts

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