Skip to content

Commit f19aef8

Browse files
committed
chore: update miniflare to get new assets functionality
1 parent 25f9fd0 commit f19aef8

File tree

5 files changed

+40
-39
lines changed

5 files changed

+40
-39
lines changed

package-lock.json

Lines changed: 33 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"devDependencies": {
1717
"@types/node": "^20.4.8",
1818
"@types/uuid": "^9.0.2",
19-
"miniflare": "^3.20240909.4",
19+
"miniflare": "^3.20241205.0",
2020
"typescript": "^5.1.6",
2121
"undici": "^5.28.4",
2222
"uuid": "^9.0.0",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/* Modules */
2828
"module": "ES2022", /* Specify what module code is generated. */
2929
// "rootDir": "./", /* Specify the root folder within your source files. */
30-
"moduleResolution": "nodenext", /* Specify how TypeScript looks up a file from a given module specifier. */
30+
"moduleResolution": "bundler", /* Specify how TypeScript looks up a file from a given module specifier. */
3131
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
3232
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
3333
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */

worker-sandbox/src/assets.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ pub async fn handle_asset(
99
let url: Url = req.url()?;
1010
let name: String = url.path_segments().unwrap().nth(1).unwrap().to_string();
1111
let url: String = ["https://dummyurl.com/", &name].concat();
12-
Ok(env
13-
.assets("ASSETS")
12+
13+
env.assets("ASSETS")
1414
.expect("ASSETS BINDING")
1515
.fetch(url, None)
16-
.await?)
16+
.await
1717
}

worker-sandbox/tests/mf.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export const mf = new Miniflare({
7373
queueProducers: ["my_queue", "my_queue"],
7474
fetchMock: mockAgent,
7575
assets: {
76-
path: "./public",
77-
bindingName: "ASSETS",
76+
directory: "./public",
77+
binding: "ASSETS",
7878
routingConfig: {
7979
has_user_worker: true,
8080
},

0 commit comments

Comments
 (0)