Skip to content

Commit 3e13ab2

Browse files
sorccuclaude
andcommitted
refactor: narrow auto-include pattern to patches/*.patch
More precise than patches/** — only includes actual patch files, avoiding accidentally bundling unrelated files in the directory. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 55050e0 commit 3e13ab2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/cli/src/services/__tests__/util.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ describe('util', () => {
4242
detector: () => ({}) as any,
4343
})
4444

45-
it('should return patches/** for pnpm', () => {
45+
it('should return patches/*.patch for pnpm', () => {
4646
const result = getAutoIncludes(makePm('pnpm'), [])
47-
expect(result).toEqual(['patches/**'])
47+
expect(result).toEqual(['patches/*.patch'])
4848
})
4949

5050
it('should return empty for npm', () => {
@@ -57,8 +57,8 @@ describe('util', () => {
5757
expect(result).toEqual([])
5858
})
5959

60-
it('should skip when user already includes patches/**', () => {
61-
const result = getAutoIncludes(makePm('pnpm'), ['patches/**'])
60+
it('should skip when user already includes patches/*.patch', () => {
61+
const result = getAutoIncludes(makePm('pnpm'), ['patches/*.patch'])
6262
expect(result).toEqual([])
6363
})
6464

packages/cli/src/services/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export function getAutoIncludes (
150150
const autoIncludes: string[] = []
151151

152152
if (packageManager.name === 'pnpm') {
153-
const patchesPattern = 'patches/**'
153+
const patchesPattern = 'patches/*.patch'
154154
const alreadyIncluded = existingIncludes.some(p => p === patchesPattern || p.startsWith('patches/'))
155155
if (!alreadyIncluded) {
156156
autoIncludes.push(patchesPattern)

0 commit comments

Comments
 (0)