Closed frol closed 11 months ago
Hey I am currently learning rust, as it is a good first issue can you please assign this to me
@ShivangRawat30 Sure, go ahead!
In addition to the regular Rust project setup, I suggest also including GitHub Actions setup for fmt/linting checks on PRs, and build and deploy to testnet and (optional) mainnet on merges to main
branch.
A very basic one can be found here: https://github.com/frol/transfer-near-contract/blob/main/.github/workflows/rust.yml (there is no deployment part there)
And also setup tests environment (workspaces-rs)
I think we could start with polishing one contract repo to a reasonable state before scripting it into cargo near new
. Currently, looking at https://github.com/near-examples/, I cannot find any Rust contract example without npm
/yarn
in there. It makes things much more complex than necessary.
So to summarize it, a new project should have the following:
cargo near
)src/lib.rs
, maybe: https://github.com/near/near-sdk-rs/blob/master/examples/status-message/src/lib.rs@ShivangRawat30 Hi. How is your progress? Can I take this task?
Here is a bootstrap project that cargo near new
should use as a template: https://github.com/frol/cargo-near-new-project.
It would be great to have a
new
command to initialize an empty project.There is
cargo-generate
andnear-create-app
that are currently suggested in the docs, but I would prefer avoiding having extra dependency (cargo-generate) or a whole different stack (near-create-app requires Node.js) and rather build the whole DevX aroundcargo near ...
commands.I believe near-create-app does too much (initializes the frontend and the contract inside a single project), and
cargo-generate
makes things harder to use than necessary, and currently developers face the whole page of just "Create a new project" where I would love to see:and the next commands:
P.S. It might also be useful to initialize common projects like basic FT, NFT contracts (see https://github.com/near/near-sdk-rs/tree/master/examples).