Skip to content

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented May 9, 2025

My first goal was to ensure, that the "webmiddleware" is tested properly. But then I realized, that the web middleware is kind of better than the old node logic. So that was used as base for the unification.

So anyhow. I tried first tried to get it work with Deno. So tried to remove node specific code as much as possible. So instead of using Buffer I used Uint8Array.

I basically needed to rewrite all the unit tests. Why keeping vitest? node --test works only reliable with node 24. But I think it is now very cool, as the tests run additionally on deno and bun.

Copy link
Contributor

github-actions bot commented May 9, 2025

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@wolfy1339 wolfy1339 moved this from 🆕 Triage to 🏗 In progress in 🧰 Octokit Active May 9, 2025
@wolfy1339 wolfy1339 added the Type: Breaking change Used to note any change that requires a major version bump label May 9, 2025
@wolfy1339 wolfy1339 marked this pull request as draft May 9, 2025 23:59
@wolfy1339 wolfy1339 added the Type: Feature New feature or request label May 10, 2025
@gr2m gr2m marked this pull request as ready for review May 12, 2025 22:42
gr2m
gr2m previously approved these changes May 13, 2025
Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just a nit

tries++;
}
throw new Error("No available ports");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add https://github.com/sindresorhus/get-port as a devdependency instead of adding this code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could but the problem is, that we run into race conditions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how but I won't die on my hill 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D

const result = concatUint8Array(data);
// Switch to queue microtask when we want to support bun and deno
setImmediate(resolve, result);
queueMicrotask(() => resolve(result));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just give the PR a proper title explaining what you've done. You can use refactor: ... as prefix.

@Uzlopak Uzlopak changed the title refactor refactor: write tests to also work with deno and bun May 14, 2025
@Uzlopak
Copy link
Contributor Author

Uzlopak commented May 14, 2025

@gr2m acceptable?

@gr2m gr2m merged commit 67a6d6d into octokit:main May 14, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in 🧰 Octokit Active May 14, 2025
Copy link
Contributor

🎉 This PR is included in version 14.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Contributor

🎉 This PR is included in version 13.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @13.x released Type: Breaking change Used to note any change that requires a major version bump Type: Feature New feature or request
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants