fix: resolve patch-package version mismatch for @wordpress/format-library#356
Merged
fix: resolve patch-package version mismatch for @wordpress/format-library#356
Conversation
The patch file was created for v5.38.0 but the installed version is now v5.41.0, causing a version mismatch warning during `npm install`. Regenerate the patch to match the current version.
patch-package excludes package.json from diffs by default. Patches that modify package.json (e.g., adding exports entries) require the `--exclude='^$'` flag to be included. Add this caveat to AGENTS.md.
Add `--error-on-warn` to the postinstall patch-package command so that version mismatches between patch files and installed packages cause a hard failure instead of a silent warning. This prevents dependabot PRs from being merged with stale patch files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Regenerates the
@wordpress/format-librarypatch file to match the currently installed version and adds--error-on-warnto prevent future mismatches from going unnoticed.Why?
Running
make npm-dependenciesproduces the following warning:This was introduced by #349 (and subsequent dependency bumps) which upgraded the package without regenerating the patch file.
How?
@wordpress/format-library@5.41.0usingnpx patch-package @wordpress/format-library --exclude='^$'(the--excludeflag is needed because the patch modifiespackage.json, which patch-package excludes by default).--error-on-warnto thepostinstallscript so that patch version mismatches cause a hard failure instead of a silent warning. This will cause CI (and local installs) to fail if a dependabot PR bumps a patched package without regenerating the patch.--exclude='^$'caveat inAGENTS.mdfor future reference.Testing Instructions
Verify CI checks pass.