Skip to content

Commit

Permalink
feat: simple spinner example app (#170)
Browse files Browse the repository at this point in the history
* simple spinner application

* downgrade cli

* bump ignite

* add  a stop

* Update _registry/ignite.apps.example-spinner.json

* Update examples/spinner/go.mod

Co-authored-by: Julien Robert <julien@rbrt.fr>

---------

Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
Pantani and julienrbrt authored Feb 25, 2025
1 parent bbd6969 commit 562a643
Show file tree
Hide file tree
Showing 10 changed files with 672 additions and 5 deletions.
35 changes: 35 additions & 0 deletions _registry/ignite.apps.example-spinner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"appName": "Spinner (example)",
"slug": "example-spinner",
"appDescription": "A simple spinner application",
"ignite": ">28.3.0",
"dependencies": {
"docker": ">23.0.5"
},
"cosmosSDK": ">0.50.4",
"authors": [
{
"name": "Danilo Pantani",
"github": "Pantani"
}
],
"repositoryUrl": "https://github.com/ignite/apps/examples/spinner",
"documentationUrl": "https://github.com/ignite/apps/blob/main/examples/spinner/README.md",
"license": {
"name": "MIT",
"url": "https://github.com/ignite/apps/blob/main/LICENSE"
},
"keywords": [
"spinner",
"example",
"cli",
"cosmos-sdk",
"ignite app"
],
"supportedPlatforms": [
"mac",
"linux"
],
"icon": "",
"cover": ""
}
3 changes: 3 additions & 0 deletions app.ignite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ apps:
example-hello-world:
description: A simple hello world application
path: ./examples/hello-world
example-spinner:
description: A simple spinner application
path: ./examples/spinner
example-hooks:
description: A simple hooks application
path: ./examples/hooks
3 changes: 2 additions & 1 deletion cca/cmd/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"fmt"
"path/filepath"

"github.com/ignite/apps/cca/templates"
"github.com/ignite/cli/v28/ignite/pkg/cliui"
"github.com/ignite/cli/v28/ignite/services/chain"
"github.com/ignite/cli/v28/ignite/services/plugin"
"github.com/ignite/cli/v28/ignite/services/scaffolder"

"github.com/ignite/apps/cca/templates"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion connect/cmd/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (

"github.com/charmbracelet/bubbles/spinner"
tea "github.com/charmbracelet/bubbletea"
"github.com/ignite/apps/connect/chains"
"github.com/ignite/cli/v28/ignite/pkg/chainregistry"
"github.com/ignite/cli/v28/ignite/services/plugin"

"github.com/ignite/apps/connect/chains"
)

const pageSize = 10
Expand Down
43 changes: 43 additions & 0 deletions examples/spinner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Ignite App: Spinner Example

The "spinner" Ignite App is a simple example demonstrating how to create a basic Ignite App that prints the spinner
interaction.

## Installation

### Within Project Directory

To use the "spinner" app within your project, execute the following command inside the project directory:

```bash
ignite app install github.com/ignite/apps/examples/spinner
```

The app will be available only when running `ignite` inside the project directory.

### Globally

To use the "spinner" app globally, execute the following command:

```bash
ignite app install -g github.com/ignite/apps/examples/spinner
```

This command will compile the app and make it immediately available to the `ignite` command lists.

## Requirements

- Go (version 1.16 or higher)
- Ignite CLI (version 28.1.1 or higher)

## How it Works

The "spinner" Ignite App is a simple example of an Ignite App that implements a basic command to print the spinner
interaction. The app consists of two main files:

- `main.go`: Contains the main code for the app, including the implementation of the `Manifest` method, which defines
the app's name and commands, and the `Execute` method, which defines the execution logic for the command.

- `cmd/cmd.go`: Contains the definition of the command, including its name and description.

When the app is executed using the Ignite CLI, it prints the spinner interaction to the console.
13 changes: 13 additions & 0 deletions examples/spinner/cmd/cmd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package cmd

import "github.com/ignite/cli/v28/ignite/services/plugin"

// GetCommands returns the list of spinner app commands.
func GetCommands() []*plugin.Command {
return []*plugin.Command{
{
Use: "spinner",
Short: "App spinner example",
},
}
}
102 changes: 102 additions & 0 deletions examples/spinner/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
module github.com/ignite/apps/examples/spinner

go 1.23.6


require (
github.com/gookit/color v1.5.4
github.com/hashicorp/go-plugin v1.6.3
github.com/ignite/cli/v28 v28.8.0
github.com/manifoldco/promptui v0.9.0
)

require (
dario.cat/mergo v1.0.1 // indirect
github.com/AlecAivazis/survey/v2 v2.3.7 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.1.5 // 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/briandowns/spinner v1.23.2 // indirect
github.com/charmbracelet/lipgloss v1.0.0 // indirect
github.com/charmbracelet/x/ansi v0.8.0 // indirect
github.com/chzyer/readline v1.5.1 // 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/cockroachdb/redact v1.1.5 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-sdk v0.50.12 // indirect
github.com/cyphar/filepath-securejoin v0.3.6 // 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/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/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
github.com/gobuffalo/helpers v0.6.7 // indirect
github.com/gobuffalo/logger v1.0.7 // indirect
github.com/gobuffalo/packd v1.0.2 // indirect
github.com/gobuffalo/plush/v4 v4.1.22 // indirect
github.com/gobuffalo/tags/v3 v3.1.4 // indirect
github.com/gobuffalo/validate/v3 v3.3.3 // indirect
github.com/goccy/go-yaml v1.15.23 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-github/v48 v48.2.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/yamux v0.1.2 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
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/oklog/run v1.1.0 // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.13.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/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/xanzy/ssh-agent v0.3.3 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
go.etcd.io/bbolt v1.4.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.23.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect
google.golang.org/grpc v1.70.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit 562a643

Please sign in to comment.