Documentation
¶
Overview ¶
Package wranglerprep installs the pinned Wrangler once and tells child processes where it is. It has no dependency on the Cloudflare provisioner, so the behaviour-test driver (which must not import the mint core) can use it.
Index ¶
Constants ¶
const WranglerBinEnv = "FULLSEND_WRANGLER_BIN"
WranglerBinEnv names the environment variable that points at a prepared Wrangler executable. When set, every Wrangler invocation in the Cloudflare provisioner runs that executable directly instead of `npx wrangler`. Concurrent `fullsend mint deploy` processes otherwise race on the shared npx cache.
Variables ¶
This section is empty.
Functions ¶
func PrepareWrangler ¶
PrepareWrangler installs the pinned Wrangler once per process and returns its executable path. Export the result as WranglerBinEnv so child `fullsend` processes skip npx.
func PrepareWranglerEnv ¶
PrepareWranglerEnv runs PrepareWrangler and exports WranglerBinEnv in the current process environment so child CLI processes inherit it. An already-set WranglerBinEnv is respected and no install is performed.
Types ¶
type WranglerInstallFunc ¶
WranglerInstallFunc installs the Worker's locked dependencies, Wrangler among them, under dir so that dir/node_modules/.bin/wrangler exists.
type WranglerPreparer ¶
type WranglerPreparer struct {
// contains filtered or unexported fields
}
WranglerPreparer installs Wrangler at most once per instance, no matter how many goroutines call Prepare concurrently. All callers receive the same result. It uses no file locks, so it only serialises callers within one process (the BT runner), which then shares the path with children.
func NewWranglerPreparer ¶
func NewWranglerPreparer(baseDir string, install WranglerInstallFunc) *WranglerPreparer
NewWranglerPreparer returns a preparer that installs the Worker's locked dependencies under a fresh directory below baseDir (the system temp dir if empty) using install (`npm ci` if nil).