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

reduce unused typing package #35

Closed
septs opened this issue Aug 10, 2019 · 4 comments

Comments

@septs
Copy link
Contributor

commented Aug 10, 2019

# install package
npm install history

# sync typing
typesync

# uninstall package
npm uninstall history

# re-sync typing
typesync # should need to remove @types/history
  1. the issue can use m(modules) field for check in search-index-min.json.
  2. package with g(globals) field have side effects
    e.q: @types/jquery only use typing

search-index-min.json structure definition:
https://github.com/microsoft/types-publisher/blob/467eb14e3fe0204aa0f5e06549271fa4bea457e1/src/create-search-index.ts#L21-L34

@jeffijoe

This comment has been minimized.

Copy link
Owner

commented Aug 10, 2019

Doing this would automatically uninstall ambient typings like @types/node which is undesirable.

@septs

This comment has been minimized.

Copy link
Contributor Author

commented Aug 10, 2019

@jeffijoe include global definition cannot be removed

image

@septs

This comment has been minimized.

Copy link
Contributor Author

commented Aug 10, 2019

This idea can only be processed without a global definition because he has no side effects.

@septs

This comment has been minimized.

Copy link
Contributor Author

commented Aug 10, 2019

➜  Downloads # no side-effects libraries
➜  Downloads cat search-index-min.json | jq '(.[].g | length) == 0' | grep 'true' | wc -l
    4880
➜  Downloads # side-effects libraries
➜  Downloads cat search-index-min.json | jq '(.[].g | length) > 0' | grep 'true' | wc -l
    1166

jeffijoe added a commit that referenced this issue Aug 11, 2019

feat: remove unused typings + ignoredeps option
Adds support for an `--ignoredeps=` flag
Automatically remove unused typings

Closes #30, closes #35

@jeffijoe jeffijoe closed this in #36 Aug 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.