-
Notifications
You must be signed in to change notification settings - Fork 110
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
[PR] Overall Typescript refactor #277
Conversation
In-progress of typing out the function parameters.
After getting through this method, the rest should be fairly simple.
Typing mock future. This can pass over to the rest of the functions.
@LuchoTurtle thanks very much for opening this PR as we discussed. 👌 |
Great work, happy to help if time permits and where needed. Seeing as there are some hiccups with the current typings (specifically concerning nested services etc.) don't be too worried about reusing those. The tests should indeed be a good safety net to avoid regression. |
@thomaux thank you, sir! I was guided by your awesome type definitions. I try to reuse as much as possible but I gotta admit I'm stumped on some aspects, especially when I constantly get Again, I'm new to this level of TS generics, so I'm just trying to learn. But thank you for the feedback, I'll take that into account 😄 |
Relevant reading: https://blog.liblab.com/typescript-npm-packages-done-right/ 👀 |
@LuchoTurtle remind me why this was paused? ⏸️ 💭 ⏳ |
@nelsonic I was only meant to work on this whenever I "had the time" or "didn't have any outstanding issues to work at", which really hasn't happened since. |
Added the changes on the index.js to coincide with the ones on TS. All JS tests should STILL work, to avoid regressions.
@LuchoTurtle Thanks for pairing on this during the morning today. 🧑💻 👌 |
Without a doubt. Because of the combination of the dependencies being updated and how the code is being transpiled from TS to JS, support only works for Node |
Ok, cool. Do you want to publish the new version? 📦 |
I feel like you should be the one to do it, I don't want to mess anything up since it's a package that is highly used :p |
# Conflicts: # package-lock.json # package.json
I'm not sure how I'd go about it. Wouldn't this need to be merged first for me to create a new version of the package in |
Nah, you can create & publish a new version on a branch. 📦 🚀 Simply run: npm version major -m 'Typescript Refactor. see: https://github.com/dwyl/aws-sdk-mock/pull/277"
npm publish
git push && git push --tags Will merge as soon as you publish. |
# Conflicts: # package-lock.json
I'm intent on publishing this later. I'm at the airport right now and I've fast-forwarded this branch to the |
Do it. I'm here and check GitHub regularly for messages. Not many people will "upgrade" that quickly. |
Okay, doing it now (after updating |
# Conflicts: # package-lock.json
…-mock into typescript-refactor
@nelsonic https://www.npmjs.com/package/aws-sdk-mock version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @LuchoTurtle 🎉
Thanks for publishing the new version to NPM. 📦 🚀
Merging.
Seeing that @thomaux already did an awesome job with implementing type definitions, I wanted to learn more about generics in Typescript so I'm attempting to rewrite the main
index.js
file in Typescript so it's friendlier for everyone 😄 .This is very much a work in progress, as I'm trying to use the pre-existing type definitions in the current package. There's much to be done but I guess this is a start. I'm running every modification against tests so functions that are typed so far should remain functional.
Some tasks:
index.js
->index.ts
)ts
.If anyone would like to chime in and give some feedback, that would be lovely!