Publish per format type declarations - #1192
Open
manzoorwanijk wants to merge 1 commit into
Open
Conversation
Resolves the `This expression is not callable` errors reported under node16 module resolution (steveukx#1191). - generate `dist/esm/index.d.ts` and `dist/cjs/index.d.ts` from the hand written typings, the CJS entry using `export =` to describe the callable `module.exports` - declare `types` per export condition so ESM consumers no longer resolve CJS declarations - add types for the deprecated `simple-git/promise` entry point - type check the ESM consumer package to cover both node16 conditions
🦋 Changeset detectedLatest commit: f5a2e51 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
manzoorwanijk
marked this pull request as ready for review
August 28, 2026 11:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1191.
Every entry point resolved to the same CommonJS declarations, checked with arethetypeswrong.
Changes
typings/index.d.ts, the CJS one usingexport =to describe the callablemodule.exports.types, so ESM consumers stop resolving CJS declarations.Before:
simple-gitsimple-git/promiseAfter:
simple-gitsimple-git/promiseTesting
Type only tests in test-typescript-esm-consumer cover both node16 conditions and fail with
TS2349: This expression is not callablewithout this change.