-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(groups): add support to ignore dependencies
- Loading branch information
1 parent
b7c0308
commit f96df8f
Showing
31 changed files
with
491 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/bin-fix-mismatches/get-expected-version/get-pinned-version.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import type { IndexedVersionGroup } from '../../lib/get-input/get-instances'; | ||
import type { PinnedVersionGroup } from '../../types/version-group'; | ||
|
||
export function getPinnedVersion( | ||
versionGroup: Pick<IndexedVersionGroup, 'pinVersion'>, | ||
versionGroup: Pick<PinnedVersionGroup, 'pinVersion'>, | ||
): string { | ||
return versionGroup.pinVersion || ''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
import type { ProgramInput } from '../../lib/get-input'; | ||
import type { IndexedVersionGroup } from '../../lib/get-input/get-instances'; | ||
import type { | ||
IndexedBannedVersionGroup, | ||
IndexedPinnedVersionGroup, | ||
IndexedVersionGroup, | ||
} from '../../lib/get-input/get-instances'; | ||
import { getHighestVersion } from './get-highest-version'; | ||
import { getPinnedVersion } from './get-pinned-version'; | ||
import { getWorkspaceVersion } from './get-workspace-version'; | ||
|
||
export function getExpectedVersion( | ||
name: string, | ||
versionGroup: Pick< | ||
IndexedVersionGroup, | ||
'isBanned' | 'instances' | 'pinVersion' | ||
>, | ||
versionGroup: | ||
| Pick<IndexedBannedVersionGroup, 'isBanned' | 'instances'> | ||
| Pick<IndexedPinnedVersionGroup, 'instances' | 'pinVersion'> | ||
| Pick<IndexedVersionGroup, 'instances'>, | ||
input: Pick<ProgramInput, 'workspace' | 'wrappers'>, | ||
): string | undefined { | ||
return versionGroup.isBanned === true | ||
? // remove this dependency | ||
undefined | ||
: getPinnedVersion(versionGroup) || | ||
(input.workspace === true && | ||
getWorkspaceVersion(name, input.wrappers)) || | ||
getHighestVersion( | ||
versionGroup.instances | ||
.filter((instance) => instance.name === name) | ||
.map(({ version }) => version), | ||
); | ||
if ('isBanned' in versionGroup && versionGroup.isBanned === true) { | ||
// remove this dependency | ||
return undefined; | ||
} | ||
if ('pinVersion' in versionGroup && versionGroup.pinVersion) { | ||
return getPinnedVersion(versionGroup); | ||
} | ||
if (input.workspace === true) { | ||
const workspaceVersion = getWorkspaceVersion(name, input.wrappers); | ||
if (workspaceVersion) return workspaceVersion; | ||
} | ||
return getHighestVersion( | ||
versionGroup.instances | ||
.filter((instance) => instance.name === name) | ||
.map(({ version }) => version), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.