Skip to content

Commit

Permalink
rename to cca
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Nov 19, 2024
1 parent 2f5660b commit 8727144
Show file tree
Hide file tree
Showing 162 changed files with 31 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"appName": "web",
"appName": "cca",
"appDescription": "Scaffold a blockchain frontend in seconds with Ignite",
"ignite": ">28.0.0",
"dependencies": {},
Expand All @@ -11,13 +11,14 @@
}
],
"repositoryUrl": "https://github.com/ignite/apps",
"documentationUrl": "https://github.com/ignite/apps/tree/main/web/README.md",
"documentationUrl": "https://github.com/ignite/apps/tree/main/cca/README.md",
"license": {
"name": "MIT",
"url": "https://github.com/ignite/apps/blob/main/LICENSE"
},
"keywords": [
"web",
"cca",
"create-cosmos-app",
"telescope",
"cosmjs",
"interchain-js",
Expand Down
4 changes: 2 additions & 2 deletions app.ignite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ apps:
wasm:
description: Scaffold a CosmosWasm-enabled chain with ease
path: ./wasm
web:
cca:
description: Scaffold a blockchain frontend in seconds with Ignite
path: ./web
path: ./cca
example-chain-info:
description: A simple chain information application
path: ./examples/chain-info
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions web/README.md → cca/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Web
# CCA App

* <https://github.com/cosmology-tech/create-cosmos-app>

## Installation

```shell
ignite app install -g github.com/ignite/apps/web
ignite app install -g github.com/ignite/apps/cca
```
5 changes: 2 additions & 3 deletions web/cmd/cmd.go → cca/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ func GetCommands() []*plugin.Command {
return []*plugin.Command{
{
PlaceCommandUnder: "scaffold",
Use: "web",
Short: "Ignite chain-admin dashboard",
Long: "Scaffolds the chain-admin dashboard, an easy to use frontend powered by Next.js and Cosmos Kit",
Use: "cca",
Short: "Ignite CCA scaffolds a Cosmos SDK chain frontend using a `create-cosmos-app` template",
Flags: []*plugin.Flag{
{
Name: flagPath,
Expand Down
10 changes: 5 additions & 5 deletions web/cmd/web.go → cca/cmd/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"path/filepath"

"github.com/ignite/apps/web/templates"
"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"
Expand All @@ -17,8 +17,8 @@ const (
flagPath = "path"
)

// ExecuteWeb executes the web subcommand.
func ExecuteWeb(ctx context.Context, cmd *plugin.ExecutedCommand) error {
// ExecuteScaffold executes the scaffold cca subcommand.
func ExecuteScaffold(ctx context.Context, cmd *plugin.ExecutedCommand) error {
flags := plugin.Flags(cmd.Flags)

session := cliui.New(cliui.StartSpinnerWithText(statusScaffolding))
Expand All @@ -39,8 +39,8 @@ func ExecuteWeb(ctx context.Context, cmd *plugin.ExecutedCommand) error {
}

if err := templates.Write(c.AppPath()); err != nil {
return fmt.Errorf("failed to write chain-admin: %w", err)
return fmt.Errorf("failed to write CCA: %w", err)
}

return session.Printf("🎉 Ignite chain-admin added (`%[1]v`).\n", c.AppPath(), c.Name())
return session.Printf("🎉 Ignite CCA added (`%[1]v`).\n", c.AppPath(), c.Name())
}
2 changes: 1 addition & 1 deletion web/go.mod → cca/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ignite/apps/web
module github.com/ignite/apps/cca

go 1.23.1

Expand Down
File renamed without changes.
17 changes: 9 additions & 8 deletions web/integration/app_test.go → cca/integration/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ import (
envtest "github.com/ignite/cli/v28/integration"
)

func TestWeb(t *testing.T) {
func TestCCA(t *testing.T) {
var (
require = require.New(t)
env = envtest.New(t)
app = env.Scaffold("web-app")
app = env.Scaffold("cca-app")
)

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

env.Must(env.Exec("install web app locally",
env.Must(env.Exec("install cca app locally",
step.NewSteps(step.New(
step.Exec(envtest.IgniteApp, "app", "install", pluginPath),
step.Workdir(app.SourcePath()),
Expand All @@ -41,19 +41,20 @@ func TestWeb(t *testing.T) {
assertGlobalPlugins(t, nil)

buf := &bytes.Buffer{}
env.Must(env.Exec("run web",
env.Must(env.Exec("run cca",
step.NewSteps(step.New(
step.Exec(
envtest.IgniteApp,
"web",
"hello",
"scaffold",
"cca",
),
step.Workdir(app.SourcePath()),
step.Stdout(buf),
step.Stderr(buf),
)),
))
require.Equal("Hello, world!\n", buf.String())

require.Contains("Ignite CCA added", buf.String())
}

func assertLocalPlugins(t *testing.T, app envtest.App, expectedPlugins []pluginsconfig.Plugin) {
Expand Down
12 changes: 6 additions & 6 deletions web/main.go → cca/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

hplugin "github.com/hashicorp/go-plugin"

"github.com/ignite/apps/web/cmd"
"github.com/ignite/apps/cca/cmd"

"github.com/ignite/cli/v28/ignite/services/plugin"
)
Expand All @@ -15,18 +15,18 @@ type app struct{}

func (app) Manifest(_ context.Context) (*plugin.Manifest, error) {
return &plugin.Manifest{
Name: "web",
Name: "cca",
Commands: cmd.GetCommands(),
}, nil
}

func (app) Execute(ctx context.Context, c *plugin.ExecutedCommand, _ plugin.ClientAPI) error {
// Remove the first two elements "ignite" and "web" from OsArgs.
// Remove the first two elements "ignite" and "scaffold" from OsArgs.
args := c.OsArgs[2:]

switch args[0] {
case "web":
return cmd.ExecuteWeb(ctx, c)
case "cca":
return cmd.ExecuteScaffold(ctx, c)
default:
return fmt.Errorf("unknown command: %s", c.Path)
}
Expand All @@ -48,7 +48,7 @@ func main() {
hplugin.Serve(&hplugin.ServeConfig{
HandshakeConfig: plugin.HandshakeConfig(),
Plugins: map[string]hplugin.Plugin{
"web": plugin.NewGRPC(&app{}),
"cca": plugin.NewGRPC(&app{}),
},
GRPCServer: hplugin.DefaultGRPCServer,
})
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8727144

Please sign in to comment.