-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5120a7
commit 9906666
Showing
166 changed files
with
28,897 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cca/templates/web linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"appName": "CCA", | ||
"slug": "cca", | ||
"appDescription": "Scaffold a blockchain frontend in seconds with Ignite", | ||
"ignite": ">28.7.0", | ||
"dependencies": {}, | ||
"cosmosSDK": ">0.50.1", | ||
"authors": [ | ||
{ | ||
"name": "Julien Robert", | ||
"github": "julienrbrt" | ||
} | ||
], | ||
"repositoryUrl": "https://github.com/ignite/apps", | ||
"documentationUrl": "https://github.com/ignite/apps/tree/main/cca/README.md", | ||
"license": { | ||
"name": "MIT", | ||
"url": "https://github.com/ignite/apps/blob/main/LICENSE" | ||
}, | ||
"keywords": [ | ||
"cca", | ||
"create-cosmos-app", | ||
"telescope", | ||
"cosmjs", | ||
"interchain-js", | ||
"cosmology", | ||
"cli", | ||
"cosmos-sdk", | ||
"ignite app" | ||
], | ||
"supportedPlatforms": [ | ||
"mac", | ||
"linux" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Web App Changelog | ||
|
||
## Unreleased | ||
|
||
## [`v0.1.0`](https://github.com/ignite/apps/releases/tag/web/v0.1.0) | ||
|
||
* First release of the Web app compatible with Ignite >= v28.x.z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# CCA App | ||
|
||
This Ignite App is aimed to extend [Ignite CLI](https://github.com/ignite/cli) and bootstrap the development of a chain frontend. | ||
It uses the widely used [Cosmology create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) template and its libraries. | ||
|
||
## Prerequisites | ||
|
||
* Ignite v28.7.0 or later | ||
* Node.js | ||
* [Corepack](https://yarnpkg.com/corepack) | ||
|
||
## Installation | ||
|
||
```shell | ||
ignite app install -g github.com/ignite/apps/cca | ||
``` | ||
|
||
### Usage | ||
|
||
Run the app using `ignite chain serve` command. | ||
In another terminal, run the frontend using the following commands: | ||
|
||
```shell | ||
ignite s cca | ||
cd web | ||
yarn install | ||
yarn dev | ||
``` | ||
|
||
Learn more about Cosmos-Kit and Ignite in their respective documentation: | ||
|
||
* <https://docs.ignite.com> | ||
* <https://github.com/cosmology-tech/create-cosmos-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package cmd | ||
|
||
import "github.com/ignite/cli/v28/ignite/services/plugin" | ||
|
||
// GetCommands returns the list of web app commands. | ||
func GetCommands() []*plugin.Command { | ||
return []*plugin.Command{ | ||
{ | ||
PlaceCommandUnder: "scaffold", | ||
Use: "cca", | ||
Short: "Ignite CCA scaffolds a Cosmos SDK chain frontend using a `create-cosmos-app` template", | ||
Flags: []*plugin.Flag{ | ||
{ | ||
Name: flagPath, | ||
Usage: "path of the app", | ||
Shorthand: "p", | ||
Type: plugin.FlagTypeString, | ||
}, | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package cmd | ||
|
||
import ( | ||
"context" | ||
"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" | ||
) | ||
|
||
const ( | ||
statusScaffolding = "Scaffolding..." | ||
|
||
flagPath = "path" | ||
) | ||
|
||
// 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)) | ||
defer session.End() | ||
|
||
appPath, err := flags.GetString(flagPath) | ||
if err != nil { | ||
return err | ||
} | ||
absPath, err := filepath.Abs(appPath) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
c, err := chain.New(absPath, chain.CollectEvents(session.EventBus())) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
sc, err := scaffolder.New(absPath) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
cfg, err := c.Config() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// add chain registry files | ||
// those are used for the wallet connector | ||
if err = sc.AddChainRegistryFiles(c, cfg); err != nil { | ||
return err | ||
} | ||
|
||
// add cca files | ||
if err := templates.Write(c.AppPath()); err != nil { | ||
return fmt.Errorf("failed to write CCA: %w", err) | ||
} | ||
|
||
return session.Printf("🎉 Ignite CCA added (`%[1]v`).\n", c.AppPath(), c.Name()) | ||
} |
Oops, something went wrong.