Variables
Const BUILTIN_REGEXP
BUILTIN_REGEXP: RegExp = /^builtin<([^>]+)>$/
Const CACHE_VERSION
CACHE_VERSION: 3 = 3
Const EXECUTABLE_FILE_MODE
EXECUTABLE_FILE_MODE: 493 = 493
Const HEADER_REGEXP
HEADER_REGEXP: RegExp = /^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/
Const NON_EXECUTABLE_FILE_MODE
NON_EXECUTABLE_FILE_MODE: 420 = 420
Const accidentalBlankLine
accidentalBlankLine: "diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,5 +1,5 @@thisis-a+file" = `diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,5 +1,5 @@thisis-a+file`
Const crlfLineBreaks
crlfLineBreaks: string = `diff --git a/banana.ts b/banana.tsnew file mode 100644index 0000000..3e1267f--- /dev/null+++ b/banana.ts@@ -0,0 +1 @@+this is a new file`.replace(/\n/g, `\r\n`)
Const invalidHeaders1
invalidHeaders1: "diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,5 +1,4 @@thisis-a+file" = `diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,5 +1,4 @@thisis-a+file`
Const invalidHeaders2
invalidHeaders2: "diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,4 +1,5 @@thisis-a+file" = `diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,4 +1,5 @@thisis-a+file`
Const invalidHeaders3
invalidHeaders3: "diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,0 +1,5 @@thisis-a+file" = `diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,0 +1,5 @@thisis-a+file`
Const invalidHeaders4
invalidHeaders4: "diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,5 +1,0 @@thisis-a+file" = `diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,5 +1,0 @@thisis-a+file`
Const invalidHeaders5
invalidHeaders5: "diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,5 +1,5@@thisis-a+file" = `diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,5 +1,5@@thisis-a+file`
Const modeChangeAndModifyAndRename
modeChangeAndModifyAndRename: "diff --git a/numbers.txt b/banana.txtold mode 100644new mode 100755similarity index 96%rename from numbers.txtrename to banana.txtindex fbf1785..92d2c5f--- a/numbers.txt+++ b/banana.txt@@ -1,4 +1,4 @@-one+netwo" = `diff --git a/numbers.txt b/banana.txtold mode 100644new mode 100755similarity index 96%rename from numbers.txtrename to banana.txtindex fbf1785..92d2c5f--- a/numbers.txt+++ b/banana.txt@@ -1,4 +1,4 @@-one+netwo`
Const patch
patch: "diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,5 +1,5 @@thisis-a+file" = `diff --git a/banana.ts b/banana.tsindex 2de83dd..842652c 100644--- a/banana.ts+++ b/banana.ts@@ -1,5 +1,5 @@thisis-a+file`
@yarnpkg/plugin-patch
This plugin adds support for the
patch:
protocol.Install
This plugin is included by default in Yarn.
Usage
Run
yarn patch <package name>
and edit the resulting folder.Once you're ready, run
yarn patch-commit -s <patch folder>
to store the result inside a.patch
file.Add the
patch:
protocol to your dependencies as such:{ "dependencies": { "lodash": "patch:lodash@1.0.0#./my-patch-file.patch" } }
Caveat
You cannot add dependencies through the
patch:
protocol. Check this FAQ entry for more details.