shop

package
v0.0.0-...-56294bc Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoComposerFileFound        = errors.New("could not determine Shopware version as no composer.json or composer.lock file was found")
	ErrShopwareDependencyNotFound = errors.New("could not determine Shopware version as no shopware/core dependency was found")
)

Functions

func DefaultConfigFileName

func DefaultConfigFileName() string

func IsShopwareVersion

func IsShopwareVersion(projectRoot string, requiredVersion string) (bool, error)

func NewShopClient

func NewShopClient(ctx context.Context, config *Config) (*adminSdk.Client, error)

Types

type Config

type Config struct {
	AdditionalConfigs []string `yaml:"include,omitempty"`
	// The URL of the Shopware instance
	URL string `yaml:"url"`
	// Controls date-based compatibility behavior, formatted as YYYY-MM-DD.
	CompatibilityDate string            `yaml:"compatibility_date,omitempty" jsonschema:"format=date"`
	Build             *ConfigBuild      `yaml:"build,omitempty"`
	AdminApi          *ConfigAdminApi   `yaml:"admin_api,omitempty"`
	ConfigDump        *ConfigDump       `yaml:"dump,omitempty"`
	ConfigDeployment  *ConfigDeployment `yaml:"deployment,omitempty"`
	Validation        *ConfigValidation `yaml:"validation,omitempty"`
	ImageProxy        *ConfigImageProxy `yaml:"image_proxy,omitempty"`
	// When enabled, composer scripts will be disabled during CI builds
	DisableComposerScripts bool `yaml:"disable_composer_scripts,omitempty"`
	// When enabled, composer install will be skipped during CI builds
	DisableComposerInstall bool `yaml:"disable_composer_install,omitempty"`
	// contains filtered or unexported fields
}

func ReadConfig

func ReadConfig(ctx context.Context, fileName string, allowFallback bool) (*Config, error)

func (*Config) HasCompatibilityDate

func (c *Config) HasCompatibilityDate() bool

func (*Config) IsAdminAPIConfigured

func (c *Config) IsAdminAPIConfigured() bool

func (*Config) IsCompatibilityDateAtLeast

func (c *Config) IsCompatibilityDateAtLeast(requiredDate string) (bool, error)

func (Config) IsFallback

func (c Config) IsFallback() bool

type ConfigAdminApi

type ConfigAdminApi struct {
	// Client ID of integration
	ClientId string `yaml:"client_id,omitempty"`
	// Client Secret of integration
	ClientSecret string `yaml:"client_secret,omitempty"`
	// Username of admin user
	Username string `yaml:"username,omitempty"`
	// Password of admin user
	Password string `yaml:"password,omitempty"`
	// Disable SSL certificate check
	DisableSSLCheck bool `yaml:"disable_ssl_check,omitempty"`
}

type ConfigBuild

type ConfigBuild struct {
	// When enabled, the assets will not be copied to the public folder
	DisableAssetCopy bool `yaml:"disable_asset_copy,omitempty"`
	// When enabled, the assets of extensions will be removed from the extension public folder. (Requires Shopware 6.5.2.0)
	RemoveExtensionAssets bool `yaml:"remove_extension_assets,omitempty"`
	// When enabled, the extensions source code will be keep in the final build
	KeepExtensionSource bool `yaml:"keep_extension_source,omitempty"`
	// When enabled, the source maps will not be removed from the final build
	KeepSourceMaps bool `yaml:"keep_source_maps,omitempty"`
	// Paths to delete for the final build
	CleanupPaths []string `yaml:"cleanup_paths,omitempty"`
	// Browserslist configuration for the Storefront build
	Browserslist string `yaml:"browserslist,omitempty"`
	// Extensions to exclude from the build
	ExcludeExtensions []string `yaml:"exclude_extensions,omitempty"`
	// When enabled, the storefront build will be skipped
	DisableStorefrontBuild bool `yaml:"disable_storefront_build,omitempty"`
	// Extensions to force build for, even if they have compiled files
	ForceExtensionBuild []ConfigBuildExtension `yaml:"force_extension_build,omitempty"`
	// When enabled, the shopware admin will be built
	ForceAdminBuild bool `yaml:"force_admin_build,omitempty"`
	// Keep following node_modules in the final build
	KeepNodeModules []string `yaml:"keep_node_modules,omitempty"`
	// MJML email template compilation configuration
	MJML *ConfigBuildMJML `yaml:"mjml,omitempty"`
	// Hooks to run at specific points during CI builds
	Hooks *ConfigBuildHooks `yaml:"hooks,omitempty"`
}

func (ConfigBuild) IsMjmlEnabled

func (c ConfigBuild) IsMjmlEnabled() bool

type ConfigBuildExtension

type ConfigBuildExtension struct {
	// Name of the extension
	Name string `yaml:"name" jsonschema:"required"`
}

ConfigBuildExtension defines the configuration for forcing extension builds.

type ConfigBuildHooks

type ConfigBuildHooks struct {
	// Commands to run before anything runs
	Pre []string `yaml:"pre,omitempty"`
	// Commands to run after everything completes
	Post []string `yaml:"post,omitempty"`
	// Commands to run before composer install
	PreComposer []string `yaml:"pre-composer,omitempty"`
	// Commands to run after composer install
	PostComposer []string `yaml:"post-composer,omitempty"`
	// Commands to run before asset build
	PreAssets []string `yaml:"pre-assets,omitempty"`
	// Commands to run after asset build
	PostAssets []string `yaml:"post-assets,omitempty"`
}

