Skip to content
Merged
5 changes: 4 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

## Unreleased

## [`v29.4.1`](https://github.com/ignite/cli/releases/tag/v29.4.1)

### Changes

- [#4807](https://github.com/ignite/cli/pull/4807) Improve unconfigured path message when building a chain.
- [#4805](https://github.com/ignite/cli/pull/4805) Fetch fallback buf token.
- [#4807](https://github.com/ignite/cli/pull/4807) Improve unconfigured path message when building a chain.
- [#4808](https://github.com/ignite/cli/pull/4808) Remove unused packages.

## [`v29.4.0`](https://github.com/ignite/cli/releases/tag/v29.4.0)

Expand Down
3 changes: 1 addition & 2 deletions ignite/cmd/ignite/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/ignite/cli/v29/ignite/pkg/cliui/colors"
"github.com/ignite/cli/v29/ignite/pkg/cliui/icons"
"github.com/ignite/cli/v29/ignite/pkg/errors"
"github.com/ignite/cli/v29/ignite/pkg/validation"
"github.com/ignite/cli/v29/ignite/pkg/xstrings"
"github.com/ignite/cli/v29/ignite/version"
)
Expand Down Expand Up @@ -64,7 +63,7 @@ func run() int {

if err != nil {
var (
validationErr validation.Error
validationErr errors.ValidationError
versionErr chainconfig.VersionError
msg string
)
Expand Down
3 changes: 1 addition & 2 deletions ignite/cmd/scaffold_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/ignite/cli/v29/ignite/pkg/cliui"
"github.com/ignite/cli/v29/ignite/pkg/errors"
"github.com/ignite/cli/v29/ignite/pkg/validation"
"github.com/ignite/cli/v29/ignite/pkg/xgenny"
"github.com/ignite/cli/v29/ignite/services/scaffolder"
modulecreate "github.com/ignite/cli/v29/ignite/templates/module/create"
Expand Down Expand Up @@ -182,7 +181,7 @@ func scaffoldModuleHandler(cmd *cobra.Command, args []string) error {
}

if err := sc.CreateModule(name, options...); err != nil {
var validationErr validation.Error
var validationErr errors.ValidationError
if !requireRegistration && errors.As(err, &validationErr) {
fmt.Fprintf(&msg, "Can't register module '%s'.\n", name)
fmt.Fprintln(&msg, validationErr.ValidationInfo())
Expand Down
11 changes: 5 additions & 6 deletions ignite/internal/analytics/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/ignite/cli/v29/ignite/internal/sentry"
"github.com/ignite/cli/v29/ignite/pkg/cliui"
"github.com/ignite/cli/v29/ignite/pkg/errors"
"github.com/ignite/cli/v29/ignite/pkg/matomo"
"github.com/ignite/cli/v29/ignite/pkg/randstr"
"github.com/ignite/cli/v29/ignite/version"
)
Expand All @@ -28,7 +27,7 @@ const (
igniteAnonIdentity = "anon_identity.json"
)

var matomoClient matomo.Client
var matomoClient MatomoClient

// anonIdentity represents an analytics identity file.
type anonIdentity struct {
Expand All @@ -39,10 +38,10 @@ type anonIdentity struct {
}

func init() {
matomoClient = matomo.New(
matomoClient = NewMatomoClient(
telemetryEndpoint,
matomo.WithIDSite(4),
matomo.WithSource("https://cli.ignite.com"),
WithIDSite(4),
WithSource("https://cli.ignite.com"),
)
}

Expand Down Expand Up @@ -73,7 +72,7 @@ func SendMetric(wg *sync.WaitGroup, cmd *cobra.Command) {
}
}

met := matomo.Metric{
met := Metric{
Name: cmd.Name(),
Cmd: path,
ScaffoldType: scaffoldType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Package matomo is a client for Matomo to send data points for hint-type=event.
package matomo
package analytics

import (
"crypto/rand"
Expand All @@ -17,17 +16,17 @@ import (
)

type (
// Client is an analytics client.
Client struct {
// MatomoClient is a matomo client.
MatomoClient struct {
endpoint string
idSite uint // Matomo ID Site.
tokenAuth string // Matomo Token Auth.
source string
httpClient http.Client
}

// Params analytics metrics body.
Params struct {
// MatomoParams analytics metrics body.
MatomoParams struct {
IDSite uint `url:"idsite"`
Rec uint `url:"rec"`
ActionName string `url:"action_name"`
Expand Down Expand Up @@ -121,32 +120,32 @@ type (
)

// Option configures code generation.
type Option func(*Client)
type Option func(*MatomoClient)

// WithIDSite adds an id site.
func WithIDSite(idSite uint) Option {
return func(c *Client) {
return func(c *MatomoClient) {
c.idSite = idSite
}
}

// WithTokenAuth adds a matomo token authentication.
func WithTokenAuth(tokenAuth string) Option {
return func(c *Client) {
return func(c *MatomoClient) {
c.tokenAuth = tokenAuth
}
}

// WithSource adds a matomo URL source.
func WithSource(source string) Option {
return func(c *Client) {
return func(c *MatomoClient) {
c.source = source
}
}

// New creates a new Matomo client.
func New(endpoint string, opts ...Option) Client {
c := Client{
// NewMatomoClient creates a new Matomo client.
func NewMatomoClient(endpoint string, opts ...Option) MatomoClient {
c := MatomoClient{
endpoint: endpoint,
source: endpoint,
httpClient: http.Client{
Expand All @@ -161,7 +160,7 @@ func New(endpoint string, opts ...Option) Client {
}

// Send sends metric event to analytics.
func (c Client) Send(params Params) error {
func (c MatomoClient) Send(params MatomoParams) error {
requestURL, err := url.Parse(c.endpoint)
if err != nil {
return err
Expand Down Expand Up @@ -189,7 +188,7 @@ func (c Client) Send(params Params) error {
}

// SendMetric build the metrics and send to analytics.
func (c Client) SendMetric(sessionID string, metric Metric) error {
func (c MatomoClient) SendMetric(sessionID string, metric Metric) error {
var (
now = time.Now()
r, _ = rand.Int(rand.Reader, big.NewInt(math.MaxInt64))
Expand All @@ -201,7 +200,7 @@ func (c Client) SendMetric(sessionID string, metric Metric) error {

cmd := splitCommand(metric.Cmd)

return c.Send(Params{
return c.Send(MatomoParams{
IDSite: c.idSite,
Rec: 1,
APIVersion: 1,
Expand Down Expand Up @@ -261,6 +260,6 @@ func splitCommand(cmd string) []string {
}

// metricURL build the metric URL.
func (c Client) metricURL(cmd string) string {
func (c MatomoClient) metricURL(cmd string) string {
return fmt.Sprintf("%s/%s", c.source, strings.ReplaceAll(cmd, " ", "_"))
}
40 changes: 0 additions & 40 deletions ignite/pkg/cosmoserror/error.go

This file was deleted.

88 changes: 0 additions & 88 deletions ignite/pkg/cosmoserror/error_test.go

This file was deleted.

13 changes: 0 additions & 13 deletions ignite/pkg/cosmostestutil/sample/sample.go

This file was deleted.

16 changes: 0 additions & 16 deletions ignite/pkg/cosmostestutil/sample/sample_test.go

This file was deleted.

25 changes: 0 additions & 25 deletions ignite/pkg/cosmosutil/address.go

This file was deleted.

Loading