sunodo / sunodo

Sunodo monorepo
https://docs.sunodo.io
Apache License 2.0
21 stars 14 forks source link

Refactor build command #459

Closed endersonmaia closed 3 weeks ago

endersonmaia commented 1 month ago

This PR will introduce a sdkRun() internal function that will work as a one-shot call to executing command using the sunodo/sdk image, and processing an input and saving an output.

The idea is that we don't need to have a running container to run the rootfs -> ext2 -> snapshot "pipeline".

Some things are not elegant TypeScript code, but the overall idea is there.

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: ec0452a0f142ae393fd476c519190ed8c9683871

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------- | ----- | | @sunodo/cli | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2024 6:20pm
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2024 6:20pm
tuler commented 3 weeks ago

I don't like very much the style of the resulting code where we have methods like createRootfsTarCommand and createExt2Command which don't receive any argument, and just return a string[], making it pointless to be a method.

It didn't need to be a class method (could be a static one), it didn't need to be async (it has no async call), and in the end it didn't even need to be a method.

endersonmaia commented 3 weeks ago

I don't like very much the style of the resulting code where we have methods like createRootfsTarCommand and createExt2Command which don't receive any argument, and just return a string[], making it pointless to be a method.

It didn't need to be a class method (could be a static one), it didn't need to be async (it has no async call), and in the end it didn't even need to be a method.

Yeah, I felt the same, but didn't want to change since it was open to review.

Any suggestion that I can fix quickly?