Skip to content

Commit

Permalink
rename marketplace to appregistry
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Jun 10, 2024
1 parent a27de35 commit 2d1980f
Show file tree
Hide file tree
Showing 26 changed files with 345 additions and 87 deletions.
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"app:hermes":
- hermes/**/*

"app:marketplace":
- marketplace/**/*
"app:appregistry":
- appregistry/**/*

"app:wasm":
- wasm/**/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"appName": "marketplace",
"appName": "appregistry",
"appDescription": "Explore the world of Ignite applications and more!",
"ignite": ">28.0.0",
"dependencies": {},
Expand All @@ -15,13 +15,13 @@
}
],
"repositoryUrl": "https://github.com/ignite/apps",
"documentationUrl": "https://github.com/ignite/apps/tree/main/marketplace/README.md",
"documentationUrl": "https://github.com/ignite/apps/tree/main/appregistry/README.md",
"license": {
"name": "MIT",
"url": "https://github.com/ignite/apps/blob/main/LICENSE"
},
"keywords": [
"marketplace",
"appregistry",
"registry",
"cli",
"cosmos-sdk",
Expand Down
4 changes: 2 additions & 2 deletions app.ignite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ apps:
hermes:
description: A wrapper around the hermes IBC relayer
path: ./hermes
marketplace:
appregistry:
description: Explore the world of Ignite applications and more!
path: ./marketplace
path: ./appregistry
consumer:
description: Internal Ignite App for scaffolding consumer chains (not to be installed manually)
path: ./consumer
Expand Down
5 changes: 5 additions & 0 deletions appregistry/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# App Registry App Changelog

## [`v0.1.0`](https://github.com/ignite/apps/releases/tag/appregistry/v0.1.0)

* First release of the app registry app compatible with Ignite >= v28.x.y
36 changes: 36 additions & 0 deletions appregistry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# App Registry App

The app registry ignite app lists application from the Ignite App Registry.
It allows users to discover and install applications built within the Ignite Apps ecosystem.

## Installation

To install the appregistry app, run the following command:

```sh
ignite app install -g github.com/ignite/apps/appregistry
```

## List

In order to list the applications, the appregistry app fetches the data from the Ignite App Registry.

```sh
ignite appregistry list
```

## Details

To view the details of a specific application, use the following command:

```sh
ignite appregistry details <app_name>
```

## Install

To install an application from the appregistry, use the following command:

```sh
ignite appregistry install <app_name>
```
4 changes: 2 additions & 2 deletions marketplace/cmd/details.go → appregistry/cmd/details.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/ignite/cli/v28/ignite/pkg/cliui"
"github.com/spf13/cobra"

"github.com/ignite/apps/marketplace/pkg/xgithub"
"github.com/ignite/apps/marketplace/registry"
"github.com/ignite/apps/appregistry/pkg/xgithub"
"github.com/ignite/apps/appregistry/registry"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions marketplace/cmd/install.go → appregistry/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
ignitecmd "github.com/ignite/cli/v28/ignite/cmd"
"github.com/ignite/cli/v28/ignite/pkg/cliui"

"github.com/ignite/apps/marketplace/pkg/xgithub"
"github.com/ignite/apps/marketplace/registry"
"github.com/ignite/apps/appregistry/pkg/xgithub"
"github.com/ignite/apps/appregistry/registry"
)

func NewInstallCmd() *cobra.Command {
Expand Down
6 changes: 3 additions & 3 deletions marketplace/cmd/list.go → appregistry/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/ignite/cli/v28/ignite/pkg/cliui"
"github.com/spf13/cobra"

"github.com/ignite/apps/marketplace/pkg/tree"
"github.com/ignite/apps/marketplace/pkg/xgithub"
"github.com/ignite/apps/marketplace/registry"
"github.com/ignite/apps/appregistry/pkg/tree"
"github.com/ignite/apps/appregistry/pkg/xgithub"
"github.com/ignite/apps/appregistry/registry"
)

const descriptionLimit = 75
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ const (
githubTokenFlag = "github-token"
)

