Skip to content
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

Create CLI that can convert sb3 to leopard or leopard-zip #129

Merged
merged 5 commits into from
Apr 30, 2024
Merged

Conversation

PullJosh
Copy link
Collaborator

Closes #128. Allows importing a .sb3 file and generating a leopard folder or zip directly from the CLI. I haven't implemented .sb3 output yet for the sake of time/effort. (And because .sb3 is currently the only allowed input method so it would be mostly useless.)

Example output:
Screenshot of sb-edit CLI output

I also did my best to make the errors look nice:
Screenshot of sb-edit CLI error

This was referenced Apr 24, 2024
@towerofnix towerofnix added the command-line Features or improvements for sb-edit CLI label Apr 24, 2024
Copy link
Member

@towerofnix towerofnix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really awesome work, thank you!!

We left a bunch of comments, but they're mostly touch-ups for the code, and should be pretty quick to address. We also filed two issues following up this pull request, and did those before reviewing, to get some familiarity with the structure here. Check them out if you're curious: #130, #131

Thanks again! Apart from the code touch-ups, this looks great.

src/cli/index.ts Show resolved Hide resolved
src/cli/index.ts Outdated Show resolved Hide resolved
src/cli/index.ts Outdated Show resolved Hide resolved
src/cli/index.ts Show resolved Hide resolved
src/cli/index.ts Outdated Show resolved Hide resolved
src/cli/index.ts Outdated Show resolved Hide resolved
src/cli/index.ts Outdated Show resolved Hide resolved
src/cli/index.ts Outdated Show resolved Hide resolved
src/cli/index.ts Outdated Show resolved Hide resolved
src/cli/index.ts Show resolved Hide resolved
@PullJosh PullJosh requested review from towerofnix and removed request for adroitwhiz April 24, 2024 18:59
Copy link
Member

@towerofnix towerofnix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This all looks good except for one more tweak to how asset directories are created.

src/cli/index.ts Outdated Show resolved Hide resolved
@PullJosh
Copy link
Collaborator Author

@towerofnix Fixed the issue you mentioned. I also noticed that the wcwidth package was not actually counting chalk string widths correctly, so I replaced it with a "stripAnsi" function that does the job. With your approval, I think this is ready to ship.

@towerofnix towerofnix self-requested a review April 25, 2024 21:09
Copy link
Member

@towerofnix towerofnix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that's a good catch (and close call) with wcwidth not doing what I thought it did! Thank you.

And thanks for addressing everything else, too, and for your work on this in general! This looks great. 🥳

@PullJosh PullJosh merged commit a9a90b3 into master Apr 30, 2024
1 check passed
@PullJosh PullJosh deleted the cli branch April 30, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command-line Features or improvements for sb-edit CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command line tool
2 participants