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

Made typings plugin friendly & add typings for every package #770

Merged
merged 24 commits into from
Sep 7, 2019
Merged

Made typings plugin friendly & add typings for every package #770

merged 24 commits into from
Sep 7, 2019

Conversation

crutchcorn
Copy link
Member

@crutchcorn crutchcorn commented Aug 6, 2019

What's Changing and Why

Previously, there was a single index.d.ts file in jimp. However, if you wanted to use any of the @jimp files, you were unable to get the typings for them individually.

This meant a few things:

  • You couldn't get typing info if you were using @jimp/custom
  • The definition files were often in different places from their logic, making maintaining them much harder

The second point was made even clearer as this went on as there were a few plugins that had no type information previously (thusly making the jimp package type info incomplete). As a result, the following plugins now have typings on the jimp package that were previously not present:

  • Circle
  • Fisheye
  • Shadow
  • Threshold

What else might be affected

This will likely be a breaking change for jimp (unless we want to export the same typings as before using export * from '@jimp/core or something similar)

Tasks

  • Add tests
  • Update Documentation
  • Update jimp.d.ts
  • Add SemVer Label

Published PR with canary version: 0.7.1-canary.770.193.0

@crutchcorn crutchcorn changed the title Made typings plugin friends & add typings for every package Made typings plugin friendly & add typings for every package Aug 7, 2019
@hipstersmoothie
Copy link
Collaborator

@crutchcorn please rebase so the CI runs

@crutchcorn
Copy link
Member Author

@hipstersmoothie done

@crutchcorn
Copy link
Member Author

Wanted to check on the status of this. Seems that tests have passed

@hipstersmoothie
Copy link
Collaborator

@crutchcorn sorry! I'm the only maintainer on this and really don't use jimp at all in my work. So I'm a little slow at getting to the issues. I haven't had time to take a proper look at this, but I'll look at it tomorrow

@crutchcorn
Copy link
Member Author

No worrier in the slightest. I know how maintaining something like this that we don't use ourselves goes. Just wanted to give a small bump cuz I know I need reminders on the one I maintain 😁

@hipstersmoothie
Copy link
Collaborator

Really liking what I'm seeing though.

I'd prefer to make the change as breakingless as possible. Would that be easy?

@crutchcorn
Copy link
Member Author

crutchcorn commented Sep 1, 2019

Actually, if I did this properly this is not a breaking change in terms of the main Jimp typings. If you'd like, I can export the same other typings (ala the font options, etc) and then it will be 100% non-breaking change

Would be an extremely trivial task, could take care of it tonight

@hipstersmoothie
Copy link
Collaborator

hipstersmoothie commented Sep 1, 2019 via email

@crutchcorn
Copy link
Member Author

crutchcorn commented Sep 1, 2019

Actually, you know what? I was just about to make that "fix", but then realized that none of the other types in that file were actually exported as of the current-most up-to-date version of said file (per commit 466b65b), so this PR in it's current state is already not a breaking change.

@Pocky9744
Copy link

Pocky9744 commented Sep 1, 2019

how can i convert .jpg to .png temporarily?
i want to convert .jpg image before color picking.
because .jpg's color picking is not exact.

@crutchcorn
Copy link
Member Author

Mmm, apologies. I'm going to reject my own PR until I can fix some issues with it. I'll try to have them fixed in the next day or two. Huge apologies for bumping when things aren't fully working >~<

Move typing files to proper locations, included typing file in package.json files, fix the configure function typings
@crutchcorn
Copy link
Member Author

So sorry once again for bumping before being ready.

I have now double and tripple checked that this should work in my own project which uses the configure function. I have also checked that the original jimp package exports the same things in it's typings now. This PR should be GTG and does not introduce any breaking changes

@hipstersmoothie hipstersmoothie added the patch Increment the patch version when merged label Sep 3, 2019
@crutchcorn
Copy link
Member Author

Actually, while this can totally be a patch for jimp, I might suggest making it a minor bump as it technically introduces the feature of typings to all of the non jimp mainline package

# Conflicts:
#	packages/jimp/jimp.d.ts
@crutchcorn
Copy link
Member Author

Merge conflicts resolved, scanIterator added to the @jimp/core package (and as a result the jimp typings)

Still not a breaking change :)

@hipstersmoothie hipstersmoothie added minor Increment the minor version when merged and removed patch Increment the patch version when merged labels Sep 7, 2019
@hipstersmoothie hipstersmoothie merged commit c1a59d6 into jimp-dev:master Sep 7, 2019
@hipstersmoothie
Copy link
Collaborator

🚀 PR was released in v0.8.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants