-
Notifications
You must be signed in to change notification settings - Fork 337
Conversation
a83635c
to
4a5b4fe
Compare
if !route.ends_with("*") { | ||
message::warn(&format!("The route in your wrangler.toml should have a trailing * to apply the Worker on every path, otherwise your site will not behave as expected.\nroute = {}*", route)); | ||
} | ||
} |
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.
i moved this down into the deploy routes function, since it's only relevant to that path
let routes = target.routes()?; | ||
log::info!("routes: {:#?}", &routes); | ||
|
||
if routes.is_empty() { |
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.
i'm nearly inclined to move this all just into the top level command function, since it doesn't really return anything, just does the console output.
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.
i think i'd rather it be its own function than in the top level
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.
i guess what i meant was, all the std out output and switching on routes etc. but i also think i might futz with this so i'm into it staying here
@@ -132,25 +151,6 @@ fn error_msg(status: reqwest::StatusCode, text: String) -> String { | |||
} | |||
} | |||
|
|||
#[test] |
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.
nothing about this test changed, i just moved it to the bottom of the module.
@@ -258,7 +258,7 @@ fn validate_target_required_fields_present(target: &Target) -> Result<(), failur | |||
None => {} | |||
} | |||
|
|||
let destination = if target.route.is_some() { | |||
let destination = if let Some(route) = &target.route { |
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.
i could fix this to check if target.routes()?.is_empty()
, however i'm also inclined to shift some of this logic into something like a Manifest::get_deploy_config
function instead, so we can keep all the logic around what is needed to publish in one place; right now it is spread across this module and settings::target
* include (optional) id in Route struct * remove unused Route::new() method * include upload result information in output of routes deploy function * split upload script and deploy into two functions
bc71586
to
ec008c8
Compare
this pr gets us to where we actually publish all specified routes within a wrangler toml.
todo:
unit tests
at least one integration test
improve output to show how routes were updated/maintained.