skypackjs / skypack-cdn

An issue tracker for the CDN
107 stars 5 forks source link

Not detecting implicit `index.d.ts` #84

Open sindresorhus opened 3 years ago

sindresorhus commented 3 years ago

For example, on https://www.skypack.dev/view/ky, it says the package does not have types, but it does. It's just that it doesn't have a types field in package.json because that's optional in this case:

Also note that if your main declaration file is named index.d.ts and lives at the root of the package (next to index.js) you do not need to mark the "types" property, though it is advisable to do so. - https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

drwpow commented 3 years ago

Hello! Yes, Skypack does require the "types" or "typings" field currently, even though TypeScript does allow for an automatically-detected index.d.ts definition file in the root.

We are working on supporting this, but currently it’s a limitation of our registry data. We currently don’t have access to a package’s complete file system as we’re indexing npm packages. All we have to make that score is what’s available in package.json, which is why we look for "types" but not index.d.ts.

We’ll add support for this soon! Sorry for any inconvenience.