-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrangler.jsonc
More file actions
58 lines (58 loc) · 2.97 KB
/
Copy pathwrangler.jsonc
File metadata and controls
58 lines (58 loc) · 2.97 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
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "psatomas-com",
"main": ".open-next/worker.js",
"compatibility_date": "2026-08-18",
"compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],
"assets": {
"directory": ".open-next/assets",
"binding": "ASSETS"
},
// Shared cache for the Oracle experiment's most recent observation per
// source+asset (see src/experiments/oracle/service/observation-cache.ts)
// — this is what lets many concurrent /api/oracle requests, across
// however many Worker isolates handle them, share one recent upstream
// fetch instead of each independently re-contacting CoinGecko. KV is
// the right tool here: it's a globally-shared, eventually-consistent
// store built for exactly this "read-heavy, infrequently-written"
// shape, with no server process of our own to keep alive.
//
// `wrangler dev` / `opennextjs-cloudflare preview` emulate KV locally
// regardless of the id below, so local development and this repo's own
// tests work with no further setup. The id below is the real production
// namespace, created via `npx wrangler kv namespace create ORACLE_CACHE`.
"kv_namespaces": [
{ "binding": "ORACLE_CACHE", "id": "5a32ced8880c499a9282c3772811243e" }
],
// Research's article store — a separate D1 database, not the Oracle KV
// above. KV is a cache (ephemeral, TTL'd, no querying); Research needs
// real persistent records with draft/published state, ordering, and
// future editing — a relational table is the right shape for that, and
// D1 is Cloudflare's native SQL option, reachable through the same
// getCloudflareContext() binding pattern already proven for KV.
//
// Same story as the KV id above: `wrangler dev` / `opennextjs-cloudflare
// preview` emulate D1 locally regardless of this id, so local dev and
// this repo's tests work with no further setup (see migrations/ and
// npm run db:migrate:local / db:seed:local). The database_id below is
// the real production database, created via
// `npx wrangler d1 create psatomas-research`; the schema is applied to
// it with `npx wrangler d1 migrations apply RESEARCH_DB --remote`.
"d1_databases": [
{
"binding": "RESEARCH_DB",
"database_name": "psatomas-research",
"database_id": "eab4dfcf-3412-48d1-bd09-9566b03fba14",
"migrations_dir": "migrations"
}
]
// Self-reference service binding (WORKER_SELF_REFERENCE -> "psatomas-com")
// omitted: it's currently unused — open-next.config.ts has no
// incremental-cache override that needs it. (The "psatomas-com" Worker
// already exists from prior deploys, predating this Research/auth work,
// so the "target must be deployed first" concern that used to apply
// here no longer does.) Re-add the `services` block (see
// node_modules/@opennextjs/cloudflare/templates/wrangler.jsonc for the
// exact shape) once a future stage needs on-demand revalidation. See
// https://opennext.js.org/cloudflare/caching
}