From c96b52eda4354a20bbc6e226c0ea004fd3d07186 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang <93241502+yhchiang-sol@users.noreply.github.com> Date: Wed, 25 Jan 2023 22:23:37 -0800 Subject: [PATCH] Update CONTRIBUTING.md for crate creation. (#29637) Create a section under CONTRIBUTING.md for crate creation. --- CONTRIBUTING.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 280ddecaf3..0cd732e888 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -208,6 +208,41 @@ of the direction" suddenly has the appearance of "I approve of these changes." Instead, add a comment that mentions the usernames that you would like a review from. Ask explicitly what you would like feedback on. +## Crate Creation + +If your PR includes a new crate, you must publish its v0.0.1 version +before the PR can be merged. Here are the steps: + +* Create a sub-directory for your new crate. +* Under the newly-created directory, create a Cargo.toml file. Below is an + example template: + +``` +[package] +name = "solana-" +version = "0.0.1" +description = "" +authors = ["Solana Maintainers "] +repository = "https://github.com/solana-labs/solana" +homepage = "https://solana.com/" +documentation = "https://docs.rs/solana-" +license = "Apache-2.0" +edition = "2021" +``` + +* Submit the PR for initial review. You should see the crate-check CI + job fails because the newly created crate is not yet published. + +* Once all review feedback has been addressed, publish v0.0.1 of the crate + under your personal crates.io account, and then transfer the crate ownership + to solana-grimes. + https://crates.io/policies#package-ownership + +* After successful publication, update the PR by replacing the v0.0.1 version + number with the correct version. At this time you should see the crate-check + CI job passes, and your published crate should be available under + https://crates.io/crates/. + ## Rust coding conventions * All Rust code is formatted using the latest version of `rustfmt`. Once @@ -258,4 +293,4 @@ Current design proposals may be viewed on the docs site: 1. [Accepted Proposals](https://docs.solana.com/proposals/accepted-design-proposals) 2. [Implemented Proposals](https://docs.solana.com/implemented-proposals/implemented-proposals) -New design proposals should follow this guide on [how to submit a design proposal](./docs/src/proposals.md#submit-a-design-proposal). \ No newline at end of file +New design proposals should follow this guide on [how to submit a design proposal](./docs/src/proposals.md#submit-a-design-proposal).