tldr-node-client icon indicating copy to clipboard operation
tldr-node-client copied to clipboard

change `-o/--os` to `-p/--platform`

Open marchersimon opened this issue 4 years ago • 23 comments
trafficstars

Closes #336

marchersimon avatar Mar 26 '21 20:03 marchersimon

Any idea what's wrong with the failed test here?

marchersimon avatar Mar 26 '21 20:03 marchersimon

@marchersimon don't edit this PR yet—I'm making some changes.

bl-ue avatar Mar 26 '21 20:03 bl-ue

Closing→reopening the PR can frequently fix the checks, not the case here. I think you may have broken it, let me see. I'll also re-run the jobs.

bl-ue avatar Mar 26 '21 20:03 bl-ue

The tests should pass now. FYI @marchersimon when you change the flags in the code (here) you also need to update references to that flag, e.g. program.os (here) corresponds directly to the string values passed to program.option, so it needs to be changed to program.platform. All of that and more I've done in the past two commits 👍🏻

bl-ue avatar Mar 26 '21 20:03 bl-ue

Oh, sorry, I just blindly replaced -o and --os without checking if they occur somewhere else. Thanks for the fix

marchersimon avatar Mar 26 '21 21:03 marchersimon

There we go, the checks are all green.

bl-ue avatar Mar 26 '21 21:03 bl-ue

Closing→reopening the PR can frequently fix the checks, not the case here. I think you may have broken it, let me see. I'll also re-run the jobs.

OT Please don't do that because it generates notification noise. You can always manually rerun Github actions through the web interface.

vladimyr avatar Mar 27 '21 00:03 vladimyr

You're right; I realized that after I closed/reopened it 😂

bl-ue avatar Mar 27 '21 00:03 bl-ue

@vladimyr this is all great stuff that you're pointing out, but as it doesn't actually improve the app from the users's perspective (i.e. performance, etc.) what do you think about ignoring all of these tweaks for this PR and saving them for another PR? I plan to open a new PR within the next couple days full of improvements I've noticed could be made and I think these would—as they're not strictly related to the osplatform change—be better for that PR.

I have a lot more things in mind than you're pointing out here, and IMO it makes the diff harder while not giving the code the wash it deserves. What do you think?

bl-ue avatar Mar 27 '21 01:03 bl-ue

Yeah you're right @agnivade, funny that I didn't think about that. What about also printing a deprecation message when -o/--os are used, stating that they will be removed in a future release or after a specific date e.g. Dec 31 2021?

bl-ue avatar Mar 27 '21 12:03 bl-ue

Sounds reasonable. It can be removed in the next major release.

agnivade avatar Mar 27 '21 14:03 agnivade

Should I still handle suggestions or would you prefer to take over? Because I think I wouldn't be very helpful here.

marchersimon avatar Mar 27 '21 19:03 marchersimon

Oh, I had a message typed but forgot to hit send 🙃 I'll take over, provided you don't mind.

bl-ue avatar Mar 27 '21 19:03 bl-ue

Sure, thank you

marchersimon avatar Mar 27 '21 20:03 marchersimon

@vladimyr this is all great stuff that you're pointing out, but as it doesn't actually improve the app from the users's perspective (i.e. performance, etc.) what do you think about ignoring all of these tweaks for this PR and saving them for another PR? I plan to open a new PR within the next couple days full of improvements I've noticed could be made and I think these would—as they're not strictly related to the osplatform change—be better for that PR.

I have a lot more things in mind than you're pointing out here, and IMO it makes the diff harder while not giving the code the wash it deserves. What do you think?

So here is what I think. You are right changes I proposed are transparent to the end-user and don't affect them in any possible way but they improve the state of a particular piece of codebase limited by boundaries of this patch/PR. I tend to follow Martin Fowler's school of thought there which can be summarised as - each time you touch some part of the codebase go and make it a bit better right away instead of scheduling grand refactors.

As per your second point, I fully agree that there are countless things that need to get addressed in tldr's codebase but please make that an incremental process rather than one big rewrite.

This last point of yours about making the diff harder I can just say I explicitly limited myself to not suggest too many changes and to keep those on topic. I think I did a good job there but that's obviously subjective 🙃

vladimyr avatar Mar 28 '21 22:03 vladimyr

Also as @agnivade pointed out this is a breaking change so increasing of major version is a semver requirement.

For displaying deprecation message, we could use https://www.npmjs.com/package/depd#deprecating-property-access

vladimyr avatar Mar 28 '21 22:03 vladimyr

For displaying deprecation message, we could use https://www.npmjs.com/package/depd#deprecating-property-access

Looks nice, I'll try it. The message might be developer-oriented rather user-oriented, but we'll see.

So here is what I think. ... ... This last point of yours about making the diff harder I can just say I explicitly limited myself to not suggest too many changes and to keep those on topic. I think I did a good job there but that's obviously subjective 🙃

Good points, I agree with all of them. I'll apply the suggestions and keep future cleanup PRs small and limited to a particular type of fix.

bl-ue avatar Mar 28 '21 22:03 bl-ue

I'm sure there'll be plenty of other PRs to the Node.js client here to improve things in too lol

(did we update the Node.js client to automatically convert the page name to lowercase?)

sbrl avatar Mar 30 '21 22:03 sbrl

No, I don't think so! Another spec compliance issue! 😄 I will gladly take care of that ASAP once this PR is merged.

bl-ue avatar Mar 30 '21 23:03 bl-ue

Is this ready for review? This still seems to replace --os by --platform.

agnivade avatar Apr 16 '21 03:04 agnivade

Oh, sorry, you're right. I just saw that the PR hasn't had activity for some time.

marchersimon avatar Apr 16 '21 09:04 marchersimon

I think this PR is indeed ready for review, @agnivade

sbrl avatar Apr 22 '21 20:04 sbrl

I think this PR is indeed ready for review, @agnivade

It still lacks deprecation notice and as @agnivade already said simply replaces --os by --platform thus introducing a breaking change. :warning: ie this needs more work/love...

vladimyr avatar Apr 23 '21 05:04 vladimyr

Closing this in favor of #421

MasterOdin avatar Oct 13 '23 04:10 MasterOdin