Skip to main content

Module wrangler

Module wrangler 

Source
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 workerd serves COMPATIBILITY_DATE. An older workerd refuses a newer date outright (wrangler dev exits: “This Worker requires compatibility date …”), so bynk doctor warns 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.rs checks 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. Parses text and, if (and only if) the first [[kv_namespaces]] entry’s id is currently exactly KV_NAMESPACE_ID_PLACEHOLDER, replaces it with id.
wrangler_needs_kv_materialisation
Whether a generated wrangler.toml’s KV namespace id is still the deploy-time placeholder — the same condition materialise_kv_namespace_id itself 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 --remote skipping a lock-file lookup entirely for a project that either has no KV binding or is already materialised.