wranglerprep

package
v0.57.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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

View Source
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

func PrepareWrangler(ctx context.Context) (string, error)

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

func PrepareWranglerEnv(ctx context.Context) error

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

type WranglerInstallFunc func(ctx context.Context, dir string) error

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).

func (*WranglerPreparer) Prepare

func (p *WranglerPreparer) Prepare(ctx context.Context) (string, error)

Prepare installs Wrangler once and returns the executable path (<dir>/node_modules/.bin/wrangler). Failures are cached and returned to every caller.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL