-
Notifications
You must be signed in to change notification settings - Fork 5
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
refactor: Type check and restructure tests #119
Conversation
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's awesome! Thanks for updating that @Peeja.
I guess you just need to sort out those linter/type issues flagged by the test workflow, and it is good to go. I also tested this locally and worked well.
Dang lack of Prettier...
@Peeja For some reason after the changes the |
* Make types work * Test through with stubs more and less with mocks * Use `@import` a bunch for readability * Avoid `let`s in favor of `const`s * Separate the rate-limiter middleware's expected environment interface from the general environment, and don't combine them until we actually combine the middlewares into the stack.
aa28761
to
c43609c
Compare
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 looks great to me! However, since the changes affect more than just the Wrangler setup, we should consider renaming the PR to reflect its broader scope.
I also added a minor suggestion about the treeKill
usage to kill the wrangler process.
It's the only way to be sure. Co-authored-by: Felipe Forbeck <[email protected]>
This is more what I was getting at with https://github.com/storacha/freeway/pull/116/files#r1787752932. This avoids some of the stashing and mutation by putting more inside the
new Promise()
construction itself.I've also pulled
wranglerEnv
out into its ownconst
, because it's actually an input, not an output. Then I've madeworkerInfo
alet
which is assigned when Wrangler boots, and isundefined
before that, signaling that Wrangler is not yet available. The previous code was failing because there wereundefined
fields that aren't typed to allowundefined
. Which wasn't an issue until…I also turned type checking on in
test/
, because apparently it wasn't already. 😛 And lastly, I've ignored.wrangler
, because Wrangler writes to that when it runs.