extension

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 59 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminVitePort    = 5173
	AdminWebpackPort = 8080
)

Default ports of the administration dev server, chosen by the platform's build tooling.

View Source
const (
	StorefrontWebpackConfig        = "Resources/app/storefront/build/webpack.config.js"
	StorefrontWebpackCJSConfig     = "Resources/app/storefront/build/webpack.config.cjs"
	StorefrontEntrypointJS         = "Resources/app/storefront/src/main.js"
	StorefrontEntrypointTS         = "Resources/app/storefront/src/main.ts"
	StorefrontBaseCSS              = "Resources/app/storefront/src/scss/base.scss"
	AdministrationWebpackConfig    = "Resources/app/administration/build/webpack.config.js"
	AdministrationWebpackCJSConfig = "Resources/app/administration/build/webpack.config.cjs"
	AdministrationEntrypointJS     = "Resources/app/administration/src/main.js"
	AdministrationEntrypointTS     = "Resources/app/administration/src/main.ts"
)
View Source
const (
	TypePlatformApp    = "app"
	TypePlatformPlugin = "plugin"
	TypeShopwareBundle = "shopware-bundle"

	ComposerTypePlugin = "shopware-platform-plugin"
	ComposerTypeApp    = "shopware-app"
	ComposerTypeBundle = "shopware-bundle"
)
View Source
const (
	// ConfigSchemaURL is the JSON Schema URL used by the YAML language server.
	ConfigSchemaURL = "https://shopware.github.io/shopware-cli/shopware-extension-schema.json"
)
View Source
const DevVersionNumber = "6.9.9.9"

Variables

View Source
var ConfigLocations = []string{
	".config/shopware-extension.yml",
	".shopware-extension.yml",
	".shopware-extension.yaml",
}
View Source
var ErrPlatformInvalidType = errors.New("invalid composer type")

Functions

func AdminDevServerPort

func AdminDevServerPort(projectRoot string) int

AdminDevServerPort returns the port of the dev server that PrepareAdminWatcher's `npm run dev` starts, mirroring how the platform's own dev script picks its tooling: Shopware 6.7+ ships Vite only (5173), while 6.6 ships both and decides at runtime via the ADMIN_VITE feature flag in var/config_js_features.json, defaulting to webpack-dev-server (8080).

func BuildAssetsForExtensions

func BuildAssetsForExtensions(ctx context.Context, sources []asset.Source, assetConfig AssetBuildConfig) error

func BuildModifier

func BuildModifier(ext Extension, extensionRoot string, config BuildModifierConfig) error

func ChecksumFile

func ChecksumFile(filePath string) (string, error)

ChecksumFile generates a XXH128 checksum for a given file

func CleanupAdministrationFiles

func CleanupAdministrationFiles(ctx context.Context, folder string) error

CleanupAdministrationFiles merges snippet files, deletes the admin source folder, and recreates it with only the merged snippets and an empty main.js.

func CleanupExtensionFolder

func CleanupExtensionFolder(path string, additionalPaths []string) error

func CleanupJavaScriptSourceMaps

func CleanupJavaScriptSourceMaps(folder string) error

CleanupJavaScriptSourceMaps removes .js.map files and their corresponding sourceMappingURL comments from .js files.

func ConfigExists

func ConfigExists(ctx context.Context, dir string) bool

ConfigExists reports whether a .config/shopware-extension.yml or .shopware-extension.yml/.yaml is present.

func ConfigPath

func ConfigPath(ctx context.Context, dir string) string

ConfigPath returns the path of an existing config file, or "" if none. It logs warnings if further config files exists that aren't used

func ConfigSchema

func ConfigSchema() []byte

ConfigSchema returns the JSON schema for the .config/shopware-extension.yml configuration file.

func ConvertExtensionsToSources

func ConvertExtensionsToSources(ctx context.Context, extensions []Extension) []asset.Source

func DumpAndLoadAssetSourcesOfProject

func DumpAndLoadAssetSourcesOfProject(ctx context.Context, project string, shopCfg *shop.Config, consoleCommand ConsoleCommandFunc) ([]asset.Source, error)

func EmptyConfigFile

func EmptyConfigFile() string

EmptyConfigFile returns the default content written by `extension config init`: yaml-language-server schema comment plus today's compatibility_date. All other keys remain optional.

