Skip to content

Commit 75171b0

Browse files
committed
Fix for dependencies specified by file protocol
1 parent d5fb67a commit 75171b0

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/__tests__/bump/bumpMinSemverRange.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ describe('bumpMinSemverRange', () => {
77
expect(result).toBe('*');
88
});
99

10+
it('preserves file: protocol with relative path', () => {
11+
const result = bumpMinSemverRange('1.0.0', 'file:../local-package');
12+
expect(result).toBe('file:../local-package');
13+
});
14+
15+
it('preserves file: protocol with absolute path', () => {
16+
const result = bumpMinSemverRange('1.0.0', 'file:/absolute/path/to/package');
17+
expect(result).toBe('file:/absolute/path/to/package');
18+
});
19+
1020
it('attaches ~ to semver range', () => {
1121
const result = bumpMinSemverRange('1.3.0', '~1.2.0');
1222
expect(result).toBe('~1.3.0');

src/bump/bumpMinSemverRange.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import semver from 'semver';
22
import { getWorkspaceRange } from '../packageManager/getWorkspaceRange';
33

44
export function bumpMinSemverRange(minVersion: string, semverRange: string): string {
5-
if (semverRange === '*') {
5+
if (semverRange === '*' || semverRange.startsWith('file:')) {
66
return semverRange;
77
}
88

0 commit comments

Comments
 (0)