fix(twitter-text): add ESM types#65147
fix(twitter-text): add ESM types#65147reosablo wants to merge 1 commit intoDefinitelyTyped:masterfrom reosablo:twitter-text_add-esm-types
Conversation
|
@reosablo Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. This is a live comment which I will keep updated. 1 package in this PR
Code ReviewsBecause this PR edits the configuration file, it can be merged once it's reviewed by a DT maintainer. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 12 days — please try to get reviewers! Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 65147,
"author": "reosablo",
"headCommitOid": "4c37be51fe8c00f79a496ca85a3fe7778b6d431f",
"mergeBaseOid": "88ab488c7d6c4ff0429a24b5822dd8e9c66a8240",
"lastPushDate": "2023-04-16T06:18:02.000Z",
"lastActivityDate": "2023-04-19T17:49:15.000Z",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Well-liked by everyone",
"pkgInfo": [
{
"name": "twitter-text",
"kind": "edit",
"files": [
{
"path": "types/twitter-text/OTHER_FILES.txt",
"kind": "package-meta",
"suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-other_filestxt)"
},
{
"path": "types/twitter-text/index.d.mts",
"kind": "package-meta",
"suspect": "edited"
},
{
"path": "types/twitter-text/package.json",
"kind": "package-meta",
"suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-packagejson) (check: `exports`)"
}
],
"owners": [
"rhysd"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
}
],
"reviews": [],
"mainBotCommentID": 1510145796,
"ciResult": "pass"
} |
|
🔔 @rhysd — please review this PR in the next few days. Be sure to explicitly select |
|
I referenced these codes to create this PR: |
|
ESM imports and CJS requires of twitter-text actually resolve to the same CJS module. The reason for the difference and the unsoundness in the types is that Node uses syntactic analysis to find The major downside to the workaround you’ve proposed here is it artificially blocks access to all deep imports to It might be possible to iterate on the workaround you have here to mitigate some of the unintended side effects such that it would be technically still lying about the implementation package structure, but observably correct. However, because this is a widespread issue, I don’t think it’s worth it to create workarounds for individual packages. I think we’re better off brainstorming how to fix this problem in general in TypeScript. |
|
Re-ping @rhysd: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
|
I'll close this PR based on the earlier comment. @andrewbranch |
twitter-textpackage seems to have different signatures between CommonJS and ESModules. This PR resolves the difference.Please fill in this template.
npm test <package to test>.Select one of these and delete the others:
If changing an existing definition: