-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support --x-dev-env for Pages (#6097)
* Support `--x-dev-env` in `wrangler pages dev` * reimplement enablePagesAssetsServiceBinding as a fetcher type binding
- Loading branch information
Showing
6 changed files
with
177 additions
and
99 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"wrangler": minor | ||
--- | ||
|
||
feat: implements the `--experimental-dev-env` (shorthand: `--x-dev-env`) flag for `wrangler pages dev` |
80 changes: 80 additions & 0 deletions
80
packages/wrangler/e2e/__snapshots__/pages-dev.test.ts.snap
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,80 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`Pages 'wrangler pages dev --x-dev-env' > should merge (with override) \`wrangler.toml\` configuration with configuration provided via the command line, with command line args taking precedence 1`] = ` | ||
"✨ Compiled Worker successfully | ||
▲ [WARNING] WARNING: You have Durable Object bindings that are not defined locally in the worker being developed. | ||
Be aware that changes to the data stored in these Durable Objects will be permanent and affect the live instances. | ||
Remote Durable Objects that are affected: | ||
- {"name":"DO_BINDING_1_TOML","class_name":"DO_1_TOML","script_name":"DO_SCRIPT_1_TOML"} | ||
- {"name":"DO_BINDING_2_TOML","class_name":"DO_2_TOML","script_name":"DO_SCRIPT_2_TOML"} | ||
Your worker has access to the following bindings: | ||
- Durable Objects: | ||
- DO_BINDING_1_TOML: NEW_DO_1 (defined in NEW_DO_SCRIPT_1) | ||
- DO_BINDING_2_TOML: DO_2_TOML (defined in DO_SCRIPT_2_TOML) | ||
- DO_BINDING_3_ARGS: DO_3_ARGS (defined in DO_SCRIPT_3_ARGS) | ||
- KV Namespaces: | ||
- KV_BINDING_1_TOML: NEW_KV_ID_1 | ||
- KV_BINDING_2_TOML: KV_ID_2_TOML | ||
- KV_BINDING_3_ARGS: KV_ID_3_ARGS | ||
- D1 Databases: | ||
- D1_BINDING_1_TOML: local-D1_BINDING_1_TOML=NEW_D1_NAME_1 (NEW_D1_NAME_1) | ||
- D1_BINDING_2_TOML: D1_NAME_2_TOML (D1_ID_2_TOML) | ||
- D1_BINDING_3_ARGS: local-D1_BINDING_3_ARGS=D1_NAME_3_ARGS (D1_NAME_3_ARGS) | ||
- R2 Buckets: | ||
- R2_BINDING_1_TOML: NEW_R2_BUCKET_1 | ||
- R2_BINDING_2_TOML: R2_BUCKET_2_TOML | ||
- R2_BINDING_3_TOML: R2_BUCKET_3_ARGS | ||
- Services: | ||
- SERVICE_BINDING_1_TOML: NEW_SERVICE_NAME_1 | ||
- SERVICE_BINDING_2_TOML: SERVICE_NAME_2_TOML | ||
- SERVICE_BINDING_3_TOML: SERVICE_NAME_3_ARGS | ||
- AI: | ||
- Name: AI_BINDING_2_TOML | ||
- Vars: | ||
- VAR1: "(hidden)" | ||
- VAR2: "VAR_2_TOML" | ||
- VAR3: "(hidden)" | ||
▲ [WARNING] This worker is bound to live services: SERVICE_BINDING_1_TOML (NEW_SERVICE_NAME_1), SERVICE_BINDING_3_TOML (SERVICE_NAME_3_ARGS), SERVICE_BINDING_2_TOML (SERVICE_NAME_2_TOML) | ||
▲ [WARNING] Using Workers AI always accesses your Cloudflare account in order to run AI models, and so will incur usage charges even in local development. | ||
" | ||
`; | ||
|
||
exports[`Pages 'wrangler pages dev' > should merge (with override) \`wrangler.toml\` configuration with configuration provided via the command line, with command line args taking precedence 1`] = ` | ||
"✨ Compiled Worker successfully | ||
▲ [WARNING] WARNING: You have Durable Object bindings that are not defined locally in the worker being developed. | ||
Be aware that changes to the data stored in these Durable Objects will be permanent and affect the live instances. | ||
Remote Durable Objects that are affected: | ||
- {"name":"DO_BINDING_1_TOML","class_name":"DO_1_TOML","script_name":"DO_SCRIPT_1_TOML"} | ||
- {"name":"DO_BINDING_2_TOML","class_name":"DO_2_TOML","script_name":"DO_SCRIPT_2_TOML"} | ||
▲ [WARNING] This worker is bound to live services: SERVICE_BINDING_1_TOML (SERVICE_NAME_1_TOML), SERVICE_BINDING_2_TOML (SERVICE_NAME_2_TOML) | ||
Your worker has access to the following bindings: | ||
- Durable Objects: | ||
- DO_BINDING_1_TOML: NEW_DO_1 (defined in NEW_DO_SCRIPT_1) | ||
- DO_BINDING_2_TOML: DO_2_TOML (defined in DO_SCRIPT_2_TOML) | ||
- DO_BINDING_3_ARGS: DO_3_ARGS (defined in DO_SCRIPT_3_ARGS) | ||
- KV Namespaces: | ||
- KV_BINDING_1_TOML: NEW_KV_ID_1 | ||
- KV_BINDING_2_TOML: KV_ID_2_TOML | ||
- KV_BINDING_3_ARGS: KV_ID_3_ARGS | ||
- D1 Databases: | ||
- D1_BINDING_1_TOML: local-D1_BINDING_1_TOML=NEW_D1_NAME_1 (NEW_D1_NAME_1) | ||
- D1_BINDING_2_TOML: D1_NAME_2_TOML (D1_ID_2_TOML) | ||
- D1_BINDING_3_ARGS: local-D1_BINDING_3_ARGS=D1_NAME_3_ARGS (D1_NAME_3_ARGS) | ||
- R2 Buckets: | ||
- R2_BINDING_1_TOML: NEW_R2_BUCKET_1 | ||
- R2_BINDING_2_TOML: R2_BUCKET_2_TOML | ||
- R2_BINDING_3_TOML: R2_BUCKET_3_ARGS | ||
- Services: | ||
- SERVICE_BINDING_1_TOML: NEW_SERVICE_NAME_1 | ||
- SERVICE_BINDING_2_TOML: SERVICE_NAME_2_TOML | ||
- SERVICE_BINDING_3_TOML: SERVICE_NAME_3_ARGS | ||
- AI: | ||
- Name: AI_BINDING_2_TOML | ||
- Vars: | ||
- VAR1: "(hidden)" | ||
- VAR2: "VAR_2_TOML" | ||
- VAR3: "(hidden)" | ||
▲ [WARNING] ⎔ Support for service bindings in local mode is experimental and may change. | ||
▲ [WARNING] ⎔ Support for external Durable Objects in local mode is experimental and may change. | ||
" | ||
`; |
Oops, something went wrong.