@pnpm/patching.apply-patch 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +2 -1
- package/lib/index.js +9 -1
- package/lib/index.js.map +1 -1
- package/package.json +7 -4
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface ApplyPatchToDirOpts {
|
|
2
|
+
allowFailure?: boolean;
|
|
2
3
|
patchedDir: string;
|
|
3
4
|
patchFilePath: string;
|
|
4
5
|
}
|
|
5
|
-
export declare function applyPatchToDir(opts: ApplyPatchToDirOpts):
|
|
6
|
+
export declare function applyPatchToDir(opts: ApplyPatchToDirOpts): boolean;
|
package/lib/index.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.applyPatchToDir = void 0;
|
|
4
4
|
const error_1 = require("@pnpm/error");
|
|
5
5
|
const applyPatches_1 = require("@pnpm/patch-package/dist/applyPatches");
|
|
6
|
+
const logger_1 = require("@pnpm/logger");
|
|
6
7
|
function applyPatchToDir(opts) {
|
|
7
8
|
// Ideally, we would just run "patch" or "git apply".
|
|
8
9
|
// However, "patch" is not available on Windows and "git apply" is hard to execute on a subdirectory of an existing repository
|
|
@@ -24,8 +25,15 @@ function applyPatchToDir(opts) {
|
|
|
24
25
|
process.chdir(cwd);
|
|
25
26
|
}
|
|
26
27
|
if (!success) {
|
|
27
|
-
|
|
28
|
+
const message = `Could not apply patch ${opts.patchFilePath} to ${opts.patchedDir}`;
|
|
29
|
+
if (opts.allowFailure) {
|
|
30
|
+
(0, logger_1.globalWarn)(message);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw new error_1.PnpmError('PATCH_FAILED', message);
|
|
34
|
+
}
|
|
28
35
|
}
|
|
36
|
+
return success;
|
|
29
37
|
}
|
|
30
38
|
exports.applyPatchToDir = applyPatchToDir;
|
|
31
39
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,wEAAkE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,wEAAkE;AAClE,yCAAyC;AAQzC,SAAgB,eAAe,CAAE,IAAyB;IACxD,qDAAqD;IACrD,8HAA8H;IAC9H,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IACzB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAC9B,IAAI,OAAO,GAAG,KAAK,CAAA;IACnB,IAAI,CAAC;QACH,OAAO,GAAG,IAAA,yBAAU,EAAC;YACnB,aAAa,EAAE,IAAI,CAAC,aAAa;SAClC,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC,CAAC,sBAAsB;QACzC,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC1B,MAAM,IAAI,iBAAS,CAAC,iBAAiB,EAAE,yBAAyB,IAAI,CAAC,aAAa,EAAE,CAAC,CAAA;QACvF,CAAC;QACD,MAAM,IAAI,iBAAS,CAAC,eAAe,EAAE,mBAAmB,IAAI,CAAC,aAAa,aAAa,GAAG,CAAC,OAAiB,EAAE,CAAC,CAAA;IACjH,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACpB,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,yBAAyB,IAAI,CAAC,aAAa,OAAO,IAAI,CAAC,UAAU,EAAE,CAAA;QACnF,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAA;QACrB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,iBAAS,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;QAC9C,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AA3BD,0CA2BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/patching.apply-patch",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Apply a patch to a directory",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -22,14 +22,17 @@
|
|
|
22
22
|
"url": "https://github.com/pnpm/pnpm/issues"
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://github.com/pnpm/pnpm/blob/main/patching/apply-patch#readme",
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@pnpm/logger": "^5.0.0"
|
|
27
|
+
},
|
|
25
28
|
"dependencies": {
|
|
26
29
|
"@pnpm/patch-package": "0.0.0",
|
|
27
30
|
"@pnpm/error": "6.0.1"
|
|
28
31
|
},
|
|
29
32
|
"devDependencies": {
|
|
30
|
-
"@pnpm/prepare": "0.0.
|
|
31
|
-
"@pnpm/patching.apply-patch": "3.0
|
|
32
|
-
"@pnpm/test-fixtures": "0.1.
|
|
33
|
+
"@pnpm/prepare": "0.0.100",
|
|
34
|
+
"@pnpm/patching.apply-patch": "3.1.0",
|
|
35
|
+
"@pnpm/test-fixtures": "0.1.30"
|
|
33
36
|
},
|
|
34
37
|
"funding": "https://opencollective.com/pnpm",
|
|
35
38
|
"exports": {
|