Skip to content

Commit 2a446fc

Browse files
committed
fix(deps): recognize Pantry lock state
1 parent 4e19799 commit 2a446fc

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

scripts/check-dependency-commits.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export function isDependencyCommit(subject: string): boolean {
77
export function hasDependencyStateChange(files: string[]): boolean {
88
return files.some(file =>
99
file === 'bun.lock'
10+
|| file === 'pantry.lock'
1011
|| file === 'config/deps.ts'
1112
|| file === 'package.json'
1213
|| file.endsWith('/package.json'),
@@ -50,15 +51,10 @@ export function checkDependencyCommits(range: string): string[] {
5051
}
5152

5253
if (import.meta.main) {
53-
if (git('ls-files', 'pantry.lock')) {
54-
console.error('pantry.lock must not be tracked. Bun owns JavaScript dependency locking.')
55-
process.exit(1)
56-
}
57-
5854
const range = resolveRange()
5955
const errors = checkDependencyCommits(range)
6056
if (errors.length > 0) {
61-
console.error('Dependency commits must change package.json, config/deps.ts, or bun.lock:')
57+
console.error('Dependency commits must change a manifest, bun.lock, or pantry.lock:')
6258
for (const error of errors)
6359
console.error(` ${error}`)
6460
process.exit(1)

tests/dependency-commits.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ describe('dependency commit integrity', () => {
88
expect(isDependencyCommit('fix(deps): repair lockfile')).toBe(false)
99
})
1010

11-
it('requires a dependency manifest or Bun lock change', () => {
11+
it('requires a dependency manifest or dependency-manager lock change', () => {
1212
expect(hasDependencyStateChange(['package.json'])).toBe(true)
1313
expect(hasDependencyStateChange(['storage/framework/core/buddy/package.json'])).toBe(true)
1414
expect(hasDependencyStateChange(['config/deps.ts'])).toBe(true)
1515
expect(hasDependencyStateChange(['bun.lock'])).toBe(true)
16+
expect(hasDependencyStateChange(['pantry.lock'])).toBe(true)
1617
expect(hasDependencyStateChange(['CHANGELOG.md'])).toBe(false)
1718
expect(hasDependencyStateChange([])).toBe(false)
1819
})

0 commit comments

Comments
 (0)