Documentation
¶
Index ¶
- Constants
- Variables
- func AdminDevServerPort(projectRoot string) int
- func BuildAssetsForExtensions(ctx context.Context, sources []asset.Source, assetConfig AssetBuildConfig) error
- func BuildModifier(ext Extension, extensionRoot string, config BuildModifierConfig) error
- func ChecksumFile(filePath string) (string, error)
- func CleanupAdministrationFiles(ctx context.Context, folder string) error
- func CleanupExtensionFolder(path string, additionalPaths []string) error
- func CleanupJavaScriptSourceMaps(folder string) error
- func ConfigExists(ctx context.Context, dir string) bool
- func ConfigPath(ctx context.Context, dir string) string
- func ConfigSchema() []byte
- func ConvertExtensionsToSources(ctx context.Context, extensions []Extension) []asset.Source
- func DumpAndLoadAssetSourcesOfProject(ctx context.Context, project string, shopCfg *shop.Config, ...) ([]asset.Source, error)
- func EmptyConfigFile() string
- func ExcludeExtensionsFromSources(sources []asset.Source, excluded []string) []asset.Source
- func FindAssetSourcesOfProject(ctx context.Context, project string, shopCfg *shop.Config) []asset.Source
- func GenerateChecksumJSON(ctx context.Context, baseFolder string, ext Extension) error
- func GetPhpVersion(ctx context.Context, constraint *version.Constraints) (string, error)
- func GetShopwareBuildVersionConstraint(config *Config) (*version.Constraints, error)
- func GetShopwareProjectConstraint(project string) (*version.Constraints, error)
- func GetShopwareVersionConstraintForBuild(ext Extension) (*version.Constraints, error)
- func GetShopwareVersions(ctx context.Context) ([]string, error)
- func GitCopyFolder(ctx context.Context, source, target, commitHash string) (string, error)
- func InitConfig(ctx context.Context, dir string, force bool) (string, error)
- func InstallNodeModulesOfConfigs(ctx context.Context, cfgs ExtensionAssetConfig, assetConfig AssetBuildConfig) ([]string, error)
- func LoadProjectAssetSources(ctx context.Context, projectRoot string, shopCfg *shop.Config, ...) ([]asset.Source, error)
- func PlatformPath(projectRoot, component, subPath string) string
- func PlatformRelPath(projectRoot, component, subPath string) string
- func PrepareAdminWatcher(ctx context.Context, projectRoot string, cmdExecutor executor.Executor, ...) (*executor.Process, error)
- func PrepareExtensionForRelease(ctx context.Context, sourceRoot, extensionRoot string, ext Extension) error
- func PrepareFolderForZipping(ctx context.Context, path string, ext Extension, extCfg *Config) error
- func PrepareStorefrontWatcher(ctx context.Context, projectRoot string, cmdExecutor executor.Executor, ...) (*executor.Process, error)
- func ResizeExtensionIcon(ctx context.Context, ext Extension) error
- func RunValidation(ctx context.Context, ext Extension, check validation.Check)
- func WritePluginJsonForSources(ctx context.Context, projectRoot string, sources []asset.Source, ...) error
- func WriteProjectPluginJson(ctx context.Context, projectRoot string, shopCfg *shop.Config, ...) error
- type App
- func (a App) GetChangelog() (*ExtensionChangelog, error)
- func (a App) GetComposerName() (string, error)
- func (a App) GetExtensionConfig() *Config
- func (a App) GetIconPath() string
- func (a App) GetLicense() (string, error)
- func (a App) GetMetaData() *ExtensionMetadata
- func (a App) GetName() (string, error)
- func (a App) GetPath() string
- func (a App) GetResourcesDir() string
- func (a App) GetResourcesDirs() []string
- func (a App) GetRootDir() string
- func (a App) GetShopwareVersionConstraint() (*version.Constraints, error)
- func (a App) GetSourceDirs() []string
- func (App) GetType() string
- func (a App) GetVersion() (*version.Version, error)
- func (a App) UpdateMetaData(metadata *ExtensionMetadata) error
- func (a App) Validate(_ context.Context, check validation.Check)
- type AssetBuildConfig
- type BuildModifierConfig
- type ChecksumJSON
- type Config
- type ConfigBuild
- type ConfigBuildZip
- type ConfigBuildZipAssets
- type ConfigBuildZipAssetsAdditionalCache
- type ConfigBuildZipChecksum
- type ConfigBuildZipComposer
- type ConfigBuildZipPack
- type ConfigBuildZipPackExcludes
- type ConfigExtraBundle
- type ConfigStore
- type ConfigStoreDemoShop
- type ConfigStoreFaq
- type ConfigStoreImage
- type ConfigStoreImageActivate
- type ConfigStoreImagePreview
- type ConfigTranslated
- type ConfigValidation
- type ConfigValidationList
- type ConsoleCommandFunc
- type Extension
- type ExtensionAssetConfig
- func (c ExtensionAssetConfig) FilterByAdmin() ExtensionAssetConfig
- func (c ExtensionAssetConfig) FilterByAdminAndEsBuild(esbuildEnabled bool) ExtensionAssetConfig
- func (c ExtensionAssetConfig) FilterByStorefrontAndEsBuild(esbuildEnabled bool) ExtensionAssetConfig
- func (c ExtensionAssetConfig) Has(name string) bool
- func (c ExtensionAssetConfig) Not(extensions []string) ExtensionAssetConfig
- func (c ExtensionAssetConfig) Only(extensions []string) ExtensionAssetConfig
- func (c ExtensionAssetConfig) RequiresAdminBuild() bool
- func (c ExtensionAssetConfig) RequiresShopwareRepository() bool
- func (c ExtensionAssetConfig) RequiresStorefrontBuild() bool
- type ExtensionAssetConfigAdmin
- type ExtensionAssetConfigEntry
- type ExtensionAssetConfigStorefront
- type ExtensionChangelog
- type ExtensionMetadata
- type ExtensionTranslated
- type Manifest
- type Meta
- type PlatformComposerJson
- type PlatformPlugin
- func (p PlatformPlugin) GetChangelog() (*ExtensionChangelog, error)
- func (p PlatformPlugin) GetComposerName() (string, error)
- func (p PlatformPlugin) GetExtensionConfig() *Config
- func (p PlatformPlugin) GetIconPath() string
- func (p PlatformPlugin) GetLicense() (string, error)
- func (p PlatformPlugin) GetMetaData() *ExtensionMetadata
- func (p PlatformPlugin) GetName() (string, error)
- func (p PlatformPlugin) GetPath() string
- func (p PlatformPlugin) GetResourcesDir() string
- func (p PlatformPlugin) GetResourcesDirs() []string
- func (p PlatformPlugin) GetRootDir() string
- func (p PlatformPlugin) GetShopwareVersionConstraint() (*version.Constraints, error)
- func (p PlatformPlugin) GetSourceDirs() []string
- func (PlatformPlugin) GetType() string
- func (p PlatformPlugin) GetVersion() (*version.Version, error)
- func (p PlatformPlugin) UpdateMetaData(metadata *ExtensionMetadata) error
- func (p PlatformPlugin) Validate(c context.Context, check validation.Check)
- type Setup
- type ShopwareBundle
- func (p ShopwareBundle) GetChangelog() (*ExtensionChangelog, error)
- func (p ShopwareBundle) GetComposerName() (string, error)
- func (p ShopwareBundle) GetExtensionConfig() *Config
- func (p ShopwareBundle) GetIconPath() string
- func (p ShopwareBundle) GetLicense() (string, error)
- func (p ShopwareBundle) GetMetaData() *ExtensionMetadata
- func (p ShopwareBundle) GetName() (string, error)
- func (p ShopwareBundle) GetPath() string
- func (p ShopwareBundle) GetResourcesDir() string
- func (p ShopwareBundle) GetResourcesDirs() []string
- func (p ShopwareBundle) GetRootDir() string
- func (p ShopwareBundle) GetShopwareVersionConstraint() (*version.Constraints, error)
- func (p ShopwareBundle) GetSourceDirs() []string
- func (ShopwareBundle) GetType() string
- func (p ShopwareBundle) GetVersion() (*version.Version, error)
- func (p ShopwareBundle) UpdateMetaData(_ *ExtensionMetadata) error
- func (p ShopwareBundle) Validate(c context.Context, check validation.Check)
- type StorefrontWatcherOptions
- type TranslatableString
Constants ¶
const ( AdminVitePort = 5173 AdminWebpackPort = 8080 )
Default ports of the administration dev server, chosen by the platform's build tooling.
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" )
const ( TypePlatformApp = "app" TypePlatformPlugin = "plugin" TypeShopwareBundle = "shopware-bundle" ComposerTypePlugin = "shopware-platform-plugin" ComposerTypeApp = "shopware-app" ComposerTypeBundle = "shopware-bundle" )
const (
// ConfigSchemaURL is the JSON Schema URL used by the YAML language server.
ConfigSchemaURL = "https://shopware.github.io/shopware-cli/shopware-extension-schema.json"
)
const DevVersionNumber = "6.9.9.9"
Variables ¶
var ConfigLocations = []string{
".config/shopware-extension.yml",
".shopware-extension.yml",
".shopware-extension.yaml",
}
var ErrPlatformInvalidType = errors.New("invalid composer type")
Functions ¶
func AdminDevServerPort ¶
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 BuildModifier ¶
func BuildModifier(ext Extension, extensionRoot string, config BuildModifierConfig) error
func ChecksumFile ¶
ChecksumFile generates a XXH128 checksum for a given file
func CleanupAdministrationFiles ¶
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 CleanupJavaScriptSourceMaps ¶
CleanupJavaScriptSourceMaps removes .js.map files and their corresponding sourceMappingURL comments from .js files.
func ConfigExists ¶
ConfigExists reports whether a .config/shopware-extension.yml or .shopware-extension.yml/.yaml is present.
func ConfigPath ¶
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 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 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 ¶
GenerateChecksumJSON creates a checksum.json file in the given folder
func GetPhpVersion ¶
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 GitCopyFolder ¶
func InitConfig ¶
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 PlatformPath ¶
func PlatformRelPath ¶
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 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 RunValidation ¶
func RunValidation(ctx context.Context, ext Extension, check validation.Check)
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (App) GetChangelog ¶
func (a App) GetChangelog() (*ExtensionChangelog, error)
func (App) GetComposerName ¶
func (App) GetExtensionConfig ¶
func (App) GetIconPath ¶
func (App) GetLicense ¶
func (App) GetMetaData ¶
func (a App) GetMetaData() *ExtensionMetadata
func (App) GetResourcesDir ¶
func (App) GetResourcesDirs ¶
func (App) GetRootDir ¶
func (App) GetShopwareVersionConstraint ¶
func (a App) GetShopwareVersionConstraint() (*version.Constraints, error)
func (App) GetSourceDirs ¶
func (App) UpdateMetaData ¶
func (a App) UpdateMetaData(metadata *ExtensionMetadata) error
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 ChecksumJSON ¶
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) GetStorageLocation ¶
func (*Config) HasCompatibilityDate ¶
func (*Config) IsCompatibilityDateAtLeast ¶
func (*Config) IsCompatibilityDateBefore ¶
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 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 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 ConfigStoreImagePreview ¶
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 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 GetExtensionByFolder ¶
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 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 ExtensionChangelog ¶
type ExtensionMetadata ¶
type ExtensionMetadata struct {
Name string
Label ExtensionTranslated
Description ExtensionTranslated
}
type ExtensionTranslated ¶
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 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
Source Files
¶
- admin_watch.go
- app.go
- asset.go
- asset_cache.go
- asset_config.go
- asset_platform.go
- build_modifier.go
- bundle.go
- changelog.go
- checksum.go
- cleanup.go
- cleanup_ci.go
- composer_info.go
- config.go
- config_init.go
- config_schema.go
- git.go
- icon.go
- manifest.go
- npm.go
- packagist.go
- platform.go
- project.go
- project_plugin_json.go
- root.go
- setup.go
- snippet_validator.go
- storefront_watch.go
- theme.go
- util.go
- validator.go
- validator_assets.go
- zip.go