Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

jstasiak
Copy link

@jstasiak jstasiak commented May 24, 2022

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.

Select one of these and delete the others:

If changing an existing definition:

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
@typescript-bot
Copy link
Contributor

typescript-bot commented May 24, 2022

@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 PR

Code Reviews

This PR can be merged once it's reviewed.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Most recent commit is approved by type definition owners or DT maintainers

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"
}

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Untested Change This PR does not touch tests labels May 24, 2022
@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board May 24, 2022
@typescript-bot
Copy link
Contributor

🔔 @nycdotnet @Ky6uk — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label May 24, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board May 24, 2022
@typescript-bot
Copy link
Contributor

@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.

@typescript-bot typescript-bot added Check Config Changes a module config files and removed The CI failed When GH Actions fails labels May 24, 2022
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board May 24, 2022
@typescript-bot typescript-bot added the The CI failed When GH Actions fails label May 24, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board May 24, 2022
@typescript-bot
Copy link
Contributor

@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
Copy link
Author

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label May 25, 2022
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board May 25, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board May 25, 2022
@@ -0,0 +1,3 @@
export * from './';
import Big from '/';
Copy link
Contributor

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.

Copy link
Author

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

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label May 27, 2022
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Needs Author Action in New Pull Request Status Board May 27, 2022
@typescript-bot
Copy link
Contributor

@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!

@typescript-bot typescript-bot removed the Revision needed This PR needs code changes before it can be merged. label May 30, 2022
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board May 30, 2022
@typescript-bot
Copy link
Contributor

@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?

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board May 30, 2022
@amcasey
Copy link
Contributor

amcasey commented May 31, 2022

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?

@amcasey amcasey moved this from Needs Maintainer Review to Waiting for Code Reviews in New Pull Request Status Board May 31, 2022
@jstasiak
Copy link
Author

jstasiak commented Jun 6, 2022

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.

@jstasiak jstasiak closed this Jun 6, 2022
@jstasiak jstasiak deleted the big.js-esm branch June 6, 2022 10:45
@typescript-bot typescript-bot removed this from Waiting for Code Reviews in New Pull Request Status Board Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Check Config Changes a module config files Popular package This PR affects a popular package (as counted by NPM download counts). Untested Change This PR does not touch tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants