From 117a4268df453dc778bada41dff69ad2293b4f9c Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Sat, 8 Apr 2023 12:18:14 +0200 Subject: [PATCH] docs: render orm and collections in docs (#15736) --- docs/.gitignore | 8 +++-- docs/architecture/_category_.json | 4 +-- docs/docs/building-apps/01-app-go-v2.md | 5 +-- docs/docs/building-modules/15-depinject.md | 8 ++--- docs/docs/building-modules/16-testing.md | 2 +- docs/docs/ecosystem/README.md | 5 +++ docs/docs/packages/README.md | 39 ++++++++++++++++++++++ docs/docs/packages/_category_.json | 5 +++ docs/docs/tooling/README.md | 16 ++++++--- docs/docs/tooling/_category_.json | 2 +- docs/docusaurus.config.js | 8 +++++ docs/post.sh | 8 +++-- docs/pre.sh | 10 ++++-- docs/rfc/_category_.json | 2 +- docs/spec/_category_.json | 4 +-- 15 files changed, 99 insertions(+), 27 deletions(-) create mode 100644 docs/docs/packages/README.md create mode 100644 docs/docs/packages/_category_.json diff --git a/docs/.gitignore b/docs/.gitignore index 1aca9b4b7a3a..baff39bd9e55 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -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 diff --git a/docs/architecture/_category_.json b/docs/architecture/_category_.json index d138de900cb3..87ceb9374844 100644 --- a/docs/architecture/_category_.json +++ b/docs/architecture/_category_.json @@ -1,5 +1,5 @@ { "label": "ADRs", - "position": 10, + "position": 11, "link": null -} +} \ No newline at end of file diff --git a/docs/docs/building-apps/01-app-go-v2.md b/docs/docs/building-apps/01-app-go-v2.md index 926d86dbbe4e..d22b9b040216 100644 --- a/docs/docs/building-apps/01-app-go-v2.md +++ b/docs/docs/building-apps/01-app-go-v2.md @@ -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). ::: @@ -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) ::: diff --git a/docs/docs/building-modules/15-depinject.md b/docs/docs/building-modules/15-depinject.md index 66dafca863da..fc8405abf7f4 100644 --- a/docs/docs/building-modules/15-depinject.md +++ b/docs/docs/building-modules/15-depinject.md @@ -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. @@ -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). diff --git a/docs/docs/building-modules/16-testing.md b/docs/docs/building-modules/16-testing.md index ad8089e05c9d..cd49fc454a30 100644 --- a/docs/docs/building-modules/16-testing.md +++ b/docs/docs/building-modules/16-testing.md @@ -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. diff --git a/docs/docs/ecosystem/README.md b/docs/docs/ecosystem/README.md index 7dc06e65cd99..488203cd8db1 100644 --- a/docs/docs/ecosystem/README.md +++ b/docs/docs/ecosystem/README.md @@ -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. diff --git a/docs/docs/packages/README.md b/docs/docs/packages/README.md new file mode 100644 index 000000000000..ad5e6699cab5 --- /dev/null +++ b/docs/docs/packages/README.md @@ -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. diff --git a/docs/docs/packages/_category_.json b/docs/docs/packages/_category_.json new file mode 100644 index 000000000000..e91118d38435 --- /dev/null +++ b/docs/docs/packages/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Packages", + "position": 9, + "link": null +} \ No newline at end of file diff --git a/docs/docs/tooling/README.md b/docs/docs/tooling/README.md index e4f0c3f8ff05..27bc94e24f34 100644 --- a/docs/docs/tooling/README.md +++ b/docs/docs/tooling/README.md @@ -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) diff --git a/docs/docs/tooling/_category_.json b/docs/docs/tooling/_category_.json index d91e08b5acbf..a01a4fcc48f6 100644 --- a/docs/docs/tooling/_category_.json +++ b/docs/docs/tooling/_category_.json @@ -1,5 +1,5 @@ { "label": "Tooling", - "position": 9, + "position": 10, "link": null } \ No newline at end of file diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index edc796ddbffb..43d56957944c 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -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", @@ -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", + }, ], }, ], diff --git a/docs/post.sh b/docs/post.sh index 4f2d6e07313c..a70eb526ad0c 100755 --- a/docs/post.sh +++ b/docs/post.sh @@ -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 diff --git a/docs/pre.sh b/docs/pre.sh index 2b9d35c87f18..cbe88f049ae8 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -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 diff --git a/docs/rfc/_category_.json b/docs/rfc/_category_.json index 40fac9822465..cff77f85f0b4 100644 --- a/docs/rfc/_category_.json +++ b/docs/rfc/_category_.json @@ -1,5 +1,5 @@ { "label": "RFCs", - "position": 12, + "position": 13, "link": null } \ No newline at end of file diff --git a/docs/spec/_category_.json b/docs/spec/_category_.json index e77f62999bbd..ebc04138332c 100644 --- a/docs/spec/_category_.json +++ b/docs/spec/_category_.json @@ -1,5 +1,5 @@ { "label": "Specifications", - "position": 11, + "position": 12, "link": null -} +} \ No newline at end of file