Skip to content

Commit

Permalink
fix: revert minVersion checking
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim authored Mar 3, 2024
1 parent e8a60ef commit bdeb3ea
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions extension/asset_platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,12 @@ func BuildAssetsForExtensions(ctx context.Context, sources []asset.Source, asset
return nil
}

minVersion, err := lookupForMinMatchingVersion(ctx, assetConfig.ShopwareVersion)
if err != nil {
return err
}

requiresShopwareSources := cfgs.RequiresShopwareRepository()

shopwareRoot := assetConfig.ShopwareRoot
var err error
if shopwareRoot == "" && requiresShopwareSources {
shopwareRoot, err = setupShopwareInTemp(ctx, minVersion)
shopwareRoot, err = setupShopwareInTemp(ctx, assetConfig.ShopwareVersion)

if err != nil {
return err
Expand Down Expand Up @@ -136,15 +132,9 @@ func BuildAssetsForExtensions(ctx context.Context, sources []asset.Source, asset
}

if !assetConfig.DisableStorefrontBuild && cfgs.RequiresStorefrontBuild() {
isNewLayout := false

if minVersion == DevVersionNumber || version.Must(version.NewVersion(minVersion)).GreaterThanOrEqual(version.Must(version.NewVersion("6.6.0.0"))) {
isNewLayout = true
}

// Build all extensions compatible with esbuild first
for name, entry := range cfgs.FilterByStorefrontAndEsBuild(true) {
options := esbuild.NewAssetCompileOptionsStorefront(name, entry.BasePath, isNewLayout)
options := esbuild.NewAssetCompileOptionsStorefront(name, entry.BasePath, false)

if _, err := esbuild.CompileExtensionAsset(ctx, options); err != nil {
return err
Expand Down Expand Up @@ -519,7 +509,12 @@ func createConfigFromPath(entryPointName string, extensionRoot string) Extension
return cfg
}

func setupShopwareInTemp(ctx context.Context, minVersion string) (string, error) {
func setupShopwareInTemp(ctx context.Context, shopwareVersionConstraint *version.Constraints) (string, error) {
minVersion, err := lookupForMinMatchingVersion(ctx, shopwareVersionConstraint)
if err != nil {
return "", err
}

dir, err := os.MkdirTemp("", "extension")
if err != nil {
return "", err
Expand Down

0 comments on commit bdeb3ea

Please sign in to comment.