-
Notifications
You must be signed in to change notification settings - Fork 774
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wrangler) add asset manifest in dev and use in ASW (#6525)
* simplify asset manifest building func in deploy * create asset manifest in dev * use asset manifest in ASW * use a reverse map in fake kv service * fix tests * review feedback * add content type to reverse map * address pr feedback
- Loading branch information
1 parent
f5bde66
commit c7a980c
Showing
13 changed files
with
355 additions
and
83 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
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
12 changes: 12 additions & 0 deletions
12
packages/miniflare/test/fixtures/assets/asset-test-helpers.ts
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,12 @@ | ||
export const bytesToHex = (buffer: ArrayBufferLike) => { | ||
return [...new Uint8Array(buffer)] | ||
.map((b) => b.toString(16).padStart(2, "0")) | ||
.join(""); | ||
}; | ||
|
||
export const hashPath = async (path: string) => { | ||
const encoder = new TextEncoder(); | ||
const data = encoder.encode(path); | ||
const hashBuffer = await crypto.subtle.digest("SHA-256", data.buffer); | ||
return new Uint8Array(hashBuffer, 0, 16); | ||
}; |
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
13 changes: 0 additions & 13 deletions
13
packages/workers-shared/asset-server-worker/src/assets-manifest-no-op.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.