Expand description
wrangler.toml generation per Worker (v0.8 §4.4 / §4.5).
Each context becomes a Cloudflare Worker with its own wrangler config.
Service Bindings are declared for every consumed context. Durable
Object bindings + exports entries are declared for every agent.
Constants§
- COMPATIBILITY_
DATE - Compile-time pinned compatibility date. Cloudflare uses this to lock
Workers runtime behaviour. When to bump it, and the gate a bump must pass,
is the policy in
design/bynk-release-discipline.md(“Part 3 — The Workers compatibility date”, #1677): reviewed at each release, and moved only after the workerd smokes pass on the new date. - KV_
NAMESPACE_ ID_ PLACEHOLDER - Deploy-time sentinel in generated Worker configuration. The driver replaces this with the persistent Cloudflare KV namespace id immediately before a remote Wrangler command runs.
- WRANGLER_
MIN - #1732: the oldest wrangler whose bundled
workerdservesCOMPATIBILITY_DATE. An olderworkerdrefuses a newer date outright (wrangler devexits: “This Worker requires compatibility date …”), sobynk doctorwarns about a wrangler below this. Set by the same compatibility-date review that sets the date (Part 3’s lag rule keeps it at least three months old).bynk-emit/tests/compat_date_policy.rschecks the policy doc names both.
Functions§
- materialise_
kv_ namespace_ id - Materialise the deploy-time KV namespace id placeholder in a generated
wrangler.toml’s text, structurally. Parsestextand, if (and only if) the first[[kv_namespaces]]entry’sidis currently exactlyKV_NAMESPACE_ID_PLACEHOLDER, replaces it withid. - wrangler_
needs_ kv_ materialisation - Whether a generated
wrangler.toml’s KV namespace id is still the deploy-time placeholder — the same conditionmaterialise_kv_namespace_iditself checks internally before writing, exposed separately so a caller can decide whether materialising is needed at all before doing the (possibly fallible) work of finding the real id to substitute — e.g.bynk dev --remoteskipping a lock-file lookup entirely for a project that either has no KV binding or is already materialised.