Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/account/account_company_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ var accountCompanyListCmd = &cobra.Command{
Long: ``,
Run: func(_ *cobra.Command, _ []string) {
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"ID", "Name", "Customer ID", "Roles"})
table.Header([]string{"ID", "Name", "Customer ID", "Roles"})

for _, membership := range services.AccountClient.GetMemberships() {
table.Append([]string{
_ = table.Append([]string{
strconv.FormatInt(int64(membership.Company.Id), 10),
membership.Company.Name,
membership.Company.CustomerNumber,
strings.Join(membership.GetRoles(), ", "),
})
}

table.Render()
_ = table.Render()
},
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/account/account_merchant_shop_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ var accountCompanyMerchantShopListCmd = &cobra.Command{
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, _ []string) error {
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"ID", "Domain", "Usage"})
table.Header([]string{"ID", "Domain", "Usage"})

shops, err := services.AccountClient.Merchant().Shops(cmd.Context())
if err != nil {
return err
}

for _, shop := range shops {
table.Append([]string{
_ = table.Append([]string{
strconv.FormatInt(int64(shop.Id), 10),
shop.Domain,
shop.Environment.Name,
})
}

table.Render()
_ = table.Render()

return nil
},
Expand Down
6 changes: 3 additions & 3 deletions cmd/account/account_producer_extension_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var accountCompanyProducerExtensionListCmd = &cobra.Command{
}

table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"ID", "Name", "Type", "Compatible with latest version", "Status"})
table.Header([]string{"ID", "Name", "Type", "Compatible with latest version", "Status"})

for _, extension := range extensions {
if extension.Status.Name == "deleted" {
Expand All @@ -49,7 +49,7 @@ var accountCompanyProducerExtensionListCmd = &cobra.Command{
compatible = "Yes"
}

table.Append([]string{
_ = table.Append([]string{
strconv.FormatInt(int64(extension.Id), 10),
extension.Name,
extension.Generation.Description,
Expand All @@ -58,7 +58,7 @@ var accountCompanyProducerExtensionListCmd = &cobra.Command{
})
}

table.Render()
_ = table.Render()

return nil
},
Expand Down
9 changes: 4 additions & 5 deletions cmd/extension/extension_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,17 @@ var extensionValidateCmd = &cobra.Command{

if context.HasErrors() || context.HasWarnings() {
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Type", "Identifier", "Message"})
table.SetAutoWrapText(false)
table.Header([]string{"Type", "Identifier", "Message"})

for _, msg := range context.Errors() {
table.Append([]string{"Error", msg.Identifier, msg.Message})
_ = table.Append([]string{"Error", msg.Identifier, msg.Message})
}

for _, msg := range context.Warnings() {
table.Append([]string{"Warning", msg.Identifier, msg.Message})
_ = table.Append([]string{"Warning", msg.Identifier, msg.Message})
}

table.Render()
_ = table.Render()
}

if context.HasErrors() {
Expand Down
7 changes: 3 additions & 4 deletions cmd/project/project_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ var projectDebug = &cobra.Command{

fmt.Println("Following extensions/bundles has been detected")
table := tablewriter.NewWriter(os.Stdout)
table.SetColWidth(100)
table.SetHeader([]string{"Name", "Path"})
table.Header([]string{"Name", "Path"})

for _, source := range sources {
table.Append([]string{source.Name, source.Path})
_ = table.Append([]string{source.Name, source.Path})
}

table.Render()
_ = table.Render()

return nil
},
Expand Down
7 changes: 3 additions & 4 deletions cmd/project/project_extension_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ var projectExtensionListCmd = &cobra.Command{
}

table := tablewriter.NewWriter(os.Stdout)
table.SetColWidth(100)
table.SetHeader([]string{"Name", "Version", "Status"})
table.Header([]string{"Name", "Version", "Status"})

for _, extension := range extensions {
table.Append([]string{extension.Name, extension.Version, extension.Status()})
_ = table.Append([]string{extension.Name, extension.Version, extension.Status()})
}

table.Render()
_ = table.Render()

return nil
},
Expand Down
7 changes: 3 additions & 4 deletions cmd/project/project_extension_outdated.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@ var projectExtensionOutdatedCmd = &cobra.Command{
}

table := tablewriter.NewWriter(os.Stdout)
table.SetColWidth(100)
table.SetHeader([]string{"Name", "Current Version", "Latest Version", "Update Source"})
table.Header([]string{"Name", "Current Version", "Latest Version", "Update Source"})

for _, extension := range extensions {
table.Append([]string{extension.Name, extension.Version, extension.LatestVersion, extension.UpdateSource})
_ = table.Append([]string{extension.Name, extension.Version, extension.LatestVersion, extension.UpdateSource})
}

table.Render()
_ = table.Render()

return fmt.Errorf("there are %d outdated extensions", len(extensions))
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/project/project_extension_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func increaseExtensionVersion(ctx context.Context, ext extension.Extension) erro
return err
}

ver.Increase()
ver.IncreasePatch()

if err = encoder.EncodeElement(ver.String(), v); err != nil {
return err
Expand Down Expand Up @@ -327,7 +327,7 @@ func increaseExtensionVersion(ctx context.Context, ext extension.Extension) erro
return err
}

ver.Increase()
ver.IncreasePatch()

composerJson["version"] = ver.String()

Expand Down
2 changes: 1 addition & 1 deletion extension/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestCreateBundle(t *testing.T) {

version, err := bundle.GetVersion()
assert.NoError(t, err)
assert.Equal(t, "1.0.0", version.String())
assert.Equal(t, "1.0.0.0", version.String())

// does notthing
bundle.Validate(getTestContext(), &ValidationContext{})
Expand Down
22 changes: 5 additions & 17 deletions extension/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestGetShopwareProjectConstraintComposerJson(t *testing.T) {
}
]}`,
},
Constraint: "6.5.0",
Constraint: "6.5.*",
},
{
Name: "Branch installed, determine by Kernel.php",
Expand All @@ -61,7 +61,7 @@ func TestGetShopwareProjectConstraintComposerJson(t *testing.T) {
final public const SHOPWARE_FALLBACK_VERSION = '6.6.9999999.9999999-dev';
`,
},
Constraint: "~6.6.0",
Constraint: "6.5.*",
},
{
Name: "Get constraint from kernel (shopware/shopware case)",
Expand Down Expand Up @@ -106,19 +106,7 @@ final public const SHOPWARE_FALLBACK_VERSION = '6.6.9999999.9999999-dev';
"shopware/core": "6.5.*"
}}`,
},
Error: "malformed constraint: 6.5.*",
},

{
Name: "composer.json malformed version, with broken lock",
Files: map[string]string{
"composer.json": `{
"require": {
"shopware/core": "6.5.*"
}}`,
"composer.lock": `broken`,
},
Error: "could not parse composer.lock",
Constraint: "6.5.*",
},

{
Expand All @@ -130,7 +118,7 @@ final public const SHOPWARE_FALLBACK_VERSION = '6.6.9999999.9999999-dev';
}}`,
"composer.lock": `{"packages": []}`,
},
Error: "malformed constraint: 6.5.*",
Constraint: "6.5.*",
},
}

Expand All @@ -146,7 +134,7 @@ final public const SHOPWARE_FALLBACK_VERSION = '6.6.9999999.9999999-dev';
assert.NoError(t, os.MkdirAll(parentDir, os.ModePerm))
}

assert.NoError(t, os.WriteFile(tmpFile, []byte(content), 0644))
assert.NoError(t, os.WriteFile(tmpFile, []byte(content), 0o644))
}

constraint, err := GetShopwareProjectConstraint(tmpDir)
Expand Down
44 changes: 24 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@ go 1.24.0
replace github.com/doutorfinancas/go-mad v0.0.0-20240205120830-463c1e9760f0 => github.com/shyim/go-mad v0.0.0-20250401132841-d19165fb2107

require (
dario.cat/mergo v1.0.1
dario.cat/mergo v1.0.2
github.com/NYTimes/gziphandler v1.1.1
github.com/bep/godartsass/v2 v2.5.0
github.com/caarlos0/env/v9 v9.0.0
github.com/charmbracelet/huh v0.7.0
github.com/charmbracelet/huh/spinner v0.0.0-20250313180200-29e1d4556a22
github.com/charmbracelet/huh/spinner v0.0.0-20250509124401-5fd7cf508477
github.com/charmbracelet/lipgloss v1.1.0
github.com/doutorfinancas/go-mad v0.0.0-20240205120830-463c1e9760f0
github.com/evanw/esbuild v0.25.3
github.com/friendsofshopware/go-shopware-admin-api-sdk v0.0.0-20231210091330-92f38f1ae77c
github.com/evanw/esbuild v0.25.4
github.com/friendsofshopware/go-shopware-admin-api-sdk v0.0.0-20240608075117-3c16ae8b5f02
github.com/go-sql-driver/mysql v1.9.2
github.com/google/uuid v1.6.0
github.com/gorilla/schema v1.4.1
github.com/invopop/jsonschema v0.13.0
github.com/joho/godotenv v1.5.1
github.com/microcosm-cc/bluemonday v1.0.27
github.com/olekukonko/tablewriter v0.0.5
github.com/olekukonko/tablewriter v1.0.4
github.com/otiai10/copy v1.14.1
github.com/shyim/go-version v0.0.0-20240530110323-4b7091cee42c
github.com/shyim/go-version v0.0.0-20250513054659-15e244b52011
github.com/spf13/cobra v1.9.1
github.com/stretchr/testify v1.10.0
github.com/tetratelabs/wazero v1.9.0
github.com/vulcand/oxy/v2 v2.0.3
github.com/wI2L/jsondiff v0.6.1
github.com/wI2L/jsondiff v0.7.0
github.com/wk8/go-ordered-map/v2 v2.1.8
github.com/yuin/goldmark v1.7.11
go.uber.org/zap v1.27.0
golang.org/x/text v0.24.0
golang.org/x/text v0.25.0
gopkg.in/yaml.v3 v3.0.1
)

Expand All @@ -41,22 +41,26 @@ require (
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/catppuccin/go v0.3.0 // indirect
github.com/charmbracelet/bubbles v0.21.0 // indirect
github.com/charmbracelet/bubbletea v1.3.4 // indirect
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
github.com/charmbracelet/x/ansi v0.8.0 // indirect
github.com/charmbracelet/bubbletea v1.3.5 // indirect
github.com/charmbracelet/colorprofile v0.3.1 // indirect
github.com/charmbracelet/x/ansi v0.9.2 // indirect
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect
github.com/charmbracelet/x/exp/strings v0.0.0-20250512155337-1597d732b701 // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/jaswdr/faker/v2 v2.3.3 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/jaswdr/faker/v2 v2.5.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/olekukonko/errors v1.1.0 // indirect
github.com/olekukonko/ll v0.0.6-0.20250511102614-9564773e9d27 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
)

Expand All @@ -70,21 +74,21 @@ require (
github.com/gorilla/css v1.0.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/compress v1.18.0
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/otiai10/mint v1.6.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/shyim/go-htmlprinter v0.0.0-20250212091723-cc11f7bf036d
github.com/shyim/go-htmlprinter v0.0.0-20250417052954-e3e325d9ba3f
github.com/spf13/pflag v1.0.6 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.39.0
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sync v0.13.0 // indirect
golang.org/x/sys v0.32.0 // indirect
google.golang.org/protobuf v1.35.2 // indirect
golang.org/x/net v0.40.0
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.14.0 // indirect
golang.org/x/sys v0.33.0 // indirect
google.golang.org/protobuf v1.36.6 // indirect
)
Loading