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 · Fixed by #36
Closed

reduce unused typing package #35

septs opened this issue Aug 10, 2019 · 4 comments · Fixed by #36

Comments

@septs
Copy link
Contributor

septs 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
Copy link
Owner

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

@septs
Copy link
Contributor Author

septs commented Aug 10, 2019

@jeffijoe include global definition cannot be removed

image

@septs
Copy link
Contributor Author

septs commented Aug 10, 2019

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

@septs
Copy link
Contributor Author

septs 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
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.

2 participants