-
Notifications
You must be signed in to change notification settings - Fork 2
replace bash scripts with unified tutorial creator CLI #7
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. One feedback that I have is why not create the CLI in Rust? As a systems programming language, Rust would be an excellent choice for a CLI tool. The code would compile down into a CLI binary that users can download and execute e.g. create-tutorial test-tutorial
. Additionally, since I consider Parity/Polkadot mostly as a "Rust shop", I think it is good for us to invest regular practice using Rust as the ROI will pay off in terms of becoming more fluent and knowledgeable with the Polkadot SDK.
Co-authored-by: Bruno Galvao <[email protected]>
I agree with you, everything has now been fully migrated to Rust. A refactor has also been done, so the code is split into multiple files for easier future improvements. Tests have been added for all functions, along with end-to-end tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good start.
```bash | ||
cd tools/create-tutorial | ||
cargo build --release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we will have a CI job that builds this and users can download the binary according to their OS.
This can come in a later PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the CONTRIBUTING.md to reflect these steps e.g. cargo build, npm run...
println!("{}", "Step 1/4: Creating git branch...".cyan()); | ||
|
||
let branch_name = format!("feat/tutorial-{}", slug); | ||
let output = Command::new("git") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend using a git crate instead of relying on using whatever git binary they have on their machine.
Summary
Replaced two separate bash scripts with a single unified CLI tool that automates tutorial creation from start to finish.
Changes
Unified Tutorial Creator
scaffold-tutorial.sh
+bootstrap-tests.sh
→create-tutorial.js
npm run create-tutorial my-tutorial
Documentation
.github/TUTORIAL_WORKFLOW.md
with visual Mermaid diagramCONTRIBUTING.md
with quick start guideBenefits
Testing