Options
All
  • Public
  • Public/Protected
  • All
Menu

Package plugin-git

@yarnpkg/plugin-git

This plugin adds support for cloning packages from Git repositories.

Install

This plugin is included by default in Yarn.

Type aliases

RepoUrlParts

RepoUrlParts: object

Type declaration

  • extra: object
    • [key: string]: string
  • repo: string
  • treeish: object

Variables

Const INVALID_PATTERNS

INVALID_PATTERNS: string[] = [`./.`,`../..`,]

Const VALID_PATTERNS

VALID_PATTERNS: string[] = [`GitHubOrg/foo-bar.js`,`GitHubOrg/foo2bar.js`,`GitHubOrg/foo-bar.js#hash`,`GitHubOrg/foo-bar.js#commit:hash`,`GitHubOrg/foo-bar.js#commit=hash`,`GitHubOrg/foo-bar.js#commit=hash&workspace=foo`,`GitHubOrg/foo-bar.js#tag=hello`,`GitHubOrg/foo-bar.js#workspace=foo`,`github:GitHubOrg/foo-bar.js`,`github:GitHubOrg/foo-bar.js#hash`,`https://github.com/yarnpkg/util-deprecate.git#v1.0.0`,`https://github.com/yarnpkg/util-deprecate.git#semver:v1.0.0`,`https://github.com/yarnpkg/util-deprecate.git#master`,`https://github.com/yarnpkg/util-deprecate.git#b3562c2798507869edb767da869cd7b85487726d`,`https://github.com/yarnpkg/util-deprecate/tarball/b3562c2798507869edb767da869cd7b85487726d`,`git://github.com/yarnpkg/util-deprecate.git#v1.0.1`,`git+ssh://git@github.com/yarnpkg/util-deprecate.git#v1.0.1`,`ssh://git@github.com/yarnpkg/util-deprecate.git#v1.0.1`,`git+ssh://git@github.com:yarnpkg/berry.git#v2.1.1`,`ssh://git@github.com:yarnpkg/berry.git#v2.1.1`,`git+https://github.com/yarnpkg/util-deprecate#v1.0.1`,`git+https://github.com/yarnpkg/util-deprecate.git#v1.0.1`,]

Const gitPatterns

gitPatterns: RegExp[] = [/^ssh:/,/^git(?:\+[^:]+)?:/,// `git+` is optional, `.git` is required/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,// GitHub `/tarball/` URLs/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/,]

Functions

clone

  • clone(url: string, configuration: Configuration): Promise<string & object>

correctURL

  • correctURL(gitURL: string): string

fetchBase

  • fetchBase(root: PortablePath, __namedParameters: object): Promise<object>

fetchChangedFiles

  • fetchChangedFiles(root: PortablePath, __namedParameters: object): Promise<(string & object)[]>

fetchChangedWorkspaces

  • fetchChangedWorkspaces(__namedParameters: object): Promise<Set<Workspace>>

fetchRoot

  • fetchRoot(initialCwd: PortablePath): Promise<null | string & object>

git

  • git(message: string, args: Array<string>, opts: Omit<execUtils.ExecvpOptions, "strict">, __namedParameters: object): Promise<object>

isGitUrl

  • isGitUrl(url: string): boolean

lastIndexOfBefore

  • lastIndexOfBefore(str: string, char: string, beforeChar: string): number

lsRemote

  • lsRemote(repo: string, configuration: Configuration): Promise<Map<any, any>>

makeGitEnvironment

  • makeGitEnvironment(): object

normalizeLocator

normalizeRepoUrl

  • normalizeRepoUrl(url: string, __namedParameters?: object): string

resolveUrl

  • resolveUrl(url: string, configuration: Configuration): Promise<string>

safeURL

  • safeURL(url: string): undefined | URL

splitRepoUrl

tryParseGitURL

  • tryParseGitURL(gitURL: string): undefined | URL

Object literals

Const plugin

plugin: object

fetchers

fetchers: GitFetcher[] = [GitFetcher,]

resolvers

resolvers: GitResolver[] = [GitResolver,]

configuration

configuration: object

changesetBaseRefs

changesetBaseRefs: object

default

default: string[] = [`master`, `origin/master`, `upstream/master`, `main`, `origin/main`, `upstream/main`]

description

description: string = `The base git refs that the current HEAD is compared against when detecting changes. Supports git branches, tags, and commits.`

isArray

isArray: true = true

isNullable

isNullable: false = false

type

type: STRING = SettingsType.STRING

changesetIgnorePatterns

changesetIgnorePatterns: object

default

default: never[] = []

description

description: string = `Array of glob patterns; files matching them will be ignored when fetching the changed files`

isArray

isArray: true = true

type

type: STRING = SettingsType.STRING

cloneConcurrency

cloneConcurrency: object

default

default: number = 2

description

description: string = `Maximal number of concurrent clones`

type

type: NUMBER = SettingsType.NUMBER

Generated using TypeDoc