From 3b8c727d615f9a489e776288d77309db65cfc346 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:08:23 -0300 Subject: [PATCH 01/15] add cosmos client docs --- docs/docs/07-packages/cosmosclient.md | 102 ++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 docs/docs/07-packages/cosmosclient.md diff --git a/docs/docs/07-packages/cosmosclient.md b/docs/docs/07-packages/cosmosclient.md new file mode 100644 index 0000000000..603c94b68c --- /dev/null +++ b/docs/docs/07-packages/cosmosclient.md @@ -0,0 +1,102 @@ +--- +sidebar_position: 1 +title: Blockchain Client (cosmosclient) +slug: /packages/cosmosclient +--- + +# Blockchain Client (cosmosclient) + +The `cosmosclient` package is a Go client for Cosmos SDK chains. It provides helpers +to query chain data and to create, sign, and broadcast transactions. + +For full API details, see the +[`cosmosclient` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosclient). + +## Example: Transfer between two cosmoshub accounts + +This example sends `1000uatom` from `alice` to `bob` on Cosmos Hub. + +It assumes: +- You already imported both accounts into a local keyring directory. +- The `alice` account has enough `uatom` to pay the amount and fees. + +```go +package main + +import ( + "context" + "fmt" + "log" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ignite/cli/v29/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v29/ignite/pkg/cosmosclient" +) + +const ( + nodeAddress = "https://rpc.cosmos.directory:443/cosmoshub" + keyringDir = "./keyring-test" + fromAccountName = "alice" + toAccountName = "bob" + amountToSend = "1000uatom" +) + +func main() { + ctx := context.Background() + + // Create a Cosmos Hub client. + client, err := cosmosclient.New( + ctx, + cosmosclient.WithNodeAddress(nodeAddress), + cosmosclient.WithBech32Prefix(cosmosaccount.AccountPrefixCosmos), + cosmosclient.WithKeyringBackend(cosmosaccount.KeyringTest), + cosmosclient.WithKeyringDir(keyringDir), + cosmosclient.WithGas(cosmosclient.GasAuto), + cosmosclient.WithGasPrices("0.025uatom"), + ) + if err != nil { + log.Fatal(err) + } + + fromAccount, err := client.Account(fromAccountName) + if err != nil { + log.Fatal(err) + } + + toAccount, err := client.Account(toAccountName) + if err != nil { + log.Fatal(err) + } + + toAddress, err := toAccount.Address(cosmosaccount.AccountPrefixCosmos) + if err != nil { + log.Fatal(err) + } + + amount, err := sdk.ParseCoinsNormalized(amountToSend) + if err != nil { + log.Fatal(err) + } + + // Build and broadcast a bank send transaction. + txService, err := client.BankSendTx(ctx, fromAccount, toAddress, amount) + if err != nil { + log.Fatal(err) + } + + resp, err := txService.Broadcast(ctx) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("transaction hash: %s\n", resp.TxHash) +} +``` + +To import accounts into the test keyring directory, you can use: + +```bash +ignite account import alice --keyring-dir ./keyring-test --keyring-backend test +ignite account import bob --keyring-dir ./keyring-test --keyring-backend test +``` From 543f86d5187c4e8d45774a346ca5ab461d9f56ac Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:12:05 -0300 Subject: [PATCH 02/15] add chain cmd runner pkg docs --- docs/docs/07-packages/chaincmdrunner.md | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 docs/docs/07-packages/chaincmdrunner.md diff --git a/docs/docs/07-packages/chaincmdrunner.md b/docs/docs/07-packages/chaincmdrunner.md new file mode 100644 index 0000000000..ba510285ab --- /dev/null +++ b/docs/docs/07-packages/chaincmdrunner.md @@ -0,0 +1,63 @@ +--- +sidebar_position: 4 +title: Chain Command Runner (chaincmd/runner) +slug: /packages/chaincmdrunner +--- + +# Chain Command Runner (chaincmd/runner) + +The `chaincmd/runner` package wraps chain daemon CLI commands with a higher-level Go API. +It is useful when you need to automate workflows like querying node status, managing accounts, +or sending tokens through a chain binary. + +For full API details, see the +[`chaincmd/runner` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner). + +## Example: Query node status and list keyring accounts + +This example uses `gaiad` as the chain binary. + +```go +package main + +import ( + "context" + "fmt" + "log" + "os" + + "github.com/ignite/cli/v29/ignite/pkg/chaincmd" + chaincmdrunner "github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner" +) + +func main() { + ctx := context.Background() + + cmd := chaincmd.New( + "gaiad", + chaincmd.WithHome(os.ExpandEnv("$HOME/.gaia")), + chaincmd.WithNodeAddress("https://rpc.cosmos.directory:443/cosmoshub"), + chaincmd.WithKeyringBackend(chaincmd.KeyringBackendTest), + ) + + runner, err := chaincmdrunner.New(ctx, cmd) + if err != nil { + log.Fatal(err) + } + + status, err := runner.Status(ctx) + if err != nil { + log.Fatal(err) + } + fmt.Printf("chain id: %s\n", status.ChainID) + + accounts, err := runner.ListAccounts(ctx) + if err != nil { + log.Fatal(err) + } + + for _, account := range accounts { + fmt.Printf("%s: %s\n", account.Name, account.Address) + } +} +``` From 93cbc20f53ea36b40e227aaa3b6a4c36a36bc187 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:12:13 -0300 Subject: [PATCH 03/15] add chain registry pkg docs --- docs/docs/07-packages/chainregistry.md | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 docs/docs/07-packages/chainregistry.md diff --git a/docs/docs/07-packages/chainregistry.md b/docs/docs/07-packages/chainregistry.md new file mode 100644 index 0000000000..e9db4c23fc --- /dev/null +++ b/docs/docs/07-packages/chainregistry.md @@ -0,0 +1,67 @@ +--- +sidebar_position: 3 +title: Chain Registry Types (chainregistry) +slug: /packages/chainregistry +--- + +# Chain Registry Types (chainregistry) + +The `chainregistry` package provides Go structs for Cosmos chain registry files such as +`chain.json` and `assetlist.json`, plus helpers to save them as JSON. + +For full API details, see the +[`chainregistry` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chainregistry). + +## Example: Generate chain.json and assetlist.json + +```go +package main + +import ( + "log" + "os" + "path/filepath" + + "github.com/ignite/cli/v29/ignite/pkg/chainregistry" +) + +func main() { + outDir := "./chain-registry" + if err := os.MkdirAll(outDir, 0o755); err != nil { + log.Fatal(err) + } + + chain := chainregistry.Chain{ + ChainName: "ignite", + PrettyName: "Ignite", + ChainID: "ignite-1", + Bech32Prefix: "cosmos", + DaemonName: "ignited", + NodeHome: ".ignite", + Status: chainregistry.ChainStatusActive, + NetworkType: chainregistry.NetworkTypeMainnet, + ChainType: chainregistry.ChainTypeCosmos, + } + + if err := chain.SaveJSON(filepath.Join(outDir, "chain.json")); err != nil { + log.Fatal(err) + } + + assetList := chainregistry.AssetList{ + ChainName: "ignite", + Assets: []chainregistry.Asset{ + { + Name: "Ignite Token", + Symbol: "IGNT", + Base: "uignite", + Display: "ignite", + TypeAsset: "sdk.coin", + }, + }, + } + + if err := assetList.SaveJSON(filepath.Join(outDir, "assetlist.json")); err != nil { + log.Fatal(err) + } +} +``` From 13832c005834f8338c28158ba6b9687d9913cd59 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:12:24 -0300 Subject: [PATCH 04/15] add cosmos faucet pkg docs --- docs/docs/07-packages/cosmosfaucet.md | 90 +++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 docs/docs/07-packages/cosmosfaucet.md diff --git a/docs/docs/07-packages/cosmosfaucet.md b/docs/docs/07-packages/cosmosfaucet.md new file mode 100644 index 0000000000..89fdd14b33 --- /dev/null +++ b/docs/docs/07-packages/cosmosfaucet.md @@ -0,0 +1,90 @@ +--- +sidebar_position: 5 +title: Token Faucet (cosmosfaucet) +slug: /packages/cosmosfaucet +--- + +# Token Faucet (cosmosfaucet) + +The `cosmosfaucet` package provides: +- A faucet service (`http.Handler`) that sends tokens from a faucet account. +- A client to request tokens from faucet endpoints. + +For full API details, see the +[`cosmosfaucet` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosfaucet). + +## Example: Start a faucet server + +```go +package main + +import ( + "context" + "log" + "net/http" + "time" + + sdkmath "cosmossdk.io/math" + + "github.com/ignite/cli/v29/ignite/pkg/chaincmd" + chaincmdrunner "github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner" + "github.com/ignite/cli/v29/ignite/pkg/cosmosfaucet" +) + +func main() { + ctx := context.Background() + + cmd := chaincmd.New( + "simd", + chaincmd.WithHome("./.simapp"), + chaincmd.WithKeyringBackend(chaincmd.KeyringBackendTest), + ) + + runner, err := chaincmdrunner.New(ctx, cmd) + if err != nil { + log.Fatal(err) + } + + faucet, err := cosmosfaucet.New( + ctx, + runner, + cosmosfaucet.Account("faucet", "", "", "", ""), + cosmosfaucet.Coin(sdkmath.NewInt(1000000), sdkmath.NewInt(100000000), "stake"), + cosmosfaucet.RefreshWindow(24*time.Hour), + ) + if err != nil { + log.Fatal(err) + } + + log.Fatal(http.ListenAndServe(":4500", faucet)) +} +``` + +## Example: Request tokens from a faucet + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/cosmosfaucet" +) + +func main() { + ctx := context.Background() + client := cosmosfaucet.NewClient("http://localhost:4500") + + resp, err := client.Transfer( + ctx, + cosmosfaucet.NewTransferRequest("cosmos1youraddresshere", []string{"1000000stake"}), + ) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("tx hash: %s\n", resp.Hash) +} +``` From 8a58a3376fd5be777f1826f1eaa4419bd3740929 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:12:36 -0300 Subject: [PATCH 05/15] add cosmos account pkg docs --- docs/docs/07-packages/cosmosaccount.md | 65 ++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 docs/docs/07-packages/cosmosaccount.md diff --git a/docs/docs/07-packages/cosmosaccount.md b/docs/docs/07-packages/cosmosaccount.md new file mode 100644 index 0000000000..9a3934a9d0 --- /dev/null +++ b/docs/docs/07-packages/cosmosaccount.md @@ -0,0 +1,65 @@ +--- +sidebar_position: 2 +title: Account Registry (cosmosaccount) +slug: /packages/cosmosaccount +--- + +# Account Registry (cosmosaccount) + +The `cosmosaccount` package manages blockchain accounts using Cosmos SDK keyring backends. +It supports creating, importing, exporting, listing, and deleting accounts. + +For full API details, see the +[`cosmosaccount` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosaccount). + +## Example: Create and query accounts + +This example creates an account in a local test keyring and then retrieves it by address. + +```go +package main + +import ( + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/cosmosaccount" +) + +func main() { + registry, err := cosmosaccount.New( + cosmosaccount.WithHome("./keyring-test"), + cosmosaccount.WithKeyringBackend(cosmosaccount.KeyringTest), + cosmosaccount.WithBech32Prefix(cosmosaccount.AccountPrefixCosmos), + ) + if err != nil { + log.Fatal(err) + } + + account, mnemonic, err := registry.Create("alice") + if err != nil { + log.Fatal(err) + } + + // Store this mnemonic securely. Anyone with it can control the account. + fmt.Printf("alice mnemonic: %s\n", mnemonic) + + address, err := account.Address(cosmosaccount.AccountPrefixCosmos) + if err != nil { + log.Fatal(err) + } + fmt.Printf("alice address: %s\n", address) + + loaded, err := registry.GetByAddress(address) + if err != nil { + log.Fatal(err) + } + fmt.Printf("loaded account name: %s\n", loaded.Name) + + accounts, err := registry.List() + if err != nil { + log.Fatal(err) + } + fmt.Printf("accounts in keyring: %d\n", len(accounts)) +} +``` From 92227417ab0dcfde67f6660b5f3b8b97d21ad31c Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:21:38 -0300 Subject: [PATCH 06/15] add missing packages --- docs/docs/07-packages/chaincmd.md | 41 +++++++++++++++++ docs/docs/07-packages/cmdrunner.md | 49 ++++++++++++++++++++ docs/docs/07-packages/cosmosanalysis.md | 47 +++++++++++++++++++ docs/docs/07-packages/cosmosbuf.md | 58 +++++++++++++++++++++++ docs/docs/07-packages/cosmosgen.md | 61 +++++++++++++++++++++++++ docs/docs/07-packages/cosmosver.md | 39 ++++++++++++++++ docs/docs/07-packages/gocmd.md | 41 +++++++++++++++++ docs/docs/07-packages/gomodule.md | 43 +++++++++++++++++ docs/docs/07-packages/gomodulepath.md | 40 ++++++++++++++++ docs/docs/07-packages/protoanalysis.md | 41 +++++++++++++++++ 10 files changed, 460 insertions(+) create mode 100644 docs/docs/07-packages/chaincmd.md create mode 100644 docs/docs/07-packages/cmdrunner.md create mode 100644 docs/docs/07-packages/cosmosanalysis.md create mode 100644 docs/docs/07-packages/cosmosbuf.md create mode 100644 docs/docs/07-packages/cosmosgen.md create mode 100644 docs/docs/07-packages/cosmosver.md create mode 100644 docs/docs/07-packages/gocmd.md create mode 100644 docs/docs/07-packages/gomodule.md create mode 100644 docs/docs/07-packages/gomodulepath.md create mode 100644 docs/docs/07-packages/protoanalysis.md diff --git a/docs/docs/07-packages/chaincmd.md b/docs/docs/07-packages/chaincmd.md new file mode 100644 index 0000000000..f82daea074 --- /dev/null +++ b/docs/docs/07-packages/chaincmd.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 7 +title: Chain Command Builder (chaincmd) +slug: /packages/chaincmd +--- + +# Chain Command Builder (chaincmd) + +The `chaincmd` package builds command definitions for Cosmos chain binaries (`simd`, `gaiad`, etc.). +It does not execute commands directly; it builds `step.Option` values that can be executed by a runner. + +For full API details, see the +[`chaincmd` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chaincmd). + +## Example: Build an `init` command + +```go +package main + +import ( + "fmt" + "strings" + + "github.com/ignite/cli/v29/ignite/pkg/chaincmd" + "github.com/ignite/cli/v29/ignite/pkg/cmdrunner/step" +) + +func main() { + cmd := chaincmd.New( + "simd", + chaincmd.WithHome("./.simapp"), + chaincmd.WithChainID("demo-1"), + chaincmd.WithKeyringBackend(chaincmd.KeyringBackendTest), + ) + + initStep := step.New(cmd.InitCommand("validator")) + + fmt.Println("binary:", initStep.Exec.Command) + fmt.Println("args:", strings.Join(initStep.Exec.Args, " ")) +} +``` diff --git a/docs/docs/07-packages/cmdrunner.md b/docs/docs/07-packages/cmdrunner.md new file mode 100644 index 0000000000..a0b965c2bf --- /dev/null +++ b/docs/docs/07-packages/cmdrunner.md @@ -0,0 +1,49 @@ +--- +sidebar_position: 6 +title: Command Runner (cmdrunner) +slug: /packages/cmdrunner +--- + +# Command Runner (cmdrunner) + +The `cmdrunner` package is a lightweight command execution layer with support for: +- per-command hooks, +- default stdio/workdir configuration, +- sequential or parallel step execution. + +For full API details, see the +[`cmdrunner` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cmdrunner). + +## Example: Run command steps + +```go +package main + +import ( + "context" + "log" + "os" + + "github.com/ignite/cli/v29/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v29/ignite/pkg/cmdrunner/step" +) + +func main() { + ctx := context.Background() + + runner := cmdrunner.New( + cmdrunner.DefaultStdout(os.Stdout), + cmdrunner.DefaultStderr(os.Stderr), + cmdrunner.DefaultWorkdir("."), + ) + + err := runner.Run( + ctx, + step.New(step.Exec("go", "version")), + step.New(step.Exec("go", "env", "GOMOD")), + ) + if err != nil { + log.Fatal(err) + } +} +``` diff --git a/docs/docs/07-packages/cosmosanalysis.md b/docs/docs/07-packages/cosmosanalysis.md new file mode 100644 index 0000000000..1822de1160 --- /dev/null +++ b/docs/docs/07-packages/cosmosanalysis.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 13 +title: Cosmos Source Analysis (cosmosanalysis) +slug: /packages/cosmosanalysis +--- + +# Cosmos Source Analysis (cosmosanalysis) + +The `cosmosanalysis` package provides static analysis helpers for Cosmos SDK chains. +It can validate chain structure, locate app files, and inspect module wiring. + +For full API details, see the +[`cosmosanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis). + +## Example: Validate chain and inspect app modules + +```go +package main + +import ( + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis" + appanalysis "github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis/app" +) + +func main() { + chainRoot := "." + + if err := cosmosanalysis.IsChainPath(chainRoot); err != nil { + log.Fatal(err) + } + + appFilePath, err := cosmosanalysis.FindAppFilePath(chainRoot) + if err != nil { + log.Fatal(err) + } + fmt.Println("app file:", appFilePath) + + modules, err := appanalysis.FindRegisteredModules(chainRoot) + if err != nil { + log.Fatal(err) + } + fmt.Printf("registered modules: %d\n", len(modules)) +} +``` diff --git a/docs/docs/07-packages/cosmosbuf.md b/docs/docs/07-packages/cosmosbuf.md new file mode 100644 index 0000000000..22a4264925 --- /dev/null +++ b/docs/docs/07-packages/cosmosbuf.md @@ -0,0 +1,58 @@ +--- +sidebar_position: 14 +title: Buf Integration (cosmosbuf) +slug: /packages/cosmosbuf +--- + +# Buf Integration (cosmosbuf) + +The `cosmosbuf` package wraps Buf CLI workflows used by Ignite, including: +- `buf generate`, +- `buf export`, +- `buf config migrate`, +- `buf dep update`. + +For full API details, see the +[`cosmosbuf` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosbuf). + +## Example: Run code generation with Buf + +```go +package main + +import ( + "context" + "log" + "os" + "path/filepath" + + "github.com/ignite/cli/v29/ignite/pkg/cache" + "github.com/ignite/cli/v29/ignite/pkg/cosmosbuf" +) + +func main() { + ctx := context.Background() + + storage, err := cache.NewStorage(filepath.Join(os.TempDir(), "ignite-cache.db")) + if err != nil { + log.Fatal(err) + } + + buf, err := cosmosbuf.New(storage, "github.com/acme/my-chain") + if err != nil { + log.Fatal(err) + } + + err = buf.Generate( + ctx, + "./proto", + "./tmp/gen", + "./proto/buf.gen.gogo.yaml", + cosmosbuf.ExcludeFiles("**/query.proto"), + cosmosbuf.IncludeImports(), + ) + if err != nil { + log.Fatal(err) + } +} +``` diff --git a/docs/docs/07-packages/cosmosgen.md b/docs/docs/07-packages/cosmosgen.md new file mode 100644 index 0000000000..c89663cfc0 --- /dev/null +++ b/docs/docs/07-packages/cosmosgen.md @@ -0,0 +1,61 @@ +--- +sidebar_position: 15 +title: Code Generation (cosmosgen) +slug: /packages/cosmosgen +--- + +# Code Generation (cosmosgen) + +The `cosmosgen` package orchestrates code generation from protobuf definitions for: +- Go protobuf code, +- TypeScript client code, +- OpenAPI specifications, +- optional frontend composables/templates. + +For full API details, see the +[`cosmosgen` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosgen). + +## Example: Run generators + +```go +package main + +import ( + "context" + "log" + "os" + "path/filepath" + + "github.com/ignite/cli/v29/ignite/pkg/cache" + "github.com/ignite/cli/v29/ignite/pkg/cosmosgen" +) + +func main() { + ctx := context.Background() + + storage, err := cache.NewStorage(filepath.Join(os.TempDir(), "ignite-cache.db")) + if err != nil { + log.Fatal(err) + } + + err = cosmosgen.Generate( + ctx, + storage, + ".", + "proto", + "github.com/acme/my-chain", + "./web", + cosmosgen.WithGoGeneration(), + cosmosgen.WithTSClientGeneration( + cosmosgen.TypescriptModulePath("./ts-client"), + "./ts-client", + true, + ), + cosmosgen.WithOpenAPIGeneration("./api/openapi.yml", nil), + cosmosgen.UpdateBufModule(), + ) + if err != nil { + log.Fatal(err) + } +} +``` diff --git a/docs/docs/07-packages/cosmosver.md b/docs/docs/07-packages/cosmosver.md new file mode 100644 index 0000000000..bc3b26de9b --- /dev/null +++ b/docs/docs/07-packages/cosmosver.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 11 +title: Cosmos SDK Versions (cosmosver) +slug: /packages/cosmosver +--- + +# Cosmos SDK Versions (cosmosver) + +The `cosmosver` package parses, detects, and compares Cosmos SDK versions. +It is used to apply version-dependent behavior in Ignite. + +For full API details, see the +[`cosmosver` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosver). + +## Example: Detect and compare SDK version + +```go +package main + +import ( + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/cosmosver" +) + +func main() { + version, err := cosmosver.Detect(".") + if err != nil { + log.Fatal(err) + } + + fmt.Println("detected:", version) + + if version.GTE(cosmosver.StargateFiftyVersion) { + fmt.Println("SDK is v0.50.0 or newer") + } +} +``` diff --git a/docs/docs/07-packages/gocmd.md b/docs/docs/07-packages/gocmd.md new file mode 100644 index 0000000000..9ad213d2d9 --- /dev/null +++ b/docs/docs/07-packages/gocmd.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 8 +title: Go Command Helpers (gocmd) +slug: /packages/gocmd +--- + +# Go Command Helpers (gocmd) + +The `gocmd` package wraps common `go` tool invocations (`mod tidy`, `build`, `test`, `list`, etc.) +and integrates with Ignite's command execution layer. + +For full API details, see the +[`gocmd` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gocmd). + +## Example: List packages and run tests + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/gocmd" +) + +func main() { + ctx := context.Background() + + pkgs, err := gocmd.List(ctx, ".", []string{"./..."}) + if err != nil { + log.Fatal(err) + } + fmt.Printf("found %d packages\n", len(pkgs)) + + if err := gocmd.Test(ctx, ".", []string{"./..."}); err != nil { + log.Fatal(err) + } +} +``` diff --git a/docs/docs/07-packages/gomodule.md b/docs/docs/07-packages/gomodule.md new file mode 100644 index 0000000000..1dc47c1397 --- /dev/null +++ b/docs/docs/07-packages/gomodule.md @@ -0,0 +1,43 @@ +--- +sidebar_position: 9 +title: Go Module Analysis (gomodule) +slug: /packages/gomodule +--- + +# Go Module Analysis (gomodule) + +The `gomodule` package parses `go.mod` files, resolves dependencies (including replacements), +and locates modules on disk. + +For full API details, see the +[`gomodule` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gomodule). + +## Example: Resolve direct dependencies + +```go +package main + +import ( + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/gomodule" +) + +func main() { + modFile, err := gomodule.ParseAt(".") + if err != nil { + log.Fatal(err) + } + + deps, err := gomodule.ResolveDependencies(modFile, false) + if err != nil { + log.Fatal(err) + } + + cosmosSDKDeps := gomodule.FilterVersions(deps, "github.com/cosmos/cosmos-sdk") + for _, dep := range cosmosSDKDeps { + fmt.Printf("%s %s\n", dep.Path, dep.Version) + } +} +``` diff --git a/docs/docs/07-packages/gomodulepath.md b/docs/docs/07-packages/gomodulepath.md new file mode 100644 index 0000000000..b4ebeba6b9 --- /dev/null +++ b/docs/docs/07-packages/gomodulepath.md @@ -0,0 +1,40 @@ +--- +sidebar_position: 10 +title: Go Module Paths (gomodulepath) +slug: /packages/gomodulepath +--- + +# Go Module Paths (gomodulepath) + +The `gomodulepath` package parses and validates Go module paths and helps discover +an app module path from the local filesystem. + +For full API details, see the +[`gomodulepath` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gomodulepath). + +## Example: Parse and discover module paths + +```go +package main + +import ( + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/gomodulepath" +) + +func main() { + parsed, err := gomodulepath.Parse("github.com/acme/my-chain") + if err != nil { + log.Fatal(err) + } + fmt.Printf("root=%s package=%s\n", parsed.Root, parsed.Package) + + found, appPath, err := gomodulepath.Find(".") + if err != nil { + log.Fatal(err) + } + fmt.Printf("module=%s path=%s\n", found.RawPath, appPath) +} +``` diff --git a/docs/docs/07-packages/protoanalysis.md b/docs/docs/07-packages/protoanalysis.md new file mode 100644 index 0000000000..571471a545 --- /dev/null +++ b/docs/docs/07-packages/protoanalysis.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 12 +title: Proto Analysis (protoanalysis) +slug: /packages/protoanalysis +--- + +# Proto Analysis (protoanalysis) + +The `protoanalysis` package parses `.proto` files and builds high-level metadata for: +- packages, +- messages and fields, +- services and RPC signatures, +- HTTP rules. + +For full API details, see the +[`protoanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/protoanalysis). + +## Example: Parse proto packages + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/protoanalysis" +) + +func main() { + pkgs, err := protoanalysis.Parse(context.Background(), protoanalysis.NewCache(), "./proto") + if err != nil { + log.Fatal(err) + } + + for _, pkg := range pkgs { + fmt.Printf("package: %s (%d files)\n", pkg.Name, len(pkg.Files)) + } +} +``` From bfa804f7aaa80ef89977e84c537912efe5d02472 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:24:26 -0300 Subject: [PATCH 07/15] missing simples pkgs --- docs/docs/07-packages/archive.md | 18 ++++++++++++++++++ docs/docs/07-packages/availableport.md | 18 ++++++++++++++++++ docs/docs/07-packages/cache.md | 18 ++++++++++++++++++ docs/docs/07-packages/checksum.md | 18 ++++++++++++++++++ docs/docs/07-packages/clictx.md | 18 ++++++++++++++++++ docs/docs/07-packages/clidoc.md | 18 ++++++++++++++++++ docs/docs/07-packages/cliui.md | 18 ++++++++++++++++++ docs/docs/07-packages/confile.md | 18 ++++++++++++++++++ docs/docs/07-packages/ctxticker.md | 18 ++++++++++++++++++ docs/docs/07-packages/debugger.md | 18 ++++++++++++++++++ docs/docs/07-packages/dircache.md | 18 ++++++++++++++++++ docs/docs/07-packages/dirchange.md | 18 ++++++++++++++++++ docs/docs/07-packages/env.md | 18 ++++++++++++++++++ docs/docs/07-packages/errors.md | 18 ++++++++++++++++++ docs/docs/07-packages/events.md | 18 ++++++++++++++++++ docs/docs/07-packages/goanalysis.md | 18 ++++++++++++++++++ docs/docs/07-packages/goenv.md | 18 ++++++++++++++++++ docs/docs/07-packages/httpstatuschecker.md | 18 ++++++++++++++++++ docs/docs/07-packages/jsonfile.md | 18 ++++++++++++++++++ docs/docs/07-packages/localfs.md | 18 ++++++++++++++++++ docs/docs/07-packages/markdownviewer.md | 18 ++++++++++++++++++ docs/docs/07-packages/multiformatname.md | 18 ++++++++++++++++++ docs/docs/07-packages/openapiconsole.md | 18 ++++++++++++++++++ docs/docs/07-packages/placeholder.md | 18 ++++++++++++++++++ docs/docs/07-packages/randstr.md | 18 ++++++++++++++++++ docs/docs/07-packages/repoversion.md | 18 ++++++++++++++++++ docs/docs/07-packages/safeconverter.md | 18 ++++++++++++++++++ docs/docs/07-packages/swagger-combine.md | 18 ++++++++++++++++++ docs/docs/07-packages/tarball.md | 18 ++++++++++++++++++ docs/docs/07-packages/truncatedbuffer.md | 18 ++++++++++++++++++ docs/docs/07-packages/xast.md | 18 ++++++++++++++++++ docs/docs/07-packages/xembed.md | 18 ++++++++++++++++++ docs/docs/07-packages/xexec.md | 18 ++++++++++++++++++ docs/docs/07-packages/xfilepath.md | 18 ++++++++++++++++++ docs/docs/07-packages/xgenny.md | 18 ++++++++++++++++++ docs/docs/07-packages/xgit.md | 18 ++++++++++++++++++ docs/docs/07-packages/xhttp.md | 18 ++++++++++++++++++ docs/docs/07-packages/xio.md | 18 ++++++++++++++++++ docs/docs/07-packages/xnet.md | 18 ++++++++++++++++++ docs/docs/07-packages/xos.md | 18 ++++++++++++++++++ docs/docs/07-packages/xstrcase.md | 18 ++++++++++++++++++ docs/docs/07-packages/xstrings.md | 18 ++++++++++++++++++ docs/docs/07-packages/xtime.md | 18 ++++++++++++++++++ docs/docs/07-packages/xurl.md | 18 ++++++++++++++++++ docs/docs/07-packages/xyaml.md | 18 ++++++++++++++++++ 45 files changed, 810 insertions(+) create mode 100644 docs/docs/07-packages/archive.md create mode 100644 docs/docs/07-packages/availableport.md create mode 100644 docs/docs/07-packages/cache.md create mode 100644 docs/docs/07-packages/checksum.md create mode 100644 docs/docs/07-packages/clictx.md create mode 100644 docs/docs/07-packages/clidoc.md create mode 100644 docs/docs/07-packages/cliui.md create mode 100644 docs/docs/07-packages/confile.md create mode 100644 docs/docs/07-packages/ctxticker.md create mode 100644 docs/docs/07-packages/debugger.md create mode 100644 docs/docs/07-packages/dircache.md create mode 100644 docs/docs/07-packages/dirchange.md create mode 100644 docs/docs/07-packages/env.md create mode 100644 docs/docs/07-packages/errors.md create mode 100644 docs/docs/07-packages/events.md create mode 100644 docs/docs/07-packages/goanalysis.md create mode 100644 docs/docs/07-packages/goenv.md create mode 100644 docs/docs/07-packages/httpstatuschecker.md create mode 100644 docs/docs/07-packages/jsonfile.md create mode 100644 docs/docs/07-packages/localfs.md create mode 100644 docs/docs/07-packages/markdownviewer.md create mode 100644 docs/docs/07-packages/multiformatname.md create mode 100644 docs/docs/07-packages/openapiconsole.md create mode 100644 docs/docs/07-packages/placeholder.md create mode 100644 docs/docs/07-packages/randstr.md create mode 100644 docs/docs/07-packages/repoversion.md create mode 100644 docs/docs/07-packages/safeconverter.md create mode 100644 docs/docs/07-packages/swagger-combine.md create mode 100644 docs/docs/07-packages/tarball.md create mode 100644 docs/docs/07-packages/truncatedbuffer.md create mode 100644 docs/docs/07-packages/xast.md create mode 100644 docs/docs/07-packages/xembed.md create mode 100644 docs/docs/07-packages/xexec.md create mode 100644 docs/docs/07-packages/xfilepath.md create mode 100644 docs/docs/07-packages/xgenny.md create mode 100644 docs/docs/07-packages/xgit.md create mode 100644 docs/docs/07-packages/xhttp.md create mode 100644 docs/docs/07-packages/xio.md create mode 100644 docs/docs/07-packages/xnet.md create mode 100644 docs/docs/07-packages/xos.md create mode 100644 docs/docs/07-packages/xstrcase.md create mode 100644 docs/docs/07-packages/xstrings.md create mode 100644 docs/docs/07-packages/xtime.md create mode 100644 docs/docs/07-packages/xurl.md create mode 100644 docs/docs/07-packages/xyaml.md diff --git a/docs/docs/07-packages/archive.md b/docs/docs/07-packages/archive.md new file mode 100644 index 0000000000..cde9b02a72 --- /dev/null +++ b/docs/docs/07-packages/archive.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 16 +title: Archive (archive) +slug: /packages/archive +--- + +# Archive (archive) + +The `archive` package provides utilities used by Ignite CLI. + +For full API details, see the +[`archive` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/archive). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/archive" +``` diff --git a/docs/docs/07-packages/availableport.md b/docs/docs/07-packages/availableport.md new file mode 100644 index 0000000000..06ce4e8e1d --- /dev/null +++ b/docs/docs/07-packages/availableport.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 17 +title: Availableport (availableport) +slug: /packages/availableport +--- + +# Availableport (availableport) + +The `availableport` package provides utilities used by Ignite CLI. + +For full API details, see the +[`availableport` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/availableport). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/availableport" +``` diff --git a/docs/docs/07-packages/cache.md b/docs/docs/07-packages/cache.md new file mode 100644 index 0000000000..85ec761f42 --- /dev/null +++ b/docs/docs/07-packages/cache.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 18 +title: Cache (cache) +slug: /packages/cache +--- + +# Cache (cache) + +The `cache` package provides utilities used by Ignite CLI. + +For full API details, see the +[`cache` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cache). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/cache" +``` diff --git a/docs/docs/07-packages/checksum.md b/docs/docs/07-packages/checksum.md new file mode 100644 index 0000000000..111c3b1ede --- /dev/null +++ b/docs/docs/07-packages/checksum.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 19 +title: Checksum (checksum) +slug: /packages/checksum +--- + +# Checksum (checksum) + +The `checksum` package provides utilities used by Ignite CLI. + +For full API details, see the +[`checksum` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/checksum). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/checksum" +``` diff --git a/docs/docs/07-packages/clictx.md b/docs/docs/07-packages/clictx.md new file mode 100644 index 0000000000..5e88d1a211 --- /dev/null +++ b/docs/docs/07-packages/clictx.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 20 +title: Clictx (clictx) +slug: /packages/clictx +--- + +# Clictx (clictx) + +The `clictx` package provides utilities used by Ignite CLI. + +For full API details, see the +[`clictx` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/clictx). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/clictx" +``` diff --git a/docs/docs/07-packages/clidoc.md b/docs/docs/07-packages/clidoc.md new file mode 100644 index 0000000000..16a5e6f7d0 --- /dev/null +++ b/docs/docs/07-packages/clidoc.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 21 +title: Clidoc (clidoc) +slug: /packages/clidoc +--- + +# Clidoc (clidoc) + +The `clidoc` package provides utilities used by Ignite CLI. + +For full API details, see the +[`clidoc` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/clidoc). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/clidoc" +``` diff --git a/docs/docs/07-packages/cliui.md b/docs/docs/07-packages/cliui.md new file mode 100644 index 0000000000..524d693e87 --- /dev/null +++ b/docs/docs/07-packages/cliui.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 22 +title: Cliui (cliui) +slug: /packages/cliui +--- + +# Cliui (cliui) + +The `cliui` package provides utilities used by Ignite CLI. + +For full API details, see the +[`cliui` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cliui). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/cliui" +``` diff --git a/docs/docs/07-packages/confile.md b/docs/docs/07-packages/confile.md new file mode 100644 index 0000000000..8f07446c12 --- /dev/null +++ b/docs/docs/07-packages/confile.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 23 +title: Confile (confile) +slug: /packages/confile +--- + +# Confile (confile) + +The `confile` package provides utilities used by Ignite CLI. + +For full API details, see the +[`confile` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/confile). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/confile" +``` diff --git a/docs/docs/07-packages/ctxticker.md b/docs/docs/07-packages/ctxticker.md new file mode 100644 index 0000000000..6d5093cc6e --- /dev/null +++ b/docs/docs/07-packages/ctxticker.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 24 +title: Ctxticker (ctxticker) +slug: /packages/ctxticker +--- + +# Ctxticker (ctxticker) + +The `ctxticker` package provides utilities used by Ignite CLI. + +For full API details, see the +[`ctxticker` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/ctxticker). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/ctxticker" +``` diff --git a/docs/docs/07-packages/debugger.md b/docs/docs/07-packages/debugger.md new file mode 100644 index 0000000000..9483e65253 --- /dev/null +++ b/docs/docs/07-packages/debugger.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 25 +title: Debugger (debugger) +slug: /packages/debugger +--- + +# Debugger (debugger) + +The `debugger` package provides utilities used by Ignite CLI. + +For full API details, see the +[`debugger` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/debugger). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/debugger" +``` diff --git a/docs/docs/07-packages/dircache.md b/docs/docs/07-packages/dircache.md new file mode 100644 index 0000000000..b6d2fd94bd --- /dev/null +++ b/docs/docs/07-packages/dircache.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 26 +title: Dircache (dircache) +slug: /packages/dircache +--- + +# Dircache (dircache) + +The `dircache` package provides utilities used by Ignite CLI. + +For full API details, see the +[`dircache` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/dircache). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/dircache" +``` diff --git a/docs/docs/07-packages/dirchange.md b/docs/docs/07-packages/dirchange.md new file mode 100644 index 0000000000..793005925e --- /dev/null +++ b/docs/docs/07-packages/dirchange.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 27 +title: Dirchange (dirchange) +slug: /packages/dirchange +--- + +# Dirchange (dirchange) + +The `dirchange` package provides utilities used by Ignite CLI. + +For full API details, see the +[`dirchange` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/dirchange). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/dirchange" +``` diff --git a/docs/docs/07-packages/env.md b/docs/docs/07-packages/env.md new file mode 100644 index 0000000000..eb53c2c725 --- /dev/null +++ b/docs/docs/07-packages/env.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 28 +title: Env (env) +slug: /packages/env +--- + +# Env (env) + +The `env` package provides utilities used by Ignite CLI. + +For full API details, see the +[`env` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/env). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/env" +``` diff --git a/docs/docs/07-packages/errors.md b/docs/docs/07-packages/errors.md new file mode 100644 index 0000000000..1a36dc90c1 --- /dev/null +++ b/docs/docs/07-packages/errors.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 29 +title: Errors (errors) +slug: /packages/errors +--- + +# Errors (errors) + +The `errors` package provides utilities used by Ignite CLI. + +For full API details, see the +[`errors` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/errors). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/errors" +``` diff --git a/docs/docs/07-packages/events.md b/docs/docs/07-packages/events.md new file mode 100644 index 0000000000..0ea737524d --- /dev/null +++ b/docs/docs/07-packages/events.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 30 +title: Events (events) +slug: /packages/events +--- + +# Events (events) + +The `events` package provides utilities used by Ignite CLI. + +For full API details, see the +[`events` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/events). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/events" +``` diff --git a/docs/docs/07-packages/goanalysis.md b/docs/docs/07-packages/goanalysis.md new file mode 100644 index 0000000000..44cf530d43 --- /dev/null +++ b/docs/docs/07-packages/goanalysis.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 31 +title: Goanalysis (goanalysis) +slug: /packages/goanalysis +--- + +# Goanalysis (goanalysis) + +The `goanalysis` package provides utilities used by Ignite CLI. + +For full API details, see the +[`goanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/goanalysis). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/goanalysis" +``` diff --git a/docs/docs/07-packages/goenv.md b/docs/docs/07-packages/goenv.md new file mode 100644 index 0000000000..4425e5eaab --- /dev/null +++ b/docs/docs/07-packages/goenv.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 32 +title: Goenv (goenv) +slug: /packages/goenv +--- + +# Goenv (goenv) + +The `goenv` package provides utilities used by Ignite CLI. + +For full API details, see the +[`goenv` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/goenv). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/goenv" +``` diff --git a/docs/docs/07-packages/httpstatuschecker.md b/docs/docs/07-packages/httpstatuschecker.md new file mode 100644 index 0000000000..2121487bfa --- /dev/null +++ b/docs/docs/07-packages/httpstatuschecker.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 33 +title: Httpstatuschecker (httpstatuschecker) +slug: /packages/httpstatuschecker +--- + +# Httpstatuschecker (httpstatuschecker) + +The `httpstatuschecker` package provides utilities used by Ignite CLI. + +For full API details, see the +[`httpstatuschecker` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/httpstatuschecker). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/httpstatuschecker" +``` diff --git a/docs/docs/07-packages/jsonfile.md b/docs/docs/07-packages/jsonfile.md new file mode 100644 index 0000000000..61e5e36ea6 --- /dev/null +++ b/docs/docs/07-packages/jsonfile.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 34 +title: Jsonfile (jsonfile) +slug: /packages/jsonfile +--- + +# Jsonfile (jsonfile) + +The `jsonfile` package provides utilities used by Ignite CLI. + +For full API details, see the +[`jsonfile` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/jsonfile). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/jsonfile" +``` diff --git a/docs/docs/07-packages/localfs.md b/docs/docs/07-packages/localfs.md new file mode 100644 index 0000000000..09f0c91c21 --- /dev/null +++ b/docs/docs/07-packages/localfs.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 35 +title: Localfs (localfs) +slug: /packages/localfs +--- + +# Localfs (localfs) + +The `localfs` package provides utilities used by Ignite CLI. + +For full API details, see the +[`localfs` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/localfs). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/localfs" +``` diff --git a/docs/docs/07-packages/markdownviewer.md b/docs/docs/07-packages/markdownviewer.md new file mode 100644 index 0000000000..a64967d2ed --- /dev/null +++ b/docs/docs/07-packages/markdownviewer.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 36 +title: Markdownviewer (markdownviewer) +slug: /packages/markdownviewer +--- + +# Markdownviewer (markdownviewer) + +The `markdownviewer` package provides utilities used by Ignite CLI. + +For full API details, see the +[`markdownviewer` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/markdownviewer). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/markdownviewer" +``` diff --git a/docs/docs/07-packages/multiformatname.md b/docs/docs/07-packages/multiformatname.md new file mode 100644 index 0000000000..6090c454ea --- /dev/null +++ b/docs/docs/07-packages/multiformatname.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 37 +title: Multiformatname (multiformatname) +slug: /packages/multiformatname +--- + +# Multiformatname (multiformatname) + +The `multiformatname` package provides utilities used by Ignite CLI. + +For full API details, see the +[`multiformatname` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/multiformatname). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/multiformatname" +``` diff --git a/docs/docs/07-packages/openapiconsole.md b/docs/docs/07-packages/openapiconsole.md new file mode 100644 index 0000000000..ef3c18cee8 --- /dev/null +++ b/docs/docs/07-packages/openapiconsole.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 38 +title: Openapiconsole (openapiconsole) +slug: /packages/openapiconsole +--- + +# Openapiconsole (openapiconsole) + +The `openapiconsole` package provides utilities used by Ignite CLI. + +For full API details, see the +[`openapiconsole` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/openapiconsole). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/openapiconsole" +``` diff --git a/docs/docs/07-packages/placeholder.md b/docs/docs/07-packages/placeholder.md new file mode 100644 index 0000000000..bb73313cc4 --- /dev/null +++ b/docs/docs/07-packages/placeholder.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 39 +title: Placeholder (placeholder) +slug: /packages/placeholder +--- + +# Placeholder (placeholder) + +The `placeholder` package provides utilities used by Ignite CLI. + +For full API details, see the +[`placeholder` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/placeholder). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/placeholder" +``` diff --git a/docs/docs/07-packages/randstr.md b/docs/docs/07-packages/randstr.md new file mode 100644 index 0000000000..57de217690 --- /dev/null +++ b/docs/docs/07-packages/randstr.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 40 +title: Randstr (randstr) +slug: /packages/randstr +--- + +# Randstr (randstr) + +The `randstr` package provides utilities used by Ignite CLI. + +For full API details, see the +[`randstr` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/randstr). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/randstr" +``` diff --git a/docs/docs/07-packages/repoversion.md b/docs/docs/07-packages/repoversion.md new file mode 100644 index 0000000000..963b530ba4 --- /dev/null +++ b/docs/docs/07-packages/repoversion.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 41 +title: Repoversion (repoversion) +slug: /packages/repoversion +--- + +# Repoversion (repoversion) + +The `repoversion` package provides utilities used by Ignite CLI. + +For full API details, see the +[`repoversion` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/repoversion). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/repoversion" +``` diff --git a/docs/docs/07-packages/safeconverter.md b/docs/docs/07-packages/safeconverter.md new file mode 100644 index 0000000000..29461d8aef --- /dev/null +++ b/docs/docs/07-packages/safeconverter.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 42 +title: Safeconverter (safeconverter) +slug: /packages/safeconverter +--- + +# Safeconverter (safeconverter) + +The `safeconverter` package provides utilities used by Ignite CLI. + +For full API details, see the +[`safeconverter` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/safeconverter). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/safeconverter" +``` diff --git a/docs/docs/07-packages/swagger-combine.md b/docs/docs/07-packages/swagger-combine.md new file mode 100644 index 0000000000..171a692b76 --- /dev/null +++ b/docs/docs/07-packages/swagger-combine.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 43 +title: Swagger Combine (swagger-combine) +slug: /packages/swagger-combine +--- + +# Swagger Combine (swagger-combine) + +The `swagger-combine` package provides utilities used by Ignite CLI. + +For full API details, see the +[`swagger-combine` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/swagger-combine). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/swagger-combine" +``` diff --git a/docs/docs/07-packages/tarball.md b/docs/docs/07-packages/tarball.md new file mode 100644 index 0000000000..aeb195367e --- /dev/null +++ b/docs/docs/07-packages/tarball.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 44 +title: Tarball (tarball) +slug: /packages/tarball +--- + +# Tarball (tarball) + +The `tarball` package provides utilities used by Ignite CLI. + +For full API details, see the +[`tarball` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/tarball). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/tarball" +``` diff --git a/docs/docs/07-packages/truncatedbuffer.md b/docs/docs/07-packages/truncatedbuffer.md new file mode 100644 index 0000000000..261e5f1487 --- /dev/null +++ b/docs/docs/07-packages/truncatedbuffer.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 45 +title: Truncatedbuffer (truncatedbuffer) +slug: /packages/truncatedbuffer +--- + +# Truncatedbuffer (truncatedbuffer) + +The `truncatedbuffer` package provides utilities used by Ignite CLI. + +For full API details, see the +[`truncatedbuffer` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/truncatedbuffer). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/truncatedbuffer" +``` diff --git a/docs/docs/07-packages/xast.md b/docs/docs/07-packages/xast.md new file mode 100644 index 0000000000..75787c00ba --- /dev/null +++ b/docs/docs/07-packages/xast.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 46 +title: Xast (xast) +slug: /packages/xast +--- + +# Xast (xast) + +The `xast` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xast` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xast). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xast" +``` diff --git a/docs/docs/07-packages/xembed.md b/docs/docs/07-packages/xembed.md new file mode 100644 index 0000000000..c1f7a655dd --- /dev/null +++ b/docs/docs/07-packages/xembed.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 47 +title: Xembed (xembed) +slug: /packages/xembed +--- + +# Xembed (xembed) + +The `xembed` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xembed` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xembed). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xembed" +``` diff --git a/docs/docs/07-packages/xexec.md b/docs/docs/07-packages/xexec.md new file mode 100644 index 0000000000..1a193fcba9 --- /dev/null +++ b/docs/docs/07-packages/xexec.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 48 +title: Xexec (xexec) +slug: /packages/xexec +--- + +# Xexec (xexec) + +The `xexec` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xexec` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xexec). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xexec" +``` diff --git a/docs/docs/07-packages/xfilepath.md b/docs/docs/07-packages/xfilepath.md new file mode 100644 index 0000000000..ea70aeb13d --- /dev/null +++ b/docs/docs/07-packages/xfilepath.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 49 +title: Xfilepath (xfilepath) +slug: /packages/xfilepath +--- + +# Xfilepath (xfilepath) + +The `xfilepath` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xfilepath` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xfilepath). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xfilepath" +``` diff --git a/docs/docs/07-packages/xgenny.md b/docs/docs/07-packages/xgenny.md new file mode 100644 index 0000000000..878f0418b8 --- /dev/null +++ b/docs/docs/07-packages/xgenny.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 50 +title: Xgenny (xgenny) +slug: /packages/xgenny +--- + +# Xgenny (xgenny) + +The `xgenny` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xgenny` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xgenny). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xgenny" +``` diff --git a/docs/docs/07-packages/xgit.md b/docs/docs/07-packages/xgit.md new file mode 100644 index 0000000000..138f4eb8c0 --- /dev/null +++ b/docs/docs/07-packages/xgit.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 51 +title: Xgit (xgit) +slug: /packages/xgit +--- + +# Xgit (xgit) + +The `xgit` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xgit` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xgit). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xgit" +``` diff --git a/docs/docs/07-packages/xhttp.md b/docs/docs/07-packages/xhttp.md new file mode 100644 index 0000000000..f360b09a4b --- /dev/null +++ b/docs/docs/07-packages/xhttp.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 52 +title: Xhttp (xhttp) +slug: /packages/xhttp +--- + +# Xhttp (xhttp) + +The `xhttp` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xhttp` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xhttp). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xhttp" +``` diff --git a/docs/docs/07-packages/xio.md b/docs/docs/07-packages/xio.md new file mode 100644 index 0000000000..32a2a0fdf0 --- /dev/null +++ b/docs/docs/07-packages/xio.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 53 +title: Xio (xio) +slug: /packages/xio +--- + +# Xio (xio) + +The `xio` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xio` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xio). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xio" +``` diff --git a/docs/docs/07-packages/xnet.md b/docs/docs/07-packages/xnet.md new file mode 100644 index 0000000000..3049a4c8aa --- /dev/null +++ b/docs/docs/07-packages/xnet.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 54 +title: Xnet (xnet) +slug: /packages/xnet +--- + +# Xnet (xnet) + +The `xnet` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xnet` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xnet). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xnet" +``` diff --git a/docs/docs/07-packages/xos.md b/docs/docs/07-packages/xos.md new file mode 100644 index 0000000000..9e0d2de100 --- /dev/null +++ b/docs/docs/07-packages/xos.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 55 +title: Xos (xos) +slug: /packages/xos +--- + +# Xos (xos) + +The `xos` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xos` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xos). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xos" +``` diff --git a/docs/docs/07-packages/xstrcase.md b/docs/docs/07-packages/xstrcase.md new file mode 100644 index 0000000000..9763ba4d9e --- /dev/null +++ b/docs/docs/07-packages/xstrcase.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 56 +title: Xstrcase (xstrcase) +slug: /packages/xstrcase +--- + +# Xstrcase (xstrcase) + +The `xstrcase` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xstrcase` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xstrcase). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xstrcase" +``` diff --git a/docs/docs/07-packages/xstrings.md b/docs/docs/07-packages/xstrings.md new file mode 100644 index 0000000000..818ea9965b --- /dev/null +++ b/docs/docs/07-packages/xstrings.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 57 +title: Xstrings (xstrings) +slug: /packages/xstrings +--- + +# Xstrings (xstrings) + +The `xstrings` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xstrings` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xstrings). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xstrings" +``` diff --git a/docs/docs/07-packages/xtime.md b/docs/docs/07-packages/xtime.md new file mode 100644 index 0000000000..f0a5641c05 --- /dev/null +++ b/docs/docs/07-packages/xtime.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 58 +title: Xtime (xtime) +slug: /packages/xtime +--- + +# Xtime (xtime) + +The `xtime` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xtime` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xtime). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xtime" +``` diff --git a/docs/docs/07-packages/xurl.md b/docs/docs/07-packages/xurl.md new file mode 100644 index 0000000000..a879214fd6 --- /dev/null +++ b/docs/docs/07-packages/xurl.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 59 +title: Xurl (xurl) +slug: /packages/xurl +--- + +# Xurl (xurl) + +The `xurl` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xurl` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xurl). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xurl" +``` diff --git a/docs/docs/07-packages/xyaml.md b/docs/docs/07-packages/xyaml.md new file mode 100644 index 0000000000..3906f8ce7f --- /dev/null +++ b/docs/docs/07-packages/xyaml.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 60 +title: Xyaml (xyaml) +slug: /packages/xyaml +--- + +# Xyaml (xyaml) + +The `xyaml` package provides utilities used by Ignite CLI. + +For full API details, see the +[`xyaml` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xyaml). + +## Basic import + +```go +import "github.com/ignite/cli/v29/ignite/pkg/xyaml" +``` From d8c29fa6345c64e9d3881252c8366161b1884266 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:28:57 -0300 Subject: [PATCH 08/15] organize docs by type --- docs/docs/07-packages/cosmos/_category_.json | 4 ++++ docs/docs/07-packages/{ => cosmos}/chaincmd.md | 0 docs/docs/07-packages/{ => cosmos}/chaincmdrunner.md | 0 docs/docs/07-packages/{ => cosmos}/chainregistry.md | 0 docs/docs/07-packages/{ => cosmos}/cosmosaccount.md | 0 docs/docs/07-packages/{ => cosmos}/cosmosanalysis.md | 0 docs/docs/07-packages/{ => cosmos}/cosmosbuf.md | 0 docs/docs/07-packages/{ => cosmos}/cosmosclient.md | 0 docs/docs/07-packages/{ => cosmos}/cosmosfaucet.md | 0 docs/docs/07-packages/{ => cosmos}/cosmosgen.md | 0 docs/docs/07-packages/{ => cosmos}/cosmostxcollector.md | 0 docs/docs/07-packages/{ => cosmos}/cosmosver.md | 0 docs/docs/07-packages/go/_category_.json | 4 ++++ docs/docs/07-packages/{ => go}/goanalysis.md | 0 docs/docs/07-packages/{ => go}/gocmd.md | 0 docs/docs/07-packages/{ => go}/goenv.md | 0 docs/docs/07-packages/{ => go}/gomodule.md | 0 docs/docs/07-packages/{ => go}/gomodulepath.md | 0 docs/docs/07-packages/misc/_category_.json | 4 ++++ docs/docs/07-packages/{ => misc}/archive.md | 0 docs/docs/07-packages/{ => misc}/availableport.md | 0 docs/docs/07-packages/{ => misc}/cache.md | 0 docs/docs/07-packages/{ => misc}/checksum.md | 0 docs/docs/07-packages/{ => misc}/clictx.md | 0 docs/docs/07-packages/{ => misc}/clidoc.md | 0 docs/docs/07-packages/{ => misc}/cliui.md | 0 docs/docs/07-packages/{ => misc}/cmdrunner.md | 0 docs/docs/07-packages/{ => misc}/confile.md | 0 docs/docs/07-packages/{ => misc}/ctxticker.md | 0 docs/docs/07-packages/{ => misc}/debugger.md | 0 docs/docs/07-packages/{ => misc}/dircache.md | 0 docs/docs/07-packages/{ => misc}/dirchange.md | 0 docs/docs/07-packages/{ => misc}/env.md | 0 docs/docs/07-packages/{ => misc}/errors.md | 0 docs/docs/07-packages/{ => misc}/events.md | 0 docs/docs/07-packages/{ => misc}/httpstatuschecker.md | 0 docs/docs/07-packages/{ => misc}/jsonfile.md | 0 docs/docs/07-packages/{ => misc}/localfs.md | 0 docs/docs/07-packages/{ => misc}/markdownviewer.md | 0 docs/docs/07-packages/{ => misc}/multiformatname.md | 0 docs/docs/07-packages/{ => misc}/openapiconsole.md | 0 docs/docs/07-packages/{ => misc}/placeholder.md | 0 docs/docs/07-packages/{ => misc}/protoanalysis.md | 0 docs/docs/07-packages/{ => misc}/randstr.md | 0 docs/docs/07-packages/{ => misc}/repoversion.md | 0 docs/docs/07-packages/{ => misc}/safeconverter.md | 0 docs/docs/07-packages/{ => misc}/swagger-combine.md | 0 docs/docs/07-packages/{ => misc}/tarball.md | 0 docs/docs/07-packages/{ => misc}/truncatedbuffer.md | 0 docs/docs/07-packages/{ => misc}/xast.md | 0 docs/docs/07-packages/{ => misc}/xembed.md | 0 docs/docs/07-packages/{ => misc}/xexec.md | 0 docs/docs/07-packages/{ => misc}/xfilepath.md | 0 docs/docs/07-packages/{ => misc}/xgenny.md | 0 docs/docs/07-packages/{ => misc}/xgit.md | 0 docs/docs/07-packages/{ => misc}/xhttp.md | 0 docs/docs/07-packages/{ => misc}/xio.md | 0 docs/docs/07-packages/{ => misc}/xnet.md | 0 docs/docs/07-packages/{ => misc}/xos.md | 0 docs/docs/07-packages/{ => misc}/xstrcase.md | 0 docs/docs/07-packages/{ => misc}/xstrings.md | 0 docs/docs/07-packages/{ => misc}/xtime.md | 0 docs/docs/07-packages/{ => misc}/xurl.md | 0 docs/docs/07-packages/{ => misc}/xyaml.md | 0 .../version-v29/07-packages/cosmos/_category_.json | 4 ++++ .../version-v29/07-packages/{ => cosmos}/cosmostxcollector.md | 0 .../versioned_docs/version-v29/07-packages/go/_category_.json | 4 ++++ .../version-v29/07-packages/misc/_category_.json | 4 ++++ 68 files changed, 24 insertions(+) create mode 100644 docs/docs/07-packages/cosmos/_category_.json rename docs/docs/07-packages/{ => cosmos}/chaincmd.md (100%) rename docs/docs/07-packages/{ => cosmos}/chaincmdrunner.md (100%) rename docs/docs/07-packages/{ => cosmos}/chainregistry.md (100%) rename docs/docs/07-packages/{ => cosmos}/cosmosaccount.md (100%) rename docs/docs/07-packages/{ => cosmos}/cosmosanalysis.md (100%) rename docs/docs/07-packages/{ => cosmos}/cosmosbuf.md (100%) rename docs/docs/07-packages/{ => cosmos}/cosmosclient.md (100%) rename docs/docs/07-packages/{ => cosmos}/cosmosfaucet.md (100%) rename docs/docs/07-packages/{ => cosmos}/cosmosgen.md (100%) rename docs/docs/07-packages/{ => cosmos}/cosmostxcollector.md (100%) rename docs/docs/07-packages/{ => cosmos}/cosmosver.md (100%) create mode 100644 docs/docs/07-packages/go/_category_.json rename docs/docs/07-packages/{ => go}/goanalysis.md (100%) rename docs/docs/07-packages/{ => go}/gocmd.md (100%) rename docs/docs/07-packages/{ => go}/goenv.md (100%) rename docs/docs/07-packages/{ => go}/gomodule.md (100%) rename docs/docs/07-packages/{ => go}/gomodulepath.md (100%) create mode 100644 docs/docs/07-packages/misc/_category_.json rename docs/docs/07-packages/{ => misc}/archive.md (100%) rename docs/docs/07-packages/{ => misc}/availableport.md (100%) rename docs/docs/07-packages/{ => misc}/cache.md (100%) rename docs/docs/07-packages/{ => misc}/checksum.md (100%) rename docs/docs/07-packages/{ => misc}/clictx.md (100%) rename docs/docs/07-packages/{ => misc}/clidoc.md (100%) rename docs/docs/07-packages/{ => misc}/cliui.md (100%) rename docs/docs/07-packages/{ => misc}/cmdrunner.md (100%) rename docs/docs/07-packages/{ => misc}/confile.md (100%) rename docs/docs/07-packages/{ => misc}/ctxticker.md (100%) rename docs/docs/07-packages/{ => misc}/debugger.md (100%) rename docs/docs/07-packages/{ => misc}/dircache.md (100%) rename docs/docs/07-packages/{ => misc}/dirchange.md (100%) rename docs/docs/07-packages/{ => misc}/env.md (100%) rename docs/docs/07-packages/{ => misc}/errors.md (100%) rename docs/docs/07-packages/{ => misc}/events.md (100%) rename docs/docs/07-packages/{ => misc}/httpstatuschecker.md (100%) rename docs/docs/07-packages/{ => misc}/jsonfile.md (100%) rename docs/docs/07-packages/{ => misc}/localfs.md (100%) rename docs/docs/07-packages/{ => misc}/markdownviewer.md (100%) rename docs/docs/07-packages/{ => misc}/multiformatname.md (100%) rename docs/docs/07-packages/{ => misc}/openapiconsole.md (100%) rename docs/docs/07-packages/{ => misc}/placeholder.md (100%) rename docs/docs/07-packages/{ => misc}/protoanalysis.md (100%) rename docs/docs/07-packages/{ => misc}/randstr.md (100%) rename docs/docs/07-packages/{ => misc}/repoversion.md (100%) rename docs/docs/07-packages/{ => misc}/safeconverter.md (100%) rename docs/docs/07-packages/{ => misc}/swagger-combine.md (100%) rename docs/docs/07-packages/{ => misc}/tarball.md (100%) rename docs/docs/07-packages/{ => misc}/truncatedbuffer.md (100%) rename docs/docs/07-packages/{ => misc}/xast.md (100%) rename docs/docs/07-packages/{ => misc}/xembed.md (100%) rename docs/docs/07-packages/{ => misc}/xexec.md (100%) rename docs/docs/07-packages/{ => misc}/xfilepath.md (100%) rename docs/docs/07-packages/{ => misc}/xgenny.md (100%) rename docs/docs/07-packages/{ => misc}/xgit.md (100%) rename docs/docs/07-packages/{ => misc}/xhttp.md (100%) rename docs/docs/07-packages/{ => misc}/xio.md (100%) rename docs/docs/07-packages/{ => misc}/xnet.md (100%) rename docs/docs/07-packages/{ => misc}/xos.md (100%) rename docs/docs/07-packages/{ => misc}/xstrcase.md (100%) rename docs/docs/07-packages/{ => misc}/xstrings.md (100%) rename docs/docs/07-packages/{ => misc}/xtime.md (100%) rename docs/docs/07-packages/{ => misc}/xurl.md (100%) rename docs/docs/07-packages/{ => misc}/xyaml.md (100%) create mode 100644 docs/versioned_docs/version-v29/07-packages/cosmos/_category_.json rename docs/versioned_docs/version-v29/07-packages/{ => cosmos}/cosmostxcollector.md (100%) create mode 100644 docs/versioned_docs/version-v29/07-packages/go/_category_.json create mode 100644 docs/versioned_docs/version-v29/07-packages/misc/_category_.json diff --git a/docs/docs/07-packages/cosmos/_category_.json b/docs/docs/07-packages/cosmos/_category_.json new file mode 100644 index 0000000000..822f31b46d --- /dev/null +++ b/docs/docs/07-packages/cosmos/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Cosmos", + "link": null +} diff --git a/docs/docs/07-packages/chaincmd.md b/docs/docs/07-packages/cosmos/chaincmd.md similarity index 100% rename from docs/docs/07-packages/chaincmd.md rename to docs/docs/07-packages/cosmos/chaincmd.md diff --git a/docs/docs/07-packages/chaincmdrunner.md b/docs/docs/07-packages/cosmos/chaincmdrunner.md similarity index 100% rename from docs/docs/07-packages/chaincmdrunner.md rename to docs/docs/07-packages/cosmos/chaincmdrunner.md diff --git a/docs/docs/07-packages/chainregistry.md b/docs/docs/07-packages/cosmos/chainregistry.md similarity index 100% rename from docs/docs/07-packages/chainregistry.md rename to docs/docs/07-packages/cosmos/chainregistry.md diff --git a/docs/docs/07-packages/cosmosaccount.md b/docs/docs/07-packages/cosmos/cosmosaccount.md similarity index 100% rename from docs/docs/07-packages/cosmosaccount.md rename to docs/docs/07-packages/cosmos/cosmosaccount.md diff --git a/docs/docs/07-packages/cosmosanalysis.md b/docs/docs/07-packages/cosmos/cosmosanalysis.md similarity index 100% rename from docs/docs/07-packages/cosmosanalysis.md rename to docs/docs/07-packages/cosmos/cosmosanalysis.md diff --git a/docs/docs/07-packages/cosmosbuf.md b/docs/docs/07-packages/cosmos/cosmosbuf.md similarity index 100% rename from docs/docs/07-packages/cosmosbuf.md rename to docs/docs/07-packages/cosmos/cosmosbuf.md diff --git a/docs/docs/07-packages/cosmosclient.md b/docs/docs/07-packages/cosmos/cosmosclient.md similarity index 100% rename from docs/docs/07-packages/cosmosclient.md rename to docs/docs/07-packages/cosmos/cosmosclient.md diff --git a/docs/docs/07-packages/cosmosfaucet.md b/docs/docs/07-packages/cosmos/cosmosfaucet.md similarity index 100% rename from docs/docs/07-packages/cosmosfaucet.md rename to docs/docs/07-packages/cosmos/cosmosfaucet.md diff --git a/docs/docs/07-packages/cosmosgen.md b/docs/docs/07-packages/cosmos/cosmosgen.md similarity index 100% rename from docs/docs/07-packages/cosmosgen.md rename to docs/docs/07-packages/cosmos/cosmosgen.md diff --git a/docs/docs/07-packages/cosmostxcollector.md b/docs/docs/07-packages/cosmos/cosmostxcollector.md similarity index 100% rename from docs/docs/07-packages/cosmostxcollector.md rename to docs/docs/07-packages/cosmos/cosmostxcollector.md diff --git a/docs/docs/07-packages/cosmosver.md b/docs/docs/07-packages/cosmos/cosmosver.md similarity index 100% rename from docs/docs/07-packages/cosmosver.md rename to docs/docs/07-packages/cosmos/cosmosver.md diff --git a/docs/docs/07-packages/go/_category_.json b/docs/docs/07-packages/go/_category_.json new file mode 100644 index 0000000000..2e626f8d23 --- /dev/null +++ b/docs/docs/07-packages/go/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Go", + "link": null +} diff --git a/docs/docs/07-packages/goanalysis.md b/docs/docs/07-packages/go/goanalysis.md similarity index 100% rename from docs/docs/07-packages/goanalysis.md rename to docs/docs/07-packages/go/goanalysis.md diff --git a/docs/docs/07-packages/gocmd.md b/docs/docs/07-packages/go/gocmd.md similarity index 100% rename from docs/docs/07-packages/gocmd.md rename to docs/docs/07-packages/go/gocmd.md diff --git a/docs/docs/07-packages/goenv.md b/docs/docs/07-packages/go/goenv.md similarity index 100% rename from docs/docs/07-packages/goenv.md rename to docs/docs/07-packages/go/goenv.md diff --git a/docs/docs/07-packages/gomodule.md b/docs/docs/07-packages/go/gomodule.md similarity index 100% rename from docs/docs/07-packages/gomodule.md rename to docs/docs/07-packages/go/gomodule.md diff --git a/docs/docs/07-packages/gomodulepath.md b/docs/docs/07-packages/go/gomodulepath.md similarity index 100% rename from docs/docs/07-packages/gomodulepath.md rename to docs/docs/07-packages/go/gomodulepath.md diff --git a/docs/docs/07-packages/misc/_category_.json b/docs/docs/07-packages/misc/_category_.json new file mode 100644 index 0000000000..8964f2ee82 --- /dev/null +++ b/docs/docs/07-packages/misc/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Miscellaneous", + "link": null +} diff --git a/docs/docs/07-packages/archive.md b/docs/docs/07-packages/misc/archive.md similarity index 100% rename from docs/docs/07-packages/archive.md rename to docs/docs/07-packages/misc/archive.md diff --git a/docs/docs/07-packages/availableport.md b/docs/docs/07-packages/misc/availableport.md similarity index 100% rename from docs/docs/07-packages/availableport.md rename to docs/docs/07-packages/misc/availableport.md diff --git a/docs/docs/07-packages/cache.md b/docs/docs/07-packages/misc/cache.md similarity index 100% rename from docs/docs/07-packages/cache.md rename to docs/docs/07-packages/misc/cache.md diff --git a/docs/docs/07-packages/checksum.md b/docs/docs/07-packages/misc/checksum.md similarity index 100% rename from docs/docs/07-packages/checksum.md rename to docs/docs/07-packages/misc/checksum.md diff --git a/docs/docs/07-packages/clictx.md b/docs/docs/07-packages/misc/clictx.md similarity index 100% rename from docs/docs/07-packages/clictx.md rename to docs/docs/07-packages/misc/clictx.md diff --git a/docs/docs/07-packages/clidoc.md b/docs/docs/07-packages/misc/clidoc.md similarity index 100% rename from docs/docs/07-packages/clidoc.md rename to docs/docs/07-packages/misc/clidoc.md diff --git a/docs/docs/07-packages/cliui.md b/docs/docs/07-packages/misc/cliui.md similarity index 100% rename from docs/docs/07-packages/cliui.md rename to docs/docs/07-packages/misc/cliui.md diff --git a/docs/docs/07-packages/cmdrunner.md b/docs/docs/07-packages/misc/cmdrunner.md similarity index 100% rename from docs/docs/07-packages/cmdrunner.md rename to docs/docs/07-packages/misc/cmdrunner.md diff --git a/docs/docs/07-packages/confile.md b/docs/docs/07-packages/misc/confile.md similarity index 100% rename from docs/docs/07-packages/confile.md rename to docs/docs/07-packages/misc/confile.md diff --git a/docs/docs/07-packages/ctxticker.md b/docs/docs/07-packages/misc/ctxticker.md similarity index 100% rename from docs/docs/07-packages/ctxticker.md rename to docs/docs/07-packages/misc/ctxticker.md diff --git a/docs/docs/07-packages/debugger.md b/docs/docs/07-packages/misc/debugger.md similarity index 100% rename from docs/docs/07-packages/debugger.md rename to docs/docs/07-packages/misc/debugger.md diff --git a/docs/docs/07-packages/dircache.md b/docs/docs/07-packages/misc/dircache.md similarity index 100% rename from docs/docs/07-packages/dircache.md rename to docs/docs/07-packages/misc/dircache.md diff --git a/docs/docs/07-packages/dirchange.md b/docs/docs/07-packages/misc/dirchange.md similarity index 100% rename from docs/docs/07-packages/dirchange.md rename to docs/docs/07-packages/misc/dirchange.md diff --git a/docs/docs/07-packages/env.md b/docs/docs/07-packages/misc/env.md similarity index 100% rename from docs/docs/07-packages/env.md rename to docs/docs/07-packages/misc/env.md diff --git a/docs/docs/07-packages/errors.md b/docs/docs/07-packages/misc/errors.md similarity index 100% rename from docs/docs/07-packages/errors.md rename to docs/docs/07-packages/misc/errors.md diff --git a/docs/docs/07-packages/events.md b/docs/docs/07-packages/misc/events.md similarity index 100% rename from docs/docs/07-packages/events.md rename to docs/docs/07-packages/misc/events.md diff --git a/docs/docs/07-packages/httpstatuschecker.md b/docs/docs/07-packages/misc/httpstatuschecker.md similarity index 100% rename from docs/docs/07-packages/httpstatuschecker.md rename to docs/docs/07-packages/misc/httpstatuschecker.md diff --git a/docs/docs/07-packages/jsonfile.md b/docs/docs/07-packages/misc/jsonfile.md similarity index 100% rename from docs/docs/07-packages/jsonfile.md rename to docs/docs/07-packages/misc/jsonfile.md diff --git a/docs/docs/07-packages/localfs.md b/docs/docs/07-packages/misc/localfs.md similarity index 100% rename from docs/docs/07-packages/localfs.md rename to docs/docs/07-packages/misc/localfs.md diff --git a/docs/docs/07-packages/markdownviewer.md b/docs/docs/07-packages/misc/markdownviewer.md similarity index 100% rename from docs/docs/07-packages/markdownviewer.md rename to docs/docs/07-packages/misc/markdownviewer.md diff --git a/docs/docs/07-packages/multiformatname.md b/docs/docs/07-packages/misc/multiformatname.md similarity index 100% rename from docs/docs/07-packages/multiformatname.md rename to docs/docs/07-packages/misc/multiformatname.md diff --git a/docs/docs/07-packages/openapiconsole.md b/docs/docs/07-packages/misc/openapiconsole.md similarity index 100% rename from docs/docs/07-packages/openapiconsole.md rename to docs/docs/07-packages/misc/openapiconsole.md diff --git a/docs/docs/07-packages/placeholder.md b/docs/docs/07-packages/misc/placeholder.md similarity index 100% rename from docs/docs/07-packages/placeholder.md rename to docs/docs/07-packages/misc/placeholder.md diff --git a/docs/docs/07-packages/protoanalysis.md b/docs/docs/07-packages/misc/protoanalysis.md similarity index 100% rename from docs/docs/07-packages/protoanalysis.md rename to docs/docs/07-packages/misc/protoanalysis.md diff --git a/docs/docs/07-packages/randstr.md b/docs/docs/07-packages/misc/randstr.md similarity index 100% rename from docs/docs/07-packages/randstr.md rename to docs/docs/07-packages/misc/randstr.md diff --git a/docs/docs/07-packages/repoversion.md b/docs/docs/07-packages/misc/repoversion.md similarity index 100% rename from docs/docs/07-packages/repoversion.md rename to docs/docs/07-packages/misc/repoversion.md diff --git a/docs/docs/07-packages/safeconverter.md b/docs/docs/07-packages/misc/safeconverter.md similarity index 100% rename from docs/docs/07-packages/safeconverter.md rename to docs/docs/07-packages/misc/safeconverter.md diff --git a/docs/docs/07-packages/swagger-combine.md b/docs/docs/07-packages/misc/swagger-combine.md similarity index 100% rename from docs/docs/07-packages/swagger-combine.md rename to docs/docs/07-packages/misc/swagger-combine.md diff --git a/docs/docs/07-packages/tarball.md b/docs/docs/07-packages/misc/tarball.md similarity index 100% rename from docs/docs/07-packages/tarball.md rename to docs/docs/07-packages/misc/tarball.md diff --git a/docs/docs/07-packages/truncatedbuffer.md b/docs/docs/07-packages/misc/truncatedbuffer.md similarity index 100% rename from docs/docs/07-packages/truncatedbuffer.md rename to docs/docs/07-packages/misc/truncatedbuffer.md diff --git a/docs/docs/07-packages/xast.md b/docs/docs/07-packages/misc/xast.md similarity index 100% rename from docs/docs/07-packages/xast.md rename to docs/docs/07-packages/misc/xast.md diff --git a/docs/docs/07-packages/xembed.md b/docs/docs/07-packages/misc/xembed.md similarity index 100% rename from docs/docs/07-packages/xembed.md rename to docs/docs/07-packages/misc/xembed.md diff --git a/docs/docs/07-packages/xexec.md b/docs/docs/07-packages/misc/xexec.md similarity index 100% rename from docs/docs/07-packages/xexec.md rename to docs/docs/07-packages/misc/xexec.md diff --git a/docs/docs/07-packages/xfilepath.md b/docs/docs/07-packages/misc/xfilepath.md similarity index 100% rename from docs/docs/07-packages/xfilepath.md rename to docs/docs/07-packages/misc/xfilepath.md diff --git a/docs/docs/07-packages/xgenny.md b/docs/docs/07-packages/misc/xgenny.md similarity index 100% rename from docs/docs/07-packages/xgenny.md rename to docs/docs/07-packages/misc/xgenny.md diff --git a/docs/docs/07-packages/xgit.md b/docs/docs/07-packages/misc/xgit.md similarity index 100% rename from docs/docs/07-packages/xgit.md rename to docs/docs/07-packages/misc/xgit.md diff --git a/docs/docs/07-packages/xhttp.md b/docs/docs/07-packages/misc/xhttp.md similarity index 100% rename from docs/docs/07-packages/xhttp.md rename to docs/docs/07-packages/misc/xhttp.md diff --git a/docs/docs/07-packages/xio.md b/docs/docs/07-packages/misc/xio.md similarity index 100% rename from docs/docs/07-packages/xio.md rename to docs/docs/07-packages/misc/xio.md diff --git a/docs/docs/07-packages/xnet.md b/docs/docs/07-packages/misc/xnet.md similarity index 100% rename from docs/docs/07-packages/xnet.md rename to docs/docs/07-packages/misc/xnet.md diff --git a/docs/docs/07-packages/xos.md b/docs/docs/07-packages/misc/xos.md similarity index 100% rename from docs/docs/07-packages/xos.md rename to docs/docs/07-packages/misc/xos.md diff --git a/docs/docs/07-packages/xstrcase.md b/docs/docs/07-packages/misc/xstrcase.md similarity index 100% rename from docs/docs/07-packages/xstrcase.md rename to docs/docs/07-packages/misc/xstrcase.md diff --git a/docs/docs/07-packages/xstrings.md b/docs/docs/07-packages/misc/xstrings.md similarity index 100% rename from docs/docs/07-packages/xstrings.md rename to docs/docs/07-packages/misc/xstrings.md diff --git a/docs/docs/07-packages/xtime.md b/docs/docs/07-packages/misc/xtime.md similarity index 100% rename from docs/docs/07-packages/xtime.md rename to docs/docs/07-packages/misc/xtime.md diff --git a/docs/docs/07-packages/xurl.md b/docs/docs/07-packages/misc/xurl.md similarity index 100% rename from docs/docs/07-packages/xurl.md rename to docs/docs/07-packages/misc/xurl.md diff --git a/docs/docs/07-packages/xyaml.md b/docs/docs/07-packages/misc/xyaml.md similarity index 100% rename from docs/docs/07-packages/xyaml.md rename to docs/docs/07-packages/misc/xyaml.md diff --git a/docs/versioned_docs/version-v29/07-packages/cosmos/_category_.json b/docs/versioned_docs/version-v29/07-packages/cosmos/_category_.json new file mode 100644 index 0000000000..822f31b46d --- /dev/null +++ b/docs/versioned_docs/version-v29/07-packages/cosmos/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Cosmos", + "link": null +} diff --git a/docs/versioned_docs/version-v29/07-packages/cosmostxcollector.md b/docs/versioned_docs/version-v29/07-packages/cosmos/cosmostxcollector.md similarity index 100% rename from docs/versioned_docs/version-v29/07-packages/cosmostxcollector.md rename to docs/versioned_docs/version-v29/07-packages/cosmos/cosmostxcollector.md diff --git a/docs/versioned_docs/version-v29/07-packages/go/_category_.json b/docs/versioned_docs/version-v29/07-packages/go/_category_.json new file mode 100644 index 0000000000..2e626f8d23 --- /dev/null +++ b/docs/versioned_docs/version-v29/07-packages/go/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Go", + "link": null +} diff --git a/docs/versioned_docs/version-v29/07-packages/misc/_category_.json b/docs/versioned_docs/version-v29/07-packages/misc/_category_.json new file mode 100644 index 0000000000..8964f2ee82 --- /dev/null +++ b/docs/versioned_docs/version-v29/07-packages/misc/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Miscellaneous", + "link": null +} From a1db902100faf7b18f5112437e2f0ad9c985b0d5 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:30:33 -0300 Subject: [PATCH 09/15] rollback versioned docs --- .../version-v29/07-packages/cosmos/_category_.json | 4 ---- .../version-v29/07-packages/{cosmos => }/cosmostxcollector.md | 0 .../versioned_docs/version-v29/07-packages/go/_category_.json | 4 ---- .../version-v29/07-packages/misc/_category_.json | 4 ---- 4 files changed, 12 deletions(-) delete mode 100644 docs/versioned_docs/version-v29/07-packages/cosmos/_category_.json rename docs/versioned_docs/version-v29/07-packages/{cosmos => }/cosmostxcollector.md (100%) delete mode 100644 docs/versioned_docs/version-v29/07-packages/go/_category_.json delete mode 100644 docs/versioned_docs/version-v29/07-packages/misc/_category_.json diff --git a/docs/versioned_docs/version-v29/07-packages/cosmos/_category_.json b/docs/versioned_docs/version-v29/07-packages/cosmos/_category_.json deleted file mode 100644 index 822f31b46d..0000000000 --- a/docs/versioned_docs/version-v29/07-packages/cosmos/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Cosmos", - "link": null -} diff --git a/docs/versioned_docs/version-v29/07-packages/cosmos/cosmostxcollector.md b/docs/versioned_docs/version-v29/07-packages/cosmostxcollector.md similarity index 100% rename from docs/versioned_docs/version-v29/07-packages/cosmos/cosmostxcollector.md rename to docs/versioned_docs/version-v29/07-packages/cosmostxcollector.md diff --git a/docs/versioned_docs/version-v29/07-packages/go/_category_.json b/docs/versioned_docs/version-v29/07-packages/go/_category_.json deleted file mode 100644 index 2e626f8d23..0000000000 --- a/docs/versioned_docs/version-v29/07-packages/go/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Go", - "link": null -} diff --git a/docs/versioned_docs/version-v29/07-packages/misc/_category_.json b/docs/versioned_docs/version-v29/07-packages/misc/_category_.json deleted file mode 100644 index 8964f2ee82..0000000000 --- a/docs/versioned_docs/version-v29/07-packages/misc/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Miscellaneous", - "link": null -} From b4adaee9d08b0886c9fe756e03dabae6032ba852 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:35:50 -0300 Subject: [PATCH 10/15] update generic docs --- docs/docs/07-packages/go/goanalysis.md | 13 ++++++++++++- docs/docs/07-packages/go/goenv.md | 11 ++++++++++- docs/docs/07-packages/misc/archive.md | 7 ++++++- docs/docs/07-packages/misc/availableport.md | 7 ++++++- docs/docs/07-packages/misc/cache.md | 10 +++++++++- docs/docs/07-packages/misc/checksum.md | 8 +++++++- docs/docs/07-packages/misc/clictx.md | 7 ++++++- docs/docs/07-packages/misc/clidoc.md | 7 ++++++- docs/docs/07-packages/misc/cliui.md | 8 +++++++- docs/docs/07-packages/misc/confile.md | 13 ++++++++++++- docs/docs/07-packages/misc/ctxticker.md | 7 ++++++- docs/docs/07-packages/misc/debugger.md | 9 ++++++++- docs/docs/07-packages/misc/dircache.md | 8 +++++++- docs/docs/07-packages/misc/dirchange.md | 9 ++++++++- docs/docs/07-packages/misc/env.md | 10 +++++++++- docs/docs/07-packages/misc/errors.md | 13 ++++++++++++- docs/docs/07-packages/misc/events.md | 13 ++++++++++++- docs/docs/07-packages/misc/httpstatuschecker.md | 7 ++++++- docs/docs/07-packages/misc/jsonfile.md | 9 ++++++++- docs/docs/07-packages/misc/localfs.md | 12 +++++++++++- docs/docs/07-packages/misc/markdownviewer.md | 6 +++++- docs/docs/07-packages/misc/multiformatname.md | 8 +++++++- docs/docs/07-packages/misc/openapiconsole.md | 6 +++++- docs/docs/07-packages/misc/placeholder.md | 10 +++++++++- docs/docs/07-packages/misc/randstr.md | 6 +++++- docs/docs/07-packages/misc/repoversion.md | 6 +++++- docs/docs/07-packages/misc/safeconverter.md | 8 +++++++- docs/docs/07-packages/misc/swagger-combine.md | 6 +++++- docs/docs/07-packages/misc/tarball.md | 7 ++++++- docs/docs/07-packages/misc/truncatedbuffer.md | 6 +++++- docs/docs/07-packages/misc/xast.md | 13 ++++++++++++- docs/docs/07-packages/misc/xembed.md | 6 +++++- docs/docs/07-packages/misc/xexec.md | 9 ++++++++- docs/docs/07-packages/misc/xfilepath.md | 11 ++++++++++- docs/docs/07-packages/misc/xgenny.md | 10 +++++++++- docs/docs/07-packages/misc/xgit.md | 10 +++++++++- docs/docs/07-packages/misc/xhttp.md | 10 +++++++++- docs/docs/07-packages/misc/xio.md | 6 +++++- docs/docs/07-packages/misc/xnet.md | 10 +++++++++- docs/docs/07-packages/misc/xos.md | 13 ++++++++++++- docs/docs/07-packages/misc/xstrcase.md | 8 +++++++- docs/docs/07-packages/misc/xstrings.md | 13 ++++++++++++- docs/docs/07-packages/misc/xtime.md | 12 +++++++++++- docs/docs/07-packages/misc/xurl.md | 13 ++++++++++++- docs/docs/07-packages/misc/xyaml.md | 7 ++++++- 45 files changed, 363 insertions(+), 45 deletions(-) diff --git a/docs/docs/07-packages/go/goanalysis.md b/docs/docs/07-packages/go/goanalysis.md index 44cf530d43..7efd71a5d1 100644 --- a/docs/docs/07-packages/go/goanalysis.md +++ b/docs/docs/07-packages/go/goanalysis.md @@ -6,11 +6,22 @@ slug: /packages/goanalysis # Goanalysis (goanalysis) -The `goanalysis` package provides utilities used by Ignite CLI. +provides a toolset for statically analysing Go applications. For full API details, see the [`goanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/goanalysis). +## Key APIs + +- `var ErrMultipleMainPackagesFound = errors.New("multiple main packages found")` +- `func AddOrRemoveTools(f *modfile.File, writer io.Writer, importsToAdd, importsToRemove []string) error` +- `func DiscoverMain(path string) (pkgPaths []string, err error)` +- `func DiscoverOneMain(path string) (pkgPath string, err error)` +- `func FindBlankImports(node *ast.File) []string` +- `func FormatImports(f *ast.File) map[string]string` +- `func FuncVarExists(f *ast.File, goImport, methodSignature string) bool` +- `func HasAnyStructFieldsInPkg(pkgPath, structName string, fields []string) (bool, error)` + ## Basic import ```go diff --git a/docs/docs/07-packages/go/goenv.md b/docs/docs/07-packages/go/goenv.md index 4425e5eaab..ee44a56392 100644 --- a/docs/docs/07-packages/go/goenv.md +++ b/docs/docs/07-packages/go/goenv.md @@ -6,11 +6,20 @@ slug: /packages/goenv # Goenv (goenv) -The `goenv` package provides utilities used by Ignite CLI. +defines env variables known by Go and some utilities around it. For full API details, see the [`goenv` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/goenv). +## Key APIs + +- `const GOBIN = "GOBIN" ...` +- `func Bin() string` +- `func ConfigurePath() error` +- `func GoModCache() string` +- `func GoPath() string` +- `func Path() string` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/archive.md b/docs/docs/07-packages/misc/archive.md index cde9b02a72..6b803739d6 100644 --- a/docs/docs/07-packages/misc/archive.md +++ b/docs/docs/07-packages/misc/archive.md @@ -6,11 +6,16 @@ slug: /packages/archive # Archive (archive) -The `archive` package provides utilities used by Ignite CLI. +The `archive` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`archive` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/archive). +## Key APIs + +- `func CreateArchive(dir string, buf io.Writer) error` +- `func ExtractArchive(outDir string, gzipStream io.Reader) error` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/availableport.md b/docs/docs/07-packages/misc/availableport.md index 06ce4e8e1d..c3175be7b0 100644 --- a/docs/docs/07-packages/misc/availableport.md +++ b/docs/docs/07-packages/misc/availableport.md @@ -6,11 +6,16 @@ slug: /packages/availableport # Availableport (availableport) -The `availableport` package provides utilities used by Ignite CLI. +The `availableport` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`availableport` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/availableport). +## Key APIs + +- `func Find(n uint, options ...Options) (ports []uint, err error)` +- `type Options func(o *availablePortOptions)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/cache.md b/docs/docs/07-packages/misc/cache.md index 85ec761f42..dcbaaf059b 100644 --- a/docs/docs/07-packages/misc/cache.md +++ b/docs/docs/07-packages/misc/cache.md @@ -6,11 +6,19 @@ slug: /packages/cache # Cache (cache) -The `cache` package provides utilities used by Ignite CLI. +The `cache` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`cache` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cache). +## Key APIs + +- `var ErrorNotFound = errors.New("no value was found with the provided key")` +- `func Key(keyParts ...string) string` +- `type Cache[T any] struct{ ... }` +- `type Storage struct{ ... }` +- `type StorageOption func(*Storage)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/checksum.md b/docs/docs/07-packages/misc/checksum.md index 111c3b1ede..f9336c8f04 100644 --- a/docs/docs/07-packages/misc/checksum.md +++ b/docs/docs/07-packages/misc/checksum.md @@ -6,11 +6,17 @@ slug: /packages/checksum # Checksum (checksum) -The `checksum` package provides utilities used by Ignite CLI. +The `checksum` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`checksum` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/checksum). +## Key APIs + +- `func Binary(binaryName string) (string, error)` +- `func Strings(inputs ...string) string` +- `func Sum(dirPath, outPath string) error` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/clictx.md b/docs/docs/07-packages/misc/clictx.md index 5e88d1a211..06220b3dbc 100644 --- a/docs/docs/07-packages/misc/clictx.md +++ b/docs/docs/07-packages/misc/clictx.md @@ -6,11 +6,16 @@ slug: /packages/clictx # Clictx (clictx) -The `clictx` package provides utilities used by Ignite CLI. +The `clictx` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`clictx` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/clictx). +## Key APIs + +- `func Do(ctx context.Context, fn func() error) error` +- `func From(ctx context.Context) context.Context` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/clidoc.md b/docs/docs/07-packages/misc/clidoc.md index 16a5e6f7d0..c0dc37fef9 100644 --- a/docs/docs/07-packages/misc/clidoc.md +++ b/docs/docs/07-packages/misc/clidoc.md @@ -6,11 +6,16 @@ slug: /packages/clidoc # Clidoc (clidoc) -The `clidoc` package provides utilities used by Ignite CLI. +The `clidoc` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`clidoc` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/clidoc). +## Key APIs + +- `type Doc struct{ ... }` +- `type Docs []Doc` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/cliui.md b/docs/docs/07-packages/misc/cliui.md index 524d693e87..b7c2eefd9a 100644 --- a/docs/docs/07-packages/misc/cliui.md +++ b/docs/docs/07-packages/misc/cliui.md @@ -6,11 +6,17 @@ slug: /packages/cliui # Cliui (cliui) -The `cliui` package provides utilities used by Ignite CLI. +The `cliui` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`cliui` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cliui). +## Key APIs + +- `var ErrAbort = errors.New("aborted or not confirmed")` +- `type Option func(s *Session)` +- `type Session struct{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/confile.md b/docs/docs/07-packages/misc/confile.md index 8f07446c12..ee693348f8 100644 --- a/docs/docs/07-packages/misc/confile.md +++ b/docs/docs/07-packages/misc/confile.md @@ -6,11 +6,22 @@ slug: /packages/confile # Confile (confile) -The `confile` package provides utilities used by Ignite CLI. +is helper to load and overwrite configuration files. For full API details, see the [`confile` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/confile). +## Key APIs + +- `var DefaultJSONEncodingCreator = &JSONEncodingCreator{}` +- `var DefaultTOMLEncodingCreator = &TOMLEncodingCreator{}` +- `var DefaultYAMLEncodingCreator = &YAMLEncodingCreator{}` +- `type ConfigFile struct{ ... }` +- `type Decoder interface{ ... }` +- `type EncodeDecoder interface{ ... }` +- `type Encoder interface{ ... }` +- `type Encoding struct{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/ctxticker.md b/docs/docs/07-packages/misc/ctxticker.md index 6d5093cc6e..ecd669b599 100644 --- a/docs/docs/07-packages/misc/ctxticker.md +++ b/docs/docs/07-packages/misc/ctxticker.md @@ -6,11 +6,16 @@ slug: /packages/ctxticker # Ctxticker (ctxticker) -The `ctxticker` package provides utilities used by Ignite CLI. +The `ctxticker` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`ctxticker` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/ctxticker). +## Key APIs + +- `func Do(ctx context.Context, d time.Duration, fn func() error) error` +- `func DoNow(ctx context.Context, d time.Duration, fn func() error) error` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/debugger.md b/docs/docs/07-packages/misc/debugger.md index 9483e65253..d4aa1069ac 100644 --- a/docs/docs/07-packages/misc/debugger.md +++ b/docs/docs/07-packages/misc/debugger.md @@ -6,11 +6,18 @@ slug: /packages/debugger # Debugger (debugger) -The `debugger` package provides utilities used by Ignite CLI. +The `debugger` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`debugger` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/debugger). +## Key APIs + +- `const DefaultAddress = "127.0.0.1:30500" ...` +- `func Run(ctx context.Context, binaryPath string, options ...Option) error` +- `func Start(ctx context.Context, binaryPath string, options ...Option) (err error)` +- `type Option func(*debuggerOptions)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/dircache.md b/docs/docs/07-packages/misc/dircache.md index b6d2fd94bd..2b475aae08 100644 --- a/docs/docs/07-packages/misc/dircache.md +++ b/docs/docs/07-packages/misc/dircache.md @@ -6,11 +6,17 @@ slug: /packages/dircache # Dircache (dircache) -The `dircache` package provides utilities used by Ignite CLI. +The `dircache` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`dircache` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/dircache). +## Key APIs + +- `var ErrCacheNotFound = errors.New("cache not found")` +- `func ClearCache() error` +- `type Cache struct{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/dirchange.md b/docs/docs/07-packages/misc/dirchange.md index 793005925e..e1fc2031dd 100644 --- a/docs/docs/07-packages/misc/dirchange.md +++ b/docs/docs/07-packages/misc/dirchange.md @@ -6,11 +6,18 @@ slug: /packages/dirchange # Dirchange (dirchange) -The `dirchange` package provides utilities used by Ignite CLI. +The `dirchange` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`dirchange` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/dirchange). +## Key APIs + +- `var ErrNoFile = errors.New("no file in specified paths")` +- `func ChecksumFromPaths(workdir string, paths ...string) ([]byte, error)` +- `func HasDirChecksumChanged(checksumCache cache.Cache[[]byte], cacheKey string, workdir string, ...) (bool, error)` +- `func SaveDirChecksum(checksumCache cache.Cache[[]byte], cacheKey string, workdir string, ...) error` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/env.md b/docs/docs/07-packages/misc/env.md index eb53c2c725..85eff7c561 100644 --- a/docs/docs/07-packages/misc/env.md +++ b/docs/docs/07-packages/misc/env.md @@ -6,11 +6,19 @@ slug: /packages/env # Env (env) -The `env` package provides utilities used by Ignite CLI. +The `env` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`env` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/env). +## Key APIs + +- `const DebugEnvVar = "IGNT_DEBUG" ...` +- `func ConfigDir() xfilepath.PathRetriever` +- `func IsDebug() bool` +- `func SetConfigDir(dir string)` +- `func SetDebug()` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/errors.md b/docs/docs/07-packages/misc/errors.md index 1a36dc90c1..99ba725aa3 100644 --- a/docs/docs/07-packages/misc/errors.md +++ b/docs/docs/07-packages/misc/errors.md @@ -6,11 +6,22 @@ slug: /packages/errors # Errors (errors) -The `errors` package provides utilities used by Ignite CLI. +provides helpers for error creation, avoiding using different. For full API details, see the [`errors` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/errors). +## Key APIs + +- `func As(err error, target any) bool` +- `func Errorf(format string, args ...any) error` +- `func Is(err, reference error) bool` +- `func Join(errs ...error) error` +- `func New(msg string) error` +- `func Unwrap(err error) error` +- `func WithStack(err error) error` +- `func Wrap(err error, msg string) error` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/events.md b/docs/docs/07-packages/misc/events.md index 0ea737524d..06a3e2b780 100644 --- a/docs/docs/07-packages/misc/events.md +++ b/docs/docs/07-packages/misc/events.md @@ -6,11 +6,22 @@ slug: /packages/events # Events (events) -The `events` package provides utilities used by Ignite CLI. +provides functionalities for packages to log their states as. For full API details, see the [`events` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/events). +## Key APIs + +- `const DefaultBufferSize = 50` +- `const GroupError = "error"` +- `type Bus struct{ ... }` +- `type BusOption func(*Bus)` +- `type Event struct{ ... }` +- `type Option func(*Event)` +- `type ProgressIndication uint8` +- `type Provider interface{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/httpstatuschecker.md b/docs/docs/07-packages/misc/httpstatuschecker.md index 2121487bfa..58e2b724b4 100644 --- a/docs/docs/07-packages/misc/httpstatuschecker.md +++ b/docs/docs/07-packages/misc/httpstatuschecker.md @@ -6,11 +6,16 @@ slug: /packages/httpstatuschecker # Httpstatuschecker (httpstatuschecker) -The `httpstatuschecker` package provides utilities used by Ignite CLI. +is a tool check health of http pages. For full API details, see the [`httpstatuschecker` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/httpstatuschecker). +## Key APIs + +- `func Check(ctx context.Context, addr string, options ...Option) (isAvailable bool, err error)` +- `type Option func(*checker)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/jsonfile.md b/docs/docs/07-packages/misc/jsonfile.md index 61e5e36ea6..3504821ea3 100644 --- a/docs/docs/07-packages/misc/jsonfile.md +++ b/docs/docs/07-packages/misc/jsonfile.md @@ -6,11 +6,18 @@ slug: /packages/jsonfile # Jsonfile (jsonfile) -The `jsonfile` package provides utilities used by Ignite CLI. +The `jsonfile` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`jsonfile` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/jsonfile). +## Key APIs + +- `var ErrFieldNotFound = errors.New("JSON field not found") ...` +- `type JSONFile struct{ ... }` +- `type ReadWriteSeeker interface{ ... }` +- `type UpdateFileOption func(map[string][]byte)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/localfs.md b/docs/docs/07-packages/misc/localfs.md index 09f0c91c21..c7d21cfb8e 100644 --- a/docs/docs/07-packages/misc/localfs.md +++ b/docs/docs/07-packages/misc/localfs.md @@ -6,11 +6,21 @@ slug: /packages/localfs # Localfs (localfs) -The `localfs` package provides utilities used by Ignite CLI. +The `localfs` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`localfs` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/localfs). +## Key APIs + +- `func MkdirAllReset(path string, perm fs.FileMode) error` +- `func Save(f fs.FS, path string) error` +- `func SaveBytesTemp(data []byte, prefix string, perm os.FileMode) (path string, cleanup func(), err error)` +- `func SaveTemp(f fs.FS) (path string, cleanup func(), err error)` +- `func Search(path, pattern string) ([]string, error)` +- `func Watch(ctx context.Context, paths []string, options ...WatcherOption) error` +- `type WatcherOption func(*watcher)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/markdownviewer.md b/docs/docs/07-packages/misc/markdownviewer.md index a64967d2ed..e74fcb9273 100644 --- a/docs/docs/07-packages/misc/markdownviewer.md +++ b/docs/docs/07-packages/misc/markdownviewer.md @@ -6,11 +6,15 @@ slug: /packages/markdownviewer # Markdownviewer (markdownviewer) -The `markdownviewer` package provides utilities used by Ignite CLI. +The `markdownviewer` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`markdownviewer` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/markdownviewer). +## Key APIs + +- `func View(path string) error` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/multiformatname.md b/docs/docs/07-packages/misc/multiformatname.md index 6090c454ea..cdc9f457f9 100644 --- a/docs/docs/07-packages/misc/multiformatname.md +++ b/docs/docs/07-packages/misc/multiformatname.md @@ -6,11 +6,17 @@ slug: /packages/multiformatname # Multiformatname (multiformatname) -The `multiformatname` package provides utilities used by Ignite CLI. +provides names automatically converted into multiple. For full API details, see the [`multiformatname` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/multiformatname). +## Key APIs + +- `func NoNumber(name string) error` +- `type Checker func(name string) error` +- `type Name struct{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/openapiconsole.md b/docs/docs/07-packages/misc/openapiconsole.md index ef3c18cee8..eaf9d39fc9 100644 --- a/docs/docs/07-packages/misc/openapiconsole.md +++ b/docs/docs/07-packages/misc/openapiconsole.md @@ -6,11 +6,15 @@ slug: /packages/openapiconsole # Openapiconsole (openapiconsole) -The `openapiconsole` package provides utilities used by Ignite CLI. +The `openapiconsole` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`openapiconsole` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/openapiconsole). +## Key APIs + +- `func Handler(title, specURL string) http.HandlerFunc` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/placeholder.md b/docs/docs/07-packages/misc/placeholder.md index bb73313cc4..269f144e08 100644 --- a/docs/docs/07-packages/misc/placeholder.md +++ b/docs/docs/07-packages/misc/placeholder.md @@ -6,11 +6,19 @@ slug: /packages/placeholder # Placeholder (placeholder) -The `placeholder` package provides utilities used by Ignite CLI. +The `placeholder` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`placeholder` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/placeholder). +## Key APIs + +- `type MissingPlaceholdersError struct{ ... }` +- `type Option func(*Tracer)` +- `type Replacer interface{ ... }` +- `type Tracer struct{ ... }` +- `type ValidationMiscError struct{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/randstr.md b/docs/docs/07-packages/misc/randstr.md index 57de217690..bcb1b6abdb 100644 --- a/docs/docs/07-packages/misc/randstr.md +++ b/docs/docs/07-packages/misc/randstr.md @@ -6,11 +6,15 @@ slug: /packages/randstr # Randstr (randstr) -The `randstr` package provides utilities used by Ignite CLI. +The `randstr` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`randstr` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/randstr). +## Key APIs + +- `func Runes(n int) string` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/repoversion.md b/docs/docs/07-packages/misc/repoversion.md index 963b530ba4..c654808d54 100644 --- a/docs/docs/07-packages/misc/repoversion.md +++ b/docs/docs/07-packages/misc/repoversion.md @@ -6,11 +6,15 @@ slug: /packages/repoversion # Repoversion (repoversion) -The `repoversion` package provides utilities used by Ignite CLI. +The `repoversion` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`repoversion` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/repoversion). +## Key APIs + +- `type Version struct{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/safeconverter.md b/docs/docs/07-packages/misc/safeconverter.md index 29461d8aef..b5d1c0c460 100644 --- a/docs/docs/07-packages/misc/safeconverter.md +++ b/docs/docs/07-packages/misc/safeconverter.md @@ -6,11 +6,17 @@ slug: /packages/safeconverter # Safeconverter (safeconverter) -The `safeconverter` package provides utilities used by Ignite CLI. +The `safeconverter` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`safeconverter` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/safeconverter). +## Key APIs + +- `func ToInt[T SafeToConvertToInt](x T) int` +- `func ToInt64[T SafeToConvertToInt](x T) int64` +- `type SafeToConvertToInt interface{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/swagger-combine.md b/docs/docs/07-packages/misc/swagger-combine.md index 171a692b76..21c5434727 100644 --- a/docs/docs/07-packages/misc/swagger-combine.md +++ b/docs/docs/07-packages/misc/swagger-combine.md @@ -6,11 +6,15 @@ slug: /packages/swagger-combine # Swagger Combine (swagger-combine) -The `swagger-combine` package provides utilities used by Ignite CLI. +The `swagger-combine` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`swagger-combine` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/swagger-combine). +## Key APIs + +- `type Config struct{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/tarball.md b/docs/docs/07-packages/misc/tarball.md index aeb195367e..cb5c77a4e6 100644 --- a/docs/docs/07-packages/misc/tarball.md +++ b/docs/docs/07-packages/misc/tarball.md @@ -6,11 +6,16 @@ slug: /packages/tarball # Tarball (tarball) -The `tarball` package provides utilities used by Ignite CLI. +The `tarball` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`tarball` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/tarball). +## Key APIs + +- `var ErrGzipFileNotFound = errors.New("file not found in the gzip") ...` +- `func ExtractFile(reader io.Reader, out io.Writer, fileName string) (string, error)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/truncatedbuffer.md b/docs/docs/07-packages/misc/truncatedbuffer.md index 261e5f1487..2c35d18376 100644 --- a/docs/docs/07-packages/misc/truncatedbuffer.md +++ b/docs/docs/07-packages/misc/truncatedbuffer.md @@ -6,11 +6,15 @@ slug: /packages/truncatedbuffer # Truncatedbuffer (truncatedbuffer) -The `truncatedbuffer` package provides utilities used by Ignite CLI. +The `truncatedbuffer` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`truncatedbuffer` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/truncatedbuffer). +## Key APIs + +- `type TruncatedBuffer struct{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xast.md b/docs/docs/07-packages/misc/xast.md index 75787c00ba..b23968f783 100644 --- a/docs/docs/07-packages/misc/xast.md +++ b/docs/docs/07-packages/misc/xast.md @@ -6,11 +6,22 @@ slug: /packages/xast # Xast (xast) -The `xast` package provides utilities used by Ignite CLI. +The `xast` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xast` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xast). +## Key APIs + +- `var AppendFuncCodeAtLine = AppendFuncAtLine` +- `var ErrStop = errors.New("ast stop")` +- `func AppendFunction(fileContent string, function string) (modifiedContent string, err error)` +- `func AppendImports(fileContent string, imports ...ImportOptions) (string, error)` +- `func InsertGlobal(fileContent string, globalType GlobalType, globals ...GlobalOptions) (modifiedContent string, err error)` +- `func Inspect(n ast.Node, f func(n ast.Node) error) (err error)` +- `func ModifyCaller(content, callerExpr string, modifiers func([]string) ([]string, error)) (string, error)` +- `func ModifyFunction(content string, funcName string, functions ...FunctionOptions) (string, error)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xembed.md b/docs/docs/07-packages/misc/xembed.md index c1f7a655dd..bc0b533c19 100644 --- a/docs/docs/07-packages/misc/xembed.md +++ b/docs/docs/07-packages/misc/xembed.md @@ -6,11 +6,15 @@ slug: /packages/xembed # Xembed (xembed) -The `xembed` package provides utilities used by Ignite CLI. +The `xembed` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xembed` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xembed). +## Key APIs + +- `func FileList(efs embed.FS, path string) ([]string, error)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xexec.md b/docs/docs/07-packages/misc/xexec.md index 1a193fcba9..5116dd6d8f 100644 --- a/docs/docs/07-packages/misc/xexec.md +++ b/docs/docs/07-packages/misc/xexec.md @@ -6,11 +6,18 @@ slug: /packages/xexec # Xexec (xexec) -The `xexec` package provides utilities used by Ignite CLI. +The `xexec` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xexec` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xexec). +## Key APIs + +- `func IsCommandAvailable(name string) bool` +- `func IsExec(binaryPath string) (bool, error)` +- `func ResolveAbsPath(filePath string) (path string, err error)` +- `func TryResolveAbsPath(filePath string) string` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xfilepath.md b/docs/docs/07-packages/misc/xfilepath.md index ea70aeb13d..3e6d98049e 100644 --- a/docs/docs/07-packages/misc/xfilepath.md +++ b/docs/docs/07-packages/misc/xfilepath.md @@ -6,11 +6,20 @@ slug: /packages/xfilepath # Xfilepath (xfilepath) -The `xfilepath` package provides utilities used by Ignite CLI. +defines functions to define path retrievers that support error. For full API details, see the [`xfilepath` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xfilepath). +## Key APIs + +- `func IsDir(path string) bool` +- `func MustAbs(path string) (string, error)` +- `func MustInvoke(p PathRetriever) string` +- `func RelativePath(appPath string) (string, error)` +- `type PathRetriever func() (path string, err error)` +- `type PathsRetriever func() (path []string, err error)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xgenny.md b/docs/docs/07-packages/misc/xgenny.md index 878f0418b8..cc84981960 100644 --- a/docs/docs/07-packages/misc/xgenny.md +++ b/docs/docs/07-packages/misc/xgenny.md @@ -6,11 +6,19 @@ slug: /packages/xgenny # Xgenny (xgenny) -The `xgenny` package provides utilities used by Ignite CLI. +The `xgenny` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xgenny` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xgenny). +## Key APIs + +- `func Transformer(ctx *plush.Context) genny.Transformer` +- `type ApplyOption func(r *applyOptions)` +- `type OverwriteCallback func(_, _, duplicated []string) error` +- `type Runner struct{ ... }` +- `type SourceModification struct{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xgit.md b/docs/docs/07-packages/misc/xgit.md index 138f4eb8c0..26afed0d93 100644 --- a/docs/docs/07-packages/misc/xgit.md +++ b/docs/docs/07-packages/misc/xgit.md @@ -6,11 +6,19 @@ slug: /packages/xgit # Xgit (xgit) -The `xgit` package provides utilities used by Ignite CLI. +The `xgit` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xgit` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xgit). +## Key APIs + +- `func AreChangesCommitted(dir string) (bool, error)` +- `func Clone(ctx context.Context, urlRef, dir string) error` +- `func InitAndCommit(path string) error` +- `func IsRepository(path string) (bool, error)` +- `func RepositoryURL(path string) (string, error)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xhttp.md b/docs/docs/07-packages/misc/xhttp.md index f360b09a4b..f333fb403d 100644 --- a/docs/docs/07-packages/misc/xhttp.md +++ b/docs/docs/07-packages/misc/xhttp.md @@ -6,11 +6,19 @@ slug: /packages/xhttp # Xhttp (xhttp) -The `xhttp` package provides utilities used by Ignite CLI. +The `xhttp` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xhttp` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xhttp). +## Key APIs + +- `const ShutdownTimeout = time.Minute` +- `func ResponseJSON(w http.ResponseWriter, status int, data interface{}) error` +- `func Serve(ctx context.Context, s *http.Server) error` +- `type ErrorResponse struct{ ... }` +- `type ErrorResponseBody struct{ ... }` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xio.md b/docs/docs/07-packages/misc/xio.md index 32a2a0fdf0..f5a08e39e5 100644 --- a/docs/docs/07-packages/misc/xio.md +++ b/docs/docs/07-packages/misc/xio.md @@ -6,11 +6,15 @@ slug: /packages/xio # Xio (xio) -The `xio` package provides utilities used by Ignite CLI. +The `xio` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xio` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xio). +## Key APIs + +- `func NopWriteCloser(w io.Writer) io.WriteCloser` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xnet.md b/docs/docs/07-packages/misc/xnet.md index 3049a4c8aa..1725589c07 100644 --- a/docs/docs/07-packages/misc/xnet.md +++ b/docs/docs/07-packages/misc/xnet.md @@ -6,11 +6,19 @@ slug: /packages/xnet # Xnet (xnet) -The `xnet` package provides utilities used by Ignite CLI. +The `xnet` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xnet` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xnet). +## Key APIs + +- `func AnyIPv4Address(port int) string` +- `func IncreasePort(addr string) (string, error)` +- `func IncreasePortBy(addr string, inc uint64) (string, error)` +- `func LocalhostIPv4Address(port int) string` +- `func MustIncreasePortBy(addr string, inc uint64) string` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xos.md b/docs/docs/07-packages/misc/xos.md index 9e0d2de100..486d5eadea 100644 --- a/docs/docs/07-packages/misc/xos.md +++ b/docs/docs/07-packages/misc/xos.md @@ -6,11 +6,22 @@ slug: /packages/xos # Xos (xos) -The `xos` package provides utilities used by Ignite CLI. +The `xos` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xos` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xos). +## Key APIs + +- `const JSONFile = "json" ...` +- `func CopyFile(srcPath, dstPath string) error` +- `func CopyFolder(srcPath, dstPath string) error` +- `func FileExists(filename string) bool` +- `func FindFiles(directory string, options ...FindFileOptions) ([]string, error)` +- `func RemoveAllUnderHome(path string) error` +- `func Rename(oldPath, newPath string) error` +- `func ValidateFolderCopy(srcPath, dstPath string, exclude ...string) ([]string, error)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xstrcase.md b/docs/docs/07-packages/misc/xstrcase.md index 9763ba4d9e..72ff5f0bc7 100644 --- a/docs/docs/07-packages/misc/xstrcase.md +++ b/docs/docs/07-packages/misc/xstrcase.md @@ -6,11 +6,17 @@ slug: /packages/xstrcase # Xstrcase (xstrcase) -The `xstrcase` package provides utilities used by Ignite CLI. +The `xstrcase` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xstrcase` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xstrcase). +## Key APIs + +- `func Lowercase(name string) string` +- `func UpperCamel(name string) string` +- `func Uppercase(name string) string` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xstrings.md b/docs/docs/07-packages/misc/xstrings.md index 818ea9965b..ebd6fa8f82 100644 --- a/docs/docs/07-packages/misc/xstrings.md +++ b/docs/docs/07-packages/misc/xstrings.md @@ -6,11 +6,22 @@ slug: /packages/xstrings # Xstrings (xstrings) -The `xstrings` package provides utilities used by Ignite CLI. +The `xstrings` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xstrings` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xstrings). +## Key APIs + +- `func AllOrSomeFilter(list, filterList []string) []string` +- `func FormatUsername(s string) string` +- `func List(n int, do func(i int) string) []string` +- `func NoDash(s string) string` +- `func NoNumberPrefix(s string) string` +- `func StringBetween(s, start, end string) string` +- `func Title(s string) string` +- `func ToUpperFirst(s string) string` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xtime.md b/docs/docs/07-packages/misc/xtime.md index f0a5641c05..43516c2217 100644 --- a/docs/docs/07-packages/misc/xtime.md +++ b/docs/docs/07-packages/misc/xtime.md @@ -6,11 +6,21 @@ slug: /packages/xtime # Xtime (xtime) -The `xtime` package provides utilities used by Ignite CLI. +The `xtime` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xtime` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xtime). +## Key APIs + +- `func FormatUnix(date time.Time) string` +- `func FormatUnixInt(unix int64) string` +- `func NowAfter(unix time.Duration) string` +- `func Seconds(seconds int64) time.Duration` +- `type Clock interface{ ... }` +- `type ClockMock struct{ ... }` +- `type ClockSystem struct{}` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xurl.md b/docs/docs/07-packages/misc/xurl.md index a879214fd6..184f1608e2 100644 --- a/docs/docs/07-packages/misc/xurl.md +++ b/docs/docs/07-packages/misc/xurl.md @@ -6,11 +6,22 @@ slug: /packages/xurl # Xurl (xurl) -The `xurl` package provides utilities used by Ignite CLI. +The `xurl` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xurl` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xurl). +## Key APIs + +- `func Address(address string) string` +- `func HTTP(s string) (string, error)` +- `func HTTPEnsurePort(s string) string` +- `func HTTPS(s string) (string, error)` +- `func IsHTTP(address string) bool` +- `func MightHTTPS(s string) (string, error)` +- `func TCP(s string) (string, error)` +- `func WS(s string) (string, error)` + ## Basic import ```go diff --git a/docs/docs/07-packages/misc/xyaml.md b/docs/docs/07-packages/misc/xyaml.md index 3906f8ce7f..7e8b28e4f0 100644 --- a/docs/docs/07-packages/misc/xyaml.md +++ b/docs/docs/07-packages/misc/xyaml.md @@ -6,11 +6,16 @@ slug: /packages/xyaml # Xyaml (xyaml) -The `xyaml` package provides utilities used by Ignite CLI. +The `xyaml` package contains reusable utilities used by Ignite CLI internals. For full API details, see the [`xyaml` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xyaml). +## Key APIs + +- `func Marshal(ctx context.Context, obj interface{}, paths ...string) (string, error)` +- `type Map map[string]interface{}` + ## Basic import ```go From af0335530d6e1fa2e3ce5d4403fd1df05921c8f1 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:39:23 -0300 Subject: [PATCH 11/15] add more description --- docs/docs/07-packages/cosmos/chaincmd.md | 38 ++-- .../docs/07-packages/cosmos/chaincmdrunner.md | 55 +---- docs/docs/07-packages/cosmos/chainregistry.md | 64 ++---- docs/docs/07-packages/cosmos/cosmosaccount.md | 62 ++---- .../docs/07-packages/cosmos/cosmosanalysis.md | 44 ++-- docs/docs/07-packages/cosmos/cosmosbuf.md | 53 +---- docs/docs/07-packages/cosmos/cosmosclient.md | 97 ++------- docs/docs/07-packages/cosmos/cosmosfaucet.md | 85 ++------ docs/docs/07-packages/cosmos/cosmosgen.md | 58 ++---- .../07-packages/cosmos/cosmostxcollector.md | 193 +----------------- docs/docs/07-packages/cosmos/cosmosver.md | 32 +-- docs/docs/07-packages/go/goanalysis.md | 2 +- docs/docs/07-packages/go/gocmd.md | 38 ++-- docs/docs/07-packages/go/goenv.md | 2 +- docs/docs/07-packages/go/gomodule.md | 39 ++-- docs/docs/07-packages/go/gomodulepath.md | 31 +-- docs/docs/07-packages/misc/archive.md | 2 +- docs/docs/07-packages/misc/availableport.md | 2 +- docs/docs/07-packages/misc/cache.md | 2 +- docs/docs/07-packages/misc/checksum.md | 2 +- docs/docs/07-packages/misc/clictx.md | 2 +- docs/docs/07-packages/misc/clidoc.md | 2 +- docs/docs/07-packages/misc/cliui.md | 2 +- docs/docs/07-packages/misc/cmdrunner.md | 42 +--- docs/docs/07-packages/misc/confile.md | 2 +- docs/docs/07-packages/misc/ctxticker.md | 2 +- docs/docs/07-packages/misc/debugger.md | 2 +- docs/docs/07-packages/misc/dircache.md | 2 +- docs/docs/07-packages/misc/dirchange.md | 2 +- docs/docs/07-packages/misc/env.md | 2 +- docs/docs/07-packages/misc/errors.md | 2 +- docs/docs/07-packages/misc/events.md | 2 +- .../07-packages/misc/httpstatuschecker.md | 2 +- docs/docs/07-packages/misc/jsonfile.md | 2 +- docs/docs/07-packages/misc/localfs.md | 2 +- docs/docs/07-packages/misc/markdownviewer.md | 2 +- docs/docs/07-packages/misc/multiformatname.md | 2 +- docs/docs/07-packages/misc/openapiconsole.md | 2 +- docs/docs/07-packages/misc/placeholder.md | 2 +- docs/docs/07-packages/misc/protoanalysis.md | 38 ++-- docs/docs/07-packages/misc/randstr.md | 2 +- docs/docs/07-packages/misc/repoversion.md | 2 +- docs/docs/07-packages/misc/safeconverter.md | 2 +- docs/docs/07-packages/misc/swagger-combine.md | 2 +- docs/docs/07-packages/misc/tarball.md | 2 +- docs/docs/07-packages/misc/truncatedbuffer.md | 2 +- docs/docs/07-packages/misc/xast.md | 2 +- docs/docs/07-packages/misc/xembed.md | 2 +- docs/docs/07-packages/misc/xexec.md | 2 +- docs/docs/07-packages/misc/xfilepath.md | 2 +- docs/docs/07-packages/misc/xgenny.md | 2 +- docs/docs/07-packages/misc/xgit.md | 2 +- docs/docs/07-packages/misc/xhttp.md | 2 +- docs/docs/07-packages/misc/xio.md | 2 +- docs/docs/07-packages/misc/xnet.md | 2 +- docs/docs/07-packages/misc/xos.md | 2 +- docs/docs/07-packages/misc/xstrcase.md | 2 +- docs/docs/07-packages/misc/xstrings.md | 2 +- docs/docs/07-packages/misc/xtime.md | 2 +- docs/docs/07-packages/misc/xurl.md | 2 +- docs/docs/07-packages/misc/xyaml.md | 2 +- 61 files changed, 223 insertions(+), 836 deletions(-) diff --git a/docs/docs/07-packages/cosmos/chaincmd.md b/docs/docs/07-packages/cosmos/chaincmd.md index f82daea074..2dadec72ab 100644 --- a/docs/docs/07-packages/cosmos/chaincmd.md +++ b/docs/docs/07-packages/cosmos/chaincmd.md @@ -6,36 +6,24 @@ slug: /packages/chaincmd # Chain Command Builder (chaincmd) -The `chaincmd` package builds command definitions for Cosmos chain binaries (`simd`, `gaiad`, etc.). -It does not execute commands directly; it builds `step.Option` values that can be executed by a runner. +The `chaincmd` package provides helpers around `SimulationCommand`, `BankSendOption`, and `ChainCmd`. For full API details, see the [`chaincmd` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chaincmd). -## Example: Build an `init` command +## Key APIs -```go -package main - -import ( - "fmt" - "strings" - - "github.com/ignite/cli/v29/ignite/pkg/chaincmd" - "github.com/ignite/cli/v29/ignite/pkg/cmdrunner/step" -) +- `func SimulationCommand(appPath string, simName string, options ...SimappOption) step.Option` +- `type BankSendOption func([]string) []string` +- `type ChainCmd struct{ ... }` +- `type GentxOption func([]string) []string` +- `type InPlaceOption func([]string) []string` +- `type KeyringBackend string` +- `type MultiNodeOption func([]string) []string` +- `type Option func(*ChainCmd)` -func main() { - cmd := chaincmd.New( - "simd", - chaincmd.WithHome("./.simapp"), - chaincmd.WithChainID("demo-1"), - chaincmd.WithKeyringBackend(chaincmd.KeyringBackendTest), - ) +## Basic import - initStep := step.New(cmd.InitCommand("validator")) - - fmt.Println("binary:", initStep.Exec.Command) - fmt.Println("args:", strings.Join(initStep.Exec.Args, " ")) -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/chaincmd" ``` diff --git a/docs/docs/07-packages/cosmos/chaincmdrunner.md b/docs/docs/07-packages/cosmos/chaincmdrunner.md index ba510285ab..24a6018876 100644 --- a/docs/docs/07-packages/cosmos/chaincmdrunner.md +++ b/docs/docs/07-packages/cosmos/chaincmdrunner.md @@ -6,58 +6,17 @@ slug: /packages/chaincmdrunner # Chain Command Runner (chaincmd/runner) -The `chaincmd/runner` package wraps chain daemon CLI commands with a higher-level Go API. -It is useful when you need to automate workflows like querying node status, managing accounts, -or sending tokens through a chain binary. +The `chaincmdrunner` package contains internal helpers used by Ignite CLI. For full API details, see the -[`chaincmd/runner` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner). +[`chaincmdrunner` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chaincmdrunner). -## Example: Query node status and list keyring accounts +## Key APIs -This example uses `gaiad` as the chain binary. +- This package does not expose a broad public API; see package docs for details. -```go -package main - -import ( - "context" - "fmt" - "log" - "os" - - "github.com/ignite/cli/v29/ignite/pkg/chaincmd" - chaincmdrunner "github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner" -) - -func main() { - ctx := context.Background() - - cmd := chaincmd.New( - "gaiad", - chaincmd.WithHome(os.ExpandEnv("$HOME/.gaia")), - chaincmd.WithNodeAddress("https://rpc.cosmos.directory:443/cosmoshub"), - chaincmd.WithKeyringBackend(chaincmd.KeyringBackendTest), - ) +## Basic import - runner, err := chaincmdrunner.New(ctx, cmd) - if err != nil { - log.Fatal(err) - } - - status, err := runner.Status(ctx) - if err != nil { - log.Fatal(err) - } - fmt.Printf("chain id: %s\n", status.ChainID) - - accounts, err := runner.ListAccounts(ctx) - if err != nil { - log.Fatal(err) - } - - for _, account := range accounts { - fmt.Printf("%s: %s\n", account.Name, account.Address) - } -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/chaincmdrunner" ``` diff --git a/docs/docs/07-packages/cosmos/chainregistry.md b/docs/docs/07-packages/cosmos/chainregistry.md index e9db4c23fc..f0579a9a25 100644 --- a/docs/docs/07-packages/cosmos/chainregistry.md +++ b/docs/docs/07-packages/cosmos/chainregistry.md @@ -6,62 +6,24 @@ slug: /packages/chainregistry # Chain Registry Types (chainregistry) -The `chainregistry` package provides Go structs for Cosmos chain registry files such as -`chain.json` and `assetlist.json`, plus helpers to save them as JSON. +The `chainregistry` package provides helpers around `APIProvider`, `APIs`, and `Asset`. For full API details, see the [`chainregistry` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chainregistry). -## Example: Generate chain.json and assetlist.json +## Key APIs -```go -package main - -import ( - "log" - "os" - "path/filepath" - - "github.com/ignite/cli/v29/ignite/pkg/chainregistry" -) - -func main() { - outDir := "./chain-registry" - if err := os.MkdirAll(outDir, 0o755); err != nil { - log.Fatal(err) - } +- `type APIProvider struct{ ... }` +- `type APIs struct{ ... }` +- `type Asset struct{ ... }` +- `type AssetList struct{ ... }` +- `type Chain struct{ ... }` +- `type ChainStatus string` +- `type ChainType string` +- `type Codebase struct{ ... }` - chain := chainregistry.Chain{ - ChainName: "ignite", - PrettyName: "Ignite", - ChainID: "ignite-1", - Bech32Prefix: "cosmos", - DaemonName: "ignited", - NodeHome: ".ignite", - Status: chainregistry.ChainStatusActive, - NetworkType: chainregistry.NetworkTypeMainnet, - ChainType: chainregistry.ChainTypeCosmos, - } +## Basic import - if err := chain.SaveJSON(filepath.Join(outDir, "chain.json")); err != nil { - log.Fatal(err) - } - - assetList := chainregistry.AssetList{ - ChainName: "ignite", - Assets: []chainregistry.Asset{ - { - Name: "Ignite Token", - Symbol: "IGNT", - Base: "uignite", - Display: "ignite", - TypeAsset: "sdk.coin", - }, - }, - } - - if err := assetList.SaveJSON(filepath.Join(outDir, "assetlist.json")); err != nil { - log.Fatal(err) - } -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/chainregistry" ``` diff --git a/docs/docs/07-packages/cosmos/cosmosaccount.md b/docs/docs/07-packages/cosmos/cosmosaccount.md index 9a3934a9d0..bd10583439 100644 --- a/docs/docs/07-packages/cosmos/cosmosaccount.md +++ b/docs/docs/07-packages/cosmos/cosmosaccount.md @@ -6,60 +6,24 @@ slug: /packages/cosmosaccount # Account Registry (cosmosaccount) -The `cosmosaccount` package manages blockchain accounts using Cosmos SDK keyring backends. -It supports creating, importing, exporting, listing, and deleting accounts. +The `cosmosaccount` package provides helpers around `KeyringServiceName`, `CoinTypeCosmos`, and `ErrAccountExists`. For full API details, see the [`cosmosaccount` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosaccount). -## Example: Create and query accounts +## Key APIs -This example creates an account in a local test keyring and then retrieves it by address. +- `const KeyringServiceName = "ignite" ...` +- `const CoinTypeCosmos = sdktypes.CoinType ...` +- `var ErrAccountExists = errors.New("account already exists")` +- `var KeyringHome = os.ExpandEnv("$HOME/.ignite/accounts")` +- `type Account struct{ ... }` +- `type AccountDoesNotExistError struct{ ... }` +- `type KeyringBackend string` +- `type Option func(*Registry)` -```go -package main - -import ( - "fmt" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/cosmosaccount" -) - -func main() { - registry, err := cosmosaccount.New( - cosmosaccount.WithHome("./keyring-test"), - cosmosaccount.WithKeyringBackend(cosmosaccount.KeyringTest), - cosmosaccount.WithBech32Prefix(cosmosaccount.AccountPrefixCosmos), - ) - if err != nil { - log.Fatal(err) - } - - account, mnemonic, err := registry.Create("alice") - if err != nil { - log.Fatal(err) - } +## Basic import - // Store this mnemonic securely. Anyone with it can control the account. - fmt.Printf("alice mnemonic: %s\n", mnemonic) - - address, err := account.Address(cosmosaccount.AccountPrefixCosmos) - if err != nil { - log.Fatal(err) - } - fmt.Printf("alice address: %s\n", address) - - loaded, err := registry.GetByAddress(address) - if err != nil { - log.Fatal(err) - } - fmt.Printf("loaded account name: %s\n", loaded.Name) - - accounts, err := registry.List() - if err != nil { - log.Fatal(err) - } - fmt.Printf("accounts in keyring: %d\n", len(accounts)) -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/cosmosaccount" ``` diff --git a/docs/docs/07-packages/cosmos/cosmosanalysis.md b/docs/docs/07-packages/cosmos/cosmosanalysis.md index 1822de1160..3f4ddc1512 100644 --- a/docs/docs/07-packages/cosmos/cosmosanalysis.md +++ b/docs/docs/07-packages/cosmos/cosmosanalysis.md @@ -6,42 +6,24 @@ slug: /packages/cosmosanalysis # Cosmos Source Analysis (cosmosanalysis) -The `cosmosanalysis` package provides static analysis helpers for Cosmos SDK chains. -It can validate chain structure, locate app files, and inspect module wiring. +The `cosmosanalysis` package provides a toolset for statically analysing Cosmos SDK's. For full API details, see the [`cosmosanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis). -## Example: Validate chain and inspect app modules +## Key APIs -```go -package main - -import ( - "fmt" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis" - appanalysis "github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis/app" -) +- `var AppEmbeddedTypes = []string{ ... }` +- `func DeepFindImplementation(modulePath string, interfaceList []string) (found []string, err error)` +- `func FindAppFilePath(chainRoot string) (path string, err error)` +- `func FindEmbed(modulePath string, targetEmbeddedTypes []string) (found []string, err error)` +- `func FindEmbedInFile(n ast.Node, targetEmbeddedTypes []string) (found []string)` +- `func FindImplementation(modulePath string, interfaceList []string) (found []string, err error)` +- `func FindImplementationInFile(n ast.Node, interfaceList []string) (found []string)` +- `func IsChainPath(path string) error` -func main() { - chainRoot := "." +## Basic import - if err := cosmosanalysis.IsChainPath(chainRoot); err != nil { - log.Fatal(err) - } - - appFilePath, err := cosmosanalysis.FindAppFilePath(chainRoot) - if err != nil { - log.Fatal(err) - } - fmt.Println("app file:", appFilePath) - - modules, err := appanalysis.FindRegisteredModules(chainRoot) - if err != nil { - log.Fatal(err) - } - fmt.Printf("registered modules: %d\n", len(modules)) -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis" ``` diff --git a/docs/docs/07-packages/cosmos/cosmosbuf.md b/docs/docs/07-packages/cosmos/cosmosbuf.md index 22a4264925..661b0f1ae0 100644 --- a/docs/docs/07-packages/cosmos/cosmosbuf.md +++ b/docs/docs/07-packages/cosmos/cosmosbuf.md @@ -6,53 +6,22 @@ slug: /packages/cosmosbuf # Buf Integration (cosmosbuf) -The `cosmosbuf` package wraps Buf CLI workflows used by Ignite, including: -- `buf generate`, -- `buf export`, -- `buf config migrate`, -- `buf dep update`. +The `cosmosbuf` package provides helpers around `CMDBuf`, `ErrInvalidCommand`, and `Version`. For full API details, see the [`cosmosbuf` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosbuf). -## Example: Run code generation with Buf +## Key APIs -```go -package main - -import ( - "context" - "log" - "os" - "path/filepath" - - "github.com/ignite/cli/v29/ignite/pkg/cache" - "github.com/ignite/cli/v29/ignite/pkg/cosmosbuf" -) +- `const CMDBuf ...` +- `var ErrInvalidCommand ...` +- `func Version(ctx context.Context) (string, error)` +- `type Buf struct{ ... }` +- `type Command string` +- `type GenOption func(*genOptions)` -func main() { - ctx := context.Background() +## Basic import - storage, err := cache.NewStorage(filepath.Join(os.TempDir(), "ignite-cache.db")) - if err != nil { - log.Fatal(err) - } - - buf, err := cosmosbuf.New(storage, "github.com/acme/my-chain") - if err != nil { - log.Fatal(err) - } - - err = buf.Generate( - ctx, - "./proto", - "./tmp/gen", - "./proto/buf.gen.gogo.yaml", - cosmosbuf.ExcludeFiles("**/query.proto"), - cosmosbuf.IncludeImports(), - ) - if err != nil { - log.Fatal(err) - } -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/cosmosbuf" ``` diff --git a/docs/docs/07-packages/cosmos/cosmosclient.md b/docs/docs/07-packages/cosmos/cosmosclient.md index 603c94b68c..a4fae2a201 100644 --- a/docs/docs/07-packages/cosmos/cosmosclient.md +++ b/docs/docs/07-packages/cosmos/cosmosclient.md @@ -6,97 +6,24 @@ slug: /packages/cosmosclient # Blockchain Client (cosmosclient) -The `cosmosclient` package is a Go client for Cosmos SDK chains. It provides helpers -to query chain data and to create, sign, and broadcast transactions. +The `cosmosclient` package provides a standalone client to connect to Cosmos SDK. For full API details, see the [`cosmosclient` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosclient). -## Example: Transfer between two cosmoshub accounts +## Key APIs -This example sends `1000uatom` from `alice` to `bob` on Cosmos Hub. +- `const GasAuto = "auto" ...` +- `var FaucetTransferEnsureDuration = time.Second * 40 ...` +- `var WithAddressPrefix = WithBech32Prefix` +- `type BroadcastOption func(*broadcastConfig)` +- `type Client struct{ ... }` +- `type ConsensusInfo struct{ ... }` +- `type FaucetClient interface{ ... }` +- `type Gasometer interface{ ... }` -It assumes: -- You already imported both accounts into a local keyring directory. -- The `alice` account has enough `uatom` to pay the amount and fees. +## Basic import ```go -package main - -import ( - "context" - "fmt" - "log" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/ignite/cli/v29/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/v29/ignite/pkg/cosmosclient" -) - -const ( - nodeAddress = "https://rpc.cosmos.directory:443/cosmoshub" - keyringDir = "./keyring-test" - fromAccountName = "alice" - toAccountName = "bob" - amountToSend = "1000uatom" -) - -func main() { - ctx := context.Background() - - // Create a Cosmos Hub client. - client, err := cosmosclient.New( - ctx, - cosmosclient.WithNodeAddress(nodeAddress), - cosmosclient.WithBech32Prefix(cosmosaccount.AccountPrefixCosmos), - cosmosclient.WithKeyringBackend(cosmosaccount.KeyringTest), - cosmosclient.WithKeyringDir(keyringDir), - cosmosclient.WithGas(cosmosclient.GasAuto), - cosmosclient.WithGasPrices("0.025uatom"), - ) - if err != nil { - log.Fatal(err) - } - - fromAccount, err := client.Account(fromAccountName) - if err != nil { - log.Fatal(err) - } - - toAccount, err := client.Account(toAccountName) - if err != nil { - log.Fatal(err) - } - - toAddress, err := toAccount.Address(cosmosaccount.AccountPrefixCosmos) - if err != nil { - log.Fatal(err) - } - - amount, err := sdk.ParseCoinsNormalized(amountToSend) - if err != nil { - log.Fatal(err) - } - - // Build and broadcast a bank send transaction. - txService, err := client.BankSendTx(ctx, fromAccount, toAddress, amount) - if err != nil { - log.Fatal(err) - } - - resp, err := txService.Broadcast(ctx) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("transaction hash: %s\n", resp.TxHash) -} -``` - -To import accounts into the test keyring directory, you can use: - -```bash -ignite account import alice --keyring-dir ./keyring-test --keyring-backend test -ignite account import bob --keyring-dir ./keyring-test --keyring-backend test +import "github.com/ignite/cli/v29/ignite/pkg/cosmosclient" ``` diff --git a/docs/docs/07-packages/cosmos/cosmosfaucet.md b/docs/docs/07-packages/cosmos/cosmosfaucet.md index 89fdd14b33..79d9b4d903 100644 --- a/docs/docs/07-packages/cosmos/cosmosfaucet.md +++ b/docs/docs/07-packages/cosmos/cosmosfaucet.md @@ -6,85 +6,24 @@ slug: /packages/cosmosfaucet # Token Faucet (cosmosfaucet) -The `cosmosfaucet` package provides: -- A faucet service (`http.Handler`) that sends tokens from a faucet account. -- A client to request tokens from faucet endpoints. +The `cosmosfaucet` package is a faucet to request tokens for sdk accounts. For full API details, see the [`cosmosfaucet` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosfaucet). -## Example: Start a faucet server +## Key APIs -```go -package main - -import ( - "context" - "log" - "net/http" - "time" - - sdkmath "cosmossdk.io/math" - - "github.com/ignite/cli/v29/ignite/pkg/chaincmd" - chaincmdrunner "github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner" - "github.com/ignite/cli/v29/ignite/pkg/cosmosfaucet" -) +- `const DefaultAccountName = "faucet" ...` +- `func TryRetrieve(ctx context.Context, chainID, rpcAddress, faucetAddress, accountAddress string) (string, error)` +- `type ErrTransferRequest struct{ ... }` +- `type Faucet struct{ ... }` +- `type FaucetInfoResponse struct{ ... }` +- `type HTTPClient struct{ ... }` +- `type Option func(*Faucet)` +- `type TransferRequest struct{ ... }` -func main() { - ctx := context.Background() - - cmd := chaincmd.New( - "simd", - chaincmd.WithHome("./.simapp"), - chaincmd.WithKeyringBackend(chaincmd.KeyringBackendTest), - ) - - runner, err := chaincmdrunner.New(ctx, cmd) - if err != nil { - log.Fatal(err) - } - - faucet, err := cosmosfaucet.New( - ctx, - runner, - cosmosfaucet.Account("faucet", "", "", "", ""), - cosmosfaucet.Coin(sdkmath.NewInt(1000000), sdkmath.NewInt(100000000), "stake"), - cosmosfaucet.RefreshWindow(24*time.Hour), - ) - if err != nil { - log.Fatal(err) - } - - log.Fatal(http.ListenAndServe(":4500", faucet)) -} -``` - -## Example: Request tokens from a faucet +## Basic import ```go -package main - -import ( - "context" - "fmt" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/cosmosfaucet" -) - -func main() { - ctx := context.Background() - client := cosmosfaucet.NewClient("http://localhost:4500") - - resp, err := client.Transfer( - ctx, - cosmosfaucet.NewTransferRequest("cosmos1youraddresshere", []string{"1000000stake"}), - ) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("tx hash: %s\n", resp.Hash) -} +import "github.com/ignite/cli/v29/ignite/pkg/cosmosfaucet" ``` diff --git a/docs/docs/07-packages/cosmos/cosmosgen.md b/docs/docs/07-packages/cosmos/cosmosgen.md index c89663cfc0..9c5e19df05 100644 --- a/docs/docs/07-packages/cosmos/cosmosgen.md +++ b/docs/docs/07-packages/cosmos/cosmosgen.md @@ -6,56 +6,24 @@ slug: /packages/cosmosgen # Code Generation (cosmosgen) -The `cosmosgen` package orchestrates code generation from protobuf definitions for: -- Go protobuf code, -- TypeScript client code, -- OpenAPI specifications, -- optional frontend composables/templates. +The `cosmosgen` package provides helpers around `ErrBufConfig`, `DepTools`, and `Generate`. For full API details, see the [`cosmosgen` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosgen). -## Example: Run generators +## Key APIs -```go -package main - -import ( - "context" - "log" - "os" - "path/filepath" - - "github.com/ignite/cli/v29/ignite/pkg/cache" - "github.com/ignite/cli/v29/ignite/pkg/cosmosgen" -) +- `var ErrBufConfig = errors.New("invalid Buf config") ...` +- `func DepTools() []string` +- `func Generate(ctx context.Context, cacheStorage cache.Storage, ...) error` +- `func MissingTools(f *modfile.File) (missingTools []string)` +- `func UnusedTools(f *modfile.File) (unusedTools []string)` +- `func Vue(path string) error` +- `type ModulePathFunc func(module.Module) string` +- `type Option func(*generateOptions)` -func main() { - ctx := context.Background() +## Basic import - storage, err := cache.NewStorage(filepath.Join(os.TempDir(), "ignite-cache.db")) - if err != nil { - log.Fatal(err) - } - - err = cosmosgen.Generate( - ctx, - storage, - ".", - "proto", - "github.com/acme/my-chain", - "./web", - cosmosgen.WithGoGeneration(), - cosmosgen.WithTSClientGeneration( - cosmosgen.TypescriptModulePath("./ts-client"), - "./ts-client", - true, - ), - cosmosgen.WithOpenAPIGeneration("./api/openapi.yml", nil), - cosmosgen.UpdateBufModule(), - ) - if err != nil { - log.Fatal(err) - } -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/cosmosgen" ``` diff --git a/docs/docs/07-packages/cosmos/cosmostxcollector.md b/docs/docs/07-packages/cosmos/cosmostxcollector.md index 372735a572..e320a938f5 100644 --- a/docs/docs/07-packages/cosmos/cosmostxcollector.md +++ b/docs/docs/07-packages/cosmos/cosmostxcollector.md @@ -6,195 +6,18 @@ slug: /packages/cosmostxcollector # Indexer (cosmostxcollector) -The package implements support for collecting transactions and events from Cosmos blockchains -into a data backend and it also adds support for querying the collected data. +The `cosmostxcollector` package provides helpers around `Collector` and `TXsCollector`. -## Transaction and event data collecting +For full API details, see the +[`cosmostxcollector` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmostxcollector). -Transactions and events can be collected using the `cosmostxcollector.Collector` type. This -type uses a `cosmosclient.Client` instance to fetch the data from each block and a data backend -adapter to save the data. +## Key APIs -### Data backend adapters +- `type Collector struct{ ... }` +- `type TXsCollector interface{ ... }` -Data backend adapters are used to query and save the collected data into different types of data -backends and must implement the `cosmostxcollector.adapter.Adapter` interface. - -An adapter for PostgreSQL is already implemented in `cosmostxcollector.adapter.postgres.Adapter`. -This is the one used in the examples. - -### Example: Data collection - -The data collection example assumes that there is a PostgreSQL database running in the local -environment containing an empty database named "cosmos". - -The required database tables will be created automatically by the collector the first time it is run. - -When the application is run it will fetch all the transactions and events starting from one of the -recent blocks until the current block height and populate the database: - -```go -package main - -import ( - "context" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/clictx" - "github.com/ignite/cli/v29/ignite/pkg/cosmosclient" - "github.com/ignite/cli/v29/ignite/pkg/cosmostxcollector" - "github.com/ignite/cli/v29/ignite/pkg/cosmostxcollector/adapter/postgres" -) - -const ( - // Name of a local PostgreSQL database - dbName = "cosmos" - - // Cosmos RPC address - rpcAddr = "https://rpc.cosmos.directory:443/cosmoshub" -) - -func collect(ctx context.Context, db postgres.Adapter) error { - // Make sure that the data backend schema is up to date - if err := db.Init(ctx); err != nil { - return err - } - - // Init the Cosmos client - client, err := cosmosclient.New(ctx, cosmosclient.WithNodeAddress(rpcAddr)) - if err != nil { - return err - } - - // Get the latest block height - latestHeight, err := client.LatestBlockHeight(ctx) - if err != nil { - return err - } - - // Collect transactions and events starting from a block height. - // The collector stops at the latest height available at the time of the call. - collector := cosmostxcollector.New(db, client) - if err := collector.Collect(ctx, latestHeight-50); err != nil { - return err - } - - return nil -} - -func main() { - ctx := clictx.From(context.Background()) - - // Init an adapter for a local PostgreSQL database running with the default values - params := map[string]string{"sslmode": "disable"} - db, err := postgres.NewAdapter(dbName, postgres.WithParams(params)) - if err != nil { - log.Fatal(err) - } - - if err := collect(ctx, db); err != nil { - log.Fatal(err) - } -} -``` - -## Queries - -Collected data can be queried through the data backend adapters using event queries or -cursor-based queries. - -Queries support sorting, paging and filtering by using different options during creation. -The cursor-based ones also support the selection of specific fields or properties and also -passing arguments in cases where the query is a function. - -By default no sorting, filtering nor paging is applied to the queries. - -### Event queries - -The event queries return events and their attributes as `[]cosmostxcollector.query.Event`. - -### Example: Query events - -The example reads transfer events from Cosmos' bank module and paginates the results. +## Basic import ```go -import ( - "context" - - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/adapter/postgres" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/query" -) - -func queryBankTransferEvents(ctx context.Context, db postgres.Adapter) ([]query.Event, error) { - // Create an event query that returns events of type "transfer" - qry := query.NewEventQuery( - query.WithFilters( - // Filter transfer events from Cosmos' bank module - postgres.FilterByEventType(banktypes.EventTypeTransfer), - ), - query.WithPageSize(10), - query.AtPage(1), - ) - - // Execute the query - return db.QueryEvents(ctx, qry) -} -``` - -### Cursor-based queries - -This type of queries is meant to be used in contexts where the Event queries are not -useful. - -Cursor-based queries can query a single "entity" which can be a table, view or function -in relational databases or a collection or function in non relational data backends. - -The result of these types of queries is a cursor that implements the `cosmostxcollector.query.Cursor` -interface. - -### Example: Query events using cursors - -```go -import ( - "context" - - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/adapter/postgres" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/query" -) - -func queryBankTransferEventIDs(ctx context.Context, db postgres.Adapter) (ids []int64, err error) { - // Create a query that returns the IDs for events of type "transfer" - qry := query.New( - "event", - query.Fields("id"), - query.WithFilters( - // Filter transfer events from Cosmos' bank module - postgres.NewFilter("type", banktypes.EventTypeTransfer), - ), - query.WithPageSize(10), - query.AtPage(1), - query.SortByFields(query.SortOrderAsc, "id"), - ) - - // Execute the query - cr, err := db.Query(ctx, qry) - if err != nil { - return nil, err - } - - // Read the results - for cr.Next() { - var eventID int64 - - if err := cr.Scan(&eventID); err != nil { - return nil, err - } - - ids = append(ids, eventID) - } - - return ids, nil -} +import "github.com/ignite/cli/v29/ignite/pkg/cosmostxcollector" ``` diff --git a/docs/docs/07-packages/cosmos/cosmosver.md b/docs/docs/07-packages/cosmos/cosmosver.md index bc3b26de9b..79555fa3d7 100644 --- a/docs/docs/07-packages/cosmos/cosmosver.md +++ b/docs/docs/07-packages/cosmos/cosmosver.md @@ -6,34 +6,20 @@ slug: /packages/cosmosver # Cosmos SDK Versions (cosmosver) -The `cosmosver` package parses, detects, and compares Cosmos SDK versions. -It is used to apply version-dependent behavior in Ignite. +The `cosmosver` package provides helpers around `StargateFortyVersion`, `Versions`, and `CosmosSDKRepoName`. For full API details, see the [`cosmosver` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosver). -## Example: Detect and compare SDK version +## Key APIs -```go -package main - -import ( - "fmt" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/cosmosver" -) +- `var StargateFortyVersion = newVersion("0.40.0") ...` +- `var Versions = []Version{ ... } ...` +- `var CosmosSDKRepoName = "cosmos-sdk" ...` +- `type Version struct{ ... }` -func main() { - version, err := cosmosver.Detect(".") - if err != nil { - log.Fatal(err) - } +## Basic import - fmt.Println("detected:", version) - - if version.GTE(cosmosver.StargateFiftyVersion) { - fmt.Println("SDK is v0.50.0 or newer") - } -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/cosmosver" ``` diff --git a/docs/docs/07-packages/go/goanalysis.md b/docs/docs/07-packages/go/goanalysis.md index 7efd71a5d1..c92b32c9d6 100644 --- a/docs/docs/07-packages/go/goanalysis.md +++ b/docs/docs/07-packages/go/goanalysis.md @@ -6,7 +6,7 @@ slug: /packages/goanalysis # Goanalysis (goanalysis) -provides a toolset for statically analysing Go applications. +The `goanalysis` package provides a toolset for statically analysing Go applications. For full API details, see the [`goanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/goanalysis). diff --git a/docs/docs/07-packages/go/gocmd.md b/docs/docs/07-packages/go/gocmd.md index 9ad213d2d9..cc670d7b1f 100644 --- a/docs/docs/07-packages/go/gocmd.md +++ b/docs/docs/07-packages/go/gocmd.md @@ -6,36 +6,24 @@ slug: /packages/gocmd # Go Command Helpers (gocmd) -The `gocmd` package wraps common `go` tool invocations (`mod tidy`, `build`, `test`, `list`, etc.) -and integrates with Ignite's command execution layer. +The `gocmd` package provides helpers around `CommandInstall`, `Build`, and `BuildPath`. For full API details, see the [`gocmd` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gocmd). -## Example: List packages and run tests +## Key APIs -```go -package main - -import ( - "context" - "fmt" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/gocmd" -) +- `const CommandInstall = "install" ...` +- `func Build(ctx context.Context, out, path string, flags []string, options ...exec.Option) error` +- `func BuildPath(ctx context.Context, output, binary, path string, flags []string, ...) error` +- `func BuildTarget(goos, goarch string) string` +- `func Env(name string) (string, error)` +- `func Fmt(ctx context.Context, path string, options ...exec.Option) error` +- `func Get(ctx context.Context, path string, pkgs []string, options ...exec.Option) error` +- `func GoImports(ctx context.Context, path string) error` -func main() { - ctx := context.Background() +## Basic import - pkgs, err := gocmd.List(ctx, ".", []string{"./..."}) - if err != nil { - log.Fatal(err) - } - fmt.Printf("found %d packages\n", len(pkgs)) - - if err := gocmd.Test(ctx, ".", []string{"./..."}); err != nil { - log.Fatal(err) - } -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/gocmd" ``` diff --git a/docs/docs/07-packages/go/goenv.md b/docs/docs/07-packages/go/goenv.md index ee44a56392..ff31bf0dfd 100644 --- a/docs/docs/07-packages/go/goenv.md +++ b/docs/docs/07-packages/go/goenv.md @@ -6,7 +6,7 @@ slug: /packages/goenv # Goenv (goenv) -defines env variables known by Go and some utilities around it. +The `goenv` package defines env variables known by Go and some utilities around it. For full API details, see the [`goenv` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/goenv). diff --git a/docs/docs/07-packages/go/gomodule.md b/docs/docs/07-packages/go/gomodule.md index 1dc47c1397..0d36d59e65 100644 --- a/docs/docs/07-packages/go/gomodule.md +++ b/docs/docs/07-packages/go/gomodule.md @@ -6,38 +6,23 @@ slug: /packages/gomodule # Go Module Analysis (gomodule) -The `gomodule` package parses `go.mod` files, resolves dependencies (including replacements), -and locates modules on disk. +The `gomodule` package provides helpers around `ErrGoModNotFound`, `JoinPath`, and `LocatePath`. For full API details, see the [`gomodule` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gomodule). -## Example: Resolve direct dependencies +## Key APIs -```go -package main - -import ( - "fmt" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/gomodule" -) +- `var ErrGoModNotFound = errors.New("go.mod not found") ...` +- `func JoinPath(path, version string) string` +- `func LocatePath(ctx context.Context, cacheStorage cache.Storage, src string, pkg Version) (path string, err error)` +- `func ParseAt(path string) (*modfile.File, error)` +- `func SplitPath(path string) (string, string)` +- `type Module struct{ ... }` +- `type Version = module.Version` -func main() { - modFile, err := gomodule.ParseAt(".") - if err != nil { - log.Fatal(err) - } +## Basic import - deps, err := gomodule.ResolveDependencies(modFile, false) - if err != nil { - log.Fatal(err) - } - - cosmosSDKDeps := gomodule.FilterVersions(deps, "github.com/cosmos/cosmos-sdk") - for _, dep := range cosmosSDKDeps { - fmt.Printf("%s %s\n", dep.Path, dep.Version) - } -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/gomodule" ``` diff --git a/docs/docs/07-packages/go/gomodulepath.md b/docs/docs/07-packages/go/gomodulepath.md index b4ebeba6b9..65628b3013 100644 --- a/docs/docs/07-packages/go/gomodulepath.md +++ b/docs/docs/07-packages/go/gomodulepath.md @@ -6,35 +6,18 @@ slug: /packages/gomodulepath # Go Module Paths (gomodulepath) -The `gomodulepath` package parses and validates Go module paths and helps discover -an app module path from the local filesystem. +The `gomodulepath` package implements functions for the manipulation of Go module. For full API details, see the [`gomodulepath` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gomodulepath). -## Example: Parse and discover module paths +## Key APIs -```go -package main - -import ( - "fmt" - "log" +- `func ExtractAppPath(path string) string` +- `type Path struct{ ... }` - "github.com/ignite/cli/v29/ignite/pkg/gomodulepath" -) +## Basic import -func main() { - parsed, err := gomodulepath.Parse("github.com/acme/my-chain") - if err != nil { - log.Fatal(err) - } - fmt.Printf("root=%s package=%s\n", parsed.Root, parsed.Package) - - found, appPath, err := gomodulepath.Find(".") - if err != nil { - log.Fatal(err) - } - fmt.Printf("module=%s path=%s\n", found.RawPath, appPath) -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/gomodulepath" ``` diff --git a/docs/docs/07-packages/misc/archive.md b/docs/docs/07-packages/misc/archive.md index 6b803739d6..99d5bc5853 100644 --- a/docs/docs/07-packages/misc/archive.md +++ b/docs/docs/07-packages/misc/archive.md @@ -6,7 +6,7 @@ slug: /packages/archive # Archive (archive) -The `archive` package contains reusable utilities used by Ignite CLI internals. +The `archive` package provides helpers around `CreateArchive` and `ExtractArchive`. For full API details, see the [`archive` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/archive). diff --git a/docs/docs/07-packages/misc/availableport.md b/docs/docs/07-packages/misc/availableport.md index c3175be7b0..02ec811938 100644 --- a/docs/docs/07-packages/misc/availableport.md +++ b/docs/docs/07-packages/misc/availableport.md @@ -6,7 +6,7 @@ slug: /packages/availableport # Availableport (availableport) -The `availableport` package contains reusable utilities used by Ignite CLI internals. +The `availableport` package provides helpers around `Find` and `Options`. For full API details, see the [`availableport` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/availableport). diff --git a/docs/docs/07-packages/misc/cache.md b/docs/docs/07-packages/misc/cache.md index dcbaaf059b..53335a4edf 100644 --- a/docs/docs/07-packages/misc/cache.md +++ b/docs/docs/07-packages/misc/cache.md @@ -6,7 +6,7 @@ slug: /packages/cache # Cache (cache) -The `cache` package contains reusable utilities used by Ignite CLI internals. +The `cache` package provides helpers around `ErrorNotFound`, `Key`, and `Cache`. For full API details, see the [`cache` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cache). diff --git a/docs/docs/07-packages/misc/checksum.md b/docs/docs/07-packages/misc/checksum.md index f9336c8f04..19cde18d74 100644 --- a/docs/docs/07-packages/misc/checksum.md +++ b/docs/docs/07-packages/misc/checksum.md @@ -6,7 +6,7 @@ slug: /packages/checksum # Checksum (checksum) -The `checksum` package contains reusable utilities used by Ignite CLI internals. +The `checksum` package provides helpers around `Binary`, `Strings`, and `Sum`. For full API details, see the [`checksum` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/checksum). diff --git a/docs/docs/07-packages/misc/clictx.md b/docs/docs/07-packages/misc/clictx.md index 06220b3dbc..ef921dfc22 100644 --- a/docs/docs/07-packages/misc/clictx.md +++ b/docs/docs/07-packages/misc/clictx.md @@ -6,7 +6,7 @@ slug: /packages/clictx # Clictx (clictx) -The `clictx` package contains reusable utilities used by Ignite CLI internals. +The `clictx` package provides helpers around `Do` and `From`. For full API details, see the [`clictx` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/clictx). diff --git a/docs/docs/07-packages/misc/clidoc.md b/docs/docs/07-packages/misc/clidoc.md index c0dc37fef9..dbf574a952 100644 --- a/docs/docs/07-packages/misc/clidoc.md +++ b/docs/docs/07-packages/misc/clidoc.md @@ -6,7 +6,7 @@ slug: /packages/clidoc # Clidoc (clidoc) -The `clidoc` package contains reusable utilities used by Ignite CLI internals. +The `clidoc` package provides helpers around `Doc` and `Docs`. For full API details, see the [`clidoc` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/clidoc). diff --git a/docs/docs/07-packages/misc/cliui.md b/docs/docs/07-packages/misc/cliui.md index b7c2eefd9a..8beb267eb2 100644 --- a/docs/docs/07-packages/misc/cliui.md +++ b/docs/docs/07-packages/misc/cliui.md @@ -6,7 +6,7 @@ slug: /packages/cliui # Cliui (cliui) -The `cliui` package contains reusable utilities used by Ignite CLI internals. +The `cliui` package provides helpers around `ErrAbort`, `Option`, and `Session`. For full API details, see the [`cliui` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cliui). diff --git a/docs/docs/07-packages/misc/cmdrunner.md b/docs/docs/07-packages/misc/cmdrunner.md index a0b965c2bf..fcb304de75 100644 --- a/docs/docs/07-packages/misc/cmdrunner.md +++ b/docs/docs/07-packages/misc/cmdrunner.md @@ -6,44 +6,20 @@ slug: /packages/cmdrunner # Command Runner (cmdrunner) -The `cmdrunner` package is a lightweight command execution layer with support for: -- per-command hooks, -- default stdio/workdir configuration, -- sequential or parallel step execution. +The `cmdrunner` package provides helpers around `Env`, `Executor`, and `Option`. For full API details, see the [`cmdrunner` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cmdrunner). -## Example: Run command steps +## Key APIs -```go -package main - -import ( - "context" - "log" - "os" - - "github.com/ignite/cli/v29/ignite/pkg/cmdrunner" - "github.com/ignite/cli/v29/ignite/pkg/cmdrunner/step" -) +- `func Env(key, val string) string` +- `type Executor interface{ ... }` +- `type Option func(*Runner)` +- `type Runner struct{ ... }` -func main() { - ctx := context.Background() +## Basic import - runner := cmdrunner.New( - cmdrunner.DefaultStdout(os.Stdout), - cmdrunner.DefaultStderr(os.Stderr), - cmdrunner.DefaultWorkdir("."), - ) - - err := runner.Run( - ctx, - step.New(step.Exec("go", "version")), - step.New(step.Exec("go", "env", "GOMOD")), - ) - if err != nil { - log.Fatal(err) - } -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/cmdrunner" ``` diff --git a/docs/docs/07-packages/misc/confile.md b/docs/docs/07-packages/misc/confile.md index ee693348f8..6f9f44de33 100644 --- a/docs/docs/07-packages/misc/confile.md +++ b/docs/docs/07-packages/misc/confile.md @@ -6,7 +6,7 @@ slug: /packages/confile # Confile (confile) -is helper to load and overwrite configuration files. +The `confile` package is helper to load and overwrite configuration files. For full API details, see the [`confile` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/confile). diff --git a/docs/docs/07-packages/misc/ctxticker.md b/docs/docs/07-packages/misc/ctxticker.md index ecd669b599..18b6c1c08b 100644 --- a/docs/docs/07-packages/misc/ctxticker.md +++ b/docs/docs/07-packages/misc/ctxticker.md @@ -6,7 +6,7 @@ slug: /packages/ctxticker # Ctxticker (ctxticker) -The `ctxticker` package contains reusable utilities used by Ignite CLI internals. +The `ctxticker` package provides helpers around `Do` and `DoNow`. For full API details, see the [`ctxticker` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/ctxticker). diff --git a/docs/docs/07-packages/misc/debugger.md b/docs/docs/07-packages/misc/debugger.md index d4aa1069ac..85f52c65e4 100644 --- a/docs/docs/07-packages/misc/debugger.md +++ b/docs/docs/07-packages/misc/debugger.md @@ -6,7 +6,7 @@ slug: /packages/debugger # Debugger (debugger) -The `debugger` package contains reusable utilities used by Ignite CLI internals. +The `debugger` package provides helpers around `DefaultAddress`, `Run`, and `Start`. For full API details, see the [`debugger` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/debugger). diff --git a/docs/docs/07-packages/misc/dircache.md b/docs/docs/07-packages/misc/dircache.md index 2b475aae08..e7dfe455c8 100644 --- a/docs/docs/07-packages/misc/dircache.md +++ b/docs/docs/07-packages/misc/dircache.md @@ -6,7 +6,7 @@ slug: /packages/dircache # Dircache (dircache) -The `dircache` package contains reusable utilities used by Ignite CLI internals. +The `dircache` package provides helpers around `ErrCacheNotFound`, `ClearCache`, and `Cache`. For full API details, see the [`dircache` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/dircache). diff --git a/docs/docs/07-packages/misc/dirchange.md b/docs/docs/07-packages/misc/dirchange.md index e1fc2031dd..c843cf1acc 100644 --- a/docs/docs/07-packages/misc/dirchange.md +++ b/docs/docs/07-packages/misc/dirchange.md @@ -6,7 +6,7 @@ slug: /packages/dirchange # Dirchange (dirchange) -The `dirchange` package contains reusable utilities used by Ignite CLI internals. +The `dirchange` package provides helpers around `ErrNoFile`, `ChecksumFromPaths`, and `HasDirChecksumChanged`. For full API details, see the [`dirchange` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/dirchange). diff --git a/docs/docs/07-packages/misc/env.md b/docs/docs/07-packages/misc/env.md index 85eff7c561..21e02db470 100644 --- a/docs/docs/07-packages/misc/env.md +++ b/docs/docs/07-packages/misc/env.md @@ -6,7 +6,7 @@ slug: /packages/env # Env (env) -The `env` package contains reusable utilities used by Ignite CLI internals. +The `env` package provides helpers around `DebugEnvVar`, `ConfigDir`, and `IsDebug`. For full API details, see the [`env` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/env). diff --git a/docs/docs/07-packages/misc/errors.md b/docs/docs/07-packages/misc/errors.md index 99ba725aa3..f43c961524 100644 --- a/docs/docs/07-packages/misc/errors.md +++ b/docs/docs/07-packages/misc/errors.md @@ -6,7 +6,7 @@ slug: /packages/errors # Errors (errors) -provides helpers for error creation, avoiding using different. +The `errors` package provides helpers for error creation, avoiding using different. For full API details, see the [`errors` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/errors). diff --git a/docs/docs/07-packages/misc/events.md b/docs/docs/07-packages/misc/events.md index 06a3e2b780..b675983eeb 100644 --- a/docs/docs/07-packages/misc/events.md +++ b/docs/docs/07-packages/misc/events.md @@ -6,7 +6,7 @@ slug: /packages/events # Events (events) -provides functionalities for packages to log their states as. +The `events` package provides functionalities for packages to log their states as. For full API details, see the [`events` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/events). diff --git a/docs/docs/07-packages/misc/httpstatuschecker.md b/docs/docs/07-packages/misc/httpstatuschecker.md index 58e2b724b4..887438dc3c 100644 --- a/docs/docs/07-packages/misc/httpstatuschecker.md +++ b/docs/docs/07-packages/misc/httpstatuschecker.md @@ -6,7 +6,7 @@ slug: /packages/httpstatuschecker # Httpstatuschecker (httpstatuschecker) -is a tool check health of http pages. +The `httpstatuschecker` package is a tool check health of http pages. For full API details, see the [`httpstatuschecker` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/httpstatuschecker). diff --git a/docs/docs/07-packages/misc/jsonfile.md b/docs/docs/07-packages/misc/jsonfile.md index 3504821ea3..455e0e7f3e 100644 --- a/docs/docs/07-packages/misc/jsonfile.md +++ b/docs/docs/07-packages/misc/jsonfile.md @@ -6,7 +6,7 @@ slug: /packages/jsonfile # Jsonfile (jsonfile) -The `jsonfile` package contains reusable utilities used by Ignite CLI internals. +The `jsonfile` package provides helpers around `ErrFieldNotFound`, `JSONFile`, and `ReadWriteSeeker`. For full API details, see the [`jsonfile` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/jsonfile). diff --git a/docs/docs/07-packages/misc/localfs.md b/docs/docs/07-packages/misc/localfs.md index c7d21cfb8e..f37951bc3a 100644 --- a/docs/docs/07-packages/misc/localfs.md +++ b/docs/docs/07-packages/misc/localfs.md @@ -6,7 +6,7 @@ slug: /packages/localfs # Localfs (localfs) -The `localfs` package contains reusable utilities used by Ignite CLI internals. +The `localfs` package provides helpers around `MkdirAllReset`, `Save`, and `SaveBytesTemp`. For full API details, see the [`localfs` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/localfs). diff --git a/docs/docs/07-packages/misc/markdownviewer.md b/docs/docs/07-packages/misc/markdownviewer.md index e74fcb9273..e84e1833de 100644 --- a/docs/docs/07-packages/misc/markdownviewer.md +++ b/docs/docs/07-packages/misc/markdownviewer.md @@ -6,7 +6,7 @@ slug: /packages/markdownviewer # Markdownviewer (markdownviewer) -The `markdownviewer` package contains reusable utilities used by Ignite CLI internals. +The `markdownviewer` package provides helpers around `View`. For full API details, see the [`markdownviewer` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/markdownviewer). diff --git a/docs/docs/07-packages/misc/multiformatname.md b/docs/docs/07-packages/misc/multiformatname.md index cdc9f457f9..790b952f19 100644 --- a/docs/docs/07-packages/misc/multiformatname.md +++ b/docs/docs/07-packages/misc/multiformatname.md @@ -6,7 +6,7 @@ slug: /packages/multiformatname # Multiformatname (multiformatname) -provides names automatically converted into multiple. +The `multiformatname` package provides names automatically converted into multiple. For full API details, see the [`multiformatname` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/multiformatname). diff --git a/docs/docs/07-packages/misc/openapiconsole.md b/docs/docs/07-packages/misc/openapiconsole.md index eaf9d39fc9..4e1c108d07 100644 --- a/docs/docs/07-packages/misc/openapiconsole.md +++ b/docs/docs/07-packages/misc/openapiconsole.md @@ -6,7 +6,7 @@ slug: /packages/openapiconsole # Openapiconsole (openapiconsole) -The `openapiconsole` package contains reusable utilities used by Ignite CLI internals. +The `openapiconsole` package provides helpers around `Handler`. For full API details, see the [`openapiconsole` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/openapiconsole). diff --git a/docs/docs/07-packages/misc/placeholder.md b/docs/docs/07-packages/misc/placeholder.md index 269f144e08..8f1d85211f 100644 --- a/docs/docs/07-packages/misc/placeholder.md +++ b/docs/docs/07-packages/misc/placeholder.md @@ -6,7 +6,7 @@ slug: /packages/placeholder # Placeholder (placeholder) -The `placeholder` package contains reusable utilities used by Ignite CLI internals. +The `placeholder` package provides helpers around `MissingPlaceholdersError`, `Option`, and `Replacer`. For full API details, see the [`placeholder` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/placeholder). diff --git a/docs/docs/07-packages/misc/protoanalysis.md b/docs/docs/07-packages/misc/protoanalysis.md index 571471a545..84aa6b327e 100644 --- a/docs/docs/07-packages/misc/protoanalysis.md +++ b/docs/docs/07-packages/misc/protoanalysis.md @@ -6,36 +6,24 @@ slug: /packages/protoanalysis # Proto Analysis (protoanalysis) -The `protoanalysis` package parses `.proto` files and builds high-level metadata for: -- packages, -- messages and fields, -- services and RPC signatures, -- HTTP rules. +The `protoanalysis` package provides a toolset for analyzing proto files and packages. For full API details, see the [`protoanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/protoanalysis). -## Example: Parse proto packages +## Key APIs -```go -package main - -import ( - "context" - "fmt" - "log" +- `var ErrImportNotFound = errors.New("proto import not found")` +- `func HasMessages(ctx context.Context, path string, names ...string) error` +- `func IsImported(path string, dependencies ...string) error` +- `type Cache struct{ ... }` +- `type File struct{ ... }` +- `type Files []File` +- `type HTTPRule struct{ ... }` +- `type Message struct{ ... }` - "github.com/ignite/cli/v29/ignite/pkg/protoanalysis" -) +## Basic import -func main() { - pkgs, err := protoanalysis.Parse(context.Background(), protoanalysis.NewCache(), "./proto") - if err != nil { - log.Fatal(err) - } - - for _, pkg := range pkgs { - fmt.Printf("package: %s (%d files)\n", pkg.Name, len(pkg.Files)) - } -} +```go +import "github.com/ignite/cli/v29/ignite/pkg/protoanalysis" ``` diff --git a/docs/docs/07-packages/misc/randstr.md b/docs/docs/07-packages/misc/randstr.md index bcb1b6abdb..d6e55e75e7 100644 --- a/docs/docs/07-packages/misc/randstr.md +++ b/docs/docs/07-packages/misc/randstr.md @@ -6,7 +6,7 @@ slug: /packages/randstr # Randstr (randstr) -The `randstr` package contains reusable utilities used by Ignite CLI internals. +The `randstr` package provides helpers around `Runes`. For full API details, see the [`randstr` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/randstr). diff --git a/docs/docs/07-packages/misc/repoversion.md b/docs/docs/07-packages/misc/repoversion.md index c654808d54..3048cfe2db 100644 --- a/docs/docs/07-packages/misc/repoversion.md +++ b/docs/docs/07-packages/misc/repoversion.md @@ -6,7 +6,7 @@ slug: /packages/repoversion # Repoversion (repoversion) -The `repoversion` package contains reusable utilities used by Ignite CLI internals. +The `repoversion` package provides helpers around `Version`. For full API details, see the [`repoversion` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/repoversion). diff --git a/docs/docs/07-packages/misc/safeconverter.md b/docs/docs/07-packages/misc/safeconverter.md index b5d1c0c460..9081397068 100644 --- a/docs/docs/07-packages/misc/safeconverter.md +++ b/docs/docs/07-packages/misc/safeconverter.md @@ -6,7 +6,7 @@ slug: /packages/safeconverter # Safeconverter (safeconverter) -The `safeconverter` package contains reusable utilities used by Ignite CLI internals. +The `safeconverter` package provides helpers around `ToInt`, `ToInt64`, and `SafeToConvertToInt`. For full API details, see the [`safeconverter` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/safeconverter). diff --git a/docs/docs/07-packages/misc/swagger-combine.md b/docs/docs/07-packages/misc/swagger-combine.md index 21c5434727..1749119a21 100644 --- a/docs/docs/07-packages/misc/swagger-combine.md +++ b/docs/docs/07-packages/misc/swagger-combine.md @@ -6,7 +6,7 @@ slug: /packages/swagger-combine # Swagger Combine (swagger-combine) -The `swagger-combine` package contains reusable utilities used by Ignite CLI internals. +The `swagger-combine` package provides helpers around `Config`. For full API details, see the [`swagger-combine` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/swagger-combine). diff --git a/docs/docs/07-packages/misc/tarball.md b/docs/docs/07-packages/misc/tarball.md index cb5c77a4e6..2178610d76 100644 --- a/docs/docs/07-packages/misc/tarball.md +++ b/docs/docs/07-packages/misc/tarball.md @@ -6,7 +6,7 @@ slug: /packages/tarball # Tarball (tarball) -The `tarball` package contains reusable utilities used by Ignite CLI internals. +The `tarball` package provides helpers around `ErrGzipFileNotFound` and `ExtractFile`. For full API details, see the [`tarball` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/tarball). diff --git a/docs/docs/07-packages/misc/truncatedbuffer.md b/docs/docs/07-packages/misc/truncatedbuffer.md index 2c35d18376..af416d5fd1 100644 --- a/docs/docs/07-packages/misc/truncatedbuffer.md +++ b/docs/docs/07-packages/misc/truncatedbuffer.md @@ -6,7 +6,7 @@ slug: /packages/truncatedbuffer # Truncatedbuffer (truncatedbuffer) -The `truncatedbuffer` package contains reusable utilities used by Ignite CLI internals. +The `truncatedbuffer` package provides helpers around `TruncatedBuffer`. For full API details, see the [`truncatedbuffer` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/truncatedbuffer). diff --git a/docs/docs/07-packages/misc/xast.md b/docs/docs/07-packages/misc/xast.md index b23968f783..24ba3e547a 100644 --- a/docs/docs/07-packages/misc/xast.md +++ b/docs/docs/07-packages/misc/xast.md @@ -6,7 +6,7 @@ slug: /packages/xast # Xast (xast) -The `xast` package contains reusable utilities used by Ignite CLI internals. +The `xast` package provides helpers around `AppendFuncCodeAtLine`, `ErrStop`, and `AppendFunction`. For full API details, see the [`xast` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xast). diff --git a/docs/docs/07-packages/misc/xembed.md b/docs/docs/07-packages/misc/xembed.md index bc0b533c19..82e7787cbc 100644 --- a/docs/docs/07-packages/misc/xembed.md +++ b/docs/docs/07-packages/misc/xembed.md @@ -6,7 +6,7 @@ slug: /packages/xembed # Xembed (xembed) -The `xembed` package contains reusable utilities used by Ignite CLI internals. +The `xembed` package provides helpers around `FileList`. For full API details, see the [`xembed` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xembed). diff --git a/docs/docs/07-packages/misc/xexec.md b/docs/docs/07-packages/misc/xexec.md index 5116dd6d8f..01888c2593 100644 --- a/docs/docs/07-packages/misc/xexec.md +++ b/docs/docs/07-packages/misc/xexec.md @@ -6,7 +6,7 @@ slug: /packages/xexec # Xexec (xexec) -The `xexec` package contains reusable utilities used by Ignite CLI internals. +The `xexec` package provides helpers around `IsCommandAvailable`, `IsExec`, and `ResolveAbsPath`. For full API details, see the [`xexec` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xexec). diff --git a/docs/docs/07-packages/misc/xfilepath.md b/docs/docs/07-packages/misc/xfilepath.md index 3e6d98049e..ccf3327a12 100644 --- a/docs/docs/07-packages/misc/xfilepath.md +++ b/docs/docs/07-packages/misc/xfilepath.md @@ -6,7 +6,7 @@ slug: /packages/xfilepath # Xfilepath (xfilepath) -defines functions to define path retrievers that support error. +The `xfilepath` package defines functions to define path retrievers that support error. For full API details, see the [`xfilepath` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xfilepath). diff --git a/docs/docs/07-packages/misc/xgenny.md b/docs/docs/07-packages/misc/xgenny.md index cc84981960..e1d1c0e9f6 100644 --- a/docs/docs/07-packages/misc/xgenny.md +++ b/docs/docs/07-packages/misc/xgenny.md @@ -6,7 +6,7 @@ slug: /packages/xgenny # Xgenny (xgenny) -The `xgenny` package contains reusable utilities used by Ignite CLI internals. +The `xgenny` package provides helpers around `Transformer`, `ApplyOption`, and `OverwriteCallback`. For full API details, see the [`xgenny` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xgenny). diff --git a/docs/docs/07-packages/misc/xgit.md b/docs/docs/07-packages/misc/xgit.md index 26afed0d93..ca9b29fd47 100644 --- a/docs/docs/07-packages/misc/xgit.md +++ b/docs/docs/07-packages/misc/xgit.md @@ -6,7 +6,7 @@ slug: /packages/xgit # Xgit (xgit) -The `xgit` package contains reusable utilities used by Ignite CLI internals. +The `xgit` package provides helpers around `AreChangesCommitted`, `Clone`, and `InitAndCommit`. For full API details, see the [`xgit` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xgit). diff --git a/docs/docs/07-packages/misc/xhttp.md b/docs/docs/07-packages/misc/xhttp.md index f333fb403d..0b0c47e456 100644 --- a/docs/docs/07-packages/misc/xhttp.md +++ b/docs/docs/07-packages/misc/xhttp.md @@ -6,7 +6,7 @@ slug: /packages/xhttp # Xhttp (xhttp) -The `xhttp` package contains reusable utilities used by Ignite CLI internals. +The `xhttp` package provides helpers around `ShutdownTimeout`, `ResponseJSON`, and `Serve`. For full API details, see the [`xhttp` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xhttp). diff --git a/docs/docs/07-packages/misc/xio.md b/docs/docs/07-packages/misc/xio.md index f5a08e39e5..98d5badb89 100644 --- a/docs/docs/07-packages/misc/xio.md +++ b/docs/docs/07-packages/misc/xio.md @@ -6,7 +6,7 @@ slug: /packages/xio # Xio (xio) -The `xio` package contains reusable utilities used by Ignite CLI internals. +The `xio` package provides helpers around `NopWriteCloser`. For full API details, see the [`xio` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xio). diff --git a/docs/docs/07-packages/misc/xnet.md b/docs/docs/07-packages/misc/xnet.md index 1725589c07..47f44a2be9 100644 --- a/docs/docs/07-packages/misc/xnet.md +++ b/docs/docs/07-packages/misc/xnet.md @@ -6,7 +6,7 @@ slug: /packages/xnet # Xnet (xnet) -The `xnet` package contains reusable utilities used by Ignite CLI internals. +The `xnet` package provides helpers around `AnyIPv4Address`, `IncreasePort`, and `IncreasePortBy`. For full API details, see the [`xnet` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xnet). diff --git a/docs/docs/07-packages/misc/xos.md b/docs/docs/07-packages/misc/xos.md index 486d5eadea..426e9d68cd 100644 --- a/docs/docs/07-packages/misc/xos.md +++ b/docs/docs/07-packages/misc/xos.md @@ -6,7 +6,7 @@ slug: /packages/xos # Xos (xos) -The `xos` package contains reusable utilities used by Ignite CLI internals. +The `xos` package provides helpers around `JSONFile`, `CopyFile`, and `CopyFolder`. For full API details, see the [`xos` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xos). diff --git a/docs/docs/07-packages/misc/xstrcase.md b/docs/docs/07-packages/misc/xstrcase.md index 72ff5f0bc7..75a69325db 100644 --- a/docs/docs/07-packages/misc/xstrcase.md +++ b/docs/docs/07-packages/misc/xstrcase.md @@ -6,7 +6,7 @@ slug: /packages/xstrcase # Xstrcase (xstrcase) -The `xstrcase` package contains reusable utilities used by Ignite CLI internals. +The `xstrcase` package provides helpers around `Lowercase`, `UpperCamel`, and `Uppercase`. For full API details, see the [`xstrcase` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xstrcase). diff --git a/docs/docs/07-packages/misc/xstrings.md b/docs/docs/07-packages/misc/xstrings.md index ebd6fa8f82..427ffb587c 100644 --- a/docs/docs/07-packages/misc/xstrings.md +++ b/docs/docs/07-packages/misc/xstrings.md @@ -6,7 +6,7 @@ slug: /packages/xstrings # Xstrings (xstrings) -The `xstrings` package contains reusable utilities used by Ignite CLI internals. +The `xstrings` package provides helpers around `AllOrSomeFilter`, `FormatUsername`, and `List`. For full API details, see the [`xstrings` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xstrings). diff --git a/docs/docs/07-packages/misc/xtime.md b/docs/docs/07-packages/misc/xtime.md index 43516c2217..f59437052e 100644 --- a/docs/docs/07-packages/misc/xtime.md +++ b/docs/docs/07-packages/misc/xtime.md @@ -6,7 +6,7 @@ slug: /packages/xtime # Xtime (xtime) -The `xtime` package contains reusable utilities used by Ignite CLI internals. +The `xtime` package provides helpers around `FormatUnix`, `FormatUnixInt`, and `NowAfter`. For full API details, see the [`xtime` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xtime). diff --git a/docs/docs/07-packages/misc/xurl.md b/docs/docs/07-packages/misc/xurl.md index 184f1608e2..b83dced4a3 100644 --- a/docs/docs/07-packages/misc/xurl.md +++ b/docs/docs/07-packages/misc/xurl.md @@ -6,7 +6,7 @@ slug: /packages/xurl # Xurl (xurl) -The `xurl` package contains reusable utilities used by Ignite CLI internals. +The `xurl` package provides helpers around `Address`, `HTTP`, and `HTTPEnsurePort`. For full API details, see the [`xurl` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xurl). diff --git a/docs/docs/07-packages/misc/xyaml.md b/docs/docs/07-packages/misc/xyaml.md index 7e8b28e4f0..4cf7979fd5 100644 --- a/docs/docs/07-packages/misc/xyaml.md +++ b/docs/docs/07-packages/misc/xyaml.md @@ -6,7 +6,7 @@ slug: /packages/xyaml # Xyaml (xyaml) -The `xyaml` package contains reusable utilities used by Ignite CLI internals. +The `xyaml` package provides helpers around `Marshal` and `Map`. For full API details, see the [`xyaml` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xyaml). From 04b40a565f2f03b6288554105996b18931a606d7 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 14:50:39 -0300 Subject: [PATCH 12/15] remove unused docs --- docs/docs/07-packages/cosmos/chaincmd.md | 44 +++++++++++---- .../docs/07-packages/cosmos/chaincmdrunner.md | 26 +++++++-- docs/docs/07-packages/cosmos/chainregistry.md | 24 ++++++-- docs/docs/07-packages/cosmos/cosmosaccount.md | 32 ++++++++--- .../docs/07-packages/cosmos/cosmosanalysis.md | 29 +++++++--- docs/docs/07-packages/cosmos/cosmosbuf.md | 49 +++++++++++++--- docs/docs/07-packages/cosmos/cosmosclient.md | 32 ++++++++--- docs/docs/07-packages/cosmos/cosmosfaucet.md | 29 +++++++--- docs/docs/07-packages/cosmos/cosmosgen.md | 56 +++++++++++++++---- .../07-packages/cosmos/cosmostxcollector.md | 19 ++++++- docs/docs/07-packages/cosmos/cosmosver.md | 26 +++++++-- docs/docs/07-packages/go/goanalysis.md | 51 +++++++++++++---- docs/docs/07-packages/go/gocmd.md | 44 +++++++++++---- docs/docs/07-packages/go/goenv.md | 35 +++++++++--- docs/docs/07-packages/go/gomodule.md | 47 ++++++++++++---- docs/docs/07-packages/go/gomodulepath.md | 34 +++++++++-- docs/docs/07-packages/misc/archive.md | 23 -------- docs/docs/07-packages/misc/availableport.md | 23 -------- docs/docs/07-packages/misc/cache.md | 54 +++++++++++++++--- docs/docs/07-packages/misc/checksum.md | 24 -------- docs/docs/07-packages/misc/clictx.md | 23 -------- docs/docs/07-packages/misc/clidoc.md | 23 -------- docs/docs/07-packages/misc/cliui.md | 24 -------- docs/docs/07-packages/misc/cmdrunner.md | 45 ++++++++++++--- docs/docs/07-packages/misc/confile.md | 29 ---------- docs/docs/07-packages/misc/ctxticker.md | 23 -------- docs/docs/07-packages/misc/debugger.md | 25 --------- docs/docs/07-packages/misc/dircache.md | 24 -------- docs/docs/07-packages/misc/dirchange.md | 44 ++++++++++++--- docs/docs/07-packages/misc/env.md | 26 --------- docs/docs/07-packages/misc/errors.md | 25 +++++++-- docs/docs/07-packages/misc/events.md | 29 ---------- .../07-packages/misc/httpstatuschecker.md | 23 -------- docs/docs/07-packages/misc/jsonfile.md | 25 --------- docs/docs/07-packages/misc/localfs.md | 28 ---------- docs/docs/07-packages/misc/markdownviewer.md | 22 -------- docs/docs/07-packages/misc/multiformatname.md | 24 -------- docs/docs/07-packages/misc/openapiconsole.md | 22 -------- docs/docs/07-packages/misc/placeholder.md | 26 --------- docs/docs/07-packages/misc/protoanalysis.md | 29 ---------- docs/docs/07-packages/misc/randstr.md | 22 -------- docs/docs/07-packages/misc/repoversion.md | 22 -------- docs/docs/07-packages/misc/safeconverter.md | 24 -------- docs/docs/07-packages/misc/swagger-combine.md | 22 -------- docs/docs/07-packages/misc/tarball.md | 23 -------- docs/docs/07-packages/misc/truncatedbuffer.md | 22 -------- docs/docs/07-packages/misc/xast.md | 29 ---------- docs/docs/07-packages/misc/xembed.md | 22 -------- docs/docs/07-packages/misc/xexec.md | 25 --------- docs/docs/07-packages/misc/xfilepath.md | 27 --------- docs/docs/07-packages/misc/xgenny.md | 26 --------- docs/docs/07-packages/misc/xgit.md | 41 +++++++++++--- docs/docs/07-packages/misc/xhttp.md | 26 --------- docs/docs/07-packages/misc/xio.md | 22 -------- docs/docs/07-packages/misc/xnet.md | 26 --------- docs/docs/07-packages/misc/xos.md | 29 ---------- docs/docs/07-packages/misc/xstrcase.md | 24 -------- docs/docs/07-packages/misc/xstrings.md | 29 ---------- docs/docs/07-packages/misc/xtime.md | 28 ---------- docs/docs/07-packages/misc/xurl.md | 42 ++++++++++---- docs/docs/07-packages/misc/xyaml.md | 23 -------- 61 files changed, 651 insertions(+), 1143 deletions(-) delete mode 100644 docs/docs/07-packages/misc/archive.md delete mode 100644 docs/docs/07-packages/misc/availableport.md delete mode 100644 docs/docs/07-packages/misc/checksum.md delete mode 100644 docs/docs/07-packages/misc/clictx.md delete mode 100644 docs/docs/07-packages/misc/clidoc.md delete mode 100644 docs/docs/07-packages/misc/cliui.md delete mode 100644 docs/docs/07-packages/misc/confile.md delete mode 100644 docs/docs/07-packages/misc/ctxticker.md delete mode 100644 docs/docs/07-packages/misc/debugger.md delete mode 100644 docs/docs/07-packages/misc/dircache.md delete mode 100644 docs/docs/07-packages/misc/env.md delete mode 100644 docs/docs/07-packages/misc/events.md delete mode 100644 docs/docs/07-packages/misc/httpstatuschecker.md delete mode 100644 docs/docs/07-packages/misc/jsonfile.md delete mode 100644 docs/docs/07-packages/misc/localfs.md delete mode 100644 docs/docs/07-packages/misc/markdownviewer.md delete mode 100644 docs/docs/07-packages/misc/multiformatname.md delete mode 100644 docs/docs/07-packages/misc/openapiconsole.md delete mode 100644 docs/docs/07-packages/misc/placeholder.md delete mode 100644 docs/docs/07-packages/misc/protoanalysis.md delete mode 100644 docs/docs/07-packages/misc/randstr.md delete mode 100644 docs/docs/07-packages/misc/repoversion.md delete mode 100644 docs/docs/07-packages/misc/safeconverter.md delete mode 100644 docs/docs/07-packages/misc/swagger-combine.md delete mode 100644 docs/docs/07-packages/misc/tarball.md delete mode 100644 docs/docs/07-packages/misc/truncatedbuffer.md delete mode 100644 docs/docs/07-packages/misc/xast.md delete mode 100644 docs/docs/07-packages/misc/xembed.md delete mode 100644 docs/docs/07-packages/misc/xexec.md delete mode 100644 docs/docs/07-packages/misc/xfilepath.md delete mode 100644 docs/docs/07-packages/misc/xgenny.md delete mode 100644 docs/docs/07-packages/misc/xhttp.md delete mode 100644 docs/docs/07-packages/misc/xio.md delete mode 100644 docs/docs/07-packages/misc/xnet.md delete mode 100644 docs/docs/07-packages/misc/xos.md delete mode 100644 docs/docs/07-packages/misc/xstrcase.md delete mode 100644 docs/docs/07-packages/misc/xstrings.md delete mode 100644 docs/docs/07-packages/misc/xtime.md delete mode 100644 docs/docs/07-packages/misc/xyaml.md diff --git a/docs/docs/07-packages/cosmos/chaincmd.md b/docs/docs/07-packages/cosmos/chaincmd.md index 2dadec72ab..e209a75cf1 100644 --- a/docs/docs/07-packages/cosmos/chaincmd.md +++ b/docs/docs/07-packages/cosmos/chaincmd.md @@ -6,24 +6,46 @@ slug: /packages/chaincmd # Chain Command Builder (chaincmd) -The `chaincmd` package provides helpers around `SimulationCommand`, `BankSendOption`, and `ChainCmd`. +The `chaincmd` package builds `step.Option` command definitions for Cosmos SDK daemon binaries (`simd`, `gaiad`, and others). It does not execute commands directly. For full API details, see the [`chaincmd` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chaincmd). +## When to use + +- Build consistent daemon command lines from typed options. +- Reuse command composition across services and tests. +- Keep chain binary-specific flags centralized. + ## Key APIs -- `func SimulationCommand(appPath string, simName string, options ...SimappOption) step.Option` -- `type BankSendOption func([]string) []string` -- `type ChainCmd struct{ ... }` -- `type GentxOption func([]string) []string` -- `type InPlaceOption func([]string) []string` -- `type KeyringBackend string` -- `type MultiNodeOption func([]string) []string` -- `type Option func(*ChainCmd)` +- `New(appCmd string, options ...Option) ChainCmd` +- `WithHome(home string) Option` +- `WithChainID(chainID string) Option` +- `InitCommand(moniker string, options ...string) step.Option` +- `BankSendCommand(fromAddress, toAddress, amount string, options ...BankSendOption) step.Option` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/chaincmd" +package main + +import ( + "fmt" + + "github.com/ignite/cli/v29/ignite/pkg/chaincmd" + "github.com/ignite/cli/v29/ignite/pkg/cmdrunner/step" +) + +func main() { + cmd := chaincmd.New( + "simd", + chaincmd.WithHome("./.simapp"), + chaincmd.WithChainID("demo-1"), + ) + + initStep := step.New(cmd.InitCommand("validator")) + fmt.Println(initStep.Exec.Command) + fmt.Println(initStep.Exec.Args) +} ``` diff --git a/docs/docs/07-packages/cosmos/chaincmdrunner.md b/docs/docs/07-packages/cosmos/chaincmdrunner.md index 24a6018876..2661a068e0 100644 --- a/docs/docs/07-packages/cosmos/chaincmdrunner.md +++ b/docs/docs/07-packages/cosmos/chaincmdrunner.md @@ -6,17 +6,35 @@ slug: /packages/chaincmdrunner # Chain Command Runner (chaincmd/runner) -The `chaincmdrunner` package contains internal helpers used by Ignite CLI. +The `chaincmdrunner` package wraps chain binary commands into typed, higher-level operations (accounts, genesis setup, tx queries, node control). For full API details, see the -[`chaincmdrunner` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chaincmdrunner). +[`chaincmdrunner` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner). + +## When to use + +- Execute chain lifecycle commands without manually assembling CLI arguments. +- Manage accounts and genesis setup from automation/test flows. +- Query transaction events using typed selectors instead of raw command output parsing. ## Key APIs -- This package does not expose a broad public API; see package docs for details. +- `New(ctx context.Context, chainCmd chaincmd.ChainCmd, options ...Option) (Runner, error)` +- `(Runner) Init(ctx context.Context, moniker string, args ...string) error` +- `(Runner) Start(ctx context.Context, args ...string) error` +- `(Runner) AddAccount(ctx context.Context, name, mnemonic, coinType, accountNumber, addressIndex string) (Account, error)` +- `(Runner) AddGenesisAccount(ctx context.Context, address, coins string) error` +- `(Runner) QueryTxByEvents(ctx context.Context, selectors ...EventSelector) ([]Event, error)` +- `(Runner) WaitTx(ctx context.Context, txHash string, retryDelay time.Duration, maxRetry int) error` + +## Common Tasks + +- Build a `Runner` from a configured `chaincmd.ChainCmd` and then call `Init`/`Start` for local node workflows. +- Use `AddAccount`, `ListAccounts`, and `ShowAccount` to manage keyring state in scripted flows. +- Query and filter tx events with `NewEventSelector` plus `QueryTxByEvents`. ## Basic import ```go -import "github.com/ignite/cli/v29/ignite/pkg/chaincmdrunner" +import chaincmdrunner "github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner" ``` diff --git a/docs/docs/07-packages/cosmos/chainregistry.md b/docs/docs/07-packages/cosmos/chainregistry.md index f0579a9a25..980f73cd08 100644 --- a/docs/docs/07-packages/cosmos/chainregistry.md +++ b/docs/docs/07-packages/cosmos/chainregistry.md @@ -6,21 +6,35 @@ slug: /packages/chainregistry # Chain Registry Types (chainregistry) -The `chainregistry` package provides helpers around `APIProvider`, `APIs`, and `Asset`. +The `chainregistry` package defines strongly-typed Go structs for Cosmos chain-registry data (`chain.json` and `assetlist.json`). For full API details, see the [`chainregistry` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/chainregistry). +## When to use + +- Parse chain-registry JSON into typed values. +- Build tooling that reads chain metadata (APIs, fees, staking tokens, assets). +- Validate or transform registry documents before writing them back. + ## Key APIs -- `type APIProvider struct{ ... }` +- `type Chain struct{ ... }` - `type APIs struct{ ... }` -- `type Asset struct{ ... }` +- `type APIProvider struct{ ... }` - `type AssetList struct{ ... }` -- `type Chain struct{ ... }` +- `type Asset struct{ ... }` +- `type Fees struct{ ... }` +- `type Staking struct{ ... }` +- `type Codebase struct{ ... }` - `type ChainStatus string` - `type ChainType string` -- `type Codebase struct{ ... }` + +## Common Tasks + +- Decode `chain.json` data into a `Chain` value and inspect RPC/REST metadata. +- Decode `assetlist.json` into `AssetList` to access denom units and logo URIs. +- Use enum-like types (`ChainStatus`, `NetworkType`, `ChainType`) to keep metadata checks explicit. ## Basic import diff --git a/docs/docs/07-packages/cosmos/cosmosaccount.md b/docs/docs/07-packages/cosmos/cosmosaccount.md index bd10583439..f0acd75199 100644 --- a/docs/docs/07-packages/cosmos/cosmosaccount.md +++ b/docs/docs/07-packages/cosmos/cosmosaccount.md @@ -6,21 +6,35 @@ slug: /packages/cosmosaccount # Account Registry (cosmosaccount) -The `cosmosaccount` package provides helpers around `KeyringServiceName`, `CoinTypeCosmos`, and `ErrAccountExists`. +The `cosmosaccount` package manages Cosmos keyring accounts (create/import/export/list/delete) with configurable backend and Bech32 settings. For full API details, see the [`cosmosaccount` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosaccount). +## When to use + +- Manage CLI account keys in Ignite services and commands. +- Switch between `test`, `os`, and `memory` keyring backends. +- Resolve addresses/public keys from named keyring entries. + ## Key APIs -- `const KeyringServiceName = "ignite" ...` -- `const CoinTypeCosmos = sdktypes.CoinType ...` -- `var ErrAccountExists = errors.New("account already exists")` -- `var KeyringHome = os.ExpandEnv("$HOME/.ignite/accounts")` -- `type Account struct{ ... }` -- `type AccountDoesNotExistError struct{ ... }` -- `type KeyringBackend string` -- `type Option func(*Registry)` +- `New(options ...Option) (Registry, error)` +- `NewInMemory(options ...Option) (Registry, error)` +- `WithKeyringBackend(backend KeyringBackend) Option` +- `WithHome(path string) Option` +- `(Registry) Create(name string) (Account, mnemonic string, err error)` +- `(Registry) Import(name, secret, passphrase string) (Account, error)` +- `(Registry) Export(name, passphrase string) (key string, err error)` +- `(Registry) GetByName(name string) (Account, error)` +- `(Registry) List() ([]Account, error)` +- `(Account) Address(accPrefix string) (string, error)` + +## Common Tasks + +- Instantiate one `Registry` with backend/home options and reuse it for all key operations. +- Call `EnsureDefaultAccount` in setup paths that require a predictable signer account. +- Resolve addresses with `Account.Address(prefix)` when your app uses non-default Bech32 prefixes. ## Basic import diff --git a/docs/docs/07-packages/cosmos/cosmosanalysis.md b/docs/docs/07-packages/cosmos/cosmosanalysis.md index 3f4ddc1512..9b5286a5e7 100644 --- a/docs/docs/07-packages/cosmos/cosmosanalysis.md +++ b/docs/docs/07-packages/cosmos/cosmosanalysis.md @@ -6,21 +6,32 @@ slug: /packages/cosmosanalysis # Cosmos Source Analysis (cosmosanalysis) -The `cosmosanalysis` package provides a toolset for statically analysing Cosmos SDK's. +The `cosmosanalysis` package provides static analysis helpers for Cosmos SDK-based projects, especially for app structure and interface/embed discovery. For full API details, see the [`cosmosanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosanalysis). +## When to use + +- Validate that a directory is a Cosmos chain project before running codegen. +- Locate key app files and embedded types in Cosmos app sources. +- Detect interface implementations across module files. + ## Key APIs -- `var AppEmbeddedTypes = []string{ ... }` -- `func DeepFindImplementation(modulePath string, interfaceList []string) (found []string, err error)` -- `func FindAppFilePath(chainRoot string) (path string, err error)` -- `func FindEmbed(modulePath string, targetEmbeddedTypes []string) (found []string, err error)` -- `func FindEmbedInFile(n ast.Node, targetEmbeddedTypes []string) (found []string)` -- `func FindImplementation(modulePath string, interfaceList []string) (found []string, err error)` -- `func FindImplementationInFile(n ast.Node, interfaceList []string) (found []string)` -- `func IsChainPath(path string) error` +- `IsChainPath(path string) error` +- `FindAppFilePath(chainRoot string) (path string, err error)` +- `ValidateGoMod(module *modfile.File) error` +- `FindImplementation(modulePath string, interfaceList []string) (found []string, err error)` +- `DeepFindImplementation(modulePath string, interfaceList []string) (found []string, err error)` +- `FindEmbed(modulePath string, targetEmbeddedTypes []string) (found []string, err error)` +- `FindEmbedInFile(n ast.Node, targetEmbeddedTypes []string) (found []string)` + +## Common Tasks + +- Call `IsChainPath` early to fail fast on unsupported project layouts. +- Use `FindAppFilePath` before AST transformations that require the chain app entrypoint. +- Use `FindImplementation`/`DeepFindImplementation` to verify generated modules are wired as expected. ## Basic import diff --git a/docs/docs/07-packages/cosmos/cosmosbuf.md b/docs/docs/07-packages/cosmos/cosmosbuf.md index 661b0f1ae0..70bc9ea77a 100644 --- a/docs/docs/07-packages/cosmos/cosmosbuf.md +++ b/docs/docs/07-packages/cosmos/cosmosbuf.md @@ -6,22 +6,53 @@ slug: /packages/cosmosbuf # Buf Integration (cosmosbuf) -The `cosmosbuf` package provides helpers around `CMDBuf`, `ErrInvalidCommand`, and `Version`. +The `cosmosbuf` package wraps Buf workflows (`generate`, `export`, `format`, `migrate`, `dep update`) used by Ignite's protobuf pipelines. For full API details, see the [`cosmosbuf` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosbuf). +## When to use + +- Trigger Buf code generation from Go services. +- Keep Buf invocation flags and error handling consistent. +- Reuse cache-aware generation behavior. + ## Key APIs -- `const CMDBuf ...` -- `var ErrInvalidCommand ...` -- `func Version(ctx context.Context) (string, error)` -- `type Buf struct{ ... }` -- `type Command string` -- `type GenOption func(*genOptions)` +- `New(cacheStorage cache.Storage, goModPath string) (Buf, error)` +- `(Buf) Generate(ctx, protoPath, output, template, options...)` +- `(Buf) Format(ctx, path)` +- `(Buf) Export(ctx, protoDir, output)` +- `Version(ctx context.Context) (string, error)` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/cosmosbuf" +package main + +import ( + "context" + "log" + "os" + "path/filepath" + + "github.com/ignite/cli/v29/ignite/pkg/cache" + "github.com/ignite/cli/v29/ignite/pkg/cosmosbuf" +) + +func main() { + storage, err := cache.NewStorage(filepath.Join(os.TempDir(), "ignite-cache.db")) + if err != nil { + log.Fatal(err) + } + + buf, err := cosmosbuf.New(storage, "github.com/acme/my-chain") + if err != nil { + log.Fatal(err) + } + + if err := buf.Format(context.Background(), "./proto"); err != nil { + log.Fatal(err) + } +} ``` diff --git a/docs/docs/07-packages/cosmos/cosmosclient.md b/docs/docs/07-packages/cosmos/cosmosclient.md index a4fae2a201..c7728ef2f1 100644 --- a/docs/docs/07-packages/cosmos/cosmosclient.md +++ b/docs/docs/07-packages/cosmos/cosmosclient.md @@ -6,21 +6,35 @@ slug: /packages/cosmosclient # Blockchain Client (cosmosclient) -The `cosmosclient` package provides a standalone client to connect to Cosmos SDK. +The `cosmosclient` package provides a high-level client for querying Cosmos SDK chains and building/signing/broadcasting transactions. For full API details, see the [`cosmosclient` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosclient). +## When to use + +- Connect Ignite tooling to a running node for status and block queries. +- Build and broadcast SDK messages with shared gas/fees/keyring settings. +- Wait for transaction inclusion and inspect block transactions/events. + ## Key APIs -- `const GasAuto = "auto" ...` -- `var FaucetTransferEnsureDuration = time.Second * 40 ...` -- `var WithAddressPrefix = WithBech32Prefix` -- `type BroadcastOption func(*broadcastConfig)` -- `type Client struct{ ... }` -- `type ConsensusInfo struct{ ... }` -- `type FaucetClient interface{ ... }` -- `type Gasometer interface{ ... }` +- `New(ctx context.Context, options ...Option) (Client, error)` +- `WithNodeAddress(addr string) Option` +- `WithHome(path string) Option` +- `WithKeyringBackend(backend cosmosaccount.KeyringBackend) Option` +- `WithGas(gas string) Option` +- `WithGasPrices(gasPrices string) Option` +- `(Client) BroadcastTx(ctx, account, msgs...) (Response, error)` +- `(Client) WaitForTx(ctx context.Context, hash string) (*ctypes.ResultTx, error)` +- `(Client) Status(ctx context.Context) (*ctypes.ResultStatus, error)` +- `(Client) LatestBlockHeight(ctx context.Context) (int64, error)` + +## Common Tasks + +- Initialize one `Client` instance with node and keyring options, then reuse it across operations. +- Call `CreateTxWithOptions` or `BroadcastTx` depending on whether you need fine-grained tx overrides. +- Use `WaitForTx`, `WaitForNextBlock`, or `WaitForBlockHeight` for deterministic flows in tests/automation. ## Basic import diff --git a/docs/docs/07-packages/cosmos/cosmosfaucet.md b/docs/docs/07-packages/cosmos/cosmosfaucet.md index 79d9b4d903..4927fba06d 100644 --- a/docs/docs/07-packages/cosmos/cosmosfaucet.md +++ b/docs/docs/07-packages/cosmos/cosmosfaucet.md @@ -6,21 +6,32 @@ slug: /packages/cosmosfaucet # Token Faucet (cosmosfaucet) -The `cosmosfaucet` package is a faucet to request tokens for sdk accounts. +The `cosmosfaucet` package provides a local faucet service and client helpers to fund Cosmos accounts during development and tests. For full API details, see the [`cosmosfaucet` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosfaucet). +## When to use + +- Automatically fund accounts in local/devnet environments. +- Expose a faucet HTTP endpoint backed by a chain key. +- Request funds from an existing faucet endpoint from automation code. + ## Key APIs -- `const DefaultAccountName = "faucet" ...` -- `func TryRetrieve(ctx context.Context, chainID, rpcAddress, faucetAddress, accountAddress string) (string, error)` -- `type ErrTransferRequest struct{ ... }` -- `type Faucet struct{ ... }` -- `type FaucetInfoResponse struct{ ... }` -- `type HTTPClient struct{ ... }` -- `type Option func(*Faucet)` -- `type TransferRequest struct{ ... }` +- `New(ctx context.Context, ccr chaincmdrunner.Runner, options ...Option) (Faucet, error)` +- `TryRetrieve(ctx context.Context, chainID, rpcAddress, faucetAddress, accountAddress string) (string, error)` +- `OpenAPI(apiAddress string) Option` +- `Coin(amount, maxAmount sdkmath.Int, denom string) Option` +- `FeeAmount(amount sdkmath.Int, denom string) Option` +- `RefreshWindow(refreshWindow time.Duration) Option` +- `NewTransferRequest(accountAddress string, coins []string) TransferRequest` + +## Common Tasks + +- Construct a `Faucet` with chain runner + options, then expose transfer endpoints for local users. +- Use `TryRetrieve` in tests before broadcasting txs to ensure accounts have spendable balance. +- Tune coin amount, max amount, and refresh window to limit faucet abuse. ## Basic import diff --git a/docs/docs/07-packages/cosmos/cosmosgen.md b/docs/docs/07-packages/cosmos/cosmosgen.md index 9c5e19df05..2315833fb2 100644 --- a/docs/docs/07-packages/cosmos/cosmosgen.md +++ b/docs/docs/07-packages/cosmos/cosmosgen.md @@ -6,24 +6,58 @@ slug: /packages/cosmosgen # Code Generation (cosmosgen) -The `cosmosgen` package provides helpers around `ErrBufConfig`, `DepTools`, and `Generate`. +The `cosmosgen` package orchestrates multi-target code generation from protobuf sources, including Go code, TS clients, composables, and OpenAPI output. For full API details, see the [`cosmosgen` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosgen). +## When to use + +- Run full generation pipelines from application services. +- Configure selective outputs (Go only, TS only, OpenAPI only, etc.). +- Check tool availability and maintain buf-related configuration. + ## Key APIs -- `var ErrBufConfig = errors.New("invalid Buf config") ...` -- `func DepTools() []string` -- `func Generate(ctx context.Context, cacheStorage cache.Storage, ...) error` -- `func MissingTools(f *modfile.File) (missingTools []string)` -- `func UnusedTools(f *modfile.File) (unusedTools []string)` -- `func Vue(path string) error` -- `type ModulePathFunc func(module.Module) string` -- `type Option func(*generateOptions)` +- `Generate(ctx, cacheStorage, appPath, protoDir, goModPath, frontendPath, options...)` +- `WithGoGeneration()` +- `WithTSClientGeneration(out, tsClientRootPath, useCache)` +- `WithOpenAPIGeneration(out, excludeList)` +- `DepTools() []string` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/cosmosgen" +package main + +import ( + "context" + "log" + "os" + "path/filepath" + + "github.com/ignite/cli/v29/ignite/pkg/cache" + "github.com/ignite/cli/v29/ignite/pkg/cosmosgen" +) + +func main() { + storage, err := cache.NewStorage(filepath.Join(os.TempDir(), "ignite-cache.db")) + if err != nil { + log.Fatal(err) + } + + err = cosmosgen.Generate( + context.Background(), + storage, + ".", + "proto", + "github.com/acme/my-chain", + "./web", + cosmosgen.WithGoGeneration(), + cosmosgen.WithOpenAPIGeneration("./api/openapi.yml", nil), + ) + if err != nil { + log.Fatal(err) + } +} ``` diff --git a/docs/docs/07-packages/cosmos/cosmostxcollector.md b/docs/docs/07-packages/cosmos/cosmostxcollector.md index e320a938f5..f70bdfa721 100644 --- a/docs/docs/07-packages/cosmos/cosmostxcollector.md +++ b/docs/docs/07-packages/cosmos/cosmostxcollector.md @@ -6,15 +6,28 @@ slug: /packages/cosmostxcollector # Indexer (cosmostxcollector) -The `cosmostxcollector` package provides helpers around `Collector` and `TXsCollector`. +The `cosmostxcollector` package streams transactions from a Cosmos client and persists them through a storage adapter. For full API details, see the [`cosmostxcollector` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmostxcollector). +## When to use + +- Build lightweight indexers that ingest transactions block by block. +- Persist transaction history in SQL or custom storage backends. +- Reuse transaction collection logic from `cosmosclient` without duplicating polling code. + ## Key APIs -- `type Collector struct{ ... }` -- `type TXsCollector interface{ ... }` +- `New(db adapter.Saver, client TXsCollector) Collector` +- `(Collector) Collect(ctx context.Context, fromHeight int64) error` +- `type TXsCollector interface{ CollectTXs(...) }` + +## Common Tasks + +- Implement `adapter.Saver` for your storage layer and pass it to `New`. +- Start collection at a chosen block height with `Collect`. +- Use a custom `TXsCollector` implementation for test doubles or alternate chain clients. ## Basic import diff --git a/docs/docs/07-packages/cosmos/cosmosver.md b/docs/docs/07-packages/cosmos/cosmosver.md index 79555fa3d7..abb76098f2 100644 --- a/docs/docs/07-packages/cosmos/cosmosver.md +++ b/docs/docs/07-packages/cosmos/cosmosver.md @@ -6,17 +6,33 @@ slug: /packages/cosmosver # Cosmos SDK Versions (cosmosver) -The `cosmosver` package provides helpers around `StargateFortyVersion`, `Versions`, and `CosmosSDKRepoName`. +The `cosmosver` package parses, compares, and detects Cosmos SDK versions used by a chain project. For full API details, see the [`cosmosver` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmosver). +## When to use + +- Detect the Cosmos SDK version from a project before scaffolding or migrations. +- Compare versions to enable/disable version-specific features. +- Access Ignite's known SDK version set and latest supported baseline. + ## Key APIs -- `var StargateFortyVersion = newVersion("0.40.0") ...` -- `var Versions = []Version{ ... } ...` -- `var CosmosSDKRepoName = "cosmos-sdk" ...` -- `type Version struct{ ... }` +- `Detect(appPath string) (version Version, err error)` +- `Parse(version string) (v Version, err error)` +- `var Versions = []Version{ ... }` +- `var Latest = Versions[len(Versions)-1]` +- `(Version) Is(version Version) bool` +- `(Version) LT(version Version) bool` +- `(Version) LTE(version Version) bool` +- `(Version) GTE(version Version) bool` + +## Common Tasks + +- Use `Detect` against a chain root to gate generation paths by SDK version. +- Parse user-provided versions with `Parse` before comparisons. +- Branch behavior with `LT`/`GTE` checks against well-known constants. ## Basic import diff --git a/docs/docs/07-packages/go/goanalysis.md b/docs/docs/07-packages/go/goanalysis.md index c92b32c9d6..51b16088e9 100644 --- a/docs/docs/07-packages/go/goanalysis.md +++ b/docs/docs/07-packages/go/goanalysis.md @@ -6,24 +6,53 @@ slug: /packages/goanalysis # Goanalysis (goanalysis) -The `goanalysis` package provides a toolset for statically analysing Go applications. +The `goanalysis` package provides static analysis helpers for Go source code. It is used in Ignite to inspect imports, discover binaries, and apply targeted source rewrites. For full API details, see the [`goanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/goanalysis). +## When to use + +- Discover main packages in a project before build/install flows. +- Inspect and normalize import usage in parsed AST files. +- Check or patch specific code patterns in generated sources. + ## Key APIs -- `var ErrMultipleMainPackagesFound = errors.New("multiple main packages found")` -- `func AddOrRemoveTools(f *modfile.File, writer io.Writer, importsToAdd, importsToRemove []string) error` -- `func DiscoverMain(path string) (pkgPaths []string, err error)` -- `func DiscoverOneMain(path string) (pkgPath string, err error)` -- `func FindBlankImports(node *ast.File) []string` -- `func FormatImports(f *ast.File) map[string]string` -- `func FuncVarExists(f *ast.File, goImport, methodSignature string) bool` -- `func HasAnyStructFieldsInPkg(pkgPath, structName string, fields []string) (bool, error)` +- `DiscoverMain(path string) ([]string, error)` +- `DiscoverOneMain(path string) (string, error)` +- `FindBlankImports(node *ast.File) []string` +- `FormatImports(f *ast.File) map[string]string` +- `ReplaceCode(pkgPath, oldFunctionName, newFunction string) error` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/goanalysis" +package main + +import ( + "fmt" + "go/parser" + "go/token" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/goanalysis" +) + +func main() { + mainPkg, err := goanalysis.DiscoverOneMain(".") + if err != nil { + log.Fatal(err) + } + fmt.Println("main package:", mainPkg) + + fset := token.NewFileSet() + file, err := parser.ParseFile(fset, "main.go", nil, 0) + if err != nil { + log.Fatal(err) + } + + blank := goanalysis.FindBlankImports(file) + fmt.Println("blank imports:", blank) +} ``` diff --git a/docs/docs/07-packages/go/gocmd.md b/docs/docs/07-packages/go/gocmd.md index cc670d7b1f..8b4f905ef0 100644 --- a/docs/docs/07-packages/go/gocmd.md +++ b/docs/docs/07-packages/go/gocmd.md @@ -6,24 +6,46 @@ slug: /packages/gocmd # Go Command Helpers (gocmd) -The `gocmd` package provides helpers around `CommandInstall`, `Build`, and `BuildPath`. +The `gocmd` package wraps common `go` tool invocations (`build`, `test`, `mod tidy`, `list`, and more) with consistent execution hooks. For full API details, see the [`gocmd` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gocmd). +## When to use + +- Run Go toolchain commands from Ignite services without manually assembling command lines. +- Apply common options (workdir/stdout/stderr) through shared execution abstractions. +- Build binaries for specific targets and manage module commands. + ## Key APIs -- `const CommandInstall = "install" ...` -- `func Build(ctx context.Context, out, path string, flags []string, options ...exec.Option) error` -- `func BuildPath(ctx context.Context, output, binary, path string, flags []string, ...) error` -- `func BuildTarget(goos, goarch string) string` -- `func Env(name string) (string, error)` -- `func Fmt(ctx context.Context, path string, options ...exec.Option) error` -- `func Get(ctx context.Context, path string, pkgs []string, options ...exec.Option) error` -- `func GoImports(ctx context.Context, path string) error` +- `Fmt(ctx, path, options...)` +- `ModTidy(ctx, path, options...)` +- `Build(ctx, out, path, flags, options...)` +- `Test(ctx, path, flags, options...)` +- `List(ctx, path, flags, options...)` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/gocmd" +package main + +import ( + "context" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/gocmd" +) + +func main() { + ctx := context.Background() + + if err := gocmd.ModTidy(ctx, "."); err != nil { + log.Fatal(err) + } + + if err := gocmd.Test(ctx, ".", []string{"./..."}); err != nil { + log.Fatal(err) + } +} ``` diff --git a/docs/docs/07-packages/go/goenv.md b/docs/docs/07-packages/go/goenv.md index ff31bf0dfd..b11ded5e41 100644 --- a/docs/docs/07-packages/go/goenv.md +++ b/docs/docs/07-packages/go/goenv.md @@ -6,22 +6,39 @@ slug: /packages/goenv # Goenv (goenv) -The `goenv` package defines env variables known by Go and some utilities around it. +The `goenv` package provides helpers around Go-related environment values (`GOPATH`, `GOBIN`, module cache, and tool PATH configuration). For full API details, see the [`goenv` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/goenv). +## When to use + +- Resolve Go binary and cache paths for tool installation. +- Build stable PATH values before running Go tools. +- Keep environment handling centralized. + ## Key APIs -- `const GOBIN = "GOBIN" ...` -- `func Bin() string` -- `func ConfigurePath() error` -- `func GoModCache() string` -- `func GoPath() string` -- `func Path() string` +- `Bin() string` +- `GoPath() string` +- `GoModCache() string` +- `Path() string` +- `ConfigurePath() error` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/goenv" +package main + +import ( + "fmt" + + "github.com/ignite/cli/v29/ignite/pkg/goenv" +) + +func main() { + fmt.Println("GOPATH:", goenv.GoPath()) + fmt.Println("GOBIN:", goenv.Bin()) + fmt.Println("PATH:", goenv.Path()) +} ``` diff --git a/docs/docs/07-packages/go/gomodule.md b/docs/docs/07-packages/go/gomodule.md index 0d36d59e65..623c41b3c8 100644 --- a/docs/docs/07-packages/go/gomodule.md +++ b/docs/docs/07-packages/go/gomodule.md @@ -6,23 +6,50 @@ slug: /packages/gomodule # Go Module Analysis (gomodule) -The `gomodule` package provides helpers around `ErrGoModNotFound`, `JoinPath`, and `LocatePath`. +The `gomodule` package parses `go.mod` files, resolves dependencies (including replacements), and locates module directories. For full API details, see the [`gomodule` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gomodule). +## When to use + +- Inspect project dependencies programmatically. +- Resolve replacement rules from `go.mod` before dependency lookup. +- Locate module paths for codegen and analysis workflows. + ## Key APIs -- `var ErrGoModNotFound = errors.New("go.mod not found") ...` -- `func JoinPath(path, version string) string` -- `func LocatePath(ctx context.Context, cacheStorage cache.Storage, src string, pkg Version) (path string, err error)` -- `func ParseAt(path string) (*modfile.File, error)` -- `func SplitPath(path string) (string, string)` -- `type Module struct{ ... }` -- `type Version = module.Version` +- `ParseAt(path string) (*modfile.File, error)` +- `ResolveDependencies(f *modfile.File, includeIndirect bool) ([]Version, error)` +- `FilterVersions(dependencies []Version, paths ...string) []Version` +- `SplitPath(path string) (string, string)` +- `JoinPath(path, version string) string` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/gomodule" +package main + +import ( + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/gomodule" +) + +func main() { + mod, err := gomodule.ParseAt(".") + if err != nil { + log.Fatal(err) + } + + deps, err := gomodule.ResolveDependencies(mod, false) + if err != nil { + log.Fatal(err) + } + + for _, dep := range gomodule.FilterVersions(deps, "github.com/cosmos/cosmos-sdk") { + fmt.Printf("%s %s\n", dep.Path, dep.Version) + } +} ``` diff --git a/docs/docs/07-packages/go/gomodulepath.md b/docs/docs/07-packages/go/gomodulepath.md index 65628b3013..e97f442870 100644 --- a/docs/docs/07-packages/go/gomodulepath.md +++ b/docs/docs/07-packages/go/gomodulepath.md @@ -6,18 +6,42 @@ slug: /packages/gomodulepath # Go Module Paths (gomodulepath) -The `gomodulepath` package implements functions for the manipulation of Go module. +The `gomodulepath` package validates and parses Go module path formats, and can discover a module path from a local project directory. For full API details, see the [`gomodulepath` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gomodulepath). +## When to use + +- Validate user-provided module names before scaffolding. +- Extract normalized app paths from full module paths. +- Discover module metadata from a working directory. + ## Key APIs -- `func ExtractAppPath(path string) string` -- `type Path struct{ ... }` +- `Parse(rawpath string) (Path, error)` +- `ParseAt(path string) (Path, error)` +- `Find(path string) (parsed Path, appPath string, err error)` +- `ExtractAppPath(path string) string` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/gomodulepath" +package main + +import ( + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/gomodulepath" +) + +func main() { + p, err := gomodulepath.Parse("github.com/acme/my-chain") + if err != nil { + log.Fatal(err) + } + fmt.Println("root:", p.Root) + fmt.Println("package:", p.Package) +} ``` diff --git a/docs/docs/07-packages/misc/archive.md b/docs/docs/07-packages/misc/archive.md deleted file mode 100644 index 99d5bc5853..0000000000 --- a/docs/docs/07-packages/misc/archive.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_position: 16 -title: Archive (archive) -slug: /packages/archive ---- - -# Archive (archive) - -The `archive` package provides helpers around `CreateArchive` and `ExtractArchive`. - -For full API details, see the -[`archive` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/archive). - -## Key APIs - -- `func CreateArchive(dir string, buf io.Writer) error` -- `func ExtractArchive(outDir string, gzipStream io.Reader) error` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/archive" -``` diff --git a/docs/docs/07-packages/misc/availableport.md b/docs/docs/07-packages/misc/availableport.md deleted file mode 100644 index 02ec811938..0000000000 --- a/docs/docs/07-packages/misc/availableport.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_position: 17 -title: Availableport (availableport) -slug: /packages/availableport ---- - -# Availableport (availableport) - -The `availableport` package provides helpers around `Find` and `Options`. - -For full API details, see the -[`availableport` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/availableport). - -## Key APIs - -- `func Find(n uint, options ...Options) (ports []uint, err error)` -- `type Options func(o *availablePortOptions)` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/availableport" -``` diff --git a/docs/docs/07-packages/misc/cache.md b/docs/docs/07-packages/misc/cache.md index 53335a4edf..3cba0bc849 100644 --- a/docs/docs/07-packages/misc/cache.md +++ b/docs/docs/07-packages/misc/cache.md @@ -6,21 +6,59 @@ slug: /packages/cache # Cache (cache) -The `cache` package provides helpers around `ErrorNotFound`, `Key`, and `Cache`. +The `cache` package provides a typed, namespaced key-value storage layer backed by BoltDB. For full API details, see the [`cache` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cache). +## When to use + +- Persist small state between command runs. +- Store typed values by namespace and key. +- Version cache entries per release/process. + ## Key APIs -- `var ErrorNotFound = errors.New("no value was found with the provided key")` -- `func Key(keyParts ...string) string` -- `type Cache[T any] struct{ ... }` -- `type Storage struct{ ... }` -- `type StorageOption func(*Storage)` +- `NewStorage(path string, options ...StorageOption) (Storage, error)` +- `New[T any](storage Storage, namespace string) Cache[T]` +- `(Cache[T]) Put(key string, value T) error` +- `(Cache[T]) Get(key string) (T, error)` +- `Key(keyParts ...string) string` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/cache" +package main + +import ( + "fmt" + "log" + "os" + "path/filepath" + + "github.com/ignite/cli/v29/ignite/pkg/cache" +) + +type BuildInfo struct { + Version string +} + +func main() { + storage, err := cache.NewStorage(filepath.Join(os.TempDir(), "ignite-cache.db")) + if err != nil { + log.Fatal(err) + } + + c := cache.New[BuildInfo](storage, "build-info") + if err := c.Put(cache.Key("latest"), BuildInfo{Version: "v1.0.0"}); err != nil { + log.Fatal(err) + } + + info, err := c.Get("latest") + if err != nil { + log.Fatal(err) + } + + fmt.Println(info.Version) +} ``` diff --git a/docs/docs/07-packages/misc/checksum.md b/docs/docs/07-packages/misc/checksum.md deleted file mode 100644 index 19cde18d74..0000000000 --- a/docs/docs/07-packages/misc/checksum.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_position: 19 -title: Checksum (checksum) -slug: /packages/checksum ---- - -# Checksum (checksum) - -The `checksum` package provides helpers around `Binary`, `Strings`, and `Sum`. - -For full API details, see the -[`checksum` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/checksum). - -## Key APIs - -- `func Binary(binaryName string) (string, error)` -- `func Strings(inputs ...string) string` -- `func Sum(dirPath, outPath string) error` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/checksum" -``` diff --git a/docs/docs/07-packages/misc/clictx.md b/docs/docs/07-packages/misc/clictx.md deleted file mode 100644 index ef921dfc22..0000000000 --- a/docs/docs/07-packages/misc/clictx.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_position: 20 -title: Clictx (clictx) -slug: /packages/clictx ---- - -# Clictx (clictx) - -The `clictx` package provides helpers around `Do` and `From`. - -For full API details, see the -[`clictx` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/clictx). - -## Key APIs - -- `func Do(ctx context.Context, fn func() error) error` -- `func From(ctx context.Context) context.Context` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/clictx" -``` diff --git a/docs/docs/07-packages/misc/clidoc.md b/docs/docs/07-packages/misc/clidoc.md deleted file mode 100644 index dbf574a952..0000000000 --- a/docs/docs/07-packages/misc/clidoc.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_position: 21 -title: Clidoc (clidoc) -slug: /packages/clidoc ---- - -# Clidoc (clidoc) - -The `clidoc` package provides helpers around `Doc` and `Docs`. - -For full API details, see the -[`clidoc` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/clidoc). - -## Key APIs - -- `type Doc struct{ ... }` -- `type Docs []Doc` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/clidoc" -``` diff --git a/docs/docs/07-packages/misc/cliui.md b/docs/docs/07-packages/misc/cliui.md deleted file mode 100644 index 8beb267eb2..0000000000 --- a/docs/docs/07-packages/misc/cliui.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_position: 22 -title: Cliui (cliui) -slug: /packages/cliui ---- - -# Cliui (cliui) - -The `cliui` package provides helpers around `ErrAbort`, `Option`, and `Session`. - -For full API details, see the -[`cliui` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cliui). - -## Key APIs - -- `var ErrAbort = errors.New("aborted or not confirmed")` -- `type Option func(s *Session)` -- `type Session struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/cliui" -``` diff --git a/docs/docs/07-packages/misc/cmdrunner.md b/docs/docs/07-packages/misc/cmdrunner.md index fcb304de75..dc3ed058f4 100644 --- a/docs/docs/07-packages/misc/cmdrunner.md +++ b/docs/docs/07-packages/misc/cmdrunner.md @@ -6,20 +6,51 @@ slug: /packages/cmdrunner # Command Runner (cmdrunner) -The `cmdrunner` package provides helpers around `Env`, `Executor`, and `Option`. +The `cmdrunner` package executes command steps with configurable stdio, hooks, environment, and optional parallelism. For full API details, see the [`cmdrunner` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cmdrunner). +## When to use + +- Execute multiple shell-like steps with common defaults. +- Attach pre/post hooks and inline stdin payloads. +- Reuse one runner setup across flows. + ## Key APIs -- `func Env(key, val string) string` -- `type Executor interface{ ... }` -- `type Option func(*Runner)` -- `type Runner struct{ ... }` +- `New(options ...Option) *Runner` +- `DefaultStdout/DefaultStderr/DefaultStdin/DefaultWorkdir` +- `RunParallel()` +- `(Runner) Run(ctx context.Context, steps ...*step.Step) error` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/cmdrunner" +package main + +import ( + "context" + "log" + "os" + + "github.com/ignite/cli/v29/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v29/ignite/pkg/cmdrunner/step" +) + +func main() { + r := cmdrunner.New( + cmdrunner.DefaultStdout(os.Stdout), + cmdrunner.DefaultStderr(os.Stderr), + ) + + err := r.Run( + context.Background(), + step.New(step.Exec("go", "version")), + step.New(step.Exec("go", "env", "GOMOD")), + ) + if err != nil { + log.Fatal(err) + } +} ``` diff --git a/docs/docs/07-packages/misc/confile.md b/docs/docs/07-packages/misc/confile.md deleted file mode 100644 index 6f9f44de33..0000000000 --- a/docs/docs/07-packages/misc/confile.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -sidebar_position: 23 -title: Confile (confile) -slug: /packages/confile ---- - -# Confile (confile) - -The `confile` package is helper to load and overwrite configuration files. - -For full API details, see the -[`confile` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/confile). - -## Key APIs - -- `var DefaultJSONEncodingCreator = &JSONEncodingCreator{}` -- `var DefaultTOMLEncodingCreator = &TOMLEncodingCreator{}` -- `var DefaultYAMLEncodingCreator = &YAMLEncodingCreator{}` -- `type ConfigFile struct{ ... }` -- `type Decoder interface{ ... }` -- `type EncodeDecoder interface{ ... }` -- `type Encoder interface{ ... }` -- `type Encoding struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/confile" -``` diff --git a/docs/docs/07-packages/misc/ctxticker.md b/docs/docs/07-packages/misc/ctxticker.md deleted file mode 100644 index 18b6c1c08b..0000000000 --- a/docs/docs/07-packages/misc/ctxticker.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_position: 24 -title: Ctxticker (ctxticker) -slug: /packages/ctxticker ---- - -# Ctxticker (ctxticker) - -The `ctxticker` package provides helpers around `Do` and `DoNow`. - -For full API details, see the -[`ctxticker` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/ctxticker). - -## Key APIs - -- `func Do(ctx context.Context, d time.Duration, fn func() error) error` -- `func DoNow(ctx context.Context, d time.Duration, fn func() error) error` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/ctxticker" -``` diff --git a/docs/docs/07-packages/misc/debugger.md b/docs/docs/07-packages/misc/debugger.md deleted file mode 100644 index 85f52c65e4..0000000000 --- a/docs/docs/07-packages/misc/debugger.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -sidebar_position: 25 -title: Debugger (debugger) -slug: /packages/debugger ---- - -# Debugger (debugger) - -The `debugger` package provides helpers around `DefaultAddress`, `Run`, and `Start`. - -For full API details, see the -[`debugger` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/debugger). - -## Key APIs - -- `const DefaultAddress = "127.0.0.1:30500" ...` -- `func Run(ctx context.Context, binaryPath string, options ...Option) error` -- `func Start(ctx context.Context, binaryPath string, options ...Option) (err error)` -- `type Option func(*debuggerOptions)` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/debugger" -``` diff --git a/docs/docs/07-packages/misc/dircache.md b/docs/docs/07-packages/misc/dircache.md deleted file mode 100644 index e7dfe455c8..0000000000 --- a/docs/docs/07-packages/misc/dircache.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_position: 26 -title: Dircache (dircache) -slug: /packages/dircache ---- - -# Dircache (dircache) - -The `dircache` package provides helpers around `ErrCacheNotFound`, `ClearCache`, and `Cache`. - -For full API details, see the -[`dircache` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/dircache). - -## Key APIs - -- `var ErrCacheNotFound = errors.New("cache not found")` -- `func ClearCache() error` -- `type Cache struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/dircache" -``` diff --git a/docs/docs/07-packages/misc/dirchange.md b/docs/docs/07-packages/misc/dirchange.md index c843cf1acc..88cdccfee7 100644 --- a/docs/docs/07-packages/misc/dirchange.md +++ b/docs/docs/07-packages/misc/dirchange.md @@ -6,20 +6,50 @@ slug: /packages/dirchange # Dirchange (dirchange) -The `dirchange` package provides helpers around `ErrNoFile`, `ChecksumFromPaths`, and `HasDirChecksumChanged`. +The `dirchange` package computes and compares directory checksums so callers can skip expensive work when inputs have not changed. For full API details, see the [`dirchange` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/dirchange). +## When to use + +- Short-circuit generation/build steps when source directories are unchanged. +- Persist checksum state between command runs. +- Detect content drift in selected file/folder sets. + ## Key APIs -- `var ErrNoFile = errors.New("no file in specified paths")` -- `func ChecksumFromPaths(workdir string, paths ...string) ([]byte, error)` -- `func HasDirChecksumChanged(checksumCache cache.Cache[[]byte], cacheKey string, workdir string, ...) (bool, error)` -- `func SaveDirChecksum(checksumCache cache.Cache[[]byte], cacheKey string, workdir string, ...) error` +- `ChecksumFromPaths(workdir string, paths ...string) ([]byte, error)` +- `HasDirChecksumChanged(checksumCache cache.Cache[[]byte], cacheKey string, workdir string, paths ...string) (bool, error)` +- `SaveDirChecksum(checksumCache cache.Cache[[]byte], cacheKey string, workdir string, paths ...string) error` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/dirchange" +package main + +import ( + "fmt" + "log" + "os" + "path/filepath" + + "github.com/ignite/cli/v29/ignite/pkg/cache" + "github.com/ignite/cli/v29/ignite/pkg/dirchange" +) + +func main() { + storage, err := cache.NewStorage(filepath.Join(os.TempDir(), "ignite-cache.db")) + if err != nil { + log.Fatal(err) + } + c := cache.New[[]byte](storage, "dir-checksum") + + changed, err := dirchange.HasDirChecksumChanged(c, "proto", ".", "proto") + if err != nil { + log.Fatal(err) + } + + fmt.Println("changed:", changed) +} ``` diff --git a/docs/docs/07-packages/misc/env.md b/docs/docs/07-packages/misc/env.md deleted file mode 100644 index 21e02db470..0000000000 --- a/docs/docs/07-packages/misc/env.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -sidebar_position: 28 -title: Env (env) -slug: /packages/env ---- - -# Env (env) - -The `env` package provides helpers around `DebugEnvVar`, `ConfigDir`, and `IsDebug`. - -For full API details, see the -[`env` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/env). - -## Key APIs - -- `const DebugEnvVar = "IGNT_DEBUG" ...` -- `func ConfigDir() xfilepath.PathRetriever` -- `func IsDebug() bool` -- `func SetConfigDir(dir string)` -- `func SetDebug()` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/env" -``` diff --git a/docs/docs/07-packages/misc/errors.md b/docs/docs/07-packages/misc/errors.md index f43c961524..4779579739 100644 --- a/docs/docs/07-packages/misc/errors.md +++ b/docs/docs/07-packages/misc/errors.md @@ -6,21 +6,34 @@ slug: /packages/errors # Errors (errors) -The `errors` package provides helpers for error creation, avoiding using different. +The `errors` package centralizes error creation, wrapping, inspection, and stack enrichment with a consistent API for Ignite code. For full API details, see the [`errors` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/errors). +## When to use + +- Wrap low-level errors with contextual messages while preserving root causes. +- Check error categories with `Is`/`As` across package boundaries. +- Aggregate multiple failures into a single returned error. + ## Key APIs -- `func As(err error, target any) bool` +- `func New(msg string) error` - `func Errorf(format string, args ...any) error` +- `func Wrap(err error, msg string) error` +- `func Wrapf(err error, format string, args ...any) error` +- `func WithStack(err error) error` - `func Is(err, reference error) bool` -- `func Join(errs ...error) error` -- `func New(msg string) error` +- `func As(err error, target any) bool` - `func Unwrap(err error) error` -- `func WithStack(err error) error` -- `func Wrap(err error, msg string) error` +- `func Join(errs ...error) error` + +## Common Tasks + +- Return `Wrap(err, "context")` from boundaries where more diagnostic context is needed. +- Use `Is` for sentinel checks and `As` for typed error extraction. +- Use `Join` when multiple independent steps can fail in the same operation. ## Basic import diff --git a/docs/docs/07-packages/misc/events.md b/docs/docs/07-packages/misc/events.md deleted file mode 100644 index b675983eeb..0000000000 --- a/docs/docs/07-packages/misc/events.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -sidebar_position: 30 -title: Events (events) -slug: /packages/events ---- - -# Events (events) - -The `events` package provides functionalities for packages to log their states as. - -For full API details, see the -[`events` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/events). - -## Key APIs - -- `const DefaultBufferSize = 50` -- `const GroupError = "error"` -- `type Bus struct{ ... }` -- `type BusOption func(*Bus)` -- `type Event struct{ ... }` -- `type Option func(*Event)` -- `type ProgressIndication uint8` -- `type Provider interface{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/events" -``` diff --git a/docs/docs/07-packages/misc/httpstatuschecker.md b/docs/docs/07-packages/misc/httpstatuschecker.md deleted file mode 100644 index 887438dc3c..0000000000 --- a/docs/docs/07-packages/misc/httpstatuschecker.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_position: 33 -title: Httpstatuschecker (httpstatuschecker) -slug: /packages/httpstatuschecker ---- - -# Httpstatuschecker (httpstatuschecker) - -The `httpstatuschecker` package is a tool check health of http pages. - -For full API details, see the -[`httpstatuschecker` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/httpstatuschecker). - -## Key APIs - -- `func Check(ctx context.Context, addr string, options ...Option) (isAvailable bool, err error)` -- `type Option func(*checker)` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/httpstatuschecker" -``` diff --git a/docs/docs/07-packages/misc/jsonfile.md b/docs/docs/07-packages/misc/jsonfile.md deleted file mode 100644 index 455e0e7f3e..0000000000 --- a/docs/docs/07-packages/misc/jsonfile.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -sidebar_position: 34 -title: Jsonfile (jsonfile) -slug: /packages/jsonfile ---- - -# Jsonfile (jsonfile) - -The `jsonfile` package provides helpers around `ErrFieldNotFound`, `JSONFile`, and `ReadWriteSeeker`. - -For full API details, see the -[`jsonfile` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/jsonfile). - -## Key APIs - -- `var ErrFieldNotFound = errors.New("JSON field not found") ...` -- `type JSONFile struct{ ... }` -- `type ReadWriteSeeker interface{ ... }` -- `type UpdateFileOption func(map[string][]byte)` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/jsonfile" -``` diff --git a/docs/docs/07-packages/misc/localfs.md b/docs/docs/07-packages/misc/localfs.md deleted file mode 100644 index f37951bc3a..0000000000 --- a/docs/docs/07-packages/misc/localfs.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -sidebar_position: 35 -title: Localfs (localfs) -slug: /packages/localfs ---- - -# Localfs (localfs) - -The `localfs` package provides helpers around `MkdirAllReset`, `Save`, and `SaveBytesTemp`. - -For full API details, see the -[`localfs` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/localfs). - -## Key APIs - -- `func MkdirAllReset(path string, perm fs.FileMode) error` -- `func Save(f fs.FS, path string) error` -- `func SaveBytesTemp(data []byte, prefix string, perm os.FileMode) (path string, cleanup func(), err error)` -- `func SaveTemp(f fs.FS) (path string, cleanup func(), err error)` -- `func Search(path, pattern string) ([]string, error)` -- `func Watch(ctx context.Context, paths []string, options ...WatcherOption) error` -- `type WatcherOption func(*watcher)` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/localfs" -``` diff --git a/docs/docs/07-packages/misc/markdownviewer.md b/docs/docs/07-packages/misc/markdownviewer.md deleted file mode 100644 index e84e1833de..0000000000 --- a/docs/docs/07-packages/misc/markdownviewer.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -sidebar_position: 36 -title: Markdownviewer (markdownviewer) -slug: /packages/markdownviewer ---- - -# Markdownviewer (markdownviewer) - -The `markdownviewer` package provides helpers around `View`. - -For full API details, see the -[`markdownviewer` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/markdownviewer). - -## Key APIs - -- `func View(path string) error` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/markdownviewer" -``` diff --git a/docs/docs/07-packages/misc/multiformatname.md b/docs/docs/07-packages/misc/multiformatname.md deleted file mode 100644 index 790b952f19..0000000000 --- a/docs/docs/07-packages/misc/multiformatname.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_position: 37 -title: Multiformatname (multiformatname) -slug: /packages/multiformatname ---- - -# Multiformatname (multiformatname) - -The `multiformatname` package provides names automatically converted into multiple. - -For full API details, see the -[`multiformatname` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/multiformatname). - -## Key APIs - -- `func NoNumber(name string) error` -- `type Checker func(name string) error` -- `type Name struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/multiformatname" -``` diff --git a/docs/docs/07-packages/misc/openapiconsole.md b/docs/docs/07-packages/misc/openapiconsole.md deleted file mode 100644 index 4e1c108d07..0000000000 --- a/docs/docs/07-packages/misc/openapiconsole.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -sidebar_position: 38 -title: Openapiconsole (openapiconsole) -slug: /packages/openapiconsole ---- - -# Openapiconsole (openapiconsole) - -The `openapiconsole` package provides helpers around `Handler`. - -For full API details, see the -[`openapiconsole` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/openapiconsole). - -## Key APIs - -- `func Handler(title, specURL string) http.HandlerFunc` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/openapiconsole" -``` diff --git a/docs/docs/07-packages/misc/placeholder.md b/docs/docs/07-packages/misc/placeholder.md deleted file mode 100644 index 8f1d85211f..0000000000 --- a/docs/docs/07-packages/misc/placeholder.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -sidebar_position: 39 -title: Placeholder (placeholder) -slug: /packages/placeholder ---- - -# Placeholder (placeholder) - -The `placeholder` package provides helpers around `MissingPlaceholdersError`, `Option`, and `Replacer`. - -For full API details, see the -[`placeholder` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/placeholder). - -## Key APIs - -- `type MissingPlaceholdersError struct{ ... }` -- `type Option func(*Tracer)` -- `type Replacer interface{ ... }` -- `type Tracer struct{ ... }` -- `type ValidationMiscError struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/placeholder" -``` diff --git a/docs/docs/07-packages/misc/protoanalysis.md b/docs/docs/07-packages/misc/protoanalysis.md deleted file mode 100644 index 84aa6b327e..0000000000 --- a/docs/docs/07-packages/misc/protoanalysis.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -sidebar_position: 12 -title: Proto Analysis (protoanalysis) -slug: /packages/protoanalysis ---- - -# Proto Analysis (protoanalysis) - -The `protoanalysis` package provides a toolset for analyzing proto files and packages. - -For full API details, see the -[`protoanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/protoanalysis). - -## Key APIs - -- `var ErrImportNotFound = errors.New("proto import not found")` -- `func HasMessages(ctx context.Context, path string, names ...string) error` -- `func IsImported(path string, dependencies ...string) error` -- `type Cache struct{ ... }` -- `type File struct{ ... }` -- `type Files []File` -- `type HTTPRule struct{ ... }` -- `type Message struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/protoanalysis" -``` diff --git a/docs/docs/07-packages/misc/randstr.md b/docs/docs/07-packages/misc/randstr.md deleted file mode 100644 index d6e55e75e7..0000000000 --- a/docs/docs/07-packages/misc/randstr.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -sidebar_position: 40 -title: Randstr (randstr) -slug: /packages/randstr ---- - -# Randstr (randstr) - -The `randstr` package provides helpers around `Runes`. - -For full API details, see the -[`randstr` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/randstr). - -## Key APIs - -- `func Runes(n int) string` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/randstr" -``` diff --git a/docs/docs/07-packages/misc/repoversion.md b/docs/docs/07-packages/misc/repoversion.md deleted file mode 100644 index 3048cfe2db..0000000000 --- a/docs/docs/07-packages/misc/repoversion.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -sidebar_position: 41 -title: Repoversion (repoversion) -slug: /packages/repoversion ---- - -# Repoversion (repoversion) - -The `repoversion` package provides helpers around `Version`. - -For full API details, see the -[`repoversion` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/repoversion). - -## Key APIs - -- `type Version struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/repoversion" -``` diff --git a/docs/docs/07-packages/misc/safeconverter.md b/docs/docs/07-packages/misc/safeconverter.md deleted file mode 100644 index 9081397068..0000000000 --- a/docs/docs/07-packages/misc/safeconverter.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_position: 42 -title: Safeconverter (safeconverter) -slug: /packages/safeconverter ---- - -# Safeconverter (safeconverter) - -The `safeconverter` package provides helpers around `ToInt`, `ToInt64`, and `SafeToConvertToInt`. - -For full API details, see the -[`safeconverter` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/safeconverter). - -## Key APIs - -- `func ToInt[T SafeToConvertToInt](x T) int` -- `func ToInt64[T SafeToConvertToInt](x T) int64` -- `type SafeToConvertToInt interface{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/safeconverter" -``` diff --git a/docs/docs/07-packages/misc/swagger-combine.md b/docs/docs/07-packages/misc/swagger-combine.md deleted file mode 100644 index 1749119a21..0000000000 --- a/docs/docs/07-packages/misc/swagger-combine.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -sidebar_position: 43 -title: Swagger Combine (swagger-combine) -slug: /packages/swagger-combine ---- - -# Swagger Combine (swagger-combine) - -The `swagger-combine` package provides helpers around `Config`. - -For full API details, see the -[`swagger-combine` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/swagger-combine). - -## Key APIs - -- `type Config struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/swagger-combine" -``` diff --git a/docs/docs/07-packages/misc/tarball.md b/docs/docs/07-packages/misc/tarball.md deleted file mode 100644 index 2178610d76..0000000000 --- a/docs/docs/07-packages/misc/tarball.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_position: 44 -title: Tarball (tarball) -slug: /packages/tarball ---- - -# Tarball (tarball) - -The `tarball` package provides helpers around `ErrGzipFileNotFound` and `ExtractFile`. - -For full API details, see the -[`tarball` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/tarball). - -## Key APIs - -- `var ErrGzipFileNotFound = errors.New("file not found in the gzip") ...` -- `func ExtractFile(reader io.Reader, out io.Writer, fileName string) (string, error)` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/tarball" -``` diff --git a/docs/docs/07-packages/misc/truncatedbuffer.md b/docs/docs/07-packages/misc/truncatedbuffer.md deleted file mode 100644 index af416d5fd1..0000000000 --- a/docs/docs/07-packages/misc/truncatedbuffer.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -sidebar_position: 45 -title: Truncatedbuffer (truncatedbuffer) -slug: /packages/truncatedbuffer ---- - -# Truncatedbuffer (truncatedbuffer) - -The `truncatedbuffer` package provides helpers around `TruncatedBuffer`. - -For full API details, see the -[`truncatedbuffer` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/truncatedbuffer). - -## Key APIs - -- `type TruncatedBuffer struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/truncatedbuffer" -``` diff --git a/docs/docs/07-packages/misc/xast.md b/docs/docs/07-packages/misc/xast.md deleted file mode 100644 index 24ba3e547a..0000000000 --- a/docs/docs/07-packages/misc/xast.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -sidebar_position: 46 -title: Xast (xast) -slug: /packages/xast ---- - -# Xast (xast) - -The `xast` package provides helpers around `AppendFuncCodeAtLine`, `ErrStop`, and `AppendFunction`. - -For full API details, see the -[`xast` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xast). - -## Key APIs - -- `var AppendFuncCodeAtLine = AppendFuncAtLine` -- `var ErrStop = errors.New("ast stop")` -- `func AppendFunction(fileContent string, function string) (modifiedContent string, err error)` -- `func AppendImports(fileContent string, imports ...ImportOptions) (string, error)` -- `func InsertGlobal(fileContent string, globalType GlobalType, globals ...GlobalOptions) (modifiedContent string, err error)` -- `func Inspect(n ast.Node, f func(n ast.Node) error) (err error)` -- `func ModifyCaller(content, callerExpr string, modifiers func([]string) ([]string, error)) (string, error)` -- `func ModifyFunction(content string, funcName string, functions ...FunctionOptions) (string, error)` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xast" -``` diff --git a/docs/docs/07-packages/misc/xembed.md b/docs/docs/07-packages/misc/xembed.md deleted file mode 100644 index 82e7787cbc..0000000000 --- a/docs/docs/07-packages/misc/xembed.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -sidebar_position: 47 -title: Xembed (xembed) -slug: /packages/xembed ---- - -# Xembed (xembed) - -The `xembed` package provides helpers around `FileList`. - -For full API details, see the -[`xembed` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xembed). - -## Key APIs - -- `func FileList(efs embed.FS, path string) ([]string, error)` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xembed" -``` diff --git a/docs/docs/07-packages/misc/xexec.md b/docs/docs/07-packages/misc/xexec.md deleted file mode 100644 index 01888c2593..0000000000 --- a/docs/docs/07-packages/misc/xexec.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -sidebar_position: 48 -title: Xexec (xexec) -slug: /packages/xexec ---- - -# Xexec (xexec) - -The `xexec` package provides helpers around `IsCommandAvailable`, `IsExec`, and `ResolveAbsPath`. - -For full API details, see the -[`xexec` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xexec). - -## Key APIs - -- `func IsCommandAvailable(name string) bool` -- `func IsExec(binaryPath string) (bool, error)` -- `func ResolveAbsPath(filePath string) (path string, err error)` -- `func TryResolveAbsPath(filePath string) string` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xexec" -``` diff --git a/docs/docs/07-packages/misc/xfilepath.md b/docs/docs/07-packages/misc/xfilepath.md deleted file mode 100644 index ccf3327a12..0000000000 --- a/docs/docs/07-packages/misc/xfilepath.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -sidebar_position: 49 -title: Xfilepath (xfilepath) -slug: /packages/xfilepath ---- - -# Xfilepath (xfilepath) - -The `xfilepath` package defines functions to define path retrievers that support error. - -For full API details, see the -[`xfilepath` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xfilepath). - -## Key APIs - -- `func IsDir(path string) bool` -- `func MustAbs(path string) (string, error)` -- `func MustInvoke(p PathRetriever) string` -- `func RelativePath(appPath string) (string, error)` -- `type PathRetriever func() (path string, err error)` -- `type PathsRetriever func() (path []string, err error)` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xfilepath" -``` diff --git a/docs/docs/07-packages/misc/xgenny.md b/docs/docs/07-packages/misc/xgenny.md deleted file mode 100644 index e1d1c0e9f6..0000000000 --- a/docs/docs/07-packages/misc/xgenny.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -sidebar_position: 50 -title: Xgenny (xgenny) -slug: /packages/xgenny ---- - -# Xgenny (xgenny) - -The `xgenny` package provides helpers around `Transformer`, `ApplyOption`, and `OverwriteCallback`. - -For full API details, see the -[`xgenny` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xgenny). - -## Key APIs - -- `func Transformer(ctx *plush.Context) genny.Transformer` -- `type ApplyOption func(r *applyOptions)` -- `type OverwriteCallback func(_, _, duplicated []string) error` -- `type Runner struct{ ... }` -- `type SourceModification struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xgenny" -``` diff --git a/docs/docs/07-packages/misc/xgit.md b/docs/docs/07-packages/misc/xgit.md index ca9b29fd47..178a53ba92 100644 --- a/docs/docs/07-packages/misc/xgit.md +++ b/docs/docs/07-packages/misc/xgit.md @@ -6,21 +6,46 @@ slug: /packages/xgit # Xgit (xgit) -The `xgit` package provides helpers around `AreChangesCommitted`, `Clone`, and `InitAndCommit`. +The `xgit` package wraps common git repository operations used by Ignite scaffolding and upgrade workflows. For full API details, see the [`xgit` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xgit). +## When to use + +- Clone template repositories during setup flows. +- Verify local repository state before mutating operations. +- Resolve repository metadata (origin URL, initialized state). + ## Key APIs -- `func AreChangesCommitted(dir string) (bool, error)` -- `func Clone(ctx context.Context, urlRef, dir string) error` -- `func InitAndCommit(path string) error` -- `func IsRepository(path string) (bool, error)` -- `func RepositoryURL(path string) (string, error)` +- `Clone(ctx context.Context, urlRef, dir string) error` +- `IsRepository(path string) (bool, error)` +- `AreChangesCommitted(dir string) (bool, error)` +- `RepositoryURL(path string) (string, error)` +- `InitAndCommit(path string) error` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/xgit" +package main + +import ( + "context" + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/xgit" +) + +func main() { + _ = context.Background() + + isRepo, err := xgit.IsRepository(".") + if err != nil { + log.Fatal(err) + } + + fmt.Println("is repository:", isRepo) +} ``` diff --git a/docs/docs/07-packages/misc/xhttp.md b/docs/docs/07-packages/misc/xhttp.md deleted file mode 100644 index 0b0c47e456..0000000000 --- a/docs/docs/07-packages/misc/xhttp.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -sidebar_position: 52 -title: Xhttp (xhttp) -slug: /packages/xhttp ---- - -# Xhttp (xhttp) - -The `xhttp` package provides helpers around `ShutdownTimeout`, `ResponseJSON`, and `Serve`. - -For full API details, see the -[`xhttp` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xhttp). - -## Key APIs - -- `const ShutdownTimeout = time.Minute` -- `func ResponseJSON(w http.ResponseWriter, status int, data interface{}) error` -- `func Serve(ctx context.Context, s *http.Server) error` -- `type ErrorResponse struct{ ... }` -- `type ErrorResponseBody struct{ ... }` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xhttp" -``` diff --git a/docs/docs/07-packages/misc/xio.md b/docs/docs/07-packages/misc/xio.md deleted file mode 100644 index 98d5badb89..0000000000 --- a/docs/docs/07-packages/misc/xio.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -sidebar_position: 53 -title: Xio (xio) -slug: /packages/xio ---- - -# Xio (xio) - -The `xio` package provides helpers around `NopWriteCloser`. - -For full API details, see the -[`xio` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xio). - -## Key APIs - -- `func NopWriteCloser(w io.Writer) io.WriteCloser` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xio" -``` diff --git a/docs/docs/07-packages/misc/xnet.md b/docs/docs/07-packages/misc/xnet.md deleted file mode 100644 index 47f44a2be9..0000000000 --- a/docs/docs/07-packages/misc/xnet.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -sidebar_position: 54 -title: Xnet (xnet) -slug: /packages/xnet ---- - -# Xnet (xnet) - -The `xnet` package provides helpers around `AnyIPv4Address`, `IncreasePort`, and `IncreasePortBy`. - -For full API details, see the -[`xnet` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xnet). - -## Key APIs - -- `func AnyIPv4Address(port int) string` -- `func IncreasePort(addr string) (string, error)` -- `func IncreasePortBy(addr string, inc uint64) (string, error)` -- `func LocalhostIPv4Address(port int) string` -- `func MustIncreasePortBy(addr string, inc uint64) string` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xnet" -``` diff --git a/docs/docs/07-packages/misc/xos.md b/docs/docs/07-packages/misc/xos.md deleted file mode 100644 index 426e9d68cd..0000000000 --- a/docs/docs/07-packages/misc/xos.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -sidebar_position: 55 -title: Xos (xos) -slug: /packages/xos ---- - -# Xos (xos) - -The `xos` package provides helpers around `JSONFile`, `CopyFile`, and `CopyFolder`. - -For full API details, see the -[`xos` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xos). - -## Key APIs - -- `const JSONFile = "json" ...` -- `func CopyFile(srcPath, dstPath string) error` -- `func CopyFolder(srcPath, dstPath string) error` -- `func FileExists(filename string) bool` -- `func FindFiles(directory string, options ...FindFileOptions) ([]string, error)` -- `func RemoveAllUnderHome(path string) error` -- `func Rename(oldPath, newPath string) error` -- `func ValidateFolderCopy(srcPath, dstPath string, exclude ...string) ([]string, error)` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xos" -``` diff --git a/docs/docs/07-packages/misc/xstrcase.md b/docs/docs/07-packages/misc/xstrcase.md deleted file mode 100644 index 75a69325db..0000000000 --- a/docs/docs/07-packages/misc/xstrcase.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_position: 56 -title: Xstrcase (xstrcase) -slug: /packages/xstrcase ---- - -# Xstrcase (xstrcase) - -The `xstrcase` package provides helpers around `Lowercase`, `UpperCamel`, and `Uppercase`. - -For full API details, see the -[`xstrcase` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xstrcase). - -## Key APIs - -- `func Lowercase(name string) string` -- `func UpperCamel(name string) string` -- `func Uppercase(name string) string` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xstrcase" -``` diff --git a/docs/docs/07-packages/misc/xstrings.md b/docs/docs/07-packages/misc/xstrings.md deleted file mode 100644 index 427ffb587c..0000000000 --- a/docs/docs/07-packages/misc/xstrings.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -sidebar_position: 57 -title: Xstrings (xstrings) -slug: /packages/xstrings ---- - -# Xstrings (xstrings) - -The `xstrings` package provides helpers around `AllOrSomeFilter`, `FormatUsername`, and `List`. - -For full API details, see the -[`xstrings` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xstrings). - -## Key APIs - -- `func AllOrSomeFilter(list, filterList []string) []string` -- `func FormatUsername(s string) string` -- `func List(n int, do func(i int) string) []string` -- `func NoDash(s string) string` -- `func NoNumberPrefix(s string) string` -- `func StringBetween(s, start, end string) string` -- `func Title(s string) string` -- `func ToUpperFirst(s string) string` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xstrings" -``` diff --git a/docs/docs/07-packages/misc/xtime.md b/docs/docs/07-packages/misc/xtime.md deleted file mode 100644 index f59437052e..0000000000 --- a/docs/docs/07-packages/misc/xtime.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -sidebar_position: 58 -title: Xtime (xtime) -slug: /packages/xtime ---- - -# Xtime (xtime) - -The `xtime` package provides helpers around `FormatUnix`, `FormatUnixInt`, and `NowAfter`. - -For full API details, see the -[`xtime` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xtime). - -## Key APIs - -- `func FormatUnix(date time.Time) string` -- `func FormatUnixInt(unix int64) string` -- `func NowAfter(unix time.Duration) string` -- `func Seconds(seconds int64) time.Duration` -- `type Clock interface{ ... }` -- `type ClockMock struct{ ... }` -- `type ClockSystem struct{}` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xtime" -``` diff --git a/docs/docs/07-packages/misc/xurl.md b/docs/docs/07-packages/misc/xurl.md index b83dced4a3..936d680f0e 100644 --- a/docs/docs/07-packages/misc/xurl.md +++ b/docs/docs/07-packages/misc/xurl.md @@ -6,24 +6,44 @@ slug: /packages/xurl # Xurl (xurl) -The `xurl` package provides helpers around `Address`, `HTTP`, and `HTTPEnsurePort`. +The `xurl` package normalizes and validates URL/address values across HTTP, HTTPS, WS, and TCP forms. For full API details, see the [`xurl` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xurl). +## When to use + +- Accept flexible user input and normalize it to valid URLs. +- Enforce protocol-specific address formats. +- Auto-fill missing ports for HTTP endpoints. + ## Key APIs -- `func Address(address string) string` -- `func HTTP(s string) (string, error)` -- `func HTTPEnsurePort(s string) string` -- `func HTTPS(s string) (string, error)` -- `func IsHTTP(address string) bool` -- `func MightHTTPS(s string) (string, error)` -- `func TCP(s string) (string, error)` -- `func WS(s string) (string, error)` +- `HTTP(s string) (string, error)` +- `HTTPS(s string) (string, error)` +- `WS(s string) (string, error)` +- `TCP(s string) (string, error)` +- `HTTPEnsurePort(s string) string` -## Basic import +## Example ```go -import "github.com/ignite/cli/v29/ignite/pkg/xurl" +package main + +import ( + "fmt" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/xurl" +) + +func main() { + addr := xurl.HTTPEnsurePort("localhost") + httpURL, err := xurl.HTTP(addr) + if err != nil { + log.Fatal(err) + } + + fmt.Println(httpURL) +} ``` diff --git a/docs/docs/07-packages/misc/xyaml.md b/docs/docs/07-packages/misc/xyaml.md deleted file mode 100644 index 4cf7979fd5..0000000000 --- a/docs/docs/07-packages/misc/xyaml.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_position: 60 -title: Xyaml (xyaml) -slug: /packages/xyaml ---- - -# Xyaml (xyaml) - -The `xyaml` package provides helpers around `Marshal` and `Map`. - -For full API details, see the -[`xyaml` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xyaml). - -## Key APIs - -- `func Marshal(ctx context.Context, obj interface{}, paths ...string) (string, error)` -- `type Map map[string]interface{}` - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/xyaml" -``` From 57fa413675c595bf8d67ad7acd25e06e6c19b5d9 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 15:00:34 -0300 Subject: [PATCH 13/15] improve docs titles --- docs/docs/02-guide/08-state.md | 2 +- docs/docs/07-packages/cosmos/cosmostxcollector.md | 4 ++-- docs/docs/07-packages/go/goanalysis.md | 4 ++-- docs/docs/07-packages/go/goenv.md | 4 ++-- docs/docs/07-packages/misc/dirchange.md | 4 ++-- docs/docs/07-packages/misc/xgit.md | 4 ++-- docs/docs/07-packages/misc/xurl.md | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/docs/02-guide/08-state.md b/docs/docs/02-guide/08-state.md index a4a7925f3f..cf2b079e5c 100644 --- a/docs/docs/02-guide/08-state.md +++ b/docs/docs/02-guide/08-state.md @@ -9,7 +9,7 @@ In blockchain applications, state refers to the current data stored on the block ## Collections Package -Ignite scaffolds using the [`collections`](http://pkg.go.dev/cosmossdk.io/collections) package for module code. This package provides a type-safe and efficient way to set and query values from the module store. +Ignite scaffolds using the [`collections`](https://pkg.go.dev/cosmossdk.io/collections) package for module code. This package provides a type-safe and efficient way to set and query values from the module store. ### Key Features of Collections diff --git a/docs/docs/07-packages/cosmos/cosmostxcollector.md b/docs/docs/07-packages/cosmos/cosmostxcollector.md index f70bdfa721..0f5f7636e2 100644 --- a/docs/docs/07-packages/cosmos/cosmostxcollector.md +++ b/docs/docs/07-packages/cosmos/cosmostxcollector.md @@ -1,10 +1,10 @@ --- sidebar_position: 0 -title: Indexer (cosmostxcollector) +title: Cosmos TX Collector (cosmostxcollector) slug: /packages/cosmostxcollector --- -# Indexer (cosmostxcollector) +# Cosmos TX Collector (cosmostxcollector) The `cosmostxcollector` package streams transactions from a Cosmos client and persists them through a storage adapter. diff --git a/docs/docs/07-packages/go/goanalysis.md b/docs/docs/07-packages/go/goanalysis.md index 51b16088e9..f4e10a14a9 100644 --- a/docs/docs/07-packages/go/goanalysis.md +++ b/docs/docs/07-packages/go/goanalysis.md @@ -1,10 +1,10 @@ --- sidebar_position: 31 -title: Goanalysis (goanalysis) +title: Go Analysis (goanalysis) slug: /packages/goanalysis --- -# Goanalysis (goanalysis) +# Go Analysis (goanalysis) The `goanalysis` package provides static analysis helpers for Go source code. It is used in Ignite to inspect imports, discover binaries, and apply targeted source rewrites. diff --git a/docs/docs/07-packages/go/goenv.md b/docs/docs/07-packages/go/goenv.md index b11ded5e41..528c4ab9ae 100644 --- a/docs/docs/07-packages/go/goenv.md +++ b/docs/docs/07-packages/go/goenv.md @@ -1,10 +1,10 @@ --- sidebar_position: 32 -title: Goenv (goenv) +title: Go Environment (goenv) slug: /packages/goenv --- -# Goenv (goenv) +# Go Environment (goenv) The `goenv` package provides helpers around Go-related environment values (`GOPATH`, `GOBIN`, module cache, and tool PATH configuration). diff --git a/docs/docs/07-packages/misc/dirchange.md b/docs/docs/07-packages/misc/dirchange.md index 88cdccfee7..c1d7d5f7a7 100644 --- a/docs/docs/07-packages/misc/dirchange.md +++ b/docs/docs/07-packages/misc/dirchange.md @@ -1,10 +1,10 @@ --- sidebar_position: 27 -title: Dirchange (dirchange) +title: Directory Change Detection (dirchange) slug: /packages/dirchange --- -# Dirchange (dirchange) +# Directory Change Detection (dirchange) The `dirchange` package computes and compares directory checksums so callers can skip expensive work when inputs have not changed. diff --git a/docs/docs/07-packages/misc/xgit.md b/docs/docs/07-packages/misc/xgit.md index 178a53ba92..7fb3e91fff 100644 --- a/docs/docs/07-packages/misc/xgit.md +++ b/docs/docs/07-packages/misc/xgit.md @@ -1,10 +1,10 @@ --- sidebar_position: 51 -title: Xgit (xgit) +title: Git Helpers (xgit) slug: /packages/xgit --- -# Xgit (xgit) +# Git Helpers (xgit) The `xgit` package wraps common git repository operations used by Ignite scaffolding and upgrade workflows. diff --git a/docs/docs/07-packages/misc/xurl.md b/docs/docs/07-packages/misc/xurl.md index 936d680f0e..619f1cd292 100644 --- a/docs/docs/07-packages/misc/xurl.md +++ b/docs/docs/07-packages/misc/xurl.md @@ -1,10 +1,10 @@ --- sidebar_position: 59 -title: Xurl (xurl) +title: URL Helpers (xurl) slug: /packages/xurl --- -# Xurl (xurl) +# URL Helpers (xurl) The `xurl` package normalizes and validates URL/address values across HTTP, HTTPS, WS, and TCP forms. From fc5f9a625b22a99fecdb440bdf17502de82ad690 Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 16:30:27 -0300 Subject: [PATCH 14/15] remoce unecessary docs --- .../docs/07-packages/{cosmos => }/chaincmd.md | 0 .../{cosmos => }/chaincmdrunner.md | 0 .../07-packages/{cosmos => }/chainregistry.md | 0 docs/docs/07-packages/cosmos/_category_.json | 4 -- .../07-packages/{cosmos => }/cosmosaccount.md | 0 .../{cosmos => }/cosmosanalysis.md | 0 .../07-packages/{cosmos => }/cosmosbuf.md | 0 .../07-packages/{cosmos => }/cosmosclient.md | 0 .../07-packages/{cosmos => }/cosmosfaucet.md | 0 .../07-packages/{cosmos => }/cosmosgen.md | 0 .../{cosmos => }/cosmostxcollector.md | 0 .../07-packages/{cosmos => }/cosmosver.md | 0 docs/docs/07-packages/go/_category_.json | 4 -- docs/docs/07-packages/go/goanalysis.md | 58 ----------------- docs/docs/07-packages/go/gocmd.md | 51 --------------- docs/docs/07-packages/go/goenv.md | 44 ------------- docs/docs/07-packages/go/gomodule.md | 55 ---------------- docs/docs/07-packages/go/gomodulepath.md | 47 -------------- docs/docs/07-packages/misc/_category_.json | 4 -- docs/docs/07-packages/misc/cache.md | 64 ------------------- docs/docs/07-packages/misc/cmdrunner.md | 56 ---------------- docs/docs/07-packages/misc/dirchange.md | 55 ---------------- docs/docs/07-packages/misc/errors.md | 42 ------------ docs/docs/07-packages/misc/xgit.md | 51 --------------- docs/docs/07-packages/misc/xurl.md | 49 -------------- .../plugin/testdata/example-plugin/go.mod | 48 +++++++------- 26 files changed, 24 insertions(+), 608 deletions(-) rename docs/docs/07-packages/{cosmos => }/chaincmd.md (100%) rename docs/docs/07-packages/{cosmos => }/chaincmdrunner.md (100%) rename docs/docs/07-packages/{cosmos => }/chainregistry.md (100%) delete mode 100644 docs/docs/07-packages/cosmos/_category_.json rename docs/docs/07-packages/{cosmos => }/cosmosaccount.md (100%) rename docs/docs/07-packages/{cosmos => }/cosmosanalysis.md (100%) rename docs/docs/07-packages/{cosmos => }/cosmosbuf.md (100%) rename docs/docs/07-packages/{cosmos => }/cosmosclient.md (100%) rename docs/docs/07-packages/{cosmos => }/cosmosfaucet.md (100%) rename docs/docs/07-packages/{cosmos => }/cosmosgen.md (100%) rename docs/docs/07-packages/{cosmos => }/cosmostxcollector.md (100%) rename docs/docs/07-packages/{cosmos => }/cosmosver.md (100%) delete mode 100644 docs/docs/07-packages/go/_category_.json delete mode 100644 docs/docs/07-packages/go/goanalysis.md delete mode 100644 docs/docs/07-packages/go/gocmd.md delete mode 100644 docs/docs/07-packages/go/goenv.md delete mode 100644 docs/docs/07-packages/go/gomodule.md delete mode 100644 docs/docs/07-packages/go/gomodulepath.md delete mode 100644 docs/docs/07-packages/misc/_category_.json delete mode 100644 docs/docs/07-packages/misc/cache.md delete mode 100644 docs/docs/07-packages/misc/cmdrunner.md delete mode 100644 docs/docs/07-packages/misc/dirchange.md delete mode 100644 docs/docs/07-packages/misc/errors.md delete mode 100644 docs/docs/07-packages/misc/xgit.md delete mode 100644 docs/docs/07-packages/misc/xurl.md diff --git a/docs/docs/07-packages/cosmos/chaincmd.md b/docs/docs/07-packages/chaincmd.md similarity index 100% rename from docs/docs/07-packages/cosmos/chaincmd.md rename to docs/docs/07-packages/chaincmd.md diff --git a/docs/docs/07-packages/cosmos/chaincmdrunner.md b/docs/docs/07-packages/chaincmdrunner.md similarity index 100% rename from docs/docs/07-packages/cosmos/chaincmdrunner.md rename to docs/docs/07-packages/chaincmdrunner.md diff --git a/docs/docs/07-packages/cosmos/chainregistry.md b/docs/docs/07-packages/chainregistry.md similarity index 100% rename from docs/docs/07-packages/cosmos/chainregistry.md rename to docs/docs/07-packages/chainregistry.md diff --git a/docs/docs/07-packages/cosmos/_category_.json b/docs/docs/07-packages/cosmos/_category_.json deleted file mode 100644 index 822f31b46d..0000000000 --- a/docs/docs/07-packages/cosmos/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Cosmos", - "link": null -} diff --git a/docs/docs/07-packages/cosmos/cosmosaccount.md b/docs/docs/07-packages/cosmosaccount.md similarity index 100% rename from docs/docs/07-packages/cosmos/cosmosaccount.md rename to docs/docs/07-packages/cosmosaccount.md diff --git a/docs/docs/07-packages/cosmos/cosmosanalysis.md b/docs/docs/07-packages/cosmosanalysis.md similarity index 100% rename from docs/docs/07-packages/cosmos/cosmosanalysis.md rename to docs/docs/07-packages/cosmosanalysis.md diff --git a/docs/docs/07-packages/cosmos/cosmosbuf.md b/docs/docs/07-packages/cosmosbuf.md similarity index 100% rename from docs/docs/07-packages/cosmos/cosmosbuf.md rename to docs/docs/07-packages/cosmosbuf.md diff --git a/docs/docs/07-packages/cosmos/cosmosclient.md b/docs/docs/07-packages/cosmosclient.md similarity index 100% rename from docs/docs/07-packages/cosmos/cosmosclient.md rename to docs/docs/07-packages/cosmosclient.md diff --git a/docs/docs/07-packages/cosmos/cosmosfaucet.md b/docs/docs/07-packages/cosmosfaucet.md similarity index 100% rename from docs/docs/07-packages/cosmos/cosmosfaucet.md rename to docs/docs/07-packages/cosmosfaucet.md diff --git a/docs/docs/07-packages/cosmos/cosmosgen.md b/docs/docs/07-packages/cosmosgen.md similarity index 100% rename from docs/docs/07-packages/cosmos/cosmosgen.md rename to docs/docs/07-packages/cosmosgen.md diff --git a/docs/docs/07-packages/cosmos/cosmostxcollector.md b/docs/docs/07-packages/cosmostxcollector.md similarity index 100% rename from docs/docs/07-packages/cosmos/cosmostxcollector.md rename to docs/docs/07-packages/cosmostxcollector.md diff --git a/docs/docs/07-packages/cosmos/cosmosver.md b/docs/docs/07-packages/cosmosver.md similarity index 100% rename from docs/docs/07-packages/cosmos/cosmosver.md rename to docs/docs/07-packages/cosmosver.md diff --git a/docs/docs/07-packages/go/_category_.json b/docs/docs/07-packages/go/_category_.json deleted file mode 100644 index 2e626f8d23..0000000000 --- a/docs/docs/07-packages/go/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Go", - "link": null -} diff --git a/docs/docs/07-packages/go/goanalysis.md b/docs/docs/07-packages/go/goanalysis.md deleted file mode 100644 index f4e10a14a9..0000000000 --- a/docs/docs/07-packages/go/goanalysis.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -sidebar_position: 31 -title: Go Analysis (goanalysis) -slug: /packages/goanalysis ---- - -# Go Analysis (goanalysis) - -The `goanalysis` package provides static analysis helpers for Go source code. It is used in Ignite to inspect imports, discover binaries, and apply targeted source rewrites. - -For full API details, see the -[`goanalysis` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/goanalysis). - -## When to use - -- Discover main packages in a project before build/install flows. -- Inspect and normalize import usage in parsed AST files. -- Check or patch specific code patterns in generated sources. - -## Key APIs - -- `DiscoverMain(path string) ([]string, error)` -- `DiscoverOneMain(path string) (string, error)` -- `FindBlankImports(node *ast.File) []string` -- `FormatImports(f *ast.File) map[string]string` -- `ReplaceCode(pkgPath, oldFunctionName, newFunction string) error` - -## Example - -```go -package main - -import ( - "fmt" - "go/parser" - "go/token" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/goanalysis" -) - -func main() { - mainPkg, err := goanalysis.DiscoverOneMain(".") - if err != nil { - log.Fatal(err) - } - fmt.Println("main package:", mainPkg) - - fset := token.NewFileSet() - file, err := parser.ParseFile(fset, "main.go", nil, 0) - if err != nil { - log.Fatal(err) - } - - blank := goanalysis.FindBlankImports(file) - fmt.Println("blank imports:", blank) -} -``` diff --git a/docs/docs/07-packages/go/gocmd.md b/docs/docs/07-packages/go/gocmd.md deleted file mode 100644 index 8b4f905ef0..0000000000 --- a/docs/docs/07-packages/go/gocmd.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -sidebar_position: 8 -title: Go Command Helpers (gocmd) -slug: /packages/gocmd ---- - -# Go Command Helpers (gocmd) - -The `gocmd` package wraps common `go` tool invocations (`build`, `test`, `mod tidy`, `list`, and more) with consistent execution hooks. - -For full API details, see the -[`gocmd` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gocmd). - -## When to use - -- Run Go toolchain commands from Ignite services without manually assembling command lines. -- Apply common options (workdir/stdout/stderr) through shared execution abstractions. -- Build binaries for specific targets and manage module commands. - -## Key APIs - -- `Fmt(ctx, path, options...)` -- `ModTidy(ctx, path, options...)` -- `Build(ctx, out, path, flags, options...)` -- `Test(ctx, path, flags, options...)` -- `List(ctx, path, flags, options...)` - -## Example - -```go -package main - -import ( - "context" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/gocmd" -) - -func main() { - ctx := context.Background() - - if err := gocmd.ModTidy(ctx, "."); err != nil { - log.Fatal(err) - } - - if err := gocmd.Test(ctx, ".", []string{"./..."}); err != nil { - log.Fatal(err) - } -} -``` diff --git a/docs/docs/07-packages/go/goenv.md b/docs/docs/07-packages/go/goenv.md deleted file mode 100644 index 528c4ab9ae..0000000000 --- a/docs/docs/07-packages/go/goenv.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -sidebar_position: 32 -title: Go Environment (goenv) -slug: /packages/goenv ---- - -# Go Environment (goenv) - -The `goenv` package provides helpers around Go-related environment values (`GOPATH`, `GOBIN`, module cache, and tool PATH configuration). - -For full API details, see the -[`goenv` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/goenv). - -## When to use - -- Resolve Go binary and cache paths for tool installation. -- Build stable PATH values before running Go tools. -- Keep environment handling centralized. - -## Key APIs - -- `Bin() string` -- `GoPath() string` -- `GoModCache() string` -- `Path() string` -- `ConfigurePath() error` - -## Example - -```go -package main - -import ( - "fmt" - - "github.com/ignite/cli/v29/ignite/pkg/goenv" -) - -func main() { - fmt.Println("GOPATH:", goenv.GoPath()) - fmt.Println("GOBIN:", goenv.Bin()) - fmt.Println("PATH:", goenv.Path()) -} -``` diff --git a/docs/docs/07-packages/go/gomodule.md b/docs/docs/07-packages/go/gomodule.md deleted file mode 100644 index 623c41b3c8..0000000000 --- a/docs/docs/07-packages/go/gomodule.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -sidebar_position: 9 -title: Go Module Analysis (gomodule) -slug: /packages/gomodule ---- - -# Go Module Analysis (gomodule) - -The `gomodule` package parses `go.mod` files, resolves dependencies (including replacements), and locates module directories. - -For full API details, see the -[`gomodule` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gomodule). - -## When to use - -- Inspect project dependencies programmatically. -- Resolve replacement rules from `go.mod` before dependency lookup. -- Locate module paths for codegen and analysis workflows. - -## Key APIs - -- `ParseAt(path string) (*modfile.File, error)` -- `ResolveDependencies(f *modfile.File, includeIndirect bool) ([]Version, error)` -- `FilterVersions(dependencies []Version, paths ...string) []Version` -- `SplitPath(path string) (string, string)` -- `JoinPath(path, version string) string` - -## Example - -```go -package main - -import ( - "fmt" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/gomodule" -) - -func main() { - mod, err := gomodule.ParseAt(".") - if err != nil { - log.Fatal(err) - } - - deps, err := gomodule.ResolveDependencies(mod, false) - if err != nil { - log.Fatal(err) - } - - for _, dep := range gomodule.FilterVersions(deps, "github.com/cosmos/cosmos-sdk") { - fmt.Printf("%s %s\n", dep.Path, dep.Version) - } -} -``` diff --git a/docs/docs/07-packages/go/gomodulepath.md b/docs/docs/07-packages/go/gomodulepath.md deleted file mode 100644 index e97f442870..0000000000 --- a/docs/docs/07-packages/go/gomodulepath.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -sidebar_position: 10 -title: Go Module Paths (gomodulepath) -slug: /packages/gomodulepath ---- - -# Go Module Paths (gomodulepath) - -The `gomodulepath` package validates and parses Go module path formats, and can discover a module path from a local project directory. - -For full API details, see the -[`gomodulepath` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/gomodulepath). - -## When to use - -- Validate user-provided module names before scaffolding. -- Extract normalized app paths from full module paths. -- Discover module metadata from a working directory. - -## Key APIs - -- `Parse(rawpath string) (Path, error)` -- `ParseAt(path string) (Path, error)` -- `Find(path string) (parsed Path, appPath string, err error)` -- `ExtractAppPath(path string) string` - -## Example - -```go -package main - -import ( - "fmt" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/gomodulepath" -) - -func main() { - p, err := gomodulepath.Parse("github.com/acme/my-chain") - if err != nil { - log.Fatal(err) - } - fmt.Println("root:", p.Root) - fmt.Println("package:", p.Package) -} -``` diff --git a/docs/docs/07-packages/misc/_category_.json b/docs/docs/07-packages/misc/_category_.json deleted file mode 100644 index 8964f2ee82..0000000000 --- a/docs/docs/07-packages/misc/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Miscellaneous", - "link": null -} diff --git a/docs/docs/07-packages/misc/cache.md b/docs/docs/07-packages/misc/cache.md deleted file mode 100644 index 3cba0bc849..0000000000 --- a/docs/docs/07-packages/misc/cache.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -sidebar_position: 18 -title: Cache (cache) -slug: /packages/cache ---- - -# Cache (cache) - -The `cache` package provides a typed, namespaced key-value storage layer backed by BoltDB. - -For full API details, see the -[`cache` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cache). - -## When to use - -- Persist small state between command runs. -- Store typed values by namespace and key. -- Version cache entries per release/process. - -## Key APIs - -- `NewStorage(path string, options ...StorageOption) (Storage, error)` -- `New[T any](storage Storage, namespace string) Cache[T]` -- `(Cache[T]) Put(key string, value T) error` -- `(Cache[T]) Get(key string) (T, error)` -- `Key(keyParts ...string) string` - -## Example - -```go -package main - -import ( - "fmt" - "log" - "os" - "path/filepath" - - "github.com/ignite/cli/v29/ignite/pkg/cache" -) - -type BuildInfo struct { - Version string -} - -func main() { - storage, err := cache.NewStorage(filepath.Join(os.TempDir(), "ignite-cache.db")) - if err != nil { - log.Fatal(err) - } - - c := cache.New[BuildInfo](storage, "build-info") - if err := c.Put(cache.Key("latest"), BuildInfo{Version: "v1.0.0"}); err != nil { - log.Fatal(err) - } - - info, err := c.Get("latest") - if err != nil { - log.Fatal(err) - } - - fmt.Println(info.Version) -} -``` diff --git a/docs/docs/07-packages/misc/cmdrunner.md b/docs/docs/07-packages/misc/cmdrunner.md deleted file mode 100644 index dc3ed058f4..0000000000 --- a/docs/docs/07-packages/misc/cmdrunner.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -sidebar_position: 6 -title: Command Runner (cmdrunner) -slug: /packages/cmdrunner ---- - -# Command Runner (cmdrunner) - -The `cmdrunner` package executes command steps with configurable stdio, hooks, environment, and optional parallelism. - -For full API details, see the -[`cmdrunner` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cmdrunner). - -## When to use - -- Execute multiple shell-like steps with common defaults. -- Attach pre/post hooks and inline stdin payloads. -- Reuse one runner setup across flows. - -## Key APIs - -- `New(options ...Option) *Runner` -- `DefaultStdout/DefaultStderr/DefaultStdin/DefaultWorkdir` -- `RunParallel()` -- `(Runner) Run(ctx context.Context, steps ...*step.Step) error` - -## Example - -```go -package main - -import ( - "context" - "log" - "os" - - "github.com/ignite/cli/v29/ignite/pkg/cmdrunner" - "github.com/ignite/cli/v29/ignite/pkg/cmdrunner/step" -) - -func main() { - r := cmdrunner.New( - cmdrunner.DefaultStdout(os.Stdout), - cmdrunner.DefaultStderr(os.Stderr), - ) - - err := r.Run( - context.Background(), - step.New(step.Exec("go", "version")), - step.New(step.Exec("go", "env", "GOMOD")), - ) - if err != nil { - log.Fatal(err) - } -} -``` diff --git a/docs/docs/07-packages/misc/dirchange.md b/docs/docs/07-packages/misc/dirchange.md deleted file mode 100644 index c1d7d5f7a7..0000000000 --- a/docs/docs/07-packages/misc/dirchange.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -sidebar_position: 27 -title: Directory Change Detection (dirchange) -slug: /packages/dirchange ---- - -# Directory Change Detection (dirchange) - -The `dirchange` package computes and compares directory checksums so callers can skip expensive work when inputs have not changed. - -For full API details, see the -[`dirchange` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/dirchange). - -## When to use - -- Short-circuit generation/build steps when source directories are unchanged. -- Persist checksum state between command runs. -- Detect content drift in selected file/folder sets. - -## Key APIs - -- `ChecksumFromPaths(workdir string, paths ...string) ([]byte, error)` -- `HasDirChecksumChanged(checksumCache cache.Cache[[]byte], cacheKey string, workdir string, paths ...string) (bool, error)` -- `SaveDirChecksum(checksumCache cache.Cache[[]byte], cacheKey string, workdir string, paths ...string) error` - -## Example - -```go -package main - -import ( - "fmt" - "log" - "os" - "path/filepath" - - "github.com/ignite/cli/v29/ignite/pkg/cache" - "github.com/ignite/cli/v29/ignite/pkg/dirchange" -) - -func main() { - storage, err := cache.NewStorage(filepath.Join(os.TempDir(), "ignite-cache.db")) - if err != nil { - log.Fatal(err) - } - c := cache.New[[]byte](storage, "dir-checksum") - - changed, err := dirchange.HasDirChecksumChanged(c, "proto", ".", "proto") - if err != nil { - log.Fatal(err) - } - - fmt.Println("changed:", changed) -} -``` diff --git a/docs/docs/07-packages/misc/errors.md b/docs/docs/07-packages/misc/errors.md deleted file mode 100644 index 4779579739..0000000000 --- a/docs/docs/07-packages/misc/errors.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -sidebar_position: 29 -title: Errors (errors) -slug: /packages/errors ---- - -# Errors (errors) - -The `errors` package centralizes error creation, wrapping, inspection, and stack enrichment with a consistent API for Ignite code. - -For full API details, see the -[`errors` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/errors). - -## When to use - -- Wrap low-level errors with contextual messages while preserving root causes. -- Check error categories with `Is`/`As` across package boundaries. -- Aggregate multiple failures into a single returned error. - -## Key APIs - -- `func New(msg string) error` -- `func Errorf(format string, args ...any) error` -- `func Wrap(err error, msg string) error` -- `func Wrapf(err error, format string, args ...any) error` -- `func WithStack(err error) error` -- `func Is(err, reference error) bool` -- `func As(err error, target any) bool` -- `func Unwrap(err error) error` -- `func Join(errs ...error) error` - -## Common Tasks - -- Return `Wrap(err, "context")` from boundaries where more diagnostic context is needed. -- Use `Is` for sentinel checks and `As` for typed error extraction. -- Use `Join` when multiple independent steps can fail in the same operation. - -## Basic import - -```go -import "github.com/ignite/cli/v29/ignite/pkg/errors" -``` diff --git a/docs/docs/07-packages/misc/xgit.md b/docs/docs/07-packages/misc/xgit.md deleted file mode 100644 index 7fb3e91fff..0000000000 --- a/docs/docs/07-packages/misc/xgit.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -sidebar_position: 51 -title: Git Helpers (xgit) -slug: /packages/xgit ---- - -# Git Helpers (xgit) - -The `xgit` package wraps common git repository operations used by Ignite scaffolding and upgrade workflows. - -For full API details, see the -[`xgit` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xgit). - -## When to use - -- Clone template repositories during setup flows. -- Verify local repository state before mutating operations. -- Resolve repository metadata (origin URL, initialized state). - -## Key APIs - -- `Clone(ctx context.Context, urlRef, dir string) error` -- `IsRepository(path string) (bool, error)` -- `AreChangesCommitted(dir string) (bool, error)` -- `RepositoryURL(path string) (string, error)` -- `InitAndCommit(path string) error` - -## Example - -```go -package main - -import ( - "context" - "fmt" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/xgit" -) - -func main() { - _ = context.Background() - - isRepo, err := xgit.IsRepository(".") - if err != nil { - log.Fatal(err) - } - - fmt.Println("is repository:", isRepo) -} -``` diff --git a/docs/docs/07-packages/misc/xurl.md b/docs/docs/07-packages/misc/xurl.md deleted file mode 100644 index 619f1cd292..0000000000 --- a/docs/docs/07-packages/misc/xurl.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -sidebar_position: 59 -title: URL Helpers (xurl) -slug: /packages/xurl ---- - -# URL Helpers (xurl) - -The `xurl` package normalizes and validates URL/address values across HTTP, HTTPS, WS, and TCP forms. - -For full API details, see the -[`xurl` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/xurl). - -## When to use - -- Accept flexible user input and normalize it to valid URLs. -- Enforce protocol-specific address formats. -- Auto-fill missing ports for HTTP endpoints. - -## Key APIs - -- `HTTP(s string) (string, error)` -- `HTTPS(s string) (string, error)` -- `WS(s string) (string, error)` -- `TCP(s string) (string, error)` -- `HTTPEnsurePort(s string) string` - -## Example - -```go -package main - -import ( - "fmt" - "log" - - "github.com/ignite/cli/v29/ignite/pkg/xurl" -) - -func main() { - addr := xurl.HTTPEnsurePort("localhost") - httpURL, err := xurl.HTTP(addr) - if err != nil { - log.Fatal(err) - } - - fmt.Println(httpURL) -} -``` diff --git a/integration/plugin/testdata/example-plugin/go.mod b/integration/plugin/testdata/example-plugin/go.mod index 1979feb583..b00aff32ac 100644 --- a/integration/plugin/testdata/example-plugin/go.mod +++ b/integration/plugin/testdata/example-plugin/go.mod @@ -1,6 +1,6 @@ module example-plugin -go 1.24.1 +go 1.25.4 replace github.com/ignite/cli/v29 => ../../../../ @@ -12,26 +12,26 @@ require ( require ( dario.cat/mergo v1.0.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/ProtonMail/go-crypto v1.1.5 // indirect + github.com/ProtonMail/go-crypto v1.1.6 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect - github.com/charmbracelet/lipgloss v1.0.0 // indirect + github.com/charmbracelet/lipgloss v1.1.0 // indirect github.com/charmbracelet/x/ansi v0.8.0 // indirect - github.com/cloudflare/circl v1.3.7 // indirect - github.com/cockroachdb/errors v1.11.3 // indirect - github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cloudflare/circl v1.6.3 // indirect + github.com/cockroachdb/errors v1.12.0 // indirect + github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect github.com/cockroachdb/redact v1.1.6 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-sdk v0.53.0 // indirect - github.com/cyphar/filepath-securejoin v0.3.6 // indirect + github.com/cosmos/cosmos-sdk v0.53.6 // indirect + github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fatih/structs v1.1.0 // indirect - github.com/getsentry/sentry-go v0.31.1 // indirect + github.com/getsentry/sentry-go v0.35.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.6.2 // indirect - github.com/go-git/go-git/v5 v5.13.2 // indirect + github.com/go-git/go-git/v5 v5.16.5 // indirect github.com/gobuffalo/flect v0.3.0 // indirect github.com/gobuffalo/genny/v2 v2.1.0 // indirect github.com/gobuffalo/github_flavored_markdown v1.1.4 // indirect @@ -64,7 +64,7 @@ require ( github.com/microcosm-cc/bluemonday v1.0.23 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/muesli/reflow v0.3.0 // indirect - github.com/muesli/termenv v0.15.2 // indirect + github.com/muesli/termenv v0.16.0 // indirect github.com/oklog/run v1.1.0 // indirect github.com/otiai10/copy v1.14.1 // indirect github.com/otiai10/mint v1.6.3 // indirect @@ -74,23 +74,23 @@ require ( github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/skeema/knownhosts v1.3.0 // indirect + github.com/skeema/knownhosts v1.3.1 // indirect github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d // indirect github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e // indirect - github.com/spf13/cobra v1.9.1 // indirect - github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/cobra v1.10.1 // indirect + github.com/spf13/pflag v1.0.10 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect go.etcd.io/bbolt v1.4.0 // indirect - golang.org/x/crypto v0.37.0 // indirect - golang.org/x/mod v0.24.0 // indirect - golang.org/x/net v0.39.0 // indirect - golang.org/x/sync v0.13.0 // indirect - golang.org/x/sys v0.32.0 // indirect - golang.org/x/term v0.31.0 // indirect - golang.org/x/text v0.24.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250422160041-2d3770c4ea7f // indirect - google.golang.org/grpc v1.72.0 // indirect - google.golang.org/protobuf v1.36.6 // indirect + golang.org/x/crypto v0.45.0 // indirect + golang.org/x/mod v0.29.0 // indirect + golang.org/x/net v0.47.0 // indirect + golang.org/x/sync v0.18.0 // indirect + golang.org/x/sys v0.38.0 // indirect + golang.org/x/term v0.37.0 // indirect + golang.org/x/text v0.31.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect + google.golang.org/grpc v1.75.0 // indirect + google.golang.org/protobuf v1.36.10 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) From 6d7a0f995c7c84b9ae1cdf5c447491ba38e42fce Mon Sep 17 00:00:00 2001 From: Pantani Date: Tue, 3 Mar 2026 16:31:34 -0300 Subject: [PATCH 15/15] rollback cosmostxcollector --- docs/docs/07-packages/cosmostxcollector.md | 202 +++++++++++++++++++-- 1 file changed, 183 insertions(+), 19 deletions(-) diff --git a/docs/docs/07-packages/cosmostxcollector.md b/docs/docs/07-packages/cosmostxcollector.md index 0f5f7636e2..372735a572 100644 --- a/docs/docs/07-packages/cosmostxcollector.md +++ b/docs/docs/07-packages/cosmostxcollector.md @@ -1,36 +1,200 @@ --- sidebar_position: 0 -title: Cosmos TX Collector (cosmostxcollector) +title: Indexer (cosmostxcollector) slug: /packages/cosmostxcollector --- -# Cosmos TX Collector (cosmostxcollector) +# Indexer (cosmostxcollector) -The `cosmostxcollector` package streams transactions from a Cosmos client and persists them through a storage adapter. +The package implements support for collecting transactions and events from Cosmos blockchains +into a data backend and it also adds support for querying the collected data. -For full API details, see the -[`cosmostxcollector` Go package documentation](https://pkg.go.dev/github.com/ignite/cli/v29/ignite/pkg/cosmostxcollector). +## Transaction and event data collecting -## When to use +Transactions and events can be collected using the `cosmostxcollector.Collector` type. This +type uses a `cosmosclient.Client` instance to fetch the data from each block and a data backend +adapter to save the data. -- Build lightweight indexers that ingest transactions block by block. -- Persist transaction history in SQL or custom storage backends. -- Reuse transaction collection logic from `cosmosclient` without duplicating polling code. +### Data backend adapters -## Key APIs +Data backend adapters are used to query and save the collected data into different types of data +backends and must implement the `cosmostxcollector.adapter.Adapter` interface. -- `New(db adapter.Saver, client TXsCollector) Collector` -- `(Collector) Collect(ctx context.Context, fromHeight int64) error` -- `type TXsCollector interface{ CollectTXs(...) }` +An adapter for PostgreSQL is already implemented in `cosmostxcollector.adapter.postgres.Adapter`. +This is the one used in the examples. -## Common Tasks +### Example: Data collection -- Implement `adapter.Saver` for your storage layer and pass it to `New`. -- Start collection at a chosen block height with `Collect`. -- Use a custom `TXsCollector` implementation for test doubles or alternate chain clients. +The data collection example assumes that there is a PostgreSQL database running in the local +environment containing an empty database named "cosmos". -## Basic import +The required database tables will be created automatically by the collector the first time it is run. + +When the application is run it will fetch all the transactions and events starting from one of the +recent blocks until the current block height and populate the database: + +```go +package main + +import ( + "context" + "log" + + "github.com/ignite/cli/v29/ignite/pkg/clictx" + "github.com/ignite/cli/v29/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v29/ignite/pkg/cosmostxcollector" + "github.com/ignite/cli/v29/ignite/pkg/cosmostxcollector/adapter/postgres" +) + +const ( + // Name of a local PostgreSQL database + dbName = "cosmos" + + // Cosmos RPC address + rpcAddr = "https://rpc.cosmos.directory:443/cosmoshub" +) + +func collect(ctx context.Context, db postgres.Adapter) error { + // Make sure that the data backend schema is up to date + if err := db.Init(ctx); err != nil { + return err + } + + // Init the Cosmos client + client, err := cosmosclient.New(ctx, cosmosclient.WithNodeAddress(rpcAddr)) + if err != nil { + return err + } + + // Get the latest block height + latestHeight, err := client.LatestBlockHeight(ctx) + if err != nil { + return err + } + + // Collect transactions and events starting from a block height. + // The collector stops at the latest height available at the time of the call. + collector := cosmostxcollector.New(db, client) + if err := collector.Collect(ctx, latestHeight-50); err != nil { + return err + } + + return nil +} + +func main() { + ctx := clictx.From(context.Background()) + + // Init an adapter for a local PostgreSQL database running with the default values + params := map[string]string{"sslmode": "disable"} + db, err := postgres.NewAdapter(dbName, postgres.WithParams(params)) + if err != nil { + log.Fatal(err) + } + + if err := collect(ctx, db); err != nil { + log.Fatal(err) + } +} +``` + +## Queries + +Collected data can be queried through the data backend adapters using event queries or +cursor-based queries. + +Queries support sorting, paging and filtering by using different options during creation. +The cursor-based ones also support the selection of specific fields or properties and also +passing arguments in cases where the query is a function. + +By default no sorting, filtering nor paging is applied to the queries. + +### Event queries + +The event queries return events and their attributes as `[]cosmostxcollector.query.Event`. + +### Example: Query events + +The example reads transfer events from Cosmos' bank module and paginates the results. ```go -import "github.com/ignite/cli/v29/ignite/pkg/cosmostxcollector" +import ( + "context" + + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/ignite/cli/ignite/pkg/cosmostxcollector/adapter/postgres" + "github.com/ignite/cli/ignite/pkg/cosmostxcollector/query" +) + +func queryBankTransferEvents(ctx context.Context, db postgres.Adapter) ([]query.Event, error) { + // Create an event query that returns events of type "transfer" + qry := query.NewEventQuery( + query.WithFilters( + // Filter transfer events from Cosmos' bank module + postgres.FilterByEventType(banktypes.EventTypeTransfer), + ), + query.WithPageSize(10), + query.AtPage(1), + ) + + // Execute the query + return db.QueryEvents(ctx, qry) +} +``` + +### Cursor-based queries + +This type of queries is meant to be used in contexts where the Event queries are not +useful. + +Cursor-based queries can query a single "entity" which can be a table, view or function +in relational databases or a collection or function in non relational data backends. + +The result of these types of queries is a cursor that implements the `cosmostxcollector.query.Cursor` +interface. + +### Example: Query events using cursors + +```go +import ( + "context" + + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/ignite/cli/ignite/pkg/cosmostxcollector/adapter/postgres" + "github.com/ignite/cli/ignite/pkg/cosmostxcollector/query" +) + +func queryBankTransferEventIDs(ctx context.Context, db postgres.Adapter) (ids []int64, err error) { + // Create a query that returns the IDs for events of type "transfer" + qry := query.New( + "event", + query.Fields("id"), + query.WithFilters( + // Filter transfer events from Cosmos' bank module + postgres.NewFilter("type", banktypes.EventTypeTransfer), + ), + query.WithPageSize(10), + query.AtPage(1), + query.SortByFields(query.SortOrderAsc, "id"), + ) + + // Execute the query + cr, err := db.Query(ctx, qry) + if err != nil { + return nil, err + } + + // Read the results + for cr.Next() { + var eventID int64 + + if err := cr.Scan(&eventID); err != nil { + return nil, err + } + + ids = append(ids, eventID) + } + + return ids, nil +} ```