func ExcludeExtensionsFromSources

func ExcludeExtensionsFromSources(sources []asset.Source, excluded []string) []asset.Source

func FindAssetSourcesOfProject

func FindAssetSourcesOfProject(ctx context.Context, project string, shopCfg *shop.Config) []asset.Source

FindAssetSourcesOfProject This finds all assets without invoking any PHP function and thinks all plugins / apps are active. Optional for CI usage.

func GenerateChecksumJSON

func GenerateChecksumJSON(ctx context.Context, baseFolder string, ext Extension) error

GenerateChecksumJSON creates a checksum.json file in the given folder

func GetPhpVersion

func GetPhpVersion(ctx context.Context, constraint *version.Constraints) (string, error)

func GetShopwareBuildVersionConstraint

func GetShopwareBuildVersionConstraint(config *Config) (*version.Constraints, error)

GetShopwareBuildVersionConstraint returns the Shopware version constraint configured as a build-time override via config.Build.ShopwareVersionConstraint. It handles a nil config gracefully and returns (nil, nil) when no override is configured. This is the single source of truth for the build-time constraint and is never mixed into an extension's reported compatibility constraint.

func GetShopwareProjectConstraint

func GetShopwareProjectConstraint(project string) (*version.Constraints, error)

func GetShopwareVersionConstraintForBuild

func GetShopwareVersionConstraintForBuild(ext Extension) (*version.Constraints, error)

GetShopwareVersionConstraintForBuild resolves the constraint that should be used when building assets for the given extension. It honors the build-time override (config.Build.ShopwareVersionConstraint) when set and otherwise falls back to the extension's reported compatibility constraint.

func GetShopwareVersions

func GetShopwareVersions(ctx context.Context) ([]string, error)

func GitCopyFolder

func GitCopyFolder(ctx context.Context, source, target, commitHash string) (string, error)

func InitConfig

func InitConfig(ctx context.Context, dir string, force bool) (string, error)

InitConfig writes a minimal .config/shopware-extension.yml with the YAML language server schema comment and today's compatibility_date. All other keys are optional.

If a config already exists and force is false, an error is returned. Returns the path of the written file.

func InstallNodeModulesOfConfigs

func InstallNodeModulesOfConfigs(ctx context.Context, cfgs ExtensionAssetConfig, assetConfig AssetBuildConfig) ([]string, error)

func LoadProjectAssetSources

func LoadProjectAssetSources(ctx context.Context, projectRoot string, shopCfg *shop.Config, cmdExecutor executor.Executor) ([]asset.Source, error)

func PlatformPath

func PlatformPath(projectRoot, component, subPath string) string

func PlatformRelPath

func PlatformRelPath(projectRoot, component, subPath string) string

func PrepareAdminWatcher

func PrepareAdminWatcher(ctx context.Context, projectRoot string, cmdExecutor executor.Executor, out io.Writer) (*executor.Process, error)

PrepareAdminWatcher runs the admin watcher preparation steps and returns the dev server process. When out is non-nil, the output of every preparation step (feature:dump, npm install, schema generation) is streamed to it so the steps are not silent while they run.

func PrepareExtensionForRelease

func PrepareExtensionForRelease(ctx context.Context, sourceRoot, extensionRoot string, ext Extension) error

PrepareExtensionForRelease Remove secret from the manifest. sourceRoot is the original folder (contains also .git).

func PrepareFolderForZipping

func PrepareFolderForZipping(ctx context.Context, path string, ext Extension, extCfg *Config) error

func PrepareStorefrontWatcher

func PrepareStorefrontWatcher(ctx context.Context, projectRoot string, cmdExecutor executor.Executor, opts StorefrontWatcherOptions, in io.Reader, out io.Writer) (*executor.Process, error)

PrepareStorefrontWatcher runs the storefront watcher preparation steps and returns the hot-proxy process. When out is non-nil, the output of every preparation step (feature:dump, theme:compile, theme:dump, npm install) is streamed to it so the steps are not silent while they run.

func ResizeExtensionIcon

func ResizeExtensionIcon(ctx context.Context, ext Extension) error

func RunValidation

func RunValidation(ctx context.Context, ext Extension, check validation.Check)

func WritePluginJsonForSources

func WritePluginJsonForSources(ctx context.Context, projectRoot string, sources []asset.Source, cmdExecutor executor.Executor) error