ConfigBuildHooks defines hooks to run at specific points during CI builds.

type ConfigBuildMJML

type ConfigBuildMJML struct {
	// Whether to enable MJML compilation
	Enabled bool `yaml:"enabled,omitempty"`
	// Directories to search for MJML files
	SearchPaths []string `yaml:"search_paths,omitempty"`
}

ConfigBuildMJML defines the configuration for MJML email template compilation.

func (ConfigBuildMJML) GetPaths

func (c ConfigBuildMJML) GetPaths(projectRoot string) []string

type ConfigDeployment

type ConfigDeployment struct {
	Hooks struct {
		// The pre hook will be executed before the deployment
		Pre string `yaml:"pre"`
		// The post hook will be executed after the deployment
		Post string `yaml:"post"`
		// The pre-install hook will be executed before the installation
		PreInstall string `yaml:"pre-install"`
		// The post-install hook will be executed after the installation
		PostInstall string `yaml:"post-install"`
		// The pre-update hook will be executed before the update
		PreUpdate string `yaml:"pre-update"`
		// The post-update hook will be executed after the update
		PostUpdate string `yaml:"post-update"`
	} `yaml:"hooks"`

	Store struct {
		LicenseDomain string `yaml:"license-domain"`
	} `yaml:"store"`

	Cache struct {
		AlwaysClear bool `yaml:"always_clear"`
	} `yaml:"cache"`

	// The extension management of the deployment
	ExtensionManagement struct {
		// When enabled, the extensions will be installed, updated, and removed
		Enabled bool `yaml:"enabled"`
		// Which extensions should not be managed
		Exclude []string `yaml:"exclude"`

		Overrides ConfigDeploymentOverrides `yaml:"overrides"`

		// DEPRECATED, On these extensions, it will be always called plugin:update
		ForceUpdatesDeprecated []string `yaml:"force_updates,omitempty" jsonschema:"deprecated=true"`
		// On these extensions, it will be always called plugin:update
		ForceUpdate []string `yaml:"force-update,omitempty"`
	} `yaml:"extension-management"`

	OneTimeTasks []struct {
		Id     string `yaml:"id" jsonschema:"required"`
		Script string `yaml:"script" jsonschema:"required"`
	} `yaml:"one-time-tasks"`
}

type ConfigDeploymentOverrides

type ConfigDeploymentOverrides map[string]struct {
	State string `yaml:"state"`
}

func (ConfigDeploymentOverrides) JSONSchema

type ConfigDump

type ConfigDump struct {
	// Allows to rewrite single columns, perfect for GDPR compliance
	Rewrite map[string]map[string]string `yaml:"rewrite,omitempty"`
	// Only export the schema of these tables
	NoData []string `yaml:"nodata,omitempty"`
	// Ignore these tables from export
	Ignore []string `yaml:"ignore,omitempty"`
	// Add an where condition to that table, schema is table name as key, and where statement as value
	Where map[string]string `yaml:"where,omitempty"`
}

func (*ConfigDump) EnableAnonymization

func (c *ConfigDump) EnableAnonymization()

EnableAnonymization adds default column rewrites for anonymizing customer data

func (*ConfigDump) EnableClean

func (c *ConfigDump) EnableClean()

EnableClean adds default tables that should be excluded from data dump in clean mode

func (*ConfigDump) NormalizeFakerExpressions

func (c *ConfigDump) NormalizeFakerExpressions()

NormalizeFakerExpressions wraps bare faker expressions with {{- -}} delimiters so they can be properly evaluated by the mysqldump faker processor.

type ConfigImageProxy

type ConfigImageProxy struct {
	// The URL of the upstream server to proxy requests to when files are not found locally
	URL string `yaml:"url,omitempty"`
}

type ConfigValidation

type ConfigValidation struct {
	// Ignore items from the validation.
	Ignore []ConfigValidationIgnoreItem `yaml:"ignore,omitempty"`

	IgnoreExtensions []ConfigValidationIgnoreExtension `yaml:"ignore_extensions,omitempty"`
}

ConfigValidation is used to configure the project validation.

type ConfigValidationIgnoreExtension

type ConfigValidationIgnoreExtension struct {
	// The name of the extension to ignore.
	Name string `yaml:"name"`
}

type ConfigValidationIgnoreItem

type ConfigValidationIgnoreItem struct {
	// The identifier of the item to ignore.
	Identifier string `yaml:"identifier"`
	// The path of the item to ignore.
	Path string `yaml:"path,omitempty"`
	// The message of the item to ignore.
	Message string `yaml:"message,omitempty"`
}

ConfigValidationIgnoreItem is used to ignore items from the validation.

type ConsoleResponse

type ConsoleResponse struct {
	Commands []struct {
		Name       string `json:"name"`
		Hidden     bool   `json:"hidden"`
		Definition struct {
			Arguments interface{} `json:"arguments"`
			Options   map[string]struct {
				Shortcut string `json:"shortcut"`
			} `json:"options"`
		} `json:"definition"`
	} `json:"commands"`
}

func GetConsoleCompletion

func GetConsoleCompletion(ctx context.Context, projectRoot string) (*ConsoleResponse, error)

func (ConsoleResponse) GetCommandOptions

func (c ConsoleResponse) GetCommandOptions(name string) []string

Jump to

Keyboard shortcuts

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