-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C3: Nuxt template dev improvements (#4996)
* C3: Update dev bindings support in nuxt template * Add initial wrangler.toml for pages frameworks with getBindingsProxy * Changeset * Use hello-world wrangler.toml template for qwik and nuxt * Increase wait time in framework e2e to combat verifyDevScript flakiness * Fixup changesets * Wait for dev server a little longer. And fix changeset * Attempt to resolve verifyDev flakiness * Skip nuxt e2e on win32
- Loading branch information
Showing
11 changed files
with
202 additions
and
21 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,7 @@ | ||
--- | ||
"create-cloudflare": minor | ||
--- | ||
|
||
feature: Add `getBindingsProxy` support to `nuxt` template via `nitro-cloudflare-dev` module. | ||
|
||
The `nuxt` template now uses the default dev command from `create-nuxt` instead of using `wrangler paves dev` on build output in order to improve the developer workflow. `nitro-cloudflare-dev` is a nitro module that leverages `getBindingsProxy` and allows bindings to work in nitro commands. |
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 @@ | ||
--- | ||
"create-cloudflare": patch | ||
--- | ||
|
||
feature: Add an empty `wrangler.toml` file to qwik and nuxt templates. |
8 changes: 8 additions & 0 deletions
8
packages/create-cloudflare/e2e-tests/fixtures/nuxt/server/routes/test.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,8 @@ | ||
export default eventHandler(async (event) => { | ||
if (!event.context.cloudflare) { | ||
return { success: false }; | ||
} | ||
const { TEST } = event.context.cloudflare.env; | ||
|
||
return { value: TEST, success: true }; | ||
}); |
2 changes: 2 additions & 0 deletions
2
packages/create-cloudflare/e2e-tests/fixtures/nuxt/wrangler.toml
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,2 @@ | ||
[vars] | ||
TEST = "C3_TEST" |
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
50 changes: 50 additions & 0 deletions
50
packages/create-cloudflare/templates/nuxt/templates/wrangler.toml
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,50 @@ | ||
name = "<TBD>" | ||
compatibility_date = "<TBD>" | ||
|
||
# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables) | ||
# Note: Use secrets to store sensitive data. | ||
# Docs: https://developers.cloudflare.com/workers/platform/environment-variables | ||
# [vars] | ||
# MY_VARIABLE = "production_value" | ||
|
||
# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs. | ||
# Docs: https://developers.cloudflare.com/workers/runtime-apis/kv | ||
# [[kv_namespaces]] | ||
# binding = "MY_KV_NAMESPACE" | ||
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | ||
|
||
# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files. | ||
# Docs: https://developers.cloudflare.com/r2/api/workers/workers-api-usage/ | ||
# [[r2_buckets]] | ||
# binding = "MY_BUCKET" | ||
# bucket_name = "my-bucket" | ||
|
||
# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer. | ||
# Docs: https://developers.cloudflare.com/queues/get-started | ||
# [[queues.producers]] | ||
# binding = "MY_QUEUE" | ||
# queue = "my-queue" | ||
|
||
# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them. | ||
# Docs: https://developers.cloudflare.com/queues/get-started | ||
# [[queues.consumers]] | ||
# queue = "my-queue" | ||
|
||
# Bind another Worker service. Use this binding to call another Worker without network overhead. | ||
# Docs: https://developers.cloudflare.com/workers/platform/services | ||
# [[services]] | ||
# binding = "MY_SERVICE" | ||
# service = "my-service" | ||
|
||
# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model. | ||
# Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps. | ||
# Docs: https://developers.cloudflare.com/workers/runtime-apis/durable-objects | ||
# [[durable_objects.bindings]] | ||
# name = "MY_DURABLE_OBJECT" | ||
# class_name = "MyDurableObject" | ||
|
||
# Durable Object migrations. | ||
# Docs: https://developers.cloudflare.com/workers/learning/using-durable-objects#configure-durable-object-classes-with-migrations | ||
# [[migrations]] | ||
# tag = "v1" | ||
# new_classes = ["MyDurableObject"] |
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
50 changes: 50 additions & 0 deletions
50
packages/create-cloudflare/templates/qwik/templates/wrangler.toml
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,50 @@ | ||
name = "<TBD>" | ||
compatibility_date = "<TBD>" | ||
|
||
# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables) | ||
# Note: Use secrets to store sensitive data. | ||
# Docs: https://developers.cloudflare.com/workers/platform/environment-variables | ||
# [vars] | ||
# MY_VARIABLE = "production_value" | ||
|
||
# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs. | ||
# Docs: https://developers.cloudflare.com/workers/runtime-apis/kv | ||
# [[kv_namespaces]] | ||
# binding = "MY_KV_NAMESPACE" | ||
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | ||
|
||
# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files. | ||
# Docs: https://developers.cloudflare.com/r2/api/workers/workers-api-usage/ | ||
# [[r2_buckets]] | ||
# binding = "MY_BUCKET" | ||
# bucket_name = "my-bucket" | ||
|
||
# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer. | ||
# Docs: https://developers.cloudflare.com/queues/get-started | ||
# [[queues.producers]] | ||
# binding = "MY_QUEUE" | ||
# queue = "my-queue" | ||
|
||
# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them. | ||
# Docs: https://developers.cloudflare.com/queues/get-started | ||
# [[queues.consumers]] | ||
# queue = "my-queue" | ||
|
||
# Bind another Worker service. Use this binding to call another Worker without network overhead. | ||
# Docs: https://developers.cloudflare.com/workers/platform/services | ||
# [[services]] | ||
# binding = "MY_SERVICE" | ||
# service = "my-service" | ||
|
||
# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model. | ||
# Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps. | ||
# Docs: https://developers.cloudflare.com/workers/runtime-apis/durable-objects | ||
# [[durable_objects.bindings]] | ||
# name = "MY_DURABLE_OBJECT" | ||
# class_name = "MyDurableObject" | ||
|
||
# Durable Object migrations. | ||
# Docs: https://developers.cloudflare.com/workers/learning/using-durable-objects#configure-durable-object-classes-with-migrations | ||
# [[migrations]] | ||
# tag = "v1" | ||
# new_classes = ["MyDurableObject"] |