patch-package should ignore files defined in yarnclean file
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- nodejs, typescript
- Domain
- tooling
Research direction
Start in src/makePatch.ts around line 265 and reproduce the reported sequence with the linked .yarnclean rule, yarn install, and patch-package on snap-shot-core. Compare the failing patch with the working Cypress example; done means the affected patch no longer fails when markdown files are removed by .yarnclean.
Written by the indexing model from the issue text.
Description
I'm running into an error running patch-package on a specific package. I noticed that the patch file removes a README.md file. This is due to my .yarnclean file defining *.md files for removal. So, I believe yarn install is running - removing the markdown file, then patch-package is running and becoming confused with the removal of the md file somehow?
Removing the *.md line from my .yarnclean file caused the patch to be successful: https://github.com/cypress-io/cypress/pull/31449/commits/38469fd1984d7edce8c9f6c7cb5236a4f10a17e8
I think .yarnclean is not playing well with patch-package. Maybe this should be updated to ignore files similar to how .gitignore` directories are ignored? https://github.com/ds300/patch-package/blob/bd2e9a49d884516199079add143c1649541e8efe/src/makePatch.ts#L265
Error
**ERROR** Failed to apply patch for package snap-shot-core at path
node_modules/snap-shot-core
This error was caused because patch-package cannot apply the following patch file:
patches/snap-shot-core+10.2.4.dev.patch
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 snap-shot-core
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
---
patch-package finished with 1 error(s).
node:child_process:966
throw err;
^
Error: Command failed: patch-package && lerna run rebuild-better-sqlite3 --scope @packages/server
You can see how the PR diff including removing the Readme file: https://github.com/cypress-io/cypress/pull/31449/files#diff-6d4ec7fb70a72c8193e10a8c390b904e6313087e19b3d2a191d466cc31063441
This seemed to work on other patches I made though - like here - so I'm not sure why this one failed.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 325
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ds300/patch-package
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
ds300/patch-package#617 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ds300/patch-package#615 · 3 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ds300/patch-package#216 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
ds300/patch-package#611 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ds300/patch-package#610 · 2 comments · 1 reaction ·
All issues in ds300/patch-package
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·