sindresorhus / meow

🐈 CLI app helper
MIT License
3.53k stars 150 forks source link

Bundle types in `index.d.ts` #245

Closed tommy-mitchell closed 1 year ago

tommy-mitchell commented 1 year ago

Fixes #244.

Uses rollup-plugin-dts to bundle types and adds another tsd test for the bundled types.

tommy-mitchell commented 1 year ago

I pinned the version of type-fest. In v4.3.0, the build fails due to https://github.com/sindresorhus/type-fest/issues/674.

sindresorhus commented 1 year ago

https://github.com/sindresorhus/type-fest/releases/tag/v4.3.1

tommy-mitchell commented 1 year ago

Resolved.

jaywcjlove commented 12 months ago
image

Could not read type file anymore. @tommy-mitchell @sindresorhus

"typescript": "^5.2.2"
tommy-mitchell commented 12 months ago

@sindresorhus do we need a types field in package.json? Not really sure why NPM isn't resolving it.

jaywcjlove commented 12 months ago

@sindresorhus do we need a types field in package.json? Not really sure why NPM isn't resolving it.

used in a project, the type could not be loaded @tommy-mitchell

sindresorhus commented 12 months ago

This is a problem with your TSConfig, not this package. This package properly exports the types: https://github.com/sindresorhus/meow/blob/1d083266d4c4f3b37da22693cf22235ca7fe9fb5/package.json#L15

See: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm

jaywcjlove commented 12 months ago

@sindresorhus thx!