Skip to content

Commit

Permalink
fix: cleanup asset build config
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Dec 3, 2023
1 parent 3eb4abf commit ad16a85
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
11 changes: 1 addition & 10 deletions cmd/extension/extension_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ var extensionAssetBundleCmd = &cobra.Command{
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
assetCfg := extension.AssetBuildConfig{
EnableESBuildForAdmin: false,
EnableESBuildForStorefront: false,
ShopwareRoot: os.Getenv("SHOPWARE_PROJECT_ROOT"),
ShopwareRoot: os.Getenv("SHOPWARE_PROJECT_ROOT"),
}
validatedExtensions := make([]extension.Extension, 0)

Expand All @@ -37,13 +35,6 @@ var extensionAssetBundleCmd = &cobra.Command{
validatedExtensions = append(validatedExtensions, ext)
}

if len(args) == 1 {
extCfg := validatedExtensions[0].GetExtensionConfig()

assetCfg.EnableESBuildForAdmin = extCfg.Build.Zip.Assets.EnableESBuildForAdmin
assetCfg.EnableESBuildForStorefront = extCfg.Build.Zip.Assets.EnableESBuildForStorefront
}

constraint, err := validatedExtensions[0].GetShopwareVersionConstraint()
if err != nil {
return fmt.Errorf("cannot get shopware version constraint: %w", err)
Expand Down
8 changes: 3 additions & 5 deletions cmd/extension/extension_zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,9 @@ var extensionZipCmd = &cobra.Command{
}

assetBuildConfig := extension.AssetBuildConfig{
EnableESBuildForAdmin: extCfg.Build.Zip.Assets.EnableESBuildForAdmin,
EnableESBuildForStorefront: extCfg.Build.Zip.Assets.EnableESBuildForStorefront,
CleanupNodeModules: true,
ShopwareRoot: os.Getenv("SHOPWARE_PROJECT_ROOT"),
ShopwareVersion: shopwareConstraint,
CleanupNodeModules: true,
ShopwareRoot: os.Getenv("SHOPWARE_PROJECT_ROOT"),
ShopwareVersion: shopwareConstraint,
}

if err := extension.BuildAssetsForExtensions(cmd.Context(), extension.ConvertExtensionsToSources(cmd.Context(), []extension.Extension{tempExt}), assetBuildConfig); err != nil {
Expand Down
2 changes: 0 additions & 2 deletions cmd/project/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ var projectCI = &cobra.Command{
}

assetCfg := extension.AssetBuildConfig{
EnableESBuildForAdmin: false,
EnableESBuildForStorefront: false,
CleanupNodeModules: true,
ShopwareRoot: args[0],
ShopwareVersion: constraint,
Expand Down
2 changes: 0 additions & 2 deletions extension/asset_platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const (
)

type AssetBuildConfig struct {
EnableESBuildForAdmin bool
EnableESBuildForStorefront bool
CleanupNodeModules bool
DisableAdminBuild bool
DisableStorefrontBuild bool
Expand Down

0 comments on commit ad16a85

Please sign in to comment.