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

fix: Return Value type of WebTorrent client.get() #69619

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TechQuery
Copy link

Please fill in this template.

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an npm package, match the name. If not, do not conflict with the name of an npm package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

If removing a declaration:

  • If a package was never on Definitely Typed, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

@typescript-bot
Copy link
Contributor

typescript-bot commented May 15, 2024

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

Inactive

This PR has been inactive for 17 days — please try to get reviewers!


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 69619,
  "author": "TechQuery",
  "headCommitOid": "c6b4b7b7d1f4697c54284be70dd1087c1a1ac120",
  "mergeBaseOid": "bfdcd1c2bad2ed372ebf698103824f4171e5e972",
  "lastPushDate": "2024-05-15T18:07:31.000Z",
  "lastActivityDate": "2024-05-28T19:46:06.000Z",
  "maintainerBlessed": "Waiting for Code Reviews",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "webtorrent",
      "kind": "edit",
      "files": [
        {
          "path": "types/webtorrent/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "niieani",
        "tlaziuk",
        "gjuchault",
        "cheeseandcereal"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 2113147370,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added the Untested Change This PR does not touch tests label May 15, 2024
@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board May 15, 2024
@typescript-bot
Copy link
Contributor

Hey @TechQuery,

😒 Your PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Please consider adding tests to cover the change you're making. Including tests allows this PR to be merged by yourself and the owners of this module.

This can potentially save days of time for you!

@typescript-bot
Copy link
Contributor

🔔 @niieani @tlaziuk @gjuchault @cheeseandcereal — 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 moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board May 15, 2024
@TechQuery
Copy link
Author

I find that @types/webtorrent's version is at 0.109.x, which is an old version published at 4 years old: https://github.com/webtorrent/webtorrent/tree/v0.109.2

But the latest webtorrent is published at about 1 month ago: https://github.com/webtorrent/webtorrent/releases/tag/v2.2.1

When I use dts-gen to generate .d.ts, I failed with no ESM support:

$ dts-gen -m webtorrent
Unexpected crash! Please log a bug with the commandline you specified.
/home/gitpod/.pnpm/global/5/.pnpm/dts-gen@0.10.2/node_modules/dts-gen/dist/run.js:84
        result = guess.generateModuleDeclarationFile(args.module, require(args.module));
                                                                  ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/gitpod/.pnpm/global/5/.pnpm/webtorrent@2.2.1/node_modules/webtorrent/index.js from /home/gitpod/.pnpm/global/5/.pnpm/dts-gen@0.10.2/node_modules/dts-gen/dist/run.js not supported.
Instead change the require of index.js in /home/gitpod/.pnpm/global/5/.pnpm/dts-gen@0.10.2/node_modules/dts-gen/dist/run.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/gitpod/.pnpm/global/5/.pnpm/dts-gen@0.10.2/node_modules/dts-gen/dist/run.js:84:67) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v20.13.1

@typescript-bot typescript-bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label May 26, 2024
@typescript-bot
Copy link
Contributor

Re-ping @niieani, @tlaziuk, @gjuchault, @cheeseandcereal:

This PR has been out for over a week, yet I haven't seen any reviews.

Could someone please give it some attention? Thanks!

@sheetalkamat sheetalkamat moved this from Needs Maintainer Review to Waiting for Code Reviews in New Pull Request Status Board May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. Untested Change This PR does not touch tests
Projects
New Pull Request Status Board
Waiting for Code Reviews
Development

Successfully merging this pull request may close these issues.

None yet

2 participants