Skip to content

index.d.ts is not published with NPM package #490

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

Closed
peterblazejewicz opened this issue May 28, 2021 · 6 comments
Closed

index.d.ts is not published with NPM package #490

peterblazejewicz opened this issue May 28, 2021 · 6 comments
Labels

Comments

@peterblazejewicz
Copy link

Describe the bug

The index.d.ts is not part of NPM distribution and it not listed in the package.json.
For this reason is serves no purpose at the moment I'm afraid.

Added here: #399

npm pack twemoji
npm notice
npm notice package: [email protected]
npm notice === Tarball Contents ===
npm notice 0      package
npm notice 1.1kB  LICENSE
npm notice 18.5kB LICENSE-GRAPHICS
npm notice 11.4kB README.md
npm notice 0      dist
npm notice 1.1kB  package.json
npm notice 33.0kB dist/twemoji.amd.js
npm notice 17.0kB dist/twemoji.esm.js
npm notice 32.0kB dist/twemoji.js
npm notice 17.0kB dist/twemoji.min.js
npm notice 32.1kB dist/twemoji.npm.js
npm notice === Tarball Details ===
npm notice name:          twemoji
npm notice version:       13.1.0
npm notice filename:      twemoji-13.1.0.tgz
npm notice package size:  32.7 kB
npm notice unpacked size: 163.3 kB
npm notice shasum:        65bb71e966dae56f0d42c30176f04cbdae109913
npm notice integrity:     sha512-e3fZRl2S9UQQd[...]rJraOXrWw/4Ew==
npm notice total files:   11
npm notice
twemoji-13.1.0.tgz

Thanks!

/cc @goooseman

goooseman added a commit to goooseman/twemoji that referenced this issue May 30, 2021
@goooseman
Copy link
Contributor

@peterblazejewicz Hi! You are completely right, I did not mention, that the project uses package.json/files and that the file is blacklisted from the package distribution.
Created #491 to resolve this issue.

@jdecked
Copy link
Contributor

jdecked commented Jun 1, 2021

Hey @goooseman @peterblazejewicz, should these types live in DefinitelyTyped instead? Would that be where you expect to find them given that this isn't a TS project? I don't use TS, but the TS publishing docs seem to indicate that we shouldn't publish the types with this package but submit them to DefinitelyTyped:

If your types are generated by your source code, publish the types with your source code. [...] Otherwise, we recommend submitting the types to DefinitelyTyped, which will publish them to the @types organization on npm.

@goooseman
Copy link
Contributor

From my personal experience supporting the type definitions is much easier when done from the original repository.

I support some of the type definitions in the DefinetelyTyped, but it usually takes too much time to update an existing type definition there.

@goooseman
Copy link
Contributor

And from the consumer perspective providing those definitions with the package itself is much more convenient

@peterblazejewicz
Copy link
Author

@jdecked thx for asking for opinion. @goooseman knows this project better, so pleasetake his advice.
I'd only say, nowadays, .d.ts are serving native JavaScript, same way as in TS only era. So project gets all the same benefits, like when being actually written in TS, say in VSCode or other IDEs. There are pros and cons of hosting your own types within project, so you folks should give it a review (imo the TS handbook is just an best 80%-working techy advise, cannot be taken literally).

@jdecked
Copy link
Contributor

jdecked commented Jun 8, 2021

Thanks for your feedback folks; we'll keep the types in here for now then. :-) This has been fixed via #491, thanks @goooseman!

@jdecked jdecked closed this as completed Jun 8, 2021
@jdecked jdecked added the bug label Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants