plugins

package
v0.0.0-...-c1ea988 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

v2/cmd/forge/plugins/build.go

v2/cmd/forge/plugins/client.go

v2/cmd/forge/plugins/client_config.go

v2/cmd/forge/plugins/cloud.go

cmd/forge/plugins/contributor.go

v2/cmd/forge/plugins/deploy.go

v2/cmd/forge/plugins/dev.go

v2/cmd/forge/plugins/dev_docker.go

v2/cmd/forge/plugins/dev_shared.go

v2/cmd/forge/plugins/doctor.go

v2/cmd/forge/plugins/extension.go

v2/cmd/forge/plugins/generate.go

v2/cmd/forge/plugins/infra.go

v2/cmd/forge/plugins/init.go

v2/cmd/forge/plugins/version.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuildPlugin

func NewBuildPlugin(cfg *config.ForgeConfig) cli.Plugin

NewBuildPlugin creates a new build plugin.

func NewClientPlugin

func NewClientPlugin(cfg *config.ForgeConfig) cli.Plugin

NewClientPlugin creates a new client plugin.

func NewCloudPlugin

func NewCloudPlugin(cfg *config.ForgeConfig) cli.Plugin

NewCloudPlugin creates a new cloud plugin.

func NewContributorPlugin

func NewContributorPlugin(cfg *config.ForgeConfig) cli.Plugin

NewContributorPlugin creates a new contributor plugin.

func NewDatabasePlugin

func NewDatabasePlugin(cfg *config.ForgeConfig) cli.Plugin

NewDatabasePlugin creates a new database plugin.

func NewDeployPlugin

func NewDeployPlugin(cfg *config.ForgeConfig) cli.Plugin

NewDeployPlugin creates a new deploy plugin.

func NewDevPlugin

func NewDevPlugin(cfg *config.ForgeConfig) cli.Plugin

NewDevPlugin creates a new development plugin.

func NewDoctorPlugin

func NewDoctorPlugin(cfg *config.ForgeConfig) cli.Plugin

NewDoctorPlugin creates a new doctor plugin.

func NewExtensionPlugin

func NewExtensionPlugin(cfg *config.ForgeConfig) cli.Plugin

NewExtensionPlugin creates a new extension plugin.

func NewGeneratePlugin

func NewGeneratePlugin(cfg *config.ForgeConfig) cli.Plugin

NewGeneratePlugin creates a new generate plugin.

func NewInfraPlugin

func NewInfraPlugin(cfg *config.ForgeConfig) cli.Plugin

NewInfraPlugin creates a new infrastructure plugin.

func NewInitPlugin

func NewInitPlugin(cfg *config.ForgeConfig) cli.Plugin

NewInitPlugin creates a new init plugin.

func SaveClientConfig

func SaveClientConfig(config *ClientConfig, path string) error

SaveClientConfig saves a client configuration to a file.

Types

type AppInfo

type AppInfo struct {
	Name      string
	Path      string
	Type      string
	AppConfig *config.AppConfig // App-level .forge.yaml configuration
}

AppInfo represents a discoverable app.

type AstroAdapter

type AstroAdapter struct{}

AstroAdapter provides Astro-specific build configuration.

func (*AstroAdapter) DefaultBuildCmd

func (a *AstroAdapter) DefaultBuildCmd(mode string) string

func (*AstroAdapter) DefaultDevCmd

func (a *AstroAdapter) DefaultDevCmd() string

func (*AstroAdapter) DefaultDistDir

func (a *AstroAdapter) DefaultDistDir(mode string) string

func (*AstroAdapter) DefaultSSREntry

func (a *AstroAdapter) DefaultSSREntry() string

func (*AstroAdapter) Name

func (a *AstroAdapter) Name() string

func (*AstroAdapter) ValidateBuild

func (a *AstroAdapter) ValidateBuild(distDir string) error

type BuildPlugin

type BuildPlugin struct {
	// contains filtered or unexported fields
}

BuildPlugin handles build operations.

func (*BuildPlugin) Commands

func (p *BuildPlugin) Commands() []cli.Command

func (*BuildPlugin) Dependencies

func (p *BuildPlugin) Dependencies() []string

func (*BuildPlugin) Description

func (p *BuildPlugin) Description() string

func (*BuildPlugin) Initialize

func (p *BuildPlugin) Initialize() error

func (*BuildPlugin) Name

func (p *BuildPlugin) Name() string

func (*BuildPlugin) Version

func (p *BuildPlugin) Version() string

type CLIAppInfo

type CLIAppInfo struct {
	Name string
	Path string // Root path of the app (e.g., apps/mycli)
}

