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

No install @types packages of devDependencies (Like the flow-typed --ignoredeps-deps dev) #30

Closed
arx-8 opened this issue Jul 11, 2019 · 8 comments · Fixed by #36
Closed

Comments

@arx-8
Copy link

arx-8 commented Jul 11, 2019

Thank you for this very useful tool!

Can I NOT install devDependencies's @types/* ?
Like the flow-typed --ignoredeps-deps dev.
https://github.com/flow-typed/flow-typed/tree/72d88e1dffd146f2f6fc1424bd7c9d991632cd3f#flow-typed-install-package-specification---ignoredeps-deps

For example

I don't want to install these.

  "devDependencies": {
    "eslint-config-prettier": "6.0.0",
    "prettier": "1.18.2"
  },

Reasons

  • I don't want to increase the number of managed packages.
  • Packages of devDependencies are not used in product code.
    • Because those @types/* are unnecessary.
  • (Maybe a little) These increase npm install time.
@jeffijoe
Copy link
Owner

I thought about this earlier but I have a lot of dev deps for testing where I do want the typings, so I didn't add it.

An ignore flag would make sense, but why on earth is theirs called --ignoredeps-deps? Why "deps-deps"? That makes no sense to me.

@arx-8
Copy link
Author

arx-8 commented Jul 13, 2019

I understand.
Thank you for your explanations.

@arx-8 arx-8 closed this as completed Jul 13, 2019
@jeffijoe
Copy link
Owner

I’m not ruling it out 😀

If you still think it’ll be useful, it can happen. But can you explain to me why they call it ignoredeps-deps?

@mubaidr
Copy link

mubaidr commented Jul 13, 2019

Came to discuss this too. The reasons provided by OP are good enough.

  • A new option/parameter can be introduced as -dep with options:
value description
prod production dependencies
dev development dependencies
peer peer dependencies
optional optional dependencies
  • By default ignore types for devDependencies?

  • Similarly an option could be introduced to install after syncing, e.g. -install

@jeffijoe
Copy link
Owner

I think the default should remain to install typings for all dependencies. We've had the inverse problem of missing dependency sections before. The added installation time is negligible as typings packages have no deps, and in a production build they would be excluded anyway.

I'm not opposed to adding a flag to ignore certain sections. If we do this, it would be using an --ignore-style switch, but I want to know why Flow chose the name they did (--ignoredeps-deps, why the double deps? What's the meaning of it?)

I'm not going to add an install switch, because adding complexity in terms of figuring out which package manager to invoke, then invoking it and redirecting IO is is simply not worth it when you can simply do typesync && yarn or typesync && npm i. If you really want to, you can create an alias in your favorite shell. 😄

@mubaidr
Copy link

mubaidr commented Jul 13, 2019

I think this flag is like:

--ignoredeps deps ignore dependencies, prod dependencies
--ignoredeps devdeps ignore dependencies, dev dependcies

i.e. ignoredeps is short for ignore dependencies and value shows which type (prod, dev, peer etc) of dependencies to ignore

@jeffijoe
Copy link
Owner

Gotcha! I'm a bit swamped right now so not sure when I'll get to it.

@jeffijoe jeffijoe reopened this Jul 13, 2019
@arx-8
Copy link
Author

arx-8 commented Jul 14, 2019

--ignoredeps-deps is just an example.
It does not mean that I want this OPTION name.

I think @mubaidr's (--ignoredeps) idea is a good!

the default should remain to install typings for all dependencies.

I agree.

jeffijoe added a commit that referenced this issue Aug 11, 2019
Adds support for an `--ignoredeps=` flag
Automatically remove unused typings

Closes #30, closes #35
This issue was closed.
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 a pull request may close this issue.

3 participants