Options
All
  • Public
  • Public/Protected
  • All
Menu

Package plugin-patch

@yarnpkg/plugin-patch

This plugin adds support for the patch: protocol.

Install

This plugin is included by default in Yarn.

Type aliases

FilePatch

FilePatch: object

Type declaration

  • afterHash: string | null
  • beforeHash: string | null
  • hunks: Array<Hunk>
  • path: PortablePath
  • semverExclusivity: string | null
  • type: "patch"

Hunk

Hunk: object

Type declaration

HunkHeader

HunkHeader: object

Type declaration

  • original: object
    • length: number
    • start: number
  • patched: object
    • length: number
    • start: number

ParsedPatchFile

ParsedPatchFile: Array<PatchFilePart>

PatchFilePart

PatchFilePart: FilePatch | FileDeletion | FileCreation | FileRename | FileModeChange

Variables

Const EXECUTABLE_FILE_MODE

EXECUTABLE_FILE_MODE: 493 = 493

Const NON_EXECUTABLE_FILE_MODE

NON_EXECUTABLE_FILE_MODE: 420 = 420

Functions

applyPatch

  • applyPatch(__namedParameters: object, __namedParameters: object): Promise<void>
  • How does noNewLineAtEndOfFile work?

    if you remove the newline from a file that had one without editing other bits:

    it creates an insertion/removal pair where the insertion has \ No new line at end of file

    if you edit a file that didn't have a new line and don't add one:

    both insertion and deletion have \ No new line at end of file

    if you edit a file that didn't have a new line and add one:

    deletion has \ No new line at end of file but not insertion

    if you edit a file that had a new line and leave it in:

    neither insetion nor deletion have the annoation

    if you remove the newline from a file that had one without editing other bits:

    it creates an insertion/removal pair where the insertion has \ No new line at end of file

    if you edit a file that didn't have a new line and don't add one:

    both insertion and deletion have \ No new line at end of file

    if you edit a file that didn't have a new line and add one:

    deletion has \ No new line at end of file but not insertion

    if you edit a file that had a new line and leave it in:

    neither insetion nor deletion have the annoation

    Parameters

    • __namedParameters: object
      • hunks: object[]
      • path: string & object
    • __namedParameters: object
      • baseFs: FakeFS<string & object>
      • dryRun: boolean

    Returns Promise<void>

applyPatchFile

  • applyPatchFile(effects: ParsedPatchFile, __namedParameters?: object): Promise<void>

applyPatchFile

  • applyPatchFile(effects: ParsedPatchFile, __namedParameters?: object): Promise<void>

applyPatchFile

  • applyPatchFile(effects: ParsedPatchFile, __namedParameters?: object): Promise<void>

extractPackageToDisk

  • extractPackageToDisk(locator: Locator, __namedParameters: object): Promise<string & object>

extractPackageToDisk

  • extractPackageToDisk(locator: Locator, __namedParameters: object): Promise<string & object>

interpretParsedPatchFile

isParentRequired

isParentRequired

loadPatchFiles

loadPatchFiles

makeDescriptor

  • makeDescriptor(ident: Ident, __namedParameters: object): Locator

makeDescriptor

  • makeDescriptor(ident: Ident, __namedParameters: object): Locator

makeLocator

  • makeLocator(ident: Ident, __namedParameters: object): Locator

makeLocator

  • makeLocator(ident: Ident, __namedParameters: object): Locator

parseDescriptor

parseDescriptor

parseHunkHeaderLine

  • parseHunkHeaderLine(headerLine: string): HunkHeader

parseLocator

  • parseLocator(locator: Locator): object

parseLocator

  • parseLocator(locator: Locator): object

parsePatchFile

parsePatchFile

parsePatchFile

verifyHunkIntegrity

  • verifyHunkIntegrity(hunk: Hunk): void

Object literals

Const plugin

plugin: object

commands

commands: (PatchCommitCommand | PatchCommand)[] = [PatchCommit,Patch,]

fetchers

fetchers: PatchFetcher[] = [PatchFetcher,]

resolvers

resolvers: PatchResolver[] = [PatchResolver,]

Generated using TypeDoc