vercelconfig

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BranchPattern = "entire/**"
	FileName      = "vercel.json"
)

Variables

This section is empty.

Functions

func CachedSettings

func CachedSettings() (*settings.EntireSettings, error)

CachedSettings returns the most recently initialized repository settings.

func DeploymentDisabled

func DeploymentDisabled(config map[string]any) bool

DeploymentDisabled reports whether Entire branches are disabled in the config.

func InitSettings

func InitSettings(ctx context.Context) error

InitSettings loads repository settings for the current command context and stores them in a small package cache.

func LoadIn added in v0.10.6

func LoadIn(root *os.Root, name string) (map[string]any, bool, error)

LoadIn reads the Vercel config file named inside root, if present.

Through the worktree's root rather than a path joined onto the repo root: vercel.json is a working-tree file, so it arrives by clone. A link leaving the worktree is refused, which is the property the worktreedir anchor exists to give.

Following an in-repo link is the CALLER's job, and it has to be: os.Root refuses an absolute symlink target even when it resolves inside the root, so name is expected to be one the caller already resolved (see setup.go's worktreeFileName). Passing the raw file name still works for the ordinary case of a real file or a relative link.

func Marshal

func Marshal(config map[string]any) ([]byte, error)

Marshal formats a Vercel config with a trailing newline.

func MaybeMergeMetadataBranchConfig

func MaybeMergeMetadataBranchConfig(repo *git.Repository, rootTreeHash plumbing.Hash) (plumbing.Hash, error)

MaybeMergeMetadataBranchConfig ensures the metadata branch root tree contains a vercel.json disabling deployments for Entire branches when Vercel support is enabled in cached settings. Existing vercel.json content is preserved.

func MergeDeploymentDisabled

func MergeDeploymentDisabled(config map[string]any)

MergeDeploymentDisabled sets deploymentEnabled["entire/**"] = false while preserving other fields.

func ResetSettingsCache

func ResetSettingsCache()

ResetSettingsCache clears the cached settings. Primarily intended for tests that exercise multiple repositories in one process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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