-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Type check and restructure tests (#119)
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 own `const`, because it's actually an _input_, not an output. Then I've made `workerInfo` a `let` which is assigned when Wrangler boots, and is `undefined` before that, signaling that Wrangler is not yet available. The previous code was failing because there were `undefined` fields that aren't typed to allow `undefined`. 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. --------- Co-authored-by: Felipe Forbeck <[email protected]>
- Loading branch information
Showing
13 changed files
with
503 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ node_modules | |
dist | ||
.mf | ||
.env | ||
.dev.vars | ||
.dev.vars | ||
.wrangler |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Environment as MiddlewareEnvironment } from '@web3-storage/gateway-lib' | ||
import { R2Bucket } from '@cloudflare/workers-types' | ||
|
||
export interface Environment extends MiddlewareEnvironment { | ||
CARPARK: R2Bucket | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.