GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(libnpmpublish): add support for stageId by 43081j · Pull Request #75043 · DefinitelyTyped/DefinitelyTyped

Conversation

@43081j

@43081j 43081j commented May 23, 2026

Copy link
Copy Markdown
Contributor

Adds support for the new stageId and associated stage option.

When stage: true, we always get a stageId back. Otherwise, we type it as
stageId?: string so it can at least still be accessed if we pass a
stage: boolean in for example.


  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change.
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run pnpm test <package to test>.
  • Provide a URL to documentation or source code which provides context for the suggested changes: feat: npm stage npm/cli#9201
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the package.json.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@43081j
feat(libnpmpublish): add support for stageId
1342202
Adds support for the new stageId and associated `stage` option.

When `stage: true`, we _always_ get a `stageId` back. Otherwise, we type it as
`stageId?: string` so it can at least still be accessed if we pass a
`stage: boolean` in for example.
@43081j
43081j force-pushed the npm-staging branch from c2eb7c2 to 1342202 Compare May 23, 2026 13:45
@typescript-bot

typescript-bot commented May 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@43081j Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

  • libnpmpublish — on npm, on unpkg

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

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, DT maintainers or others

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": 75043,
  "author": "43081j",
  "headCommitOid": "1837a7a9ff802e7698ce148e613a6b102a126ee2",
  "mergeBaseOid": "ce6d550f9ae837b90d47e86cf60228fbd86ba06a",
  "lastPushDate": "2026-05-23T13:45:26.000Z",
  "lastActivityDate": "2026-06-03T21:40:40.000Z",
  "mergeOfferDate": "2026-06-03T17:15:52.000Z",
  "mergeRequestDate": "2026-06-03T21:40:40.000Z",
  "mergeRequestUser": "43081j",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "libnpmpublish",
      "kind": "edit",
      "files": [
        {
          "path": "types/libnpmpublish/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/libnpmpublish/libnpmpublish-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/libnpmpublish/package.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "nicolas377",
        "Guy-Adler"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "jakebailey",
      "date": "2026-06-03T17:15:07.000Z",
      "isMaintainer": true
    }
  ],
  "mainBotCommentID": 4525539578,
  "ciResult": "pass"
}
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot typescript-bot added this to Pull Request Status Board May 23, 2026
@typescript-bot typescript-bot moved this to Waiting for Code Reviews in Pull Request Status Board May 23, 2026
@typescript-bot

typescript-bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

🔔 @nicolas377 @Guy-Adler — 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@43081j
chore: run format
e53ab29
jakebailey
jakebailey reviewed Jun 1, 2026
View reviewed changes
Comment thread types/libnpmpublish/index.d.ts Outdated
Comment on lines +61 to +70
declare function publish(
manifest: PackageJson,
tarballData: Buffer,
options: Omit<PublishOptions, "stage"> & { stage: true },
): Promise<Response & { stageId: string }>;
declare function publish(
manifest: PackageJson,
tarballData: Buffer,
options?: PublishOptions,
): Promise<Response & { stageId?: string }>;

@jakebailey jakebailey Jun 1, 2026

Copy link
Copy Markdown
Member

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.

This is... clever; does this package actually do this elsewhere?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@43081j 43081j Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

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.

tagging the stageId on? i don't think so. the publish implementation does it directly iirc

let me know if that's the part you meant

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jakebailey jakebailey Jun 1, 2026

Copy link
Copy Markdown
Member

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.

I mean specifically the part where you are trying to get perfect types here for the output

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@43081j 43081j Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

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.

well, before we didn't have any knowledge of stageId but the source library does tag it on.

so the bare minimum is Response & { stageId?: string }. But I figured if we can type it as required when we pass stage: true, it'd help us avoid a bunch of unnecessary type guards or casts.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jakebailey jakebailey Jun 1, 2026

Copy link
Copy Markdown
Member

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.

Why isn't it already an optional prop on Response? I think mainly I find the second overload to be the weird one.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@43081j 43081j Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

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.

it does, doesn't it?

when stage isn't true we get Response & { stageId?: string } back, no?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jakebailey jakebailey Jun 2, 2026

Copy link
Copy Markdown
Member

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.

No, I mean literally add to Response, so an intersection is not required for the default case

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@43081j 43081j Jun 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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.

because its not our Response , it comes from node-fetch in this case. in the source package it comes from make-fetch-happen.

i'm not sure we should be extending that since we don't own it.

and the stageId is only set by publish - no other function.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jakebailey jakebailey Jun 2, 2026

Copy link
Copy Markdown
Member

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.

Oh, I see.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jakebailey jakebailey Jun 2, 2026

Copy link
Copy Markdown
Member

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.

That does seem super weird, though; do you know where they do that?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jakebailey
jakebailey reviewed Jun 1, 2026
View reviewed changes
Comment thread types/libnpmpublish/index.d.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@43081j
chore: export inline
a0697bd
@typescript-bot

typescript-bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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 Jun 3, 2026
@typescript-bot

typescript-bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Re-ping @nicolas377, @Guy-Adler:

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

Could someone please give it some attention? Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jakebailey
jakebailey reviewed Jun 3, 2026
View reviewed changes
Comment thread types/libnpmpublish/index.d.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@43081j
chore: redundant emit
1837a7a
@typescript-bot

typescript-bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jakebailey
jakebailey approved these changes Jun 3, 2026
View reviewed changes
@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 Jun 3, 2026
@typescript-bot

typescript-bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@43081j: Everything looks good here. I am ready to merge this PR (at 1837a7a) 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! ❤️

(@nicolas377, @Guy-Adler: you can do this too.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Waiting for Author to Merge in Pull Request Status Board Jun 3, 2026
@43081j

43081j commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

ready to merge 🏃

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in Pull Request Status Board Jun 3, 2026
@typescript-bot
typescript-bot merged commit 3f337f1 into DefinitelyTyped:master Jun 3, 2026
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@43081j
43081j deleted the npm-staging branch June 4, 2026 08:37
@typescript-automation typescript-automation Bot removed this from Pull Request Status Board Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jakebailey jakebailey jakebailey approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@43081j @typescript-bot @jakebailey
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.