package.dist.applyPatches.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of patch-package Show documentation
Show all versions of patch-package Show documentation
Fix broken node modules with no fuss
The newest version!
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyPatch = exports.applyPatchesForPackage = exports.applyPatchesForApp = void 0;
const chalk_1 = __importDefault(require("chalk"));
const fs_1 = require("fs");
const fs_extra_1 = require("fs-extra");
const path_1 = require("path");
const semver_1 = __importDefault(require("semver"));
const hash_1 = require("./hash");
const makePatch_1 = require("./makePatch");
const packageIsDevDependency_1 = require("./packageIsDevDependency");
const apply_1 = require("./patch/apply");
const read_1 = require("./patch/read");
const reverse_1 = require("./patch/reverse");
const patchFs_1 = require("./patchFs");
const path_2 = require("./path");
const stateFile_1 = require("./stateFile");
class PatchApplicationError extends Error {
constructor(msg) {
super(msg);
}
}
function getInstalledPackageVersion({ appPath, path, pathSpecifier, isDevOnly, patchFilename, }) {
const packageDir = path_2.join(appPath, path);
if (!fs_extra_1.existsSync(packageDir)) {
if (process.env.NODE_ENV === "production" && isDevOnly) {
return null;
}
let err = `${chalk_1.default.red("Error:")} Patch file found for package ${path_1.posix.basename(pathSpecifier)}` + ` which is not present at ${path_2.relative(".", packageDir)}`;
if (!isDevOnly && process.env.NODE_ENV === "production") {
err += `
If this package is a dev dependency, rename the patch file to
${chalk_1.default.bold(patchFilename.replace(".patch", ".dev.patch"))}
`;
}
throw new PatchApplicationError(err);
}
const { version } = require(path_2.join(packageDir, "package.json"));
// normalize version for `npm ci`
const result = semver_1.default.valid(version);
if (result === null) {
throw new PatchApplicationError(`${chalk_1.default.red("Error:")} Version string '${version}' cannot be parsed from ${path_2.join(packageDir, "package.json")}`);
}
return result;
}
function logPatchApplication(patchDetails) {
const sequenceString = patchDetails.sequenceNumber != null
? ` (${patchDetails.sequenceNumber}${patchDetails.sequenceName ? " " + patchDetails.sequenceName : ""})`
: "";
console.log(`${chalk_1.default.bold(patchDetails.pathSpecifier)}@${patchDetails.version}${sequenceString} ${chalk_1.default.green("✔")}`);
}
function applyPatchesForApp({ appPath, reverse, patchDir, shouldExitWithError, shouldExitWithWarning, bestEffort, }) {
const patchesDirectory = path_2.join(appPath, patchDir);
const groupedPatches = patchFs_1.getGroupedPatches(patchesDirectory);
if (groupedPatches.numPatchFiles === 0) {
console.log(chalk_1.default.blueBright("No patch files found"));
return;
}
const errors = [];
const warnings = [...groupedPatches.warnings];
for (const patches of Object.values(groupedPatches.pathSpecifierToPatchFiles)) {
applyPatchesForPackage({
patches,
appPath,
patchDir,
reverse,
warnings,
errors,
bestEffort,
});
}
for (const warning of warnings) {
console.log(warning);
}
for (const error of errors) {
console.log(error);
}
const problemsSummary = [];
if (warnings.length) {
problemsSummary.push(chalk_1.default.yellow(`${warnings.length} warning(s)`));
}
if (errors.length) {
problemsSummary.push(chalk_1.default.red(`${errors.length} error(s)`));
}
if (problemsSummary.length) {
console.log("---");
console.log("patch-package finished with", problemsSummary.join(", ") + ".");
}
if (errors.length && shouldExitWithError) {
process.exit(1);
}
if (warnings.length && shouldExitWithWarning) {
process.exit(1);
}
process.exit(0);
}
exports.applyPatchesForApp = applyPatchesForApp;
function applyPatchesForPackage({ patches, appPath, patchDir, reverse, warnings, errors, bestEffort, }) {
const pathSpecifier = patches[0].pathSpecifier;
const state = patches.length > 1 ? stateFile_1.getPatchApplicationState(patches[0]) : null;
const unappliedPatches = patches.slice(0);
const appliedPatches = [];
// if there are multiple patches to apply, we can't rely on the reverse-patch-dry-run behavior to make this operation
// idempotent, so instead we need to check the state file to see whether we have already applied any of the patches
// todo: once this is battle tested we might want to use the same approach for single patches as well, but it's not biggie since the dry run thing is fast
if (unappliedPatches && state) {
for (let i = 0; i < state.patches.length; i++) {
const patchThatWasApplied = state.patches[i];
if (!patchThatWasApplied.didApply) {
break;
}
const patchToApply = unappliedPatches[0];
const currentPatchHash = hash_1.hashFile(path_2.join(appPath, patchDir, patchToApply.patchFilename));
if (patchThatWasApplied.patchContentHash === currentPatchHash) {
// this patch was applied we can skip it
appliedPatches.push(unappliedPatches.shift());
}
else {
console.log(chalk_1.default.red("Error:"), `The patches for ${chalk_1.default.bold(pathSpecifier)} have changed.`, `You should reinstall your node_modules folder to make sure the package is up to date`);
process.exit(1);
}
}
}
if (reverse && state) {
// if we are reversing the patches we need to make the unappliedPatches array
// be the reversed version of the appliedPatches array.
// The applied patches array should then be empty because it is used differently
// when outputting the state file.
unappliedPatches.length = 0;
unappliedPatches.push(...appliedPatches);
unappliedPatches.reverse();
appliedPatches.length = 0;
}
if (appliedPatches.length) {
// some patches have already been applied
appliedPatches.forEach(logPatchApplication);
}
if (!unappliedPatches.length) {
return;
}
let failedPatch = null;
packageLoop: for (const patchDetails of unappliedPatches) {
try {
const { name, version, path, isDevOnly, patchFilename } = patchDetails;
const installedPackageVersion = getInstalledPackageVersion({
appPath,
path,
pathSpecifier,
isDevOnly: isDevOnly ||
// check for direct-dependents in prod
(process.env.NODE_ENV === "production" &&
packageIsDevDependency_1.packageIsDevDependency({
appPath,
patchDetails,
})),
patchFilename,
});
if (!installedPackageVersion) {
// it's ok we're in production mode and this is a dev only package
console.log(`Skipping dev-only ${chalk_1.default.bold(pathSpecifier)}@${version} ${chalk_1.default.blue("✔")}`);
continue;
}
if (applyPatch({
patchFilePath: path_2.join(appPath, patchDir, patchFilename),
reverse,
patchDetails,
patchDir,
cwd: process.cwd(),
bestEffort,
})) {
appliedPatches.push(patchDetails);
// yay patch was applied successfully
// print warning if version mismatch
if (installedPackageVersion !== version) {
warnings.push(createVersionMismatchWarning({
packageName: name,
actualVersion: installedPackageVersion,
originalVersion: version,
pathSpecifier,
path,
}));
}
logPatchApplication(patchDetails);
}
else if (patches.length > 1) {
makePatch_1.logPatchSequenceError({ patchDetails });
// in case the package has multiple patches, we need to break out of this inner loop
// because we don't want to apply more patches on top of the broken state
failedPatch = patchDetails;
break packageLoop;
}
else if (installedPackageVersion === version) {
// completely failed to apply patch
// TODO: propagate useful error messages from patch application
errors.push(createBrokenPatchFileError({
packageName: name,
patchFilename,
pathSpecifier,
path,
}));
break packageLoop;
}
else {
errors.push(createPatchApplicationFailureError({
packageName: name,
actualVersion: installedPackageVersion,
originalVersion: version,
patchFilename,
path,
pathSpecifier,
}));
// in case the package has multiple patches, we need to break out of this inner loop
// because we don't want to apply more patches on top of the broken state
break packageLoop;
}
}
catch (error) {
if (error instanceof PatchApplicationError) {
errors.push(error.message);
}
else {
errors.push(createUnexpectedError({
filename: patchDetails.patchFilename,
error: error,
}));
}
// in case the package has multiple patches, we need to break out of this inner loop
// because we don't want to apply more patches on top of the broken state
break packageLoop;
}
}
if (patches.length > 1) {
if (reverse) {
if (!state) {
throw new Error("unexpected state: no state file found while reversing");
}
// if we removed all the patches that were previously applied we can delete the state file
if (appliedPatches.length === patches.length) {
stateFile_1.clearPatchApplicationState(patches[0]);
}
else {
// We failed while reversing patches and some are still in the applied state.
// We need to update the state file to reflect that.
// appliedPatches is currently the patches that were successfully reversed, in the order they were reversed
// So we need to find the index of the last reversed patch in the original patches array
// and then remove all the patches after that. Sorry for the confusing code.
const lastReversedPatchIndex = patches.indexOf(appliedPatches[appliedPatches.length - 1]);
if (lastReversedPatchIndex === -1) {
throw new Error("unexpected state: failed to find last reversed patch in original patches array");
}
stateFile_1.savePatchApplicationState({
packageDetails: patches[0],
patches: patches.slice(0, lastReversedPatchIndex).map((patch) => ({
didApply: true,
patchContentHash: hash_1.hashFile(path_2.join(appPath, patchDir, patch.patchFilename)),
patchFilename: patch.patchFilename,
})),
isRebasing: false,
});
}
}
else {
const nextState = appliedPatches.map((patch) => ({
didApply: true,
patchContentHash: hash_1.hashFile(path_2.join(appPath, patchDir, patch.patchFilename)),
patchFilename: patch.patchFilename,
}));
if (failedPatch) {
nextState.push({
didApply: false,
patchContentHash: hash_1.hashFile(path_2.join(appPath, patchDir, failedPatch.patchFilename)),
patchFilename: failedPatch.patchFilename,
});
}
stateFile_1.savePatchApplicationState({
packageDetails: patches[0],
patches: nextState,
isRebasing: !!failedPatch,
});
}
if (failedPatch) {
process.exit(1);
}
}
}
exports.applyPatchesForPackage = applyPatchesForPackage;
function applyPatch({ patchFilePath, reverse, patchDetails, patchDir, cwd, bestEffort, }) {
const patch = read_1.readPatch({
patchFilePath,
patchDetails,
patchDir,
});
const forward = reverse ? reverse_1.reversePatch(patch) : patch;
try {
if (!bestEffort) {
apply_1.executeEffects(forward, { dryRun: true, cwd, bestEffort: false });
}
const errors = bestEffort ? [] : undefined;
apply_1.executeEffects(forward, { dryRun: false, cwd, bestEffort, errors });
if (errors === null || errors === void 0 ? void 0 : errors.length) {
console.log("Saving errors to", chalk_1.default.cyan.bold("./patch-package-errors.log"));
fs_1.writeFileSync("patch-package-errors.log", errors.join("\n\n"));
process.exit(0);
}
}
catch (e) {
try {
const backward = reverse ? patch : reverse_1.reversePatch(patch);
apply_1.executeEffects(backward, {
dryRun: true,
cwd,
bestEffort: false,
});
}
catch (e) {
return false;
}
}
return true;
}
exports.applyPatch = applyPatch;
function createVersionMismatchWarning({ packageName, actualVersion, originalVersion, pathSpecifier, path, }) {
return `
${chalk_1.default.yellow("Warning:")} patch-package detected a patch file version mismatch
Don't worry! This is probably fine. The patch was still applied
successfully. Here's the deets:
Patch file created for
${packageName}@${chalk_1.default.bold(originalVersion)}
applied to
${packageName}@${chalk_1.default.bold(actualVersion)}
At path
${path}
This warning is just to give you a heads-up. There is a small chance of
breakage even though the patch was applied successfully. Make sure the package
still behaves like you expect (you wrote tests, right?) and then run
${chalk_1.default.bold(`patch-package ${pathSpecifier}`)}
to update the version in the patch file name and make this warning go away.
`;
}
function createBrokenPatchFileError({ packageName, patchFilename, path, pathSpecifier, }) {
return `
${chalk_1.default.red.bold("**ERROR**")} ${chalk_1.default.red(`Failed to apply patch for package ${chalk_1.default.bold(packageName)} at path`)}
${path}
This error was caused because patch-package cannot apply the following patch file:
patches/${patchFilename}
Try removing node_modules and trying again. If that doesn't work, maybe there was
an accidental change made to the patch file? Try recreating it by manually
editing the appropriate files and running:
patch-package ${pathSpecifier}
If that doesn't work, then it's a bug in patch-package, so please submit a bug
report. Thanks!
https://github.com/ds300/patch-package/issues
`;
}
function createPatchApplicationFailureError({ packageName, actualVersion, originalVersion, patchFilename, path, pathSpecifier, }) {
return `
${chalk_1.default.red.bold("**ERROR**")} ${chalk_1.default.red(`Failed to apply patch for package ${chalk_1.default.bold(packageName)} at path`)}
${path}
This error was caused because ${chalk_1.default.bold(packageName)} has changed since you
made the patch file for it. This introduced conflicts with your patch,
just like a merge conflict in Git when separate incompatible changes are
made to the same piece of code.
Maybe this means your patch file is no longer necessary, in which case
hooray! Just delete it!
Otherwise, you need to generate a new patch file.
To generate a new one, just repeat the steps you made to generate the first
one.
i.e. manually make the appropriate file changes, then run
patch-package ${pathSpecifier}
Info:
Patch file: patches/${patchFilename}
Patch was made for version: ${chalk_1.default.green.bold(originalVersion)}
Installed version: ${chalk_1.default.red.bold(actualVersion)}
`;
}
function createUnexpectedError({ filename, error, }) {
return `
${chalk_1.default.red.bold("**ERROR**")} ${chalk_1.default.red(`Failed to apply patch file ${chalk_1.default.bold(filename)}`)}
${error.stack}
`;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwbHlQYXRjaGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2FwcGx5UGF0Y2hlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxrREFBeUI7QUFDekIsMkJBQWtDO0FBQ2xDLHVDQUFxQztBQUNyQywrQkFBNEI7QUFDNUIsb0RBQTJCO0FBQzNCLGlDQUFpQztBQUNqQywyQ0FBbUQ7QUFFbkQscUVBQWlFO0FBQ2pFLHlDQUE4QztBQUM5Qyx1Q0FBd0M7QUFDeEMsNkNBQThDO0FBQzlDLHVDQUE2QztBQUM3QyxpQ0FB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TlYgPT09IFwicHJvZHVjdGlvblwiICYmXG4gICAgICAgICAgICBwYWNrYWdlSXNEZXZEZXBlbmRlbmN5KHtcbiAgICAgICAgICAgICAgYXBwUGF0aCxcbiAgICAgICAgICAgICAgcGF0Y2hEZXRhaWxzLFxuICAgICAgICAgICAgfSkpLFxuICAgICAgICBwYXRjaEZpbGVuYW1lLFxuICAgICAgfSlcbiAgICAgIGlmICghaW5zdGFsbGVkUGFja2FnZVZlcnNpb24pIHtcbiAgICAgICAgLy8gaXQncyBvayB3ZSdyZSBpbiBwcm9kdWN0aW9uIG1vZGUgYW5kIHRoaXMgaXMgYSBkZXYgb25seSBwYWNrYWdlXG4gICAgICAgIGNvbnNvbGUubG9nKFxuICAgICAgICAgIGBTa2lwcGluZyBkZXYtb25seSAke2NoYWxrLmJvbGQoXG4gICAgICAgICAgICBwYXRoU3BlY2lmaWVyLFxuICAgICAgICAgICl9QCR7dmVyc2lvbn0gJHtjaGFsay5ibHVlKFwi4pyUXCIpfWAsXG4gICAgICAgIClcbiAgICAgICAgY29udGludWVcbiAgICAgIH1cblxuICAgICAgaWYgKFxuICAgICAgICBhcHBseVBhdGNoKHtcbiAgICAgICAgICBwYXRjaEZpbGVQYXRoOiBqb2luKGFwcFBhdGgsIHBhdGNoRGlyLCBwYXRjaEZpbGVuYW1lKSBhcyBzdHJpbmcsXG4gICAgICAgICAgcmV2ZXJzZSxcbiAgICAgICAgICBwYXRjaERldGFpbHMsXG4gICAgICAgICAgcGF0Y2hEaXIsXG4gICAgICAgICAgY3dkOiBwcm9jZXNzLmN3ZCgpLFxuICAgICAgICAgIGJlc3RFZmZvcnQsXG4gICAgICAgIH0pXG4gICAgICApIHtcbiAgICAgICAgYXBwbGllZFBhdGNoZXMucHVzaChwYXRjaERldGFpbHMpXG4gICAgICAgIC8vIHlheSBwYXRjaCB3YXMgYXBwbGllZCBzdWNjZXNzZnVsbHlcbiAgICAgICAgLy8gcHJpbnQgd2FybmluZyBpZiB2ZXJzaW9uIG1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