Skip to content

Commit

Permalink
docs: render orm and collections in docs (#15736)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Apr 8, 2023
1 parent 31c084f commit 117a426
Show file tree
Hide file tree
Showing 15 changed files with 99 additions and 27 deletions.
8 changes: 5 additions & 3 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ docs/docs/spec
docs/docs/architecture
docs/docs/rfc
docs/docs/tooling/01-cosmovisor.md
docs/docs/tooling/02-depinject.md
docs/docs/tooling/03-confix.md
docs/docs/tooling/04-hubl.md
docs/docs/tooling/02-confix.md
docs/docs/tooling/03-hubl.md
docs/docs/packages/01-depinject.md
docs/docs/packages/02-collections.md
docs/docs/packages/03-orm.md
docs/run-node/04-rosetta.md
docs/migrations/02-upgrading.md

Expand Down
4 changes: 2 additions & 2 deletions docs/architecture/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "ADRs",
"position": 10,
"position": 11,
"link": null
}
}
5 changes: 3 additions & 2 deletions docs/docs/building-apps/01-app-go-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 1

:::note Synopsis

The Cosmos SDK allows much easier wiring of an `app.go` thanks to App Wiring and [`depinject`](../tooling/02-depinject.md).
The Cosmos SDK allows much easier wiring of an `app.go` thanks to App Wiring and [`depinject`](../packages/01-depinject.md).
Learn more about the rationale of App Wiring in [ADR-057](../architecture/adr-057-app-wiring.md).

:::
Expand All @@ -16,7 +16,8 @@ Learn more about the rationale of App Wiring in [ADR-057](../architecture/adr-05
### Pre-requisite Readings

* [ADR 057: App Wiring](../architecture/adr-057-app-wiring.md)
* [Depinject Documentation](../tooling/02-depinject.md)
* [Depinject Documentation](../packages/01-depinject.md)
* [Modules depinject-ready](../building-modules/15-depinject.md)

:::

Expand Down
8 changes: 4 additions & 4 deletions docs/docs/building-modules/15-depinject.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
sidebar_position: 1
---

# Dependency Injection
# Modules depinject-ready

:::note

### Pre-requisite Readings

* [Cosmos SDK Dependency Injection Framework](../tooling/02-depinject.md)
* [Depinject Documentation](../packages/01-depinject.md)

:::

[`depinject`](../tooling/02-depinject.md) is used to wire any module in `app.go`.
[`depinject`](../packages/01-depinject.md) is used to wire any module in `app.go`.
All core modules are already configured to support dependency injection.

To work with `depinject` a module must define its configuration and requirements so that `depinject` can provide the right dependencies.
Expand Down Expand Up @@ -115,6 +115,6 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/module/module.go#L

The module is now ready to be used with `depinject` by a chain developer.

## App Wiring
## Integrate in an application

The App Wiring is done in `app_config.go` / `app.yaml` and `app_v2.go` and is explained in detail in the [overview of `app_v2.go`](../building-apps/01-app-go-v2.md).
2 changes: 1 addition & 1 deletion docs/docs/building-modules/16-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/tests/integration/bank/kee

## Simulations

Simulations uses as well a minimal application, built with [`depinject`](../tooling/02-depinject.md):
Simulations uses as well a minimal application, built with [`depinject`](../packages/01-depinject.md):

:::note
You can as well use the `AppConfig` `configurator` for creating an `AppConfig` [inline](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/slashing/app_test.go#L54-L62). There is no difference between those two ways, use whichever you prefer.
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/ecosystem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ This section highlights some of the cosmos ecosystem tooling and where to find i

See the official [`ibc-go` documentation](https://ibc.cosmos.network).

### `x/capability`

The capability module was once a Cosmos SDK module. From SDK v0.48, this module is maintained by the IBC team.
Find out more on their [repository](https://github.com/cosmos/ibc-go/tree/fdd664698d79864f1e00e147f9879e58497b5ef1/modules/capability).

## CosmWasm smart contracts

>CosmWasm is a smart contracting platform built for the Cosmos ecosystem. Simply put, it's the Cosmos (Cosm) way of using WebAssembly (Wasm) hence the name.
Expand Down
39 changes: 39 additions & 0 deletions docs/docs/packages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
sidebar_position: 0
---

# Packages

The Cosmos SDK is a collection of Go modules. This section provides documentation on various packages that can used when developing a Cosmos SDK chain.
It lists all standalone Go modules that are part of the Cosmos SDK.

:::tip
For more information on SDK modules, see the [SDK Modules](https://docs.cosmos.network/main/modules) section.
For more information on SDK tooling, see the [Tooling](https://docs.cosmos.network/main/tooling) section.
:::

## Core

* [Core](https://pkg.go.dev/cosmossdk.io/core) - Core library defining SDK interfaces ([ADR-063](https://docs.cosmos.network/main/architecture/adr-063-core-module-api))
* [API](https://pkg.go.dev/cosmossdk.io/api) - API library containing generated SDK Pulsar API
* [Store](https://pkg.go.dev/cosmossdk.io/store) - Implementation of the Cosmos SDK store

## State Management

* [Collections](./02-collections.md) - State management library
* [ORM](./03-orm.md) - State management library

## Automation

* [Depinject](./01-depinject.md) - Dependency injection framework
* [Client/v2](https://pkg.go.dev/cosmossdk.io/client/v2) - Library powering [AutoCLI](https://docs.cosmos.network/main/building-modules/autocli)

## Utilities

* [Log](https://pkg.go.dev/cosmossdk.io/log) - Logging library
* [Errors](https://pkg.go.dev/cosmossdk.io/errors) - Error handling library
* [Math](https://pkg.go.dev/cosmossdk.io/math) - Math library for SDK arithmetic operations

## Example

* [SimApp](https://pkg.go.dev/cosmossdk.io/simapp) - SimApp is **the** sample Cosmos SDK chain. This package should not be imported in your application.
5 changes: 5 additions & 0 deletions docs/docs/packages/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Packages",
"position": 9,
"link": null
}
16 changes: 11 additions & 5 deletions docs/docs/tooling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ sidebar_position: 0

# Tools

This section provides documentation on various tooling used in development of a Cosmos SDK chain, operating a node and testing.
This section provides documentation on various tooling maintained by the SDK team.
This includes tools for development, operating a node, and ease of use of a Cosmos SDK chain.

## CLI Tools

* [Protocol Buffers](./00-protobuf.md)
* [Cosmovisor](./01-cosmovisor.md)
* [Depinject](./02-depinject.md)
* [Confix](./03-confix.md)
* [Hubl](./04-hubl.md)
* [Confix](./02-confix.md)
* [Hubl](./03-hubl.md)
* [Rosetta](https://docs.cosmos.network/main/run-node/rosetta)

## Other Tools

* [Protocol Buffers](./00-protobuf.md)
2 changes: 1 addition & 1 deletion docs/docs/tooling/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Tooling",
"position": 9,
"position": 10,
"link": null
}
8 changes: 8 additions & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ const config = {
],
to: "/main/modules/upgrade/",
},
{
from: ["/main/modules/capability"],
to: "/main/ecosystem",
},
{
from: ["/main/run-node/cosmovisor"],
to: "/main/tooling/cosmovisor",
Expand All @@ -393,6 +397,10 @@ const config = {
from: ["/main/migrations/pre-upgrade"],
to: "/main/building-apps/app-upgrade",
},
{
from: ["/main/tooling/depinject"],
to: "/main/packages/depinject",
},
],
},
],
Expand Down
8 changes: 5 additions & 3 deletions docs/post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

find docs/modules ! -name '_category_.json' -type f -exec rm -rf {} +
rm -rf docs/tooling/01-cosmovisor.md
rm -rf docs/tooling/02-depinject.md
rm -rf docs/tooling/03-confix.md
rm -rf docs/tooling/04-hubl.md
rm -rf docs/tooling/02-confix.md
rm -rf docs/tooling/03-hubl.md
rm -rf docs/packages/01-depinject.md
rm -rf docs/packages/02-collections.md
rm -rf docs/packages/03-orm.md
rm -rf docs/run-node/04-rosetta.md
rm -rf docs/architecture
rm -rf docs/spec
Expand Down
10 changes: 7 additions & 3 deletions docs/pre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ cat ../x/README.md | sed 's/\.\.\/docs\/building-modules\/README\.md/\/building-

## Add tooling documentation
cp ../tools/cosmovisor/README.md ./docs/tooling/01-cosmovisor.md
cp ../depinject/README.md ./docs/tooling/02-depinject.md
cp ../tools/confix/README.md ./docs/tooling/03-confix.md
cp ../tools/hubl/README.md ./docs/tooling/04-hubl.md
cp ../tools/confix/README.md ./docs/tooling/02-confix.md
cp ../tools/hubl/README.md ./docs/tooling/03-hubl.md

## Add package documentation
cp ../depinject/README.md ./docs/packages/01-depinject.md
cp ../collections/README.md ./docs/packages/02-collections.md
cp ../orm/README.md ./docs/packages/03-orm.md

## Add rosetta documentation
cp ../tools/rosetta/README.md ./docs/run-node/04-rosetta.md
Expand Down
2 changes: 1 addition & 1 deletion docs/rfc/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "RFCs",
"position": 12,
"position": 13,
"link": null
}
4 changes: 2 additions & 2 deletions docs/spec/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Specifications",
"position": 11,
"position": 12,
"link": null
}
}

0 comments on commit 117a426

Please sign in to comment.