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

feat: Add Termwind to style the TextOutputFormatter. #28

Merged
merged 7 commits into from
Aug 12, 2023

Conversation

xiCO2k
Copy link
Contributor

@xiCO2k xiCO2k commented Aug 8, 2023

Hey,

This PR adds a new style for the TextOutputFormatter using Termwind.

Before

image

After

image

If you like this output but don't like to have the HTML inside the class, I can move that to a view.

Thanks.

@TomasVotruba
Copy link
Owner

Thank you Francisco, this looks neat and stylish 🙏

If you like this output but don't like to have the HTML inside the class, I can move that to a view.

That would be ideal, so we have the logic and HTML separated 👍

@xiCO2k
Copy link
Contributor Author

xiCO2k commented Aug 9, 2023

@TomasVotruba ready!

On the last commit I did remove the TablePrinter and moved the logic to the TextOutputFormatter.

Let me know what do you think.

@TomasVotruba
Copy link
Owner

Thanks for the updated 👍 , I'll handle it today

Btw, could you update the vendor command as well, so we have the output consistent? :)

$this->symfonyStyle->createTable()
->setHeaders(['Metric', 'All dependencies', 'Without dev', 'Change'])
->setColumnWidth(0, 20)
->setRows([
[
'All lines',
NumberFormat::pretty($fullVendorMeasurement->getLines()),
NumberFormat::pretty($noDevVendorMeasurement->getLines()),
NumberFormat::percent($linesDifferenceRelative),
],
[
'Lines of code',
NumberFormat::pretty($fullVendorMeasurement->getNonCommentLines()),
NumberFormat::pretty($noDevVendorMeasurement->getNonCommentLines()),
NumberFormat::percent($nonCommentLinesDifferenceRelative),
],
])
->setColumnStyle(1, $padLeftTableStyle)
->setColumnStyle(2, $padLeftTableStyle)
->setColumnStyle(3, $padLeftTableStyle)
->setColumnStyle(4, $padLeftTableStyle)
->render();

@xiCO2k
Copy link
Contributor Author

xiCO2k commented Aug 11, 2023

@TomasVotruba still need more time to have the VendorCommand, will keep you posted.

@xiCO2k
Copy link
Contributor Author

xiCO2k commented Aug 12, 2023

@TomasVotruba please take a look, I may try to restyle the Progress Bar as well, but want to know your thoughts first.

Thanks.

@TomasVotruba
Copy link
Owner

Thank you 👍

Looks good for me 👏
Let's merge it so we can iterate testing in real life. I might adjust it later, but want to ship it now 💪

@TomasVotruba TomasVotruba merged commit d6962fe into TomasVotruba:main Aug 12, 2023
7 checks passed
@xiCO2k xiCO2k deleted the feat/add-termwind branch August 12, 2023 16:54
@xiCO2k
Copy link
Contributor Author

xiCO2k commented Aug 12, 2023

sounds great!

@TomasVotruba
Copy link
Owner

Btw, I'm curious, how do you use this package? How and when do you need to measure these?

@xiCO2k
Copy link
Contributor Author

xiCO2k commented Aug 12, 2023

for the ProgressBar I would say I will add a method the Loading class and add a view to handle the styling.

@TomasVotruba
Copy link
Owner

I mean how do you the lines package and what for

@xiCO2k
Copy link
Contributor Author

xiCO2k commented Aug 14, 2023

got it 😀.

I'm using it on a couple of a big projects that I'm cleaning up, and thats good to keep track of it

@TomasVotruba
Copy link
Owner

That's cool 😎 I'm doing something with dripping as much dependencies as I can.

I'd love to see your tricks to remove code :) what's your most effective way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants