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

⚠ Adding jokes to the API should be easier #13

Open
ABSphreak opened this issue Oct 8, 2020 · 13 comments
Open

⚠ Adding jokes to the API should be easier #13

ABSphreak opened this issue Oct 8, 2020 · 13 comments
Assignees
Labels
hacktoberfest Hacktoberfest contributions welcomed!

Comments

@ABSphreak
Copy link
Owner

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.

@ABSphreak ABSphreak added hacktoberfest Hacktoberfest contributions welcomed! up-for-grabs You can take the issue and work on it labels Oct 8, 2020
@damn-dvlpr
Copy link

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.

@ABSphreak
Copy link
Owner Author

@damn-dvlpr sure go ahead.

@ABSphreak ABSphreak removed the up-for-grabs You can take the issue and work on it label Oct 8, 2020
@damn-dvlpr
Copy link

I'll open a PR real soon, meanwhile I would want you to go through this discussion here:
tinganho/l10ns#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!

@ABSphreak
Copy link
Owner Author

@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

@damn-dvlpr
Copy link

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

@ABSphreak
Copy link
Owner Author

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?

@damn-dvlpr
Copy link

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.

@ABSphreak
Copy link
Owner Author

Exactly my point. Try to think of some other solution if you can.

@anuraghazra
Copy link

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"
	},
]

@ABSphreak
Copy link
Owner Author

@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!

@anuraghazra
Copy link

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

image

@ABSphreak
Copy link
Owner Author

Cool! Updating soon.

@ivan-developer-01
Copy link

@ABSphreak Still no update?

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

No branches or pull requests

4 participants