Skip to content

Conversation

@mapleeit
Copy link
Collaborator

@mapleeit mapleeit commented Jun 21, 2019

Migrate TS typings from DefinitelyTyped/DefinitelyTyped here for the convenience of maintaining and usage.

This should fix #427

from DefinitelyTyped/DefinitelyTyped here for the convenience of maintaining and usage
@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.122% when pulling a3c0142 on feat/add-typings into 87751e0 on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.122% when pulling a3c0142 on feat/add-typings into 87751e0 on master.

@mapleeit mapleeit merged commit 0fb2f57 into master Jun 24, 2019
"node": ">= 0.12"
},
"dependencies": {
"@types/node": "^12.0.8",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mapleeit So it's necessary "evil" to have this as prod dependency?

Copy link
Collaborator Author

@mapleeit mapleeit Jun 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think it is...

Otherwise people need to install this by themselves when using types.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When they're using types, they should have it already from TS, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll test this later.

@alexindigo
Copy link
Member

Let's get other chance to review ;)

@mapleeit
Copy link
Collaborator Author

Let's get other chance to review ;)

Sure, my bad.


Hi, @tabeth , do you have time to take a look at this. I'm not sure that is this @types/node dep necessary.

@alexindigo
Copy link
Member

Thanks a lot, your help really appreciated. 🙏

@tabeth
Copy link

tabeth commented Jun 24, 2019

@alexindigo @mapleeit

If we're going to maintain types outside of DefinitelyTyped, then yes, we do have to include @types/node as a dependency. Though personally I think it makes more sense to just open a pull request in DefinitelyTyped than in this repository. If we are going to continue in this way, we should to submit a PR to remove the types from DefinitelyTyped to avoid confusion.

@mapleeit
Copy link
Collaborator Author

To be honest, I'm a little confused about where is the best place to put typings files.

DefinitelyTyped is one option. But I think it may be not the best option for the convenience of usage and maintaining? (I already made a PR to DefinitelyTyped 5 days ago, still no response) And people must install @types/form-data.

I saw axios put typing file in their own repo. So I think it is an option?


I'll make a PR to remove the types from DefinitelyTyped if we decide to store it at here. I could also revert this commit if we decide to not, considering we still not have a new npm version.

@alexindigo
Copy link
Member

alexindigo commented Jun 25, 2019

@mapleeit
Copy link
Collaborator Author

@alexindigo Yes, because the typing file of axios is quite simple. It doesn't use stream and http definition within NodeJS.

https://github.com/form-data/form-data/blob/master/index.d.ts#L6

@alexindigo
Copy link
Member

This is what they have in DefinitelyTyped:

devDep

And this is next.js server, that uses TS and relying on node modules, like http:
https://github.com/zeit/next.js/tree/canary/packages/next-server
– No prod types dependencies.

Also I'm seeing @types/node as devDep in Electron:
https://github.com/electron/electron/blob/master/package.json#L15

Let's try to put it into devDep and see how it works.

@tabeth
Copy link

tabeth commented Jun 25, 2019

@alexindigo @mapleeit

Yeah, it would be better to put them in devDependencies. The types don't compile to usable code anyway, so it wouldn't actually amount to much to make them a regular dependency.

@mapleeit
Copy link
Collaborator Author

Agreed with devDependencies.

@mapleeit
Copy link
Collaborator Author

@tabeth @alexindigo I made a PR to move @types/node, please take a look when you have time : )

Then we may can release a version and I remove the @types/form-data from DefinitelyTyped.

mikeharder added a commit to mikeharder/azure-sdk-for-js that referenced this pull request Jul 15, 2019
- TS typings were moved from @types/form-data to form-data in 2.5.0
  - form-data/form-data#428
- @types/form-data is deprecated as of 2.5.0
  - DefinitelyTyped/DefinitelyTyped#36819
mikeharder added a commit to Azure/azure-sdk-for-js that referenced this pull request Jul 15, 2019
- TS typings were moved from @types/form-data to form-data in 2.5.0
  - form-data/form-data#428
- @types/form-data is deprecated as of 2.5.0
  - DefinitelyTyped/DefinitelyTyped#36819
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.

@types/form-data: Property 'getBuffer' does not exist on type 'FormData'

5 participants