-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Refactor forc init + add forc new #1669
Conversation
2 �[0m�[32mSuccessfully created contract: sway �[0m To compile, use `forc build`, and to run tests use `forc test` ---- Read the Docs: - Sway Book: https://fuellabs.github.io/sway/latest - Rust SDK Book: https://fuellabs.github.io/fuels-rs/latest - TypeScript SDK: https://github.com/FuelLabs/fuels-ts Join the Community: - Follow us @swaylang: https://twitter.com/SwayLang - Ask questions in dev-chat on Discord: https://discord.com/invite/xfpK4Pe Report Bugs: - Sway Issues: https://github.com/FuelLabs/sway/issues/new add
f742e9e
to
4a1cdac
Compare
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.
Great to see this happening!
I think we can remove a lot of duplicated code/logic between forc new
and forc init
.
We can think of
forc new <path>
very roughly as a tiny short-hand wrapper around:
mkdir -p <path>
forc init --path <path>
Let's refactor the forc new
logic here to take advantage of the forc init
functionality to make this easier to maintain and keep behaviour consistent.
Converting to draft both because will a few comments to address, and so as not to merge it during the hackathon by accident since it's a breaking change. |
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.
Just a couple more small things, then I'll test locally and we should be good to go!
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.
Nice work. Pulled down and tested locally. All looks good.
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.
Just opened #1841 to cut down on some of the duped logic.
d1cbb82
to
b80ffa1
Compare
Description
forc init
toforc new
, and updatesforc init
functionality to be more similar tocargo init
Testing steps
forc init
project with combinations of the different flagsRead the Docs:
Join the Community:
Report Bugs: