bower

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package bower validates Bower package trees and indexes versions from their bower.json manifest. The item tree remains the source of truth.

Index

Constants

View Source
const MaxManifestBytes = 1 << 20

Variables

View Source
var ErrManifest = errors.New("bower: invalid bower manifest")

Functions

func ManifestPath

func ManifestPath(name, version string) string

func ParsePath

func ParsePath(p string) (name, version, file string, ok bool)

ParsePath accepts files inside a single versioned Bower package tree.

func Serves

func Serves(t repo.PackageType) bool

func ValidName

func ValidName(name string) bool

func ValidVersion

func ValidVersion(version string) bool

Types

type Handler

type Handler struct{ generic.Handler }

func (Handler) Admit

func (Handler) Admit(
	ctx context.Context,
	env format.Env,
	c repo.Config,
	w format.Write,
) (format.Write, error)

func (Handler) Deployed

func (Handler) Deployed(ctx context.Context, env format.Env, c repo.Config, it types.Item) error

func (Handler) Inspect

func (Handler) Inspect(
	ctx context.Context,
	env format.Env,
	_ repo.Config,
	w format.Write,
) (any, error)

func (Handler) Reindex

func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error

type Manifest

type Manifest struct {
	Name         string            `json:"name"`
	Version      string            `json:"version"`
	Dependencies map[string]string `json:"dependencies,omitempty"`
}

func DecodeGitManifest

func DecodeGitManifest(body []byte) (Manifest, error)

DecodeGitManifest accepts upstream Git tags whose bower.json omits version; Bower takes that version from the selected Git tag. A stated version must still agree with the tag before the archive enters the remote cache.

func DecodeManifest

func DecodeManifest(body []byte) (Manifest, error)

DecodeManifest accepts one bounded JSON object and rejects duplicate security-sensitive keys, since clients can interpret duplicate keys differently when selecting a package identity or dependency.

Jump to

Keyboard shortcuts

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