store

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectFrameworkVersion

func DetectFrameworkVersion(dir string, composerPackageName string) string

DetectFrameworkVersion reads composer.lock in dir and returns the major version of the given composer package. Returns "" if the file is missing or the package is not found.

func DetectFrameworkWithStore

func DetectFrameworkWithStore(dir string) (string, bool)

DetectFrameworkWithStore wraps config.DetectFramework with a store fallback. When no local framework matches and stdin is a terminal, it checks the store index and prompts the user to install a matching definition. Returns the framework name and true if resolved, ("", false) otherwise.

Types

type Client

type Client struct {
	BaseURL  string
	CacheDir string
}

Client fetches framework definitions from the remote store.

func NewClient

func NewClient() *Client

NewClient returns a store client with default settings.

func (*Client) DetectFromStore

func (c *Client) DetectFromStore(dir string) (*IndexEntry, string, bool)

DetectFromStore checks the store index for a framework matching the given project directory. Returns the matching entry, the resolved version, and true if found. The version is auto-detected from composer.lock when possible.

func (*Client) FetchFramework

func (c *Client) FetchFramework(name, version string) (*config.Framework, error)

FetchFramework downloads a framework definition from the store. Always fetches from remote to ensure definitions are up to date.

func (*Client) FetchIndex

func (c *Client) FetchIndex() (*Index, error)

FetchIndex downloads the store index, using a 24-hour disk cache.

func (*Client) InvalidateIndex

func (c *Client) InvalidateIndex()

InvalidateIndex removes the cached index so the next FetchIndex call hits the network.

func (*Client) Search

func (c *Client) Search(query string) ([]IndexEntry, error)

Search filters the store index by a case-insensitive substring match on name or label.

type Index

type Index struct {
	Frameworks []IndexEntry `json:"frameworks"`
}

Index is the top-level store index listing all available frameworks.

type IndexEntry

type IndexEntry struct {
	Name     string                 `json:"name"`
	Label    string                 `json:"label"`
	Versions []string               `json:"versions"`
	Latest   string                 `json:"latest"`
	Detect   []config.FrameworkRule `json:"detect"`
}

IndexEntry describes a single framework available in the store.

Jump to

Keyboard shortcuts

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