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

@types/node is listed as dependency rather than a devDependency #84

Closed
fde31 opened this issue Mar 24, 2021 · 8 comments
Closed

@types/node is listed as dependency rather than a devDependency #84

fde31 opened this issue Mar 24, 2021 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@fde31
Copy link

fde31 commented Mar 24, 2021

Describe the bug
Not necessarily a bug but I noticed that the @types/node package is listed as production dependency, adding additional bloat to the package. Maybe I missed something, but is it necessary or just an oversight?

Expected behavior
I expect xmlbuilder to only still production relevant dependencies when running npm install --production

Version:

  • xmlbuilder2 [2.4.0]

Happy to make a PR for this change but thought I'd check first if there is a specific reason it's not just a devDependency

Thanks

@fde31 fde31 added the bug Something isn't working label Mar 24, 2021
@fde31 fde31 changed the title @types/node is listed as depedency rather than a devDependency @types/node is listed as dependency rather than a devDependency Mar 24, 2021
@campionfellin
Copy link

Any update here? This is a change I'd like to see as well

@oozcitak
Copy link
Owner

oozcitak commented Mar 30, 2021

The reason is that the library exports some node types. For example XMLBuilderCB class is a node EventEmitter. Without @types/node in production dependencies, TypeScript consumers of the package wouldn't see the EventEmitter interface.

Edit: Related #52

@campionfellin
Copy link

Would it be possible to use * as the node version instead of 14.6.2?

@oozcitak
Copy link
Owner

Would it be possible to use * as the node version instead of 14.6.2?

Can you describe why you require this?

@campionfellin
Copy link

We're getting conflicting versions of @types/node that seems to be causing issues on Windows machines: projen/projen#498 . You can see that jest uses * as well:

https://github.com/facebook/jest/blob/36d23f5fa145bbcecd7529fa198fe3e26b5e41e3/packages/jest-console/package.json#L18

I think it may also work if you add it as a peerDependency but I am not entirely sure.

@campionfellin
Copy link

@oozcitak would you be able to release a new version of xmlbuilder2 please? :)

@oozcitak
Copy link
Owner

@campionfellin Can you wait till weekend? I'm on a trip for two days.

@campionfellin
Copy link

Yes, that's great :) Enjoy your trip! 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants