Documentation
¶
Overview ¶
Package source parses the source-reference vocabulary shared by package installation and Pig piglet resource origins. It preserves upstream Pi's npm/git/local grammar while allowing Pig products to contribute explicit lowercase schemes without teaching generic code their transport semantics.
pig additive (D18): product-neutral typed source and contributed schemes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidNPMPackageName ¶
ValidNPMPackageName reports whether name is a name npm accepts for a package that is about to be published. It does not check npm's length limit; npm reports that when it publishes.
pig additive (D18): npm publication of Packages and Piglet source.
func ValidNPMVersion ¶
ValidNPMVersion reports whether version is a version npm publishes: a full MAJOR.MINOR.PATCH semantic version with an optional prerelease and build, and no leading `v`. Go's semver also accepts the shorthand `1` and `1.2`, which npm rejects as an invalid version.
pig additive (D18): npm publication of Packages and Piglet source.
Types ¶
type BarePolicy ¶
type BarePolicy uint8
BarePolicy controls how a source without an explicit scheme/path marker is interpreted. Each caller selects local, npm, or rejection semantics.
const ( BareReject BarePolicy = iota BareLocal BareNPM )
type Options ¶
type Options struct {
BaseDir string
Bare BarePolicy
AllowContributed bool
}
Options defines boundary-specific parsing behavior.
type Ref ¶
type Ref struct {
Raw string
Kind Kind
Scheme string
Locator string
NPMName string
NPMVer string
NPMRegistry string
GitHost string
GitPath string
GitRef string
GitRepo string
GitSubdir string
}
Ref is a parsed source. Raw is retained for settings/piglet serialization; identity fields exclude mutable version/ref selectors where upstream package de-duplication does.