-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwrangler.jsonc
More file actions
249 lines (235 loc) · 6.3 KB
/
wrangler.jsonc
File metadata and controls
249 lines (235 loc) · 6.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
{
"$schema": "node_modules/wrangler/config-schema.json",
// === BASE CONFIGURATION ===
// Common settings shared across all environments
// Environment-specific settings are defined in the "env" sections below
"main": ".open-next/worker.js",
"compatibility_date": "2025-01-02",
"compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],
"find_additional_modules": true,
"preserve_file_names": false,
"minify": false,
"no_bundle": false,
"logpush": true,
// Custom domains are used instead of workers.dev subdomain
"workers_dev": false,
"preview_urls": false,
// Performance and resource limits
"limits": {
"cpu_ms": 300000, // 5 minutes max per request
},
// Assets configuration (shared across environments)
"assets": {
"binding": "ASSETS",
"directory": ".open-next/assets",
},
"images": {
"binding": "IMAGES",
},
// KV namespaces (shared across environments for local dev)
// initOpenNextCloudflareForDev() reads from root level during next dev
"kv_namespaces": [
{
"binding": "KV_QUICKBOOKS",
"id": "b58a50d9090b46a181322eb96d0c8c90",
"preview_id": "b58a50d9090b46a181322eb96d0c8c90",
},
],
// Observability (full sampling for both dev and prod)
"observability": {
"enabled": true,
"logs": {
"invocation_logs": true,
},
"head_sampling_rate": 1.0,
},
// Durable Objects for advanced caching features (shared across environments)
"durable_objects": {
"bindings": [
{
"name": "NEXT_CACHE_DO_QUEUE",
"class_name": "DOQueueHandler",
},
{
"name": "NEXT_TAG_CACHE_DO_SHARDED",
"class_name": "DOShardedTagCache",
},
{
"name": "NEXT_CACHE_DO_PURGE",
"class_name": "BucketCachePurge",
},
],
},
"migrations": [
{
"tag": "v1",
"new_sqlite_classes": [
"DOQueueHandler",
"DOShardedTagCache",
"BucketCachePurge",
],
},
],
// === LOCAL ENVIRONMENT (for `wrangler dev`) ===
// Keep local env for local development with separate R2/KV
// === DEPLOYMENT ENVIRONMENTS ===
// Separate workers for dev/prod to prevent PR deployments from affecting production
"env": {
"dev": {
"name": "allthingslinux-dev",
"routes": [
{
"pattern": "allthingslinux.dev",
"custom_domain": true,
},
],
// Bindings for dev environment
"r2_buckets": [
{
"binding": "NEXT_INC_CACHE_R2_BUCKET",
"bucket_name": "atl-cache-dev",
},
],
"kv_namespaces": [
{
"binding": "KV_QUICKBOOKS",
"id": "a7e7f8796625426c8355ec8bd60b75c1",
},
],
"vars": {
"NEXT_PUBLIC_URL": "https://allthingslinux.dev",
"NEXT_PUBLIC_API_URL": "https://allthingslinux.dev/api",
"NEXT_PUBLIC_GITHUB_REPO_OWNER": "allthingslinux",
"NEXT_PUBLIC_GITHUB_REPO_NAME": "applications",
},
"services": [
{
"binding": "WORKER_SELF_REFERENCE",
"service": "allthingslinux-dev",
},
],
"images": {
"binding": "IMAGES",
},
"durable_objects": {
"bindings": [
{
"name": "NEXT_CACHE_DO_QUEUE",
"class_name": "DOQueueHandler",
},
{
"name": "NEXT_TAG_CACHE_DO_SHARDED",
"class_name": "DOShardedTagCache",
},
{
"name": "NEXT_CACHE_DO_PURGE",
"class_name": "BucketCachePurge",
},
],
},
},
"prod": {
"name": "allthingslinux-prod",
"routes": [
{
"pattern": "allthingslinux.org",
"custom_domain": true,
},
],
// Bindings for prod environment
"r2_buckets": [
{
"binding": "NEXT_INC_CACHE_R2_BUCKET",
"bucket_name": "atl-cache-prod",
},
],
"kv_namespaces": [
{
"binding": "KV_QUICKBOOKS",
"id": "7bfc722d19ea48b0b35422ac27029dfa",
},
],
"vars": {
"NEXT_PUBLIC_URL": "https://allthingslinux.org",
"NEXT_PUBLIC_API_URL": "https://allthingslinux.org/api",
"NEXT_PUBLIC_GITHUB_REPO_OWNER": "allthingslinux",
"NEXT_PUBLIC_GITHUB_REPO_NAME": "applications",
},
"services": [
{
"binding": "WORKER_SELF_REFERENCE",
"service": "allthingslinux-prod",
},
],
"images": {
"binding": "IMAGES",
},
"durable_objects": {
"bindings": [
{
"name": "NEXT_CACHE_DO_QUEUE",
"class_name": "DOQueueHandler",
},
{
"name": "NEXT_TAG_CACHE_DO_SHARDED",
"class_name": "DOShardedTagCache",
},
{
"name": "NEXT_CACHE_DO_PURGE",
"class_name": "BucketCachePurge",
},
],
},
},
"local": {
"name": "allthingslinux-local",
"workers_dev": true, // Override to enable workers.dev for local development
"minify": false,
"preserve_file_names": true,
"services": [
{
"binding": "WORKER_SELF_REFERENCE",
"service": "allthingslinux-local",
},
],
"r2_buckets": [
{
"binding": "NEXT_INC_CACHE_R2_BUCKET",
"bucket_name": "atl-cache-local",
},
],
"kv_namespaces": [
{
"binding": "KV_QUICKBOOKS",
"id": "b58a50d9090b46a181322eb96d0c8c90",
"preview_id": "b58a50d9090b46a181322eb96d0c8c90",
},
],
"vars": {
"NEXT_PUBLIC_URL": "http://localhost:8788",
"NEXT_PUBLIC_API_URL": "http://localhost:8788/api",
"NEXT_PUBLIC_GITHUB_REPO_OWNER": "allthingslinux",
"NEXT_PUBLIC_GITHUB_REPO_NAME": "applications",
},
"images": {
"binding": "IMAGES",
},
"durable_objects": {
"bindings": [
{
"name": "NEXT_CACHE_DO_QUEUE",
"class_name": "DOQueueHandler",
},
{
"name": "NEXT_TAG_CACHE_DO_SHARDED",
"class_name": "DOShardedTagCache",
},
{
"name": "NEXT_CACHE_DO_PURGE",
"class_name": "BucketCachePurge",
},
],
},
},
},
}