8000 feat: add support for custom patches by dkonieczek · Pull Request #147 · searchspring/snapfu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add support for custom patches #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 28, 2025
Merged

Conversation

dkonieczek
Copy link
Contributor

Moved custom patches to a different directory ~/.searchspring/snapfu-patches/custom/{version} instead of ~/.searchspring/snapfu-patches/{framework}/{version} so that existing versions of snapfu don't break when reading new snapfu-patches structure. Custom patches are not listed in the snapfu patch list command. snapfu patch apply [version] and snapfu patch apply latest should not be affected. Only specifying a custom patch via snapfu patch apply [custom-patch-name] should be allowed and also not alter package.json version.

@dkonieczek dkonieczek requested review from korgon and Copilot May 28, 2025 14:46
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for custom patches by moving them to a new directory structure and ensuring that using a custom patch via "snapfu patch apply [custom-patch-name]" does not affect package.json version.

  • New function getCustomPatchVersions to load custom patch versions.
  • Updated applyPatches logic to distinguish custom patches from standard version patches.
  • Conditional update of package.json is applied only for standard patches.
Comments suppressed due to low confidence (1)

src/patch.js:156

  • The regex contains a double caret (^^) which is likely unintended and may prevent correct matching of version strings. Consider replacing it with a single caret '^'.
const versionMatch = /^^\w?(\d+\.\d+\.\d+)$/.exec(versionApply);

@dkonieczek dkonieczek linked an issue May 28, 2025 that may be closed by this pull request
@dkonieczek dkonieczek requested review from korgon and removed request for korgon May 28, 2025 15:21
Copy link
Contributor
@korgon korgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good code changes - this is working well. 👍🏻

@dkonieczek dkonieczek merged commit f1fa797 into main May 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Patch Support
2 participants
0