CLIAppInfo represents a discovered CLI application.

type ClientConfig

type ClientConfig struct {
	// Source configuration
	Source SourceConfig `yaml:"source"`

	// Default generation settings
	Defaults GenerationDefaults `yaml:"defaults"`

	// Streaming extension configuration
	Streaming StreamingExtConfig `yaml:"streaming,omitempty"`

	// Multiple client configurations
	Clients []ClientGenConfig `yaml:"clients,omitempty"`
}

ClientConfig represents the .forge-client.yml configuration file.

func DefaultClientConfig

func DefaultClientConfig() *ClientConfig

DefaultClientConfig returns a default client configuration.

func LoadClientConfig

func LoadClientConfig(startDir string) (*ClientConfig, error)

LoadClientConfig loads .forge-client.yml from the current directory or parent.

type ClientGenConfig

type ClientGenConfig struct {
	Name     string `yaml:"name"`
	Language string `yaml:"language"`
	Output   string `yaml:"output"`
	Package  string `yaml:"package,omitempty"`
	BaseURL  string `yaml:"base_url,omitempty"`
	Module   string `yaml:"module,omitempty"`

	// Override feature flags
	Auth      *bool `yaml:"auth,omitempty"`
	Streaming *bool `yaml:"streaming,omitempty"`
}

ClientGenConfig defines configuration for generating a specific client.

type ClientPlugin

type ClientPlugin struct {
	// contains filtered or unexported fields
}

ClientPlugin handles client code generation.

func (*ClientPlugin) Commands

func (p *ClientPlugin) Commands() []cli.Command

func (*ClientPlugin) Dependencies

func (p *ClientPlugin) Dependencies() []string

func (*ClientPlugin) Description

func (p *ClientPlugin) Description() string

func (*ClientPlugin) Initialize

func (p *ClientPlugin) Initialize() error

func (*ClientPlugin) Name

func (p *ClientPlugin) Name() string

func (*ClientPlugin) Version

func (p *ClientPlugin) Version() string

type CloudPlugin

type CloudPlugin struct {
	// contains filtered or unexported fields
}

CloudPlugin handles Forge Cloud operations.

func (*CloudPlugin) Commands

func (p *CloudPlugin) Commands() []cli.Command

func (*CloudPlugin) Dependencies

func (p *CloudPlugin) Dependencies() []string

func (*CloudPlugin) Description

func (p *CloudPlugin) Description() string

func (*CloudPlugin) Initialize

func (p *CloudPlugin) Initialize() error

func (*CloudPlugin) Name

func (p *CloudPlugin) Name() string

func (*CloudPlugin) Version

func (p *CloudPlugin) Version() string

type CommandFlag

type CommandFlag struct {
	Name        string
	ShortName   string
	Type        string // "string", "bool", "int", "float", "stringSlice"
	Description string
}

CommandFlag represents a parsed flag specification for command generation.

type ContributorPlugin

type ContributorPlugin struct {
	// contains filtered or unexported fields
}

ContributorPlugin handles dashboard contributor scaffolding, building, and dev.

func (*ContributorPlugin) Commands

func (p *ContributorPlugin) Commands() []cli.Command

func (*ContributorPlugin) Dependencies

func (p *ContributorPlugin) Dependencies() []string

func (*ContributorPlugin) Description

func (p *ContributorPlugin) Description() string

func (*ContributorPlugin) Initialize

func (p *ContributorPlugin) Initialize() error

func (*ContributorPlugin) Name

func (p *ContributorPlugin) Name() string

func (*ContributorPlugin) Version

func (p *ContributorPlugin) Version() string

type CustomAdapter

type CustomAdapter struct{}

CustomAdapter provides a pass-through adapter for custom frameworks.

func (*CustomAdapter) DefaultBuildCmd

func (a *CustomAdapter) DefaultBuildCmd(_ string) string

func (*CustomAdapter) DefaultDevCmd

func (a *CustomAdapter) DefaultDevCmd() string

func (*CustomAdapter) DefaultDistDir

func (a *CustomAdapter) DefaultDistDir(_ string) string

func (*CustomAdapter) DefaultSSREntry

func (a *CustomAdapter) DefaultSSREntry() string

func (*CustomAdapter) Name

func (a *CustomAdapter) Name() string

func (*CustomAdapter) ValidateBuild

func (a *CustomAdapter) ValidateBuild(distDir string) error

type DatabasePlugin

type DatabasePlugin struct {
	// contains filtered or unexported fields
}

DatabasePlugin handles database operations.

func (*DatabasePlugin) Commands

func (p *DatabasePlugin) Commands() []cli.Command

func (*DatabasePlugin) Dependencies

