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

Add type definitions badge #286

Merged
merged 3 commits into from
Sep 18, 2018
Merged

Add type definitions badge #286

merged 3 commits into from
Sep 18, 2018

Conversation

paulmelnikow
Copy link
Contributor

Hi @sindresorhus! I added this badge to Shields at your suggestion badges/shields#1252, and though I'd see if you'd like to include it here!

@sindresorhus
Copy link
Member

sindresorhus commented Jul 28, 2018

Is there any way to get the badge without the version numbers? The badge is very long and I don't see much value in having those version numbers.

@paulmelnikow
Copy link
Contributor Author

It is really long.

The reason I had included the version numbers was to help developers distinguish between well maintained libraries, whose defs are being kept up to date, and libraries which aren't. It seems like the version number is useful for that. That said, I'm relatively new to TypeScript and Flow so I appreciate your perspective on this!

Further thoughts?

@sindresorhus
Copy link
Member

The reason I had included the version numbers was to help developers distinguish between well maintained libraries, whose defs are being kept up to date, and libraries which aren't. It seems like the version number is useful for that.

What if my library is mature and stable and doesn't need updates? Many packages don't even have TS or Flow as development dependencies.


I would go for number 2.

@paulmelnikow
Copy link
Contributor Author

I see. Thanks. 👍

Could I ask a couple other questions?

For packages that don’t declare the dependencies, is there a better way to infer their type support?

Is it possible that a future breaking change to the language would require definitions to be updated, even if the library is mature?

@sindresorhus
Copy link
Member

For packages that don’t declare the dependencies, is there a better way to infer their type support?

For TS, you could look for a index.d.ts file in root or a types field in package.json.

For Flow, you could look for a index.js.flow file in root or a flow-typed directory in root.

Is it possible that a future breaking change to the language would require definitions to be updated, even if the library is mature?

Yes, but I don't think a version is a good enough indicator of that. TS might break a library in a minor release or never. It really depends on what features you use and how. For simple node modules, it's unlikely new versions will break much.

@paulmelnikow
Copy link
Contributor Author

Great. Thanks so much for the feedback. Give me a few days and I will make some updates to the badge.

paulmelnikow added a commit to badges/shields that referenced this pull request Aug 19, 2018
@sindresorhus
Copy link
Member

@paulmelnikow Can this be finished now?

@Qix-
Copy link
Member

Qix- commented Sep 18, 2018

Late to the game but 2 was the choice I would have made as well.

Just for some validation 💃

@Qix-
Copy link
Member

Qix- commented Sep 18, 2018

Resolved the conflicts (will need a squash merge). Only issue I see, which is super nit-picky, is a wrap of a single badge:

image

@sindresorhus
Copy link
Member

We can drop the Awesome badge.

@sindresorhus sindresorhus merged commit b9c95db into chalk:master Sep 18, 2018
@Qix-
Copy link
Member

Qix- commented Sep 18, 2018

SGTM, thanks @sindresorhus and @paulmelnikow!

@paulmelnikow
Copy link
Contributor Author

Ah yep! Thanks for merging this!

@paulmelnikow paulmelnikow deleted the typedef-badge branch September 18, 2018 20:39
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 this pull request may close these issues.

None yet

3 participants