// NewMarketplace creates a new marketplace command that holds
// some other sub commands related to running marketplace like
// NewAppRegistry creates a new app registry command that holds
// some other sub commands related to running appregistry like
// list and info.
func NewMarketplace() *cobra.Command {
func NewAppRegistry() *cobra.Command {
c := &cobra.Command{
Use: "marketplace [command]",
Use: "appregistry [command]",
Aliases: []string{"mp"},
Short: "Browse the Ignite App Marketplace",
Long: `Marketplace is a command line tool that helps you to search for ignite apps.
Short: "Browse the Ignite App Registry App",
Long: `AppRegistry is a command line tool that helps you to search for ignite apps.
It also helps you to get more information about an app.
Please note this command uses the Github API that a very limited rate limit for unauthenticated requests
so it's recommended to use the --github-token flag you want to use marketplace commands frequently.`,
so it's recommended to use the --github-token flag you want to use appregistry commands frequently.`,
SilenceErrors: true,
}

Expand Down
2 changes: 1 addition & 1 deletion marketplace/go.mod → appregistry/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ignite/apps/marketplace
module github.com/ignite/apps/appregistry

go 1.21.1

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ import (
envtest "github.com/ignite/cli/v28/integration"
)

func TestMarketplace(t *testing.T) {
func TestAppRegistry(t *testing.T) {
var (
require = require.New(t)
env = envtest.New(t)
)

dir, err := os.Getwd()
require.NoError(err)
pluginPath := filepath.Join(filepath.Dir(filepath.Dir(dir)), "marketplace")
pluginPath := filepath.Join(filepath.Dir(filepath.Dir(dir)), "appregistry")

env.Must(env.Exec("add marketplace plugin globally",
env.Must(env.Exec("add appregistry plugin globally",
step.NewSteps(step.New(
step.Exec(envtest.IgniteApp, "app", "install", "-g", pluginPath),
)),
Expand All @@ -35,11 +35,11 @@ func TestMarketplace(t *testing.T) {
assertGlobalPlugins(t, []pluginsconfig.Plugin{{Path: pluginPath}})

listOutput := &bytes.Buffer{}
env.Must(env.Exec("run marketplace list",
env.Must(env.Exec("run appregistry list",
step.NewSteps(step.New(
step.Exec(
envtest.IgniteApp,
"marketplace",
"appregistry",
"list",
),
// all test outputs are going to the stdErr for no reason, but
Expand All @@ -49,14 +49,14 @@ func TestMarketplace(t *testing.T) {
)),
))
gotList := listOutput.String()
require.True(strings.Contains(gotList, "marketplace :"), "unexpected output: %s", gotList)
require.True(strings.Contains(gotList, "appregistry :"), "unexpected output: %s", gotList)

infoOutput := &bytes.Buffer{}
env.Must(env.Exec("run marketplace info",
env.Must(env.Exec("run appregistry info",
step.NewSteps(step.New(
step.Exec(
envtest.IgniteApp,
"marketplace",
"appregistry",
"info",
"explorer",
),
Expand Down
14 changes: 7 additions & 7 deletions marketplace/main.go → appregistry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ import (
hplugin "github.com/hashicorp/go-plugin"
"github.com/ignite/cli/v28/ignite/services/plugin"

"github.com/ignite/apps/marketplace/cmd"
"github.com/ignite/apps/appregistry/cmd"
)

var _ plugin.Interface = app{}

type app struct{}

func (app) Manifest(context.Context) (*plugin.Manifest, error) {
m := &plugin.Manifest{Name: "marketplace"}
m.ImportCobraCommand(cmd.NewMarketplace(), "ignite")
m := &plugin.Manifest{Name: "appregistry"}
m.ImportCobraCommand(cmd.NewAppRegistry(), "ignite")
return m, nil
}

func (app) Execute(_ context.Context, c *plugin.ExecutedCommand, _ plugin.ClientAPI) error {
// Instead of a switch on c.Use, we run the root command like if
// we were in a command line context. This implies to set os.Args
// correctly.
// Remove the first arg "ignite" from OSArgs because our marketplace
// command root is "marketplace" not "ignite".
// Remove the first arg "ignite" from OSArgs because our appregistry
// command root is "appregistry" not "ignite".
os.Args = c.OsArgs[1:]
return cmd.NewMarketplace().Execute()
return cmd.NewAppRegistry().Execute()
}

func (app) ExecuteHookPre(context.Context, *plugin.ExecutedHook, plugin.ClientAPI) error {
Expand All @@ -46,7 +46,7 @@ func main() {
hplugin.Serve(&hplugin.ServeConfig{
HandshakeConfig: plugin.HandshakeConfig(),
Plugins: map[string]hplugin.Plugin{
"marketplace": plugin.NewGRPC(&app{}),
"appregistry": plugin.NewGRPC(&app{}),
},
GRPCServer: hplugin.DefaultGRPCServer,
})
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/ignite/apps/marketplace/pkg/tree"
"github.com/ignite/apps/appregistry/pkg/tree"
)

func TestTree(t *testing.T) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/google/go-github/v56/github"
"github.com/stretchr/testify/require"

"github.com/ignite/apps/marketplace/pkg/xgithub"
"github.com/ignite/apps/appregistry/pkg/xgithub"
)

func TestClient_GetDirectoryFiles(t *testing.T) {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions marketplace/registry/list.go → appregistry/registry/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/ignite/cli/v28/ignite/pkg/errors"

"github.com/ignite/apps/marketplace/pkg/xgithub"
"github.com/ignite/apps/appregistry/pkg/xgithub"
)

const (
Expand All @@ -31,7 +31,7 @@ func NewRegistryQuerier(client *xgithub.Client) *Querier {
return &Querier{client: client}
}

// List list apps from the ignite app marketplace/registry.
// List list apps from the ignite app appregistry/registry.
func (r *Querier) List(ctx context.Context) ([]AppEntry, error) {
appsFiles, err := r.client.GetDirectoryFiles(ctx, igniteGitHubOrg, igniteAppsRepo, registryDir)
if err != nil {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion go.work.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ use (
./examples/hooks
./explorer
./hermes
./marketplace
./appregistry
./rollkit
)
5 changes: 0 additions & 5 deletions marketplace/CHANGELOG.md

This file was deleted.

36 changes: 0 additions & 36 deletions marketplace/README.md

This file was deleted.

Loading

0 comments on commit 2d1980f

Please sign in to comment.