-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make sure C3 works with the latest astro versions #7497
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ | ||
--- | ||
"create-cloudflare": patch | ||
--- | ||
|
||
fix: make sure C3 works with the latest Astro versions |
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
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
packages/create-cloudflare/templates-experimental/astro/templates/ts/public/.assetsignore
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,4 @@ | ||
_worker.js | ||
_routes.json | ||
_headers | ||
_redirects |
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
...ges/create-cloudflare/templates-experimental/astro/templates/ts/worker-configuration.d.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,4 @@ | ||
// Generated by Wrangler | ||
// After adding bindings to `wrangler.toml`, regenerate this interface via `npm run cf-typegen` | ||
interface Env { | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/create-cloudflare/templates-experimental/astro/templates/ts/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,12 @@ | ||
#:schema node_modules/wrangler/config-schema.json | ||
name = "<TBD>" | ||
compatibility_date = "<TBD>" | ||
compatibility_flags = ["nodejs_compat_v2"] | ||
main = "./dist/_worker.js/index.js" | ||
assets = { directory = "./dist", binding = "ASSETS" } | ||
|
||
# Workers Logs | ||
# Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/ | ||
# Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs | ||
[observability] | ||
enabled = true |
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
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
packages/create-cloudflare/templates/astro/templates/ts/worker-configuration.d.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,4 @@ | ||
// Generated by Wrangler | ||
// After adding bindings to `wrangler.toml`, regenerate this interface via `npm run cf-typegen` | ||
interface Env { | ||
} |
86 changes: 86 additions & 0 deletions
86
packages/create-cloudflare/templates/astro/templates/ts/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,86 @@ | ||
#:schema node_modules/wrangler/config-schema.json | ||
name = "<TBD>" | ||
compatibility_date = "<TBD>" | ||
compatibility_flags = ["nodejs_compat"] | ||
pages_build_output_dir = "./dist" | ||
|
||
# Automatically place your workloads in an optimal location to minimize latency. | ||
# If you are running back-end logic in a Pages Function, running it closer to your back-end infrastructure | ||
# rather than the end user may result in better performance. | ||
# Docs: https://developers.cloudflare.com/pages/functions/smart-placement/#smart-placement | ||
# [placement] | ||
# mode = "smart" | ||
|
||
# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables) | ||
# Docs: | ||
# - https://developers.cloudflare.com/pages/functions/bindings/#environment-variables | ||
# Note: Use secrets to store sensitive data. | ||
# - https://developers.cloudflare.com/pages/functions/bindings/#secrets | ||
# [vars] | ||
# MY_VARIABLE = "production_value" | ||
|
||
# Bind the Workers AI model catalog. Run machine learning models, powered by serverless GPUs, on Cloudflare’s global network | ||
# Docs: https://developers.cloudflare.com/pages/functions/bindings/#workers-ai | ||
# [ai] | ||
# binding = "AI" | ||
|
||
# Bind a D1 database. D1 is Cloudflare’s native serverless SQL database. | ||
# Docs: https://developers.cloudflare.com/pages/functions/bindings/#d1-databases | ||
# [[d1_databases]] | ||
# binding = "MY_DB" | ||
# database_name = "my-database" | ||
# database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
|
||
# 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" | ||
# script_name = 'my-durable-object' | ||
|
||
# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs. | ||
# Docs: https://developers.cloudflare.com/pages/functions/bindings/#kv-namespaces | ||
# [[kv_namespaces]] | ||
# binding = "MY_KV_NAMESPACE" | ||
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | ||
|
||
# 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/pages/functions/bindings/#queue-producers | ||
# [[queues.producers]] | ||
# binding = "MY_QUEUE" | ||
# queue = "my-queue" | ||
|
||
# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files. | ||
# Docs: https://developers.cloudflare.com/pages/functions/bindings/#r2-buckets | ||
# [[r2_buckets]] | ||
# binding = "MY_BUCKET" | ||
# bucket_name = "my-bucket" | ||
|
||
# Bind another Worker service. Use this binding to call another Worker without network overhead. | ||
# Docs: https://developers.cloudflare.com/pages/functions/bindings/#service-bindings | ||
# [[services]] | ||
# binding = "MY_SERVICE" | ||
# service = "my-service" | ||
|
||
# To use different bindings for preview and production environments, follow the examples below. | ||
# When using environment-specific overrides for bindings, ALL bindings must be specified on a per-environment basis. | ||
# Docs: https://developers.cloudflare.com/pages/functions/wrangler-configuration#environment-specific-overrides | ||
|
||
######## PREVIEW environment config ######## | ||
|
||
# [env.preview.vars] | ||
# API_KEY = "xyz789" | ||
|
||
# [[env.preview.kv_namespaces]] | ||
# binding = "MY_KV_NAMESPACE" | ||
# id = "<PREVIEW_NAMESPACE_ID>" | ||
|
||
######## PRODUCTION environment config ######## | ||
|
||
# [env.production.vars] | ||
# API_KEY = "abc123" | ||
|
||
# [[env.production.kv_namespaces]] | ||
# binding = "MY_KV_NAMESPACE" | ||
# id = "<PRODUCTION_NAMESPACE_ID>" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Funnily enough, it looks like this isn't really needed since it looks like the Astro CLI creates a tsconfig.json for you even if you tell it that you're not planning on using TypeScript 🤷
I would still keep this in as I think this is the proper implementation (workaround excluded) and it is more robust (it won't break if the Astro CLI changes the above behavior and stops creating the tsconfig file)