jeffijoe / typesync

Install missing TypeScript typings for dependencies in your package.json.
MIT License
1.51k stars 21 forks source link

Display directory name in CLI output if `package.name` is absent #26

Closed niklashigi closed 5 years ago

niklashigi commented 5 years ago

First of all, great job on this package! It helps a lot with installing dependencies in TypeScript projects and the CLI output is really pretty.

However, I've found one small problem which is that when you don't specify a name in your project's package.json, the CLI output shows undefined: If you're wondering why anyone would not specify a package name: It's simply redundant for "top-level packages" like back- or front-end codebases since they are not meant to be used as package dependencies.

My PR makes the package name fall back to the directory name which is helpful enough in most cases:

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 89b2562fc78133f4eda1824f5cd76fb20622952f on shroudedcode:package-name-fallback into 3952f8eb6345f28f8210249ce21f96181cd6fce7 on jeffijoe:master.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 89b2562fc78133f4eda1824f5cd76fb20622952f on shroudedcode:package-name-fallback into 3952f8eb6345f28f8210249ce21f96181cd6fce7 on jeffijoe:master.

jeffijoe commented 5 years ago

Good catch! Thanks for the PR!

I hope to have some time next week, I’ll release this with the other changes if I can get them done. 😀