func (p *DatabasePlugin) Dependencies() []string

func (*DatabasePlugin) Description

func (p *DatabasePlugin) Description() string

func (*DatabasePlugin) Initialize

func (p *DatabasePlugin) Initialize() error

func (*DatabasePlugin) Name

func (p *DatabasePlugin) Name() string

func (*DatabasePlugin) Version

func (p *DatabasePlugin) Version() string

type DeployPlugin

type DeployPlugin struct {
	// contains filtered or unexported fields
}

DeployPlugin handles deployment operations.

func (*DeployPlugin) Commands

func (p *DeployPlugin) Commands() []cli.Command

func (*DeployPlugin) Dependencies

func (p *DeployPlugin) Dependencies() []string

func (*DeployPlugin) Description

func (p *DeployPlugin) Description() string

func (*DeployPlugin) Initialize

func (p *DeployPlugin) Initialize() error

func (*DeployPlugin) Name

func (p *DeployPlugin) Name() string

func (*DeployPlugin) Version

func (p *DeployPlugin) Version() string

type DevPlugin

type DevPlugin struct {
	// contains filtered or unexported fields
}

DevPlugin handles development commands.

func (*DevPlugin) Commands

func (p *DevPlugin) Commands() []cli.Command

func (*DevPlugin) Dependencies

func (p *DevPlugin) Dependencies() []string

func (*DevPlugin) Description

func (p *DevPlugin) Description() string

func (*DevPlugin) Initialize

func (p *DevPlugin) Initialize() error

func (*DevPlugin) Name

func (p *DevPlugin) Name() string

func (*DevPlugin) Version

func (p *DevPlugin) Version() string

type DoctorPlugin

type DoctorPlugin struct {
	// contains filtered or unexported fields
}

DoctorPlugin provides system diagnostics.

func (*DoctorPlugin) Commands

func (p *DoctorPlugin) Commands() []cli.Command

func (*DoctorPlugin) Dependencies

func (p *DoctorPlugin) Dependencies() []string

func (*DoctorPlugin) Description

func (p *DoctorPlugin) Description() string

func (*DoctorPlugin) Initialize

func (p *DoctorPlugin) Initialize() error

func (*DoctorPlugin) Name

func (p *DoctorPlugin) Name() string

func (*DoctorPlugin) Version

func (p *DoctorPlugin) Version() string

type ExtensionPlugin

type ExtensionPlugin struct {
	// contains filtered or unexported fields
}

ExtensionPlugin handles extension operations.

func (*ExtensionPlugin) Commands

func (p *ExtensionPlugin) Commands() []cli.Command

func (*ExtensionPlugin) Dependencies

func (p *ExtensionPlugin) Dependencies() []string

func (*ExtensionPlugin) Description

func (p *ExtensionPlugin) Description() string

func (*ExtensionPlugin) Initialize

func (p *ExtensionPlugin) Initialize() error

func (*ExtensionPlugin) Name

func (p *ExtensionPlugin) Name() string

func (*ExtensionPlugin) Version

func (p *ExtensionPlugin) Version() string

type FrameworkAdapter

type FrameworkAdapter interface {
	// Name returns the framework identifier ("astro", "nextjs", "custom").
	Name() string

	// DefaultBuildCmd returns the default build command for the given mode.
	DefaultBuildCmd(mode string) string

	// DefaultDevCmd returns the default dev server command.
	DefaultDevCmd() string

	// DefaultDistDir returns the default build output directory for the given mode.
	DefaultDistDir(mode string) string

	// DefaultSSREntry returns the default SSR entry point.
	DefaultSSREntry() string

	// ValidateBuild checks that the build output exists and is valid.
	ValidateBuild(distDir string) error
}

FrameworkAdapter provides framework-specific defaults and build commands for dashboard contributors.

func GetFrameworkAdapter

func GetFrameworkAdapter(frameworkType string) (FrameworkAdapter, error)

GetFrameworkAdapter returns the adapter for the given framework type.

type GeneratePlugin

type GeneratePlugin struct {
	// contains filtered or unexported fields
}

GeneratePlugin handles code generation.

func (*GeneratePlugin) Commands

func (p *GeneratePlugin) Commands() []cli.Command

func (*GeneratePlugin) Dependencies

func (p *GeneratePlugin) Dependencies() []string

func (*GeneratePlugin) Description

func (p *GeneratePlugin) Description() string

func (*GeneratePlugin) Initialize

func (p *GeneratePlugin) Initialize() error

func (*GeneratePlugin) Name

func (p *GeneratePlugin) Name() string

func (*GeneratePlugin) Version

func (p *GeneratePlugin) Version() string

type GenerationDefaults

type GenerationDefaults struct {
	Language string `yaml:"language"`
	Output   string `yaml:"output"`
	Package  string `yaml:"package"`
	BaseURL  string `yaml:"base_url,omitempty"`
	Module   string `yaml:"module,omitempty"`

	// Feature flags
	Auth      bool `yaml:"auth"`
	Streaming bool `yaml:"streaming"`

	// Streaming features
	Reconnection    bool `yaml:"reconnection"`
	Heartbeat       bool `yaml:"heartbeat"`
	StateManagement bool `yaml:"state_management"`

	// Enhanced features
	UseFetch        bool `yaml:"use_fetch"`
	DualPackage     bool `yaml:"dual_package"`
	GenerateTests   bool `yaml:"generate_tests"`
	GenerateLinting bool `yaml:"generate_linting"`
	GenerateCI      bool `yaml:"generate_ci"`
	ErrorTaxonomy   bool `yaml:"error_taxonomy"`
	Interceptors    bool `yaml:"interceptors"`
	Pagination      bool `yaml:"pagination"`

	// Output control
	ClientOnly bool `yaml:"client_only"` // Generate only client source files
}

GenerationDefaults defines default settings for client generation.

type InfraPlugin

type InfraPlugin struct {
	// contains filtered or unexported fields
}

InfraPlugin handles infrastructure deployment operations.

func (*InfraPlugin) Commands

func (p *InfraPlugin) Commands() []cli.Command

func (*InfraPlugin) Dependencies

func (p *InfraPlugin) Dependencies() []string

func (*InfraPlugin) Description

func (p *InfraPlugin) Description() string

func (*InfraPlugin) Initialize

func (p *InfraPlugin) Initialize() error

func (*InfraPlugin) Name

func (p *InfraPlugin) Name() string

func (*InfraPlugin) Version

func (p *InfraPlugin) Version() string

type InitPlugin

type InitPlugin struct {
	// contains filtered or unexported fields
}

InitPlugin handles project initialization.

func (*InitPlugin) Commands

func (p *InitPlugin) Commands() []cli.Command

func (*InitPlugin) Dependencies

func (p *InitPlugin) Dependencies() []string

func (*InitPlugin) Description

func (p *InitPlugin) Description() string

func (*InitPlugin) Initialize

func (p *InitPlugin) Initialize() error

func (*InitPlugin) Name

func (p *InitPlugin) Name() string

func (*InitPlugin) Version

func (p *InitPlugin) Version() string

type NextjsAdapter

type NextjsAdapter struct{}

NextjsAdapter provides Next.js-specific build configuration.

func (*NextjsAdapter) DefaultBuildCmd

func (a *NextjsAdapter) DefaultBuildCmd(mode string) string

func (*NextjsAdapter) DefaultDevCmd

func (a *NextjsAdapter) DefaultDevCmd() string

func (*NextjsAdapter) DefaultDistDir

func (a *NextjsAdapter) DefaultDistDir(mode string) string

func (*NextjsAdapter) DefaultSSREntry

func (a *NextjsAdapter) DefaultSSREntry() string

func (*NextjsAdapter) Name

func (a *NextjsAdapter) Name() string

func (*NextjsAdapter) ValidateBuild

func (a *NextjsAdapter) ValidateBuild(distDir string) error

type SourceConfig

type SourceConfig struct {
	// Type: "file", "url", "auto"
	Type string `yaml:"type"`

	// Path to spec file (when type=file)
	Path string `yaml:"path,omitempty"`

	// URL to fetch spec (when type=url)
	URL string `yaml:"url,omitempty"`

	// Auto-discovery paths (when type=auto)
	AutoDiscoverPaths []string `yaml:"auto_discover_paths,omitempty"`
}

SourceConfig defines where to get the API specification.

type StreamingExtConfig

type StreamingExtConfig struct {
	// Enable room management client
	Rooms bool `yaml:"rooms"`

	// Enable presence tracking client
	Presence bool `yaml:"presence"`

	// Enable typing indicator client
	Typing bool `yaml:"typing"`

	// Enable pub/sub channel client
	Channels bool `yaml:"channels"`

	// Enable message history support
	History bool `yaml:"history"`
}

StreamingExtConfig defines streaming extension features configuration.

type TargetInfo

type TargetInfo struct {
	Name        string
	Type        string // "app" or "extension"
	IsExtension bool
	Path        string
}

TargetInfo represents an app or extension that can receive a controller.

Directories

Path Synopsis
v2/cmd/forge/plugins/infra/generator.go
v2/cmd/forge/plugins/infra/generator.go

Jump to

Keyboard shortcuts

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