-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: introduce typings #113
Conversation
Please feel free to make suggestions, changes and questions 🙋🏻♂️ There are some interesting improvements such as defining types dynamically (for final user), but I've chosen to keep this PR as objective as possible. |
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.
My understanding is that the types ought to be able to be committed to the repo as a single index.d.ts without any changes to the dependencies, build, etc. That would be my preference.
@searls, thanks for the clarification. I've removed all external changes to A change in package.json has been made to ensure that both editors, CommonJS and ES Modules imports retrieve the same type definitions (also for compatibility): + "types": "./index.d.ts",
"exports": {
".": {
"require": "./lib/quibble.js",
"import": "./lib/quibble.mjs",
+ "types": "./index.d.ts"
},
"./package.json": "./package.json"
}, Could you review it again? |
Thanks! If there's an issue with these, I'm sure we'll hear about it |
I'm watching the repository for issues and PRs. If something new comes up, I can help if necessary 🙋🏻♂️ |
@searls Can we please have a release since this was merged? |
Closes #107.
This PR introduces typings (
.d.ts
files) to quibble.I opted for an easier way to generate the types, which is to change all the extensions to
.ts
and then generate the compilation. This gives me all the declaration types asany
.Then I undo the changes and start working on each
type
properly.Notes
I've added a test that compiles the typings, but it's important to note that this test doesn't reflect in the main code.This test is designed to ensure that no compilation breaks for final users due to quibble typings.any
for external parameters that are outside the quibble's control, so users can freely define their own mocks types (or not).Two development dependencies have been added in order to perform the tests:@types/nodetypescript