func WriteProjectPluginJson

func WriteProjectPluginJson(ctx context.Context, projectRoot string, shopCfg *shop.Config, cmdExecutor executor.Executor) error

Types

type App

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

func (App) GetChangelog

func (a App) GetChangelog() (*ExtensionChangelog, error)

func (App) GetComposerName

func (a App) GetComposerName() (string, error)

func (App) GetExtensionConfig

func (a App) GetExtensionConfig() *Config

func (App) GetIconPath

func (a App) GetIconPath() string

func (App) GetLicense

func (a App) GetLicense() (string, error)

func (App) GetMetaData

func (a App) GetMetaData() *ExtensionMetadata

func (App) GetName

func (a App) GetName() (string, error)

func (App) GetPath

func (a App) GetPath() string

func (App) GetResourcesDir

func (a App) GetResourcesDir() string

func (App) GetResourcesDirs

func (a App) GetResourcesDirs() []string

func (App) GetRootDir

func (a App) GetRootDir() string

func (App) GetShopwareVersionConstraint

func (a App) GetShopwareVersionConstraint() (*version.Constraints, error)

func (App) GetSourceDirs

func (a App) GetSourceDirs() []string

func (App) GetType

func (App) GetType() string

func (App) GetVersion

func (a App) GetVersion() (*version.Version, error)

func (App) UpdateMetaData

func (a App) UpdateMetaData(metadata *ExtensionMetadata) error

func (App) Validate

func (a App) Validate(_ context.Context, check validation.Check)

type AssetBuildConfig

type AssetBuildConfig struct {
	EnableAssetCaching           bool
	CleanupNodeModules           bool
	DisableAdminBuild            bool
	DisableStorefrontBuild       bool
	ShopwareRoot                 string
	ShopwareVersion              *version.Constraints
	Browserslist                 string
	SkipExtensionsWithBuildFiles bool
	NPMForceInstall              bool
	ForceExtensionBuild          []string
	ForceAdminBuild              bool
	KeepNodeModules              []string
	Executor                     executor.Executor
}

func (AssetBuildConfig) ExecutorWithRelDir

func (c AssetBuildConfig) ExecutorWithRelDir(relDir string) executor.Executor

ExecutorWithRelDir returns the configured executor with the given relative dir, or a local executor if none is configured.

func (AssetBuildConfig) NormalizePath

func (c AssetBuildConfig) NormalizePath(hostPath string) string

type BuildModifierConfig

type BuildModifierConfig struct {
	AppBackendUrl    string
	AppBackendSecret string
	Version          string
}

type ChecksumJSON

type ChecksumJSON struct {
	Algorithm        string            `json:"algorithm"`
	Hashes           map[string]string `json:"hashes"`
	Version          string            `json:"version"`
	ExtensionVersion string            `json:"extensionVersion"`
}

type Config

type Config struct {
	// Controls date-based compatibility behavior, formatted as YYYY-MM-DD.
	CompatibilityDate string `yaml:"compatibility_date,omitempty" jsonschema:"format=date"`
	// Store is the store configuration of the extension.
	Store ConfigStore `yaml:"store,omitempty"`
	// Build is the build configuration of the extension.
	Build ConfigBuild `yaml:"build,omitempty"`
	// Changelog is the changelog configuration of the extension.
	Changelog changelog.Config `yaml:"changelog,omitempty"`
	// Validation is the validation configuration of the extension.
	Validation ConfigValidation `yaml:"validation,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Dump

func (c *Config) Dump(dir string) error

func (*Config) GetStorageLocation

func (c *Config) GetStorageLocation() string

func (*Config) HasCompatibilityDate

func (c *Config) HasCompatibilityDate() bool

func (*Config) IsCompatibilityDateAtLeast

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

func (*Config) IsCompatibilityDateBefore

func (c *Config) IsCompatibilityDateBefore(requiredDate string) bool

type ConfigBuild

type ConfigBuild struct {
	// ExtraBundles can be used to declare additional bundles to be considered for building
	ExtraBundles []ConfigExtraBundle `yaml:"extraBundles,omitempty"`
	// Override the shopware version constraint for building, can be used to specify the version of the shopware to use for building
	ShopwareVersionConstraint string `yaml:"shopwareVersionConstraint,omitempty"`
	// Configuration for zipping
	Zip ConfigBuildZip `yaml:"zip"`
}

type ConfigBuildZip

type ConfigBuildZip struct {
	// Configuration for composer
	Composer ConfigBuildZipComposer `yaml:"composer,omitempty"`
	// Configuration for assets
	Assets ConfigBuildZipAssets `yaml:"assets,omitempty"`
	// Configuration for packing
	Pack ConfigBuildZipPack `yaml:"pack,omitempty"`

	Checksum ConfigBuildZipChecksum `yaml:"checksum,omitempty"`
}

Configuration for zipping.

type ConfigBuildZipAssets

type ConfigBuildZipAssets struct {
	// When enabled, the shopware-cli build the assets
	Enabled bool `yaml:"enabled"`
	// When enabled, compiled assets are cached and restored across builds, keyed by the source-file content hash
	EnableAssetCaching bool `yaml:"enable_asset_caching"`
	// Commands to run before the assets build
	BeforeHooks []string `yaml:"before_hooks,omitempty"`
	// Commands to run after the assets build
	AfterHooks []string `yaml:"after_hooks,omitempty"`
	// When enabled, builtin esbuild will be used for the admin assets
	EnableESBuildForAdmin bool `yaml:"enable_es_build_for_admin"`
	// When enabled, builtin esbuild will be used for the storefront assets
	EnableESBuildForStorefront bool `yaml:"enable_es_build_for_storefront"`
	// When disabled, builtin sass support will be disabled
	DisableSass bool `yaml:"disable_sass"`
	// When enabled, npm will install only production dependencies
	NpmStrict bool `yaml:"npm_strict"`
	// Additional paths to include in asset caching
	AdditionalCaches []ConfigBuildZipAssetsAdditionalCache `yaml:"additional_caches,omitempty"`
}

type ConfigBuildZipAssetsAdditionalCache

type ConfigBuildZipAssetsAdditionalCache struct {
	// The output path to cache, relative to extension root
	Path string `yaml:"path"`
	// Source paths to hash for the cache key, relative to extension root
	SourcePaths []string `yaml:"source_paths"`
}

type ConfigBuildZipChecksum

type ConfigBuildZipChecksum struct {
	// Following files will be excluded from the checksum calculation
	Ignore []string `yaml:"ignore,omitempty"`
}

Configuration for checksum calculation.

type ConfigBuildZipComposer

type ConfigBuildZipComposer struct {
	// When enabled, a vendor folder will be created in the zip build
	Enabled bool `yaml:"enabled"`
	// Commands to run before the composer install
	BeforeHooks []string `yaml:"before_hooks,omitempty"`
	// Commands to run after the composer install
	AfterHooks []string `yaml:"after_hooks,omitempty"`
	// Composer packages to be excluded from the zip build
	ExcludedPackages []string `yaml:"excluded_packages,omitempty"`
}

type ConfigBuildZipPack

type ConfigBuildZipPack struct {
	// Excludes can be used to exclude files from the zip build
	Excludes ConfigBuildZipPackExcludes `yaml:"excludes,omitempty"`
	// Commands to run before the pack
	BeforeHooks []string `yaml:"before_hooks,omitempty"`
}

type ConfigBuildZipPackExcludes

type ConfigBuildZipPackExcludes struct {
	// Paths to exclude from the zip build
	Paths []string `yaml:"paths,omitempty"`
}

type ConfigExtraBundle

type ConfigExtraBundle struct {
	// Path to the bundle, relative from the extension root (src folder)
	Path string `yaml:"path"`
	// Name of the bundle, if empty the folder name of path will be used
	Name string `yaml:"name"`
}

func (ConfigExtraBundle) ResolveName

func (b ConfigExtraBundle) ResolveName() string

ResolveName returns the bundle name, defaulting to the base of the path if not explicitly set.

func (ConfigExtraBundle) ResolvePath

func (b ConfigExtraBundle) ResolvePath(rootDir string) string

ResolvePath returns the resolved path for the extra bundle relative to the given root directory.

type ConfigStore

type ConfigStore struct {
	// Specifies the visibility in stores.
	Availabilities *[]string `yaml:"availabilities" jsonschema:"enum=German,enum=International"`
	// Specifies the default locale.
	DefaultLocale *string `yaml:"default_locale" jsonschema:"enum=de_DE,enum=en_GB"`
	// Specifies the languages the extension is translated.
	Localizations *[]string `` /* 437-byte string literal not displayed */
	// Specifies the type of the extension.
	Type *string `yaml:"type" jsonschema:"enum=extension,enum=theme"`
	// Specifies the Path to the icon (256x256 px) for store.
	Icon *string `yaml:"icon"`
	// Specifies whether the extension should automatically be set compatible with Shopware bugfix versions.
	AutomaticBugfixVersionCompatibility *bool `yaml:"automatic_bugfix_version_compatibility"`
	// Specifies the meta title of the extension in store.
	MetaTitle ConfigTranslated[string] `yaml:"meta_title" jsonschema:"maxLength=50"`
	// Specifies the meta description of the extension in store.
	MetaDescription ConfigTranslated[string] `yaml:"meta_description" jsonschema:"maxLength=185"`
	// Specifies the description of the extension in store.
	Description ConfigTranslated[string] `yaml:"description"`
	// Installation manual of the extension in store.
	InstallationManual ConfigTranslated[string] `yaml:"installation_manual"`
	// Specifies the tags of the extension.
	Tags ConfigTranslated[[]string] `yaml:"tags,omitempty"`
	// Specifies the links of YouTube-Videos to show or describe the extension.
	Videos ConfigTranslated[[]string] `yaml:"videos,omitempty"`
	// Specifies the highlights of the extension.
	Highlights ConfigTranslated[[]string] `yaml:"highlights,omitempty"`
	// Specifies the features of the extension.
	Features ConfigTranslated[[]string] `yaml:"features"`
	// Specifies Frequently Asked Questions for the extension.
	Faq ConfigTranslated[[]ConfigStoreFaq] `yaml:"faq"`
	// Specifies images for the extension in the store.
	Images *[]ConfigStoreImage `yaml:"images,omitempty"`
	// Specifies the directory where the images are located.
	ImageDirectory *string `yaml:"image_directory,omitempty"`
	// Specifies the demo shops of the extension in the store.
	DemoShops *[]ConfigStoreDemoShop `yaml:"demo_shops,omitempty"`
}

func (*ConfigStore) IsInGermanStore

func (c *ConfigStore) IsInGermanStore() bool

type ConfigStoreDemoShop

type ConfigStoreDemoShop struct {
	// Specifies the type of the demo shop.
	Type string `yaml:"type" jsonschema:"enum=frontend,enum=backend"`
	// Specifies the URL to the demo shop.
	Link string `yaml:"link"`
	// Specifies the language of the demo shop.
	Localization string `yaml:"localization" jsonschema:"enum=de_DE,enum=en_GB"`
	// Specifies the login name to access the demo shop.
	LoginName string `yaml:"login_name,omitempty"`
	// Specifies the login password to access the demo shop.
	LoginPassword string `yaml:"login_password,omitempty"`
}

type ConfigStoreFaq

type ConfigStoreFaq struct {
	Question string `yaml:"question"`
	Answer   string `yaml:"answer"`
	Position int    `yaml:"position"`
}

type ConfigStoreImage

type ConfigStoreImage struct {
	// File path to image relative from root of the extension
	File string `yaml:"file"`
	// Specifies whether the image is active in the language.
	Activate ConfigStoreImageActivate `yaml:"activate"`
	// Specifies whether the image is a preview in the language.
	Preview ConfigStoreImagePreview `yaml:"preview"`
	// Position of the image in the store gallery. Images are sorted ascending; the lowest value is shown first.
	Position int `yaml:"position"`
	// Deprecated: use Position instead.
	Priority int `yaml:"priority,omitempty" jsonschema_extras:"deprecated=true"`
}

func (ConfigStoreImage) GetPosition

func (i ConfigStoreImage) GetPosition() int

GetPosition returns the configured image position, falling back to the deprecated priority.

type ConfigStoreImageActivate

type ConfigStoreImageActivate struct {
	German  bool `yaml:"de"`
	English bool `yaml:"en"`
}

type ConfigStoreImagePreview

type ConfigStoreImagePreview struct {
	German  bool `yaml:"de"`
	English bool `yaml:"en"`
}

type ConfigTranslated

type ConfigTranslated[T any] struct {
	German  *T `yaml:"de,omitempty"`
	English *T `yaml:"en,omitempty"`
}

type ConfigValidation

type ConfigValidation struct {
	// Ignore items from the validation.
	Ignore          ConfigValidationList `yaml:"ignore,omitempty"`
	StoreCompliance bool                 `yaml:"store_compliance,omitempty"`
	// PhpVersion overrides the PHP version used for linting (e.g. "8.4").
	// When set, this takes precedence over the version derived from composer.json or the static Shopware-to-PHP mapping.
	PhpVersion string `yaml:"php_version,omitempty"`
}

ConfigValidation is used to configure the extension validation.

type ConfigValidationList

type ConfigValidationList []validation.ToolConfigIgnore

func (*ConfigValidationList) Identifiers

func (c *ConfigValidationList) Identifiers() []string

type ConsoleCommandFunc

type ConsoleCommandFunc func(ctx context.Context, args ...string) *exec.Cmd

type Extension

type Extension interface {
	GetName() (string, error)
	GetComposerName() (string, error)
	// Deprecated: use the list variation instead
	GetResourcesDir() string
	GetResourcesDirs() []string

	GetIconPath() string

	// GetRootDir Returns the root folder where the code is located plugin -> src, app ->
	GetRootDir() string
	GetSourceDirs() []string
	GetVersion() (*version.Version, error)
	GetLicense() (string, error)
	GetShopwareVersionConstraint() (*version.Constraints, error)
	GetType() string
	GetPath() string
	GetChangelog() (*ExtensionChangelog, error)
	GetMetaData() *ExtensionMetadata
	UpdateMetaData(*ExtensionMetadata) error
	GetExtensionConfig() *Config
	Validate(context.Context, validation.Check)
}

func FindExtensionsFromProject

func FindExtensionsFromProject(ctx context.Context, project string, onlyLocal bool) []Extension

func GetExtensionByFolder

func GetExtensionByFolder(ctx context.Context, path string) (Extension, error)

func GetExtensionByZip

func GetExtensionByZip(ctx context.Context, filePath string) (Extension, error)

type ExtensionAssetConfig

type ExtensionAssetConfig map[string]*ExtensionAssetConfigEntry

func BuildAssetConfigFromExtensions

func BuildAssetConfigFromExtensions(ctx context.Context, sources []asset.Source, assetCfg AssetBuildConfig) ExtensionAssetConfig

func (ExtensionAssetConfig) FilterByAdmin

func (c ExtensionAssetConfig) FilterByAdmin() ExtensionAssetConfig

func (ExtensionAssetConfig) FilterByAdminAndEsBuild

func (c ExtensionAssetConfig) FilterByAdminAndEsBuild(esbuildEnabled bool) ExtensionAssetConfig

func (ExtensionAssetConfig) FilterByStorefrontAndEsBuild

func (c ExtensionAssetConfig) FilterByStorefrontAndEsBuild(esbuildEnabled bool) ExtensionAssetConfig

func (ExtensionAssetConfig) Has

func (c ExtensionAssetConfig) Has(name string) bool

func (ExtensionAssetConfig) Not

func (c ExtensionAssetConfig) Not(extensions []string) ExtensionAssetConfig

func (ExtensionAssetConfig) Only

func (c ExtensionAssetConfig) Only(extensions []string) ExtensionAssetConfig

func (ExtensionAssetConfig) RequiresAdminBuild

func (c ExtensionAssetConfig) RequiresAdminBuild() bool

func (ExtensionAssetConfig) RequiresShopwareRepository

func (c ExtensionAssetConfig) RequiresShopwareRepository() bool

func (ExtensionAssetConfig) RequiresStorefrontBuild

func (c ExtensionAssetConfig) RequiresStorefrontBuild() bool

type ExtensionAssetConfigAdmin

type ExtensionAssetConfigAdmin struct {
	Path          string  `json:"path"`
	EntryFilePath *string `json:"entryFilePath"`
	Webpack       *string `json:"webpack"`
}

type ExtensionAssetConfigEntry

type ExtensionAssetConfigEntry struct {
	BasePath                   string                         `json:"basePath"`
	Views                      []string                       `json:"views"`
	TechnicalName              string                         `json:"technicalName"`
	Administration             ExtensionAssetConfigAdmin      `json:"administration"`
	Storefront                 ExtensionAssetConfigStorefront `json:"storefront"`
	EnableESBuildForAdmin      bool
	EnableESBuildForStorefront bool
	DisableSass                bool
	NpmStrict                  bool
	AdditionalCaches           []ConfigBuildZipAssetsAdditionalCache
	// contains filtered or unexported fields
}

func (*ExtensionAssetConfigEntry) GetContentHash

func (e *ExtensionAssetConfigEntry) GetContentHash() (string, error)

GetContentHash returns a cached xxhash of all relevant files in the extension

func (*ExtensionAssetConfigEntry) GetOutputAdminPath

func (e *ExtensionAssetConfigEntry) GetOutputAdminPath() string

func (*ExtensionAssetConfigEntry) GetOutputStorefrontPath

func (e *ExtensionAssetConfigEntry) GetOutputStorefrontPath() string

func (*ExtensionAssetConfigEntry) RequiresBuild

func (e *ExtensionAssetConfigEntry) RequiresBuild() bool

type ExtensionAssetConfigStorefront

type ExtensionAssetConfigStorefront struct {
	Path          string   `json:"path"`
	EntryFilePath *string  `json:"entryFilePath"`
	Webpack       *string  `json:"webpack"`
	StyleFiles    []string `json:"styleFiles"`
}

type ExtensionChangelog

type ExtensionChangelog struct {
	German     string `json:"german"`
	English    string `json:"english"`
	Changelogs map[string]string
}

type ExtensionMetadata

type ExtensionMetadata struct {
	Name        string
	Label       ExtensionTranslated
	Description ExtensionTranslated
}

type ExtensionTranslated

type ExtensionTranslated struct {
	German  string `json:"german"`
	English string `json:"english"`
}

type Manifest

type Manifest struct {
	Meta  Meta   `xml:"meta"`
	Setup *Setup `xml:"setup,omitempty"`
}

type Meta

type Meta struct {
	Name          string             `xml:"name"`
	Label         TranslatableString `xml:"label"`
	Description   TranslatableString `xml:"description,omitempty"`
	Author        string             `xml:"author,omitempty"`
	Copyright     string             `xml:"copyright,omitempty"`
	Version       string             `xml:"version"`
	Icon          string             `xml:"icon,omitempty"`
	License       string             `xml:"license"`
	Compatibility string             `xml:"compatibility,omitempty"`
}

type PlatformComposerJson

type PlatformComposerJson struct {
	Name        string   `json:"name"`
	Keywords    []string `json:"keywords"`
	Description string   `json:"description"`
	Version     string   `json:"version"`
	Type        string   `json:"type"`
	License     string   `json:"license"`
	Authors     []struct {
		Name     string `json:"name"`
		Homepage string `json:"homepage"`
	} `json:"authors"`
	Require  map[string]string         `json:"require"`
	Extra    platformComposerJsonExtra `json:"extra"`
	Autoload struct {
		Psr0 map[string]string `json:"psr-0"`
		Psr4 map[string]string `json:"psr-4"`
	} `json:"autoload"`
	Suggest map[string]string `json:"suggest"`
}

type PlatformPlugin

type PlatformPlugin struct {
	Composer PlatformComposerJson
	// contains filtered or unexported fields
}

func (PlatformPlugin) GetChangelog

func (p PlatformPlugin) GetChangelog() (*ExtensionChangelog, error)

func (PlatformPlugin) GetComposerName

func (p PlatformPlugin) GetComposerName() (string, error)

func (PlatformPlugin) GetExtensionConfig

func (p PlatformPlugin) GetExtensionConfig() *Config

func (PlatformPlugin) GetIconPath

func (p PlatformPlugin) GetIconPath() string

func (PlatformPlugin) GetLicense

func (p PlatformPlugin) GetLicense() (string, error)

func (PlatformPlugin) GetMetaData

func (p PlatformPlugin) GetMetaData() *ExtensionMetadata

func (PlatformPlugin) GetName

func (p PlatformPlugin) GetName() (string, error)

func (PlatformPlugin) GetPath

func (p PlatformPlugin) GetPath() string

func (PlatformPlugin) GetResourcesDir

func (p PlatformPlugin) GetResourcesDir() string

GetResourcesDir returns the resources directory of the plugin.

func (PlatformPlugin) GetResourcesDirs

func (p PlatformPlugin) GetResourcesDirs() []string

func (PlatformPlugin) GetRootDir

func (p PlatformPlugin) GetRootDir() string

GetRootDir returns the src directory of the plugin.

func (PlatformPlugin) GetShopwareVersionConstraint

func (p PlatformPlugin) GetShopwareVersionConstraint() (*version.Constraints, error)

func (PlatformPlugin) GetSourceDirs

func (p PlatformPlugin) GetSourceDirs() []string

func (PlatformPlugin) GetType

func (PlatformPlugin) GetType() string

func (PlatformPlugin) GetVersion

func (p PlatformPlugin) GetVersion() (*version.Version, error)

func (PlatformPlugin) UpdateMetaData

func (p PlatformPlugin) UpdateMetaData(metadata *ExtensionMetadata) error

func (PlatformPlugin) Validate

func (p PlatformPlugin) Validate(c context.Context, check validation.Check)

type Setup

type Setup struct {
	RegistrationUrl string `xml:"registrationUrl"`
	Secret          string `xml:"secret,omitempty"`
}

type ShopwareBundle

type ShopwareBundle struct {
	Composer shopwareBundleComposerJson
	// contains filtered or unexported fields
}

func (ShopwareBundle) GetChangelog

func (p ShopwareBundle) GetChangelog() (*ExtensionChangelog, error)

func (ShopwareBundle) GetComposerName

func (p ShopwareBundle) GetComposerName() (string, error)

func (ShopwareBundle) GetExtensionConfig

func (p ShopwareBundle) GetExtensionConfig() *Config

func (ShopwareBundle) GetIconPath

func (p ShopwareBundle) GetIconPath() string

func (ShopwareBundle) GetLicense

func (p ShopwareBundle) GetLicense() (string, error)

func (ShopwareBundle) GetMetaData

func (p ShopwareBundle) GetMetaData() *ExtensionMetadata

func (ShopwareBundle) GetName

func (p ShopwareBundle) GetName() (string, error)

func (ShopwareBundle) GetPath

func (p ShopwareBundle) GetPath() string

func (ShopwareBundle) GetResourcesDir

func (p ShopwareBundle) GetResourcesDir() string

GetResourcesDir returns the resources directory of the shopware bundle.

func (ShopwareBundle) GetResourcesDirs

func (p ShopwareBundle) GetResourcesDirs() []string

func (ShopwareBundle) GetRootDir

func (p ShopwareBundle) GetRootDir() string

GetRootDir returns the src directory of the bundle.

func (ShopwareBundle) GetShopwareVersionConstraint

func (p ShopwareBundle) GetShopwareVersionConstraint() (*version.Constraints, error)

func (ShopwareBundle) GetSourceDirs

func (p ShopwareBundle) GetSourceDirs() []string

func (ShopwareBundle) GetType

func (ShopwareBundle) GetType() string

func (ShopwareBundle) GetVersion

func (p ShopwareBundle) GetVersion() (*version.Version, error)

func (ShopwareBundle) UpdateMetaData

func (p ShopwareBundle) UpdateMetaData(_ *ExtensionMetadata) error

func (ShopwareBundle) Validate

func (p ShopwareBundle) Validate(c context.Context, check validation.Check)

type StorefrontWatcherOptions

type StorefrontWatcherOptions struct {
	ThemeID   string
	DomainURL string
	// ProxyHostname, when set, routes the deprecated webpack hot-proxy watcher
	// through the shared proxy at this hostname (e.g.
	// "storefront-watch.my-shop.shopware.local") instead of exposing fixed
	// local ports, so multiple shops can watch in parallel. Empty keeps the
	// classic local-port behavior.
	ProxyHostname string
}

func ResolveStorefrontWatcherOptions

func ResolveStorefrontWatcherOptions(ctx context.Context, cmdExecutor executor.Executor, salesChannelID string) (StorefrontWatcherOptions, error)

ResolveStorefrontWatcherOptions picks the sales channel to watch and resolves its theme through the Admin API.

type TranslatableString

type TranslatableString []struct {
	Value string `xml:",chardata"`
	Lang  string `xml:"lang,attr,omitempty"`
}

func (TranslatableString) GetValueByLanguage

func (t TranslatableString) GetValueByLanguage(lang []string) string

Jump to

Keyboard shortcuts

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