-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inconsistency: services have binding not name in wrangler.toml (#302
) * Allow helper `parsePluginWranglerConfig` to be given `Log` instances * Fix inconsistency: services have `binding` not `name` in `wrangler.toml` I noticed that in Workers docs and Miniflare there's inconsistency in how services are declared: - Workers expect `binding` key https://github.com/cloudflare/cloudflare-docs/blob/a65a35843ffb7b69caf2758cc5f2ad805251d166/content/workers/wrangler/configuration.md?plain=1#L212-L220 - Miniflare expects `name` I added 2 graceful and 2 error scenarios: - (graceful) accept `name` with warning if `binding` is missing - (graceful) accept `name` and `binding` both given and the same - (error) throw if both `binding` and `name` are given but they don't match - (error) throw if neither `binding` not `name` is given I decided to handle it with errors, not with mutually exclusive presence of either `name` or `binding` in interface `WranglerServiceConfig` because `name` should go away - it's just a behavior mismatch. Related: #280 Syntax in wrangler2: cloudflare/workers-sdk#906
- Loading branch information
Showing
5 changed files
with
137 additions
and
11 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
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