-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle a workaround big.js ESM import #60496
Conversation
Big.js can't be imported as-is in ESM mode[1] but there's a workaround: it can be imported as 'big.js/big.mjs'. The unfortunate downside of this is the lack of type coverage, which this patch aims to rectify. [1] MikeMcl/big.js#170
@jstasiak 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 PRCode ReviewsThis PR can be merged once it's reviewed. 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. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 60496,
"author": "jstasiak",
"headCommitOid": "46e0e95b152c1091d62cc6c10f58059617f29254",
"mergeBaseOid": "c432b1015151bc90947ea2ac3b1a50a86734ad0b",
"lastPushDate": "2022-05-30T08:15:13.000Z",
"lastActivityDate": "2022-05-31T16:37:24.000Z",
"maintainerBlessed": "Waiting for Code Reviews",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Popular",
"pkgInfo": [
{
"name": "big.js",
"kind": "edit",
"files": [
{
"path": "types/big.js/OTHER_FILES.txt",
"kind": "package-meta",
"suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-other_filestxt)"
},
{
"path": "types/big.js/big.mjs.d.ts",
"kind": "definition"
}
],
"owners": [
"nycdotnet",
"Ky6uk"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
}
],
"reviews": [
{
"type": "stale",
"reviewer": "amcasey",
"date": "2022-05-27T18:01:02.000Z",
"abbrOid": "0f9329b"
}
],
"mainBotCommentID": 1135820584,
"ciResult": "pass"
} |
🔔 @nycdotnet @Ky6uk — please review this PR in the next few days. Be sure to explicitly select |
@jstasiak The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review. |
@jstasiak The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review. |
CI failed for unrelated reason, errors present in the |
types/big.js/big.mjs.d.ts
Outdated
@@ -0,0 +1,3 @@ | |||
export * from './'; | |||
import Big from '/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo? It's unusual to import from an absolute path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right, fixed
@jstasiak One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you! |
@amcasey Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
To be honest, this seems like a bit of a hack. Having said that, it's modelling a hack in the underlying library, so it's probably okay? Thoughts, @nycdotnet @Ky6uk? |
For what it's worth big.js 6.2.0 has been released and it can be imported in ESM code just fine now so I'll close this PR. |
Big.js can't be imported as-is in ESM mode[1] but there's a workaround:
it can be imported as 'big.js/big.mjs'. The unfortunate downside of this
is the lack of type coverage, which this patch aims to rectify.
[1] MikeMcl/big.js#170
Please fill in this template.
npm test <package to test>
.Select one of these and delete the others:
If changing an existing definition: