package.json exports should have priority over typesVersions#50890
Conversation
weswigham
left a comment
There was a problem hiding this comment.
Maybe a types@>=4 condition or the like would be useful as a test alongside the typesVersions object, too, if you're up for adding another test case.
|
This probably needs a big call out in the docs in the |
|
How's this for the release notes?
|
|
q: shouldn't the presented diff only add the |
|
The presence of |
Is how you should shape that export object, to accommodate types for a |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [typescript](https://www.typescriptlang.org/) ([source](https://github.com/Microsoft/TypeScript)) | devDependencies | minor | [`4.8.4` -> `4.9.4`](https://renovatebot.com/diffs/npm/typescript/4.8.4/4.9.4) | --- ### Release Notes <details> <summary>Microsoft/TypeScript</summary> ### [`v4.9.4`](https://github.com/microsoft/TypeScript/releases/tag/v4.9.4): TypeScript 4.9.4 [Compare Source](https://github.com/Microsoft/TypeScript/compare/v4.9.3...v4.9.4) For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9). For the complete list of fixed issues, check out the - [fixed issues query for Typescript v4.9.4](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.9.4%22+is%3Aclosed+). Downloads are available on: - [npm](https://www.npmjs.com/package/typescript) - [NuGet package](https://app
package.json
exportsis a superset of the features supported bytypesVersions, but currentlytypesVersionsis consulted first. This prevents TypeScript from recognizing theexportsfor a path that also matches atypesVersionspath, which is a big problem if the package wants to use conditional exports that benefit--moduleResolution nodenextandtypesVersionsfor--moduleResolution node. As far as I can tell, this was just an oversight, as no existing tests broke when I changed the order.Thanks to @fictitious for noticing at andrewbranch/example-subpath-exports-ts-compat#1