Description
Moving from v2.0.2 → v2.0.3 is a breaking change. In my own application the code below...
import type caporal from '@caporal/core';
... now throws this error:
(rpt2 plugin) Error: $PROJECT/packages/cli/src/session.ts(29,34): semantic error TS2503: Cannot find namespace 'caporal'.
That error can be fixed by doing import type * as caporal ...
instead, but a number of other issues remain, related to the fact that Caporal is now being imported as ESM rather than CJS. The specifics here would depend on a user's build system, and also module resolution settings in TypeScript (if applicable).
I believe the issue is caused by introduction of the package.json#exports
field. While it is technically possible to introduce that field without a breaking change, it is very difficult in practice. It's considered best practice to only add the exports
field in a major release.
Perhaps it would be possible to publish v2.0.7 as a duplicate of v2.0.2, and leave the breaking changes for v3?