microsoft / microsoft/DefinitelyTyped-tools

Recommend to install with `--save-dev` when types are not part of the external API

Open
#1,211 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
423
Forks
237
Avg merge
18h 18m
Merged PRs (30d)
11

Description

The current generated README shows the install example with --save option:

https://github.com/microsoft/DefinitelyTyped-tools/blob/c1e60ab05f61a35bfcfcd67f663bad76dc06a1c6/packages/publisher/src/generate-packages.ts#L176

Wouldn't it be valuable to instruct users whether to choose --save or --save-dev for types?

For example:

If the types are consumed only within your package, install it with --save-dev option:

npm install --save-dev ...

If your package directly or indirectly exports the types, use the --save option instead of --save-dev.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/publisher/src/generate-packages.ts around line 176, where the generated README install example uses --save. Determine how the generator can distinguish types used only internally from types exported by the package, then regenerate the README and verify that internal types recommend --save-dev while exported types retain --save.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.