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

Updated Emojis and automation #1

Merged
merged 17 commits into from
Sep 3, 2018
Merged

Conversation

stefanzweifel
Copy link
Contributor

Hey there 👋

This PR adds a node build command to the project, to hopefully automate the creation of the snippets-file with new emojis in the future.

The bulk of the emojis and their shortcodes are build from the gemoji node package, which itself depends on the gemoji ruby gem maintained by GitHub itself.

As there's still a PR open in the upstream github/gemoji repository to add emojis from the 2017 release, I've added a handful of emojis myself (See otherSnippetsAndEmojis.js).

Other stuff that has changed in comparison to master:

  • I've deleted the emoji-pack-unzipped folder. Everytime a new build is created, there would be thousand of changes, as the UUID changes. Don't know if this okay or if this should be added back in 🤷‍♂️
  • The Emoji Pack.alfredsnippets which can be downloaded and used in Alfred is committed to the repo

Let me know if something is unclear or something should be changed. Happy to help.

@califa
Copy link
Owner

califa commented Aug 19, 2018

Hey @stefanzweifel, thanks for the awesome changes! The build process is definitely going to help keep this up to date! I also think it's a good idea to remove the unzipped pack. I thought this would make diffing easier but it hadn't occurred to me that the UUID would change.

On closer inspection of the original pack, it looks like there are a few differences and I think we should keep it consistent for the existing user base. These changes were made to make the pack easier to use.

  • It uses spaces rather than underscores between words.
  • It includes additional tags for easier search, for instance weather on :sunny_cloud:.
    • Note that Alfred changed how the search works at some point. These tags were placed in parentheses and that worked great with fuzzy search, but it's now broken and should be changed to alias - tag tag.
    • This also goes for starting the snippet names (not keywords) with :, which also breaks search.
  • It included a lot of manual optimizations. Some examples:
    • :bowing_man: was changed to :bow:, :upside_down_man: changed to :upside down:, etc.
    • All flags were renamed to to flag_XX and included the country name as an alias for easier search.
    • etc etc, it was so long ago I can't even remember what else I put in there. I probably should have been thinking of how to keep this updated but ¯\(ツ)

Do you think it would be possible to:

  1. Switch underscores out with spaces.
  2. Extract the naming of these pre-existing emojis in the pack so that we don't override things people are used to.
  3. Add aliases (already included in gemoji) as tags in the new emoji titles.
  4. As a separate PR, I'll figure out how to remove the : from all of the emoji names (not keywords) so that search starts working again. Long overdue.

Thanks!

@stefanzweifel
Copy link
Contributor Author

Thanks for the fast response.

While working on this PR I discovered that the emoji keywords differed from your original snippet pack. I thought I just give it a try, but totally forgot that it would break the workflow from existing users.

To your points:

  1. Shouldn't be a problem, if you're okay when all underscores are replaced with spaces.
  2. Shouldn't be too hard. I would try to extract all your custom keywords and little additions. When running the build process these custom rules would be re-applied.
  3. No problem. Just to be sure and as an example, the title for 😆 would be:
😆 laughing satisfied - happy haha

Based on this data

  1. I've removed the : from this line of code and Alfred search seems to be working fine again

So 1., 3. and 4. are pretty easy. 2nd point will need some time…

@stefanzweifel
Copy link
Contributor Author

I figured out a way to get the differences between your original Emoji Pack and the new version. I've generated this file which contains a diff of the emojis.

Instead of picking, which old emoji keyword/name we should keep, I would suggest that we just keep all of them. I've added a script which would patch these old emojis in.

This file is now responsible of building the archive.

You can download a patched build here:
Emoji Pack - Patched.alfredsnippets.zip

Let me know if you have further questions.

@califa
Copy link
Owner

califa commented Sep 3, 2018

@stefanzweifel this is amazing work. Is the best way to keep this up to date moving forward just rebuilding locally every time gemoji releases an update?

@stefanzweifel
Copy link
Contributor Author

@califa Yeah I think so.

You could add a service like dependabot to automatically retrieve PRs to be notified if a dependency updates and then create a new build.

@califa califa merged commit b665c14 into califa:master Sep 3, 2018
@califa
Copy link
Owner

califa commented Sep 3, 2018

Great work! I'll update the download link and blog post shortly :)

@stefanzweifel
Copy link
Contributor Author

Don't forget to rebuild the snippets file and push it to the repo. :shipit: ✌️

@califa
Copy link
Owner

califa commented Sep 3, 2018

Running the build will do that right?

@stefanzweifel stefanzweifel deleted the automate-it branch September 3, 2018 17:41
@califa
Copy link
Owner

califa commented Sep 3, 2018

Just to be clear, the patch is what's adding the new emojis?

@stefanzweifel
Copy link
Contributor Author

The patch is for adding the emojis which differ from gemoji. So stuff like :bow: and :hands:.

I'm updating my local fork and push a new PR, to make it a bit more clear ☺️

@stefanzweifel stefanzweifel mentioned this pull request Sep 3, 2018
@stefanzweifel
Copy link
Contributor Author

@califa Here's the PR with the updates file #2. (Ready to be merged, published, downloaded and used)

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