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

Update readme.md to include a note about dev mode install #851

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions readme.md
Expand Up @@ -75,6 +75,13 @@ PR welcome for additional commonly needed types and docs improvements. Read the
npm install type-fest
```

<p>Or, for projects that do not export these or dependent types, install as a dev only dependency with: </p>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not entirely accurate. The types don't need to be exported for it to need to be a dependency, and not dev dependency. Even if the types are used internally in a index.d.ts file (and not exported), type-fest needs to a dependency. Basically, if types included in a package use types from type-fest, type-fest needs to be a dependency.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless one explicitly add an ignore to the imports, then they become optional imports, see eg this helper of mine: https://github.com/voxpelli/ts-ignore-import


```sh
npm install type-fest --save-dev
```


*Requires TypeScript >=5.1*

*Works best with [`{strict: true}`](https://www.typescriptlang.org/tsconfig#strict) in your tsconfig.*
Expand Down