-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add TypeScript typings for SemanticReleaseError #92
base: master
Are you sure you want to change the base?
Conversation
Can you provide some context? There is no description in your PR... |
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.
Need to add typings
to the package.json
so tsc
can actually find these.
I've been insanely busy, so haven't circled around on this yet. These typings look sensible. |
btw, @mattyclarkson is there a way to put all the typing in the same file in the main repo? Or is it necessary/better to have the typing for the error in this repo? |
Sorry, I didn't realise this PR had been created, I'll fix this up soon. |
message default to `""` when `new Error()` is provided no message
@mattyclarkson This should be ready, I hope I didn't miss anything. |
Possibly, but it would probably require extra configuration of the TypeScript compiler options. The standard way is to either keep the typings next to the code and specify the I would say this it the most ergonomic way to do the typings; they are near the corresponding JavaScript code so can easily be updated and do not require any extra packages to be installed when using the package in a TypeScript project. |
@mattyclarkson You could create a package, say To which either you require the developer to install that library, or each of your libraries target the typings library with the typings property, and include the typings library as optional peer dependency in NPM. |
@pathurs yup you could do that. If we're planning to have the typings separate to the JavaScript project it might make more sense to just submit them to |
@mattyclarkson I dislike DefinitelyTyped because it's harder for impulse volunteers to improve or include additions, however, it is definitely the preferred way. |
@pathurs I also dislike DefinitelyTyped and separate typing packages. I find that they get out of sync and confusing for beginners to submit changes. I find that packages that have typings included in the project usually have a better quality experience. |
@pvdlg this is good to go when you have time to swing by. |
Ok, let's wait for the PR in the main semantic-release package to merge this one. |
@pvdlg Any news on this? TypeScript is throwing errors for not finding the type definitions |
@pvdlg Which PR do you mean? |
One that does't exists yet. No point in merging this PR until we have type in the core of semantic-release. |
Any news on merging this PR? I don't see a reason to wait for the main semantic-release repo to have typings (they are avilable via DefinitelyTyped) since this package is separated. |
Add TypeScript typings for the class
SemanticReleaseError
.This will allow TypeScript developers to import the Error with proper typings and intellisense.
Child of semantic-release/semantic-release#952
Connected to semantic-release/semantic-release#952