Skip to content

docs: add and fix crate-level documentation for all CosmWasm crates #2510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/check/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! This binary provides a CLI tool for verifying CosmWasm smart contracts before uploading to a blockchain.
//!
//! For more information, see: <https://docs.cosmwasm.com>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs were recently moved to https://cosmwasm.cosmos.network, so I would link to that.


use std::collections::HashSet;
use std::fs::File;
use std::io::Read;
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! This crate contains components of cosmwasm-std that can be used in no_std environments.
//!
//! For more information, see: <https://docs.cosmwasm.com>

#![no_std]

mod crypto;
Expand Down
13 changes: 9 additions & 4 deletions packages/crypto/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
//! The crypto crate is intended to be used in internal crates / utils.
//! Please don't use any of these types directly, as
//! they might change frequently, or be removed in the future.
//! This crate does not adhere to semantic versioning.
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! This crate implements cryptography-related functions for CosmWasm contracts and internal crates.
//!
//! For more information, see: <https://docs.cosmwasm.com>

// The crypto crate is intended to be used in internal crates / utils.
// Please don't use any of these types directly, as
// they might change frequently, or be removed in the future.
// This crate does not adhere to semantic versioning.
Comment on lines +6 to +9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now this is not part of the crate docs anymore, but it really should be. Let's just keep this note part of the crate docs below the new explainer.


extern crate alloc;

Expand Down
5 changes: 5 additions & 0 deletions packages/cw-schema-derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! Derive macros for cw-schema. For internal use only.
//!
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! For more information, see: <https://docs.cosmwasm.com>

mod expand;

macro_rules! bail {
Expand Down
5 changes: 5 additions & 0 deletions packages/cw-schema/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! This crate is a dependency for CosmWasm contracts to generate schema files for their messages.
//!
//! For more information, see: <https://docs.cosmwasm.com>

#![no_std]

extern crate alloc;
Expand Down
4 changes: 4 additions & 0 deletions packages/derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! Derive macros for CosmWasm contract development. For internal use only. Do not use directly.
//!
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! For more information, see: <https://docs.cosmwasm.com>
use proc_macro2::TokenStream;
use quote::{format_ident, quote, ToTokens};
use std::env;
Expand Down
4 changes: 4 additions & 0 deletions packages/schema-derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! Derive macros for cosmwasm-schema. For internal use only.
//!
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! For more information, see: <https://docs.cosmwasm.com>
mod cw_serde;
mod error;
mod generate_api;
Expand Down
5 changes: 5 additions & 0 deletions packages/schema/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! This crate is a dev-dependency for CosmWasm contracts to generate JSON Schema files.
//!
//! For more information, see: <https://docs.cosmwasm.com>

mod casing;
mod export;
mod idl;
Expand Down
5 changes: 5 additions & 0 deletions packages/std/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! This crate provides the standard library for Wasm-based smart contracts on Cosmos blockchains.
//!
//! For more information, see: <https://docs.cosmwasm.com>

#[cfg(not(feature = "std"))]
core::compile_error!(
r#"Please enable `cosmwasm-std`'s `std` feature, as we might move existing functionality to that feature in the future.
Expand Down
5 changes: 5 additions & 0 deletions packages/vm-derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! Derive macros for cosmwasm-vm. For internal use only. No stability guarantees.
//!
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! For more information, see: <https://docs.cosmwasm.com>

mod hash_function;

macro_rules! maybe {
Expand Down
5 changes: 5 additions & 0 deletions packages/vm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! CosmWasm is a smart contract platform for the Cosmos ecosystem.
//! This crate provides VM bindings to run CosmWasm contracts.
//!
//! For more information, see: <https://docs.cosmwasm.com>

mod backend;
mod cache;
mod calls;
Expand Down