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

[@types/node] add findPackageJSON to node:module #71595

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

JakobJingleheimer
Copy link
Contributor

@JakobJingleheimer JakobJingleheimer commented Jan 7, 2025

This utility was introduced in v23.2.0, and will be released to the 22 line in v22.14.0. I don't know how to convey that in this package (that's usually controlled by different branches, like a v23 branch and a v22, but that isn't the case here, probably because it's a monorepo).

It also raises a common issue with @types/node: wherever you see string, it does not accept any string, it accepts specific kinds of strings. The actual type def would look more like:

type FileURLString = `file://${string}`;
type RelativeFSPath = `.${sep}${string}`;
type AbsoluteFSPath = `${sep}${string}`; // Probably more complicated because of Windows

static findPackageJSON(
  specifier: FileURLString | RelativeFSPath | AbsoluteFSPath | URL,
  base?: FileURLString | RelativeFSPath | AbsoluteFSPath | URL,
): AbsoluteFSPath | undefined

Please fill in this template.

If changing an existing definition:

This utility was introduced in v23.2.0, and will be released to the 22 line in v22.14.0.
@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 7, 2025

@JakobJingleheimer Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

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

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Only a DT maintainer can approve changes without tests

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 71595,
  "author": "JakobJingleheimer",
  "headCommitOid": "5f28c559f10033a36e566b5643c2e56dc8de4557",
  "mergeBaseOid": "9747f450dc49e139cb45f0c89ce11623c90252f4",
  "lastPushDate": "2025-01-07T19:59:36.000Z",
  "lastActivityDate": "2025-02-13T21:46:09.000Z",
  "mergeOfferDate": "2025-02-13T21:43:45.000Z",
  "mergeRequestDate": "2025-02-13T21:46:09.000Z",
  "mergeRequestUser": "JakobJingleheimer",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "node",
      "kind": "edit",
      "files": [
        {
          "path": "types/node/module.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "Microsoft",
        "jkomyno",
        "alvis",
        "r3nya",
        "btoueg",
        "smac89",
        "touffy",
        "DeividasBakanas",
        "eyqs",
        "Hannes-Magnusson-CK",
        "hoo29",
        "kjin",
        "ajafff",
        "islishude",
        "mwiktorczyk",
        "mohsen1",
        "galkin",
        "parambirs",
        "eps1lon",
        "ThomasdenH",
        "WilcoBakker",
        "wwwy3y3",
        "samuela",
        "kuehlein",
        "bhongy",
        "chyzwar",
        "trivikr",
        "yoursunny",
        "qwelias",
        "ExE-Boss",
        "peterblazejewicz",
        "addaleax",
        "victorperin",
        "NodeJS",
        "LinusU",
        "wafuwafu13",
        "mcollina",
        "Semigradsky"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "weswigham",
      "date": "2025-02-13T21:43:07.000Z",
      "isMaintainer": true
    },
    {
      "type": "stale",
      "reviewer": "RyanCavanaugh",
      "date": "2025-01-14T02:09:23.000Z",
      "abbrOid": "43ca93c"
    }
  ],
  "mainBotCommentID": 2576120517,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Critical package Untested Change This PR does not touch tests labels Jan 7, 2025
@typescript-bot
Copy link
Contributor

Hey @JakobJingleheimer,

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

@DangerBotOSS
Copy link

DangerBotOSS commented Jan 7, 2025

Formatting

The following files are not formatted:

  1. types/node/module.d.ts

Consider running pnpm dprint fmt on these files to make review easier.

Generated by 🚫 dangerJS against 5f28c55

@Renegade334
Copy link
Contributor

This will be added to the active (v22) definitions, but the version updates have to be sequential, so will need to hold off for the time being.

@JakobJingleheimer
Copy link
Contributor Author

OH! You don't include APIs that are in latest and not yet LTS?

@Renegade334
Copy link
Contributor

@types/node hasn't maintained a non-LTS branch since v17. Ideally this would change, but the repo needs a lot of love before reaching that stage.

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Jan 14, 2025
@Renegade334
Copy link
Contributor

@JakobJingleheimer can we please hold off on merging this prematurely? As things stand, this will get merged into @types/node v22.11, and it's impossible to clean up versioned packages once we move past them.

We are iterating upwards, can this be included in an appropriately versioned update soon?

@JakobJingleheimer
Copy link
Contributor Author

Yes 🙂 i think your bot will be angry though.

@typescript-bot typescript-bot added Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. and removed Self Merge This PR can now be self-merged by the PR author or an owner labels Jan 23, 2025
@typescript-bot
Copy link
Contributor

@JakobJingleheimer Unfortunately, this pull request currently has a merge conflict 😥. Please update your PR branch to be up-to-date with respect to master. Have a nice day!

@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Feb 6, 2025
@typescript-bot
Copy link
Contributor

@JakobJingleheimer I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Feb 13th (in a week) if the issues aren't addressed.

@typescript-bot typescript-bot added Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. and removed Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. Abandoned This PR had no activity for a long time, and is considered abandoned Maintainer Approved labels Feb 12, 2025
@typescript-bot
Copy link
Contributor

@typescript-bot
Copy link
Contributor

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

@Renegade334
Copy link
Contributor

@JakobJingleheimer are you happy for this commit to be rolled into a v22.14.0 update bundle?

@JakobJingleheimer
Copy link
Contributor Author

Sure!

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner and removed Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. labels Feb 13, 2025
@typescript-bot
Copy link
Contributor

@JakobJingleheimer: Everything looks good here. I am ready to merge this PR (at 5f28c55) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@microsoft, @jkomyno, @alvis, @r3nya, @btoueg, @smac89, @Touffy, @DeividasBakanas, @eyqs, @Hannes-Magnusson-CK, @hoo29, @kjin, @ajafff, @islishude, @mwiktorczyk, @mohsen1, @galkin, @parambirs, @eps1lon, @ThomasdenH, @WilcoBakker, @wwwy3y3, @samuela, @kuehlein, @bhongy, @chyzwar, @trivikr, @yoursunny, @qwelias, @ExE-Boss, @peterblazejewicz, @addaleax, @victorperin, @nodejs, @LinusU, @wafuwafu13, @mcollina, @Semigradsky: you can do this too.)

@JakobJingleheimer
Copy link
Contributor Author

Ready to merge

@typescript-bot typescript-bot merged commit f94babd into DefinitelyTyped:master Feb 13, 2025
15 checks passed
@JakobJingleheimer JakobJingleheimer deleted the patch-3 branch February 27, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical package Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner Untested Change This PR does not touch tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants