readme-jokes
readme-jokes copied to clipboard
⚠ Adding jokes to the API should be easier
Adding jokes to the jokes.json
API should be easier,
right now, if people are adding jokes to the same joke-index concurrently,
only one PR can be merged, the rest would show a merge conflict,
which is tedious.
That's bound to happen as eventually everyone is adding the new joke at the end(i.e. same line) which produces a conflict. Well I would want to work on this. would request you to assign.
@damn-dvlpr sure go ahead.
I'll open a PR real soon, meanwhile I would want you to go through this discussion here: https://github.com/tinganho/l10ns/issues/133 to get a deeper dive so that we can discuss it further. Right now I am trying to implement git-json-merge: https://www.npmjs.com/package/git-json-merge Let's just hope it does the trick!
@damn-dvlpr hey, I will look into this discussion asap. You can reach out to me on Discord if you want to discuss → ABSphreak#1420
Having been trying to implement the npm module from the past 2 days, yet haven't been able to find a viable solution. Do you think this module won't suffice in our case? https://www.npmjs.com/package/git-json-merge
It might work, but how do we configure that to auto-resolve the issues in our case? Our conflicts are happening because of Joke indexing being redundant on different PRs, how would this be helpful in our case?
Have you tried it on your Fork?
I was trying it out on a test repo I created, i can't figure out with whom this script is interacting with, whether it resolved on the local clone, or alters the working of git merger driver. the documentation seems missing to me hence all the trouble.
Exactly my point. Try to think of some other solution if you can.
Why are you guys using ArrayLike Objects? just use plain arrays less merge conflicts and easier to use and add more jokes
Don't use ArrayLike Objects. ->
{
"0": {
"q": "Relationship status?",
"a": "I'll leave the relations to the database.",
"form": "qa"
},
"1": {
"q": "How do you get the code for the bank vault?",
"a": "You checkout their branch.",
"form": "qa"
},
}
Use Arrays ->
[
{
"q": "Relationship status?",
"a": "I'll leave the relations to the database.",
"form": "qa"
},
{
"q": "How do you get the code for the bank vault?",
"a": "You checkout their branch.",
"form": "qa"
},
]
@anuraghazra at first I just randomly picked the joke from ArrayLike Objects, would change the whole thing to Arrays, then I'd have to change it from a JSON to JS file I think.
Thanks for the tip man!
Yup you can just use array.from method to convert the whole thing automatically. and create the JS or JSON file which ever you prefer
Cool! Updating soon.
@ABSphreak Still no update?