Open Sukhmai opened 4 years ago
Hi Sukhmai,
This library has several npm packages now.
Chenosaurus (original lib) https://www.npmjs.com/package/poker-evaluator (typing in https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/poker-evaluator/index.d.ts)
Canvaskisa fork: https://www.npmjs.com/package/latest-poker-evaluator (I can't see any difference between this and Chenosaurus')
My (rorymcgit) fork + rewrite in Typescript: https://www.npmjs.com/package/poker-evaluator-ts (I split out some of the constants so I could use their types in some frontend code that consumed them. I also added tests and updated some es5->es6 code)
If your desire is to add a licence to it I would suggest opening a pull request from your fork to this repo, instead of adding yet another similar package to the npm registry. This repo has the benefit of having been battle tested as well as having DefinitelyTyped types for users using Typescript to rely on.
As an aside, I would be happy to merge my changes into this repo and remove my poker-evaluator-ts package too.
Hi rory, I emailed the owner of the repository, and I don't think he wants to be the maintainer of this code anymore. I'd be more than happy to delete my npm package, and have your package be the defacto latest version. My only concern is that I'm not using typescript in my application. I'm assuming I can still import your package and work with it in plain js?
I'll also add a pr for a MIT license to your repository, who gave permission through email, so that people can know that they use the package freely.
Hi rory, I've been testing your package for a bit, and you've made a few breaking changes to the code.
Thanks for testing it out Sukhmai!
Correct, the dat file is loaded on instantiation of the class. This defers from the existing API as outlined in the README Looking at it with some fresh eyes, it does not need to happen and could instead NOT defer from the existing API, so I will change this, making evalHand()
a static method and load the ranks data outside of the class.
I did not realise usage included passing the integer values as arguments, and thought that was only for protection before using #toLowerCase
. Thanks for pointing this out, should be trivial to add back in.
My suggested next steps... If @chenosaurus is unwilling to continue maintaining the npm package and you are in contact with him I suggest you ask him to hand over ownership to you (providing you want to maintain it). This would involve @chenosaurus transferring ownership on npm https://docs.npmjs.com/transferring-a-package-from-a-user-account-to-another-user-account. You would then republish to that name from your fork.
My focus will be on updating my fork to re-align with the existing the api and accept integer arguments. I'll then open a PR into your fork and if all good, deprecate the poker-evaluator-ts package.
That sounds great! I'll try to reach out and get the ownership transferred. Thank you for putting so much effort into improving the project.
As a sidenote: you've obviously contributed significantly more to the project than me, so if you want ownership I can also transfer the package to you. If that's not something you're interested in, I'd be happy to maintain it.
I have a PR open in DefinitelyTyped updating the types to allow number input. I also removed evalCard
from the types as this is only used internally in the package as far as I know. @Sukhmai If you could review it, I'd appreciate that!
I updated my fork as follows:
PokerEvaluator
and do PokerEvaluator.evalHand(...)
instead of having to instantiate the class first (all methods are now static and the classes have no state).FYI I have not yet published an update to my package, but will do that after some more testing.
Hi all, with permission from the owner of the repository, I have published a npm package with the latest version of the code. Currently the poker-evaluator package is behind the GitHub repository. I was also permitted to add a license. If anyone has suggestions for features, or wants to make a pull request, I'm more than happy to work on updating the repository.
The new npm package: https://www.npmjs.com/package/poker-evaluatehand The new repository: https://github.com/Sukhmai/poker-evaluatehand
Hopefully this helps everyone.