Documentation
¶
Index ¶
- func FileExists(path string) bool
- func FindupFrom(name, dir string) (string, error)
- func ParsePackageManagerString(packageManager string) (manager string, version string, err error)
- func PathExists(path string) bool
- type PackageManager
- func DetectPackageManager(projectDirectory string) (packageManager *PackageManager, err error)
- func GetPackageManager(projectDirectory string, pkg *packageJson.PackageJSON) (packageManager *PackageManager, err error)
- func GetPackageManagerFromString(packageManagerStr string) (packageManager *PackageManager, err error)
- func (pm PackageManager) CanPrune(projectDirectory string) (bool, error)
- func (pm PackageManager) GetVersion() (string, error)
- func (pm PackageManager) GetWorkspaceIgnores(rootpath string) ([]string, error)
- func (pm PackageManager) GetWorkspaces(rootpath string, relativePath bool) ([]string, error)
- func (pm PackageManager) PrunePatchedPackages(pkgJSON *packageJson.PackageJSON, patches []string) error
- type Pnpm6Workspaces
- type PnpmWorkspaces
- type YarnRC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
func FindupFrom ¶
func ParsePackageManagerString ¶
ParsePackageManagerString takes a package manager version string parses it into consituent components
func PathExists ¶
Types ¶
type PackageManager ¶
type PackageManager struct { // The descriptive name of the Package Manager. Name string // The unique identifier of the Package Manager. Slug string // The command used to invoke the Package Manager. Command string // The location of the package spec file used by the Package Manager. Specfile string // The location of the package lock file used by the Package Manager. Lockfile string // The directory in which package assets are stored by the Package Manager. PackageDir string // The location of the file that defines the workspace. Empty if workspaces defined in package.json WorkspaceConfigurationPath string // The separator that the Package Manger uses to identify arguments that // should be passed through to the underlying script. ArgSeparator []string // Test a manager and version tuple to see if it is the Package Manager. Matches func(manager string, version string) (bool, error) // contains filtered or unexported fields }
PackageManager is an abstraction across package managers
func DetectPackageManager ¶ added in v0.0.5
func DetectPackageManager(projectDirectory string) (packageManager *PackageManager, err error)
detectPackageManager attempts to detect the package manager by inspecting the project directory state.
func GetPackageManager ¶
func GetPackageManager(projectDirectory string, pkg *packageJson.PackageJSON) (packageManager *PackageManager, err error)
GetPackageManager attempts all methods for identifying the package manager in use.
func GetPackageManagerFromString ¶ added in v0.0.3
func GetPackageManagerFromString(packageManagerStr string) (packageManager *PackageManager, err error)
func (PackageManager) CanPrune ¶
func (pm PackageManager) CanPrune(projectDirectory string) (bool, error)
CanPrune returns if we can produce a pruned workspace. Can error if fs issues occur
func (PackageManager) GetVersion ¶ added in v0.0.5
func (pm PackageManager) GetVersion() (string, error)
func (PackageManager) GetWorkspaceIgnores ¶
func (pm PackageManager) GetWorkspaceIgnores(rootpath string) ([]string, error)
GetWorkspaceIgnores returns an array of globs not to search for workspaces.
func (PackageManager) GetWorkspaces ¶
func (pm PackageManager) GetWorkspaces(rootpath string, relativePath bool) ([]string, error)
GetWorkspaces returns the list of package.json files for the current mono[space|repo].
func (PackageManager) PrunePatchedPackages ¶
func (pm PackageManager) PrunePatchedPackages(pkgJSON *packageJson.PackageJSON, patches []string) error
PrunePatchedPackages will alter the provided pkgJSON to only reference the provided patches
type Pnpm6Workspaces ¶
type Pnpm6Workspaces struct {
Packages []string `yaml:"packages,omitempty"`
}
Pnpm6Workspaces is a representation of workspace package globs found in pnpm-workspace.yaml
type PnpmWorkspaces ¶
type PnpmWorkspaces struct {
Packages []string `yaml:"packages,omitempty"`
}
PnpmWorkspaces is a representation of workspace package globs found in pnpm-workspace.yaml