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
// CopyFileFrom copies the source file to the executor workingDir from the provided filesystem, making sure the destination Path exists.
CopyFileFrom(ctx context.Context, srcFS afero.Fs, srcPath, dstPath string) error
// Cleanup cleans up the environment.
Cleanup(ctx context.Context) error
// GetWorkingDir returns the working directory of the executor.
GetWorkingDir() string
}
Executor defines the interface for executing the synthesis process.
type NewExecutorFn ¶
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
}
Click to show internal directories.
Click to hide internal directories.