Skip to content
Snippets Groups Projects
Unverified Commit 68f34a99 authored by Michael Kriese's avatar Michael Kriese Committed by GitHub
Browse files

chore: fix types (#23665)

parent c42f02f2
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ import type { BumpPackageVersionResult } from '../types'; ...@@ -6,7 +6,7 @@ import type { BumpPackageVersionResult } from '../types';
export function bumpPackageVersion( export function bumpPackageVersion(
content: string, content: string,
currentValue: string, currentValue: string,
bumpVersion: ReleaseType | string bumpVersion: ReleaseType
): BumpPackageVersionResult { ): BumpPackageVersionResult {
logger.debug( logger.debug(
{ bumpVersion, currentValue }, { bumpVersion, currentValue },
...@@ -15,7 +15,7 @@ export function bumpPackageVersion( ...@@ -15,7 +15,7 @@ export function bumpPackageVersion(
let newChartVersion: string | null; let newChartVersion: string | null;
let bumpedContent = content; let bumpedContent = content;
try { try {
newChartVersion = semver.inc(currentValue, bumpVersion as ReleaseType); newChartVersion = semver.inc(currentValue, bumpVersion);
if (!newChartVersion) { if (!newChartVersion) {
throw new Error('semver inc failed'); throw new Error('semver inc failed');
} }
......
...@@ -56,7 +56,7 @@ export function updateDependency({ ...@@ -56,7 +56,7 @@ export function updateDependency({
export function bumpPackageVersion( export function bumpPackageVersion(
content: string, content: string,
currentValue: string | undefined, currentValue: string | undefined,
bumpVersion: ReleaseType | string bumpVersion: ReleaseType
): BumpPackageVersionResult { ): BumpPackageVersionResult {
logger.debug( logger.debug(
{ bumpVersion, currentValue }, { bumpVersion, currentValue },
...@@ -83,7 +83,7 @@ export function bumpPackageVersion( ...@@ -83,7 +83,7 @@ export function bumpPackageVersion(
const startTagPosition = versionNode.startTagPosition; const startTagPosition = versionNode.startTagPosition;
const versionPosition = content.indexOf(versionNode.val, startTagPosition); const versionPosition = content.indexOf(versionNode.val, startTagPosition);
const newPomVersion = semver.inc(currentValue, bumpVersion as ReleaseType); const newPomVersion = semver.inc(currentValue, bumpVersion);
if (!newPomVersion) { if (!newPomVersion) {
throw new Error('semver inc failed'); throw new Error('semver inc failed');
} }
......
...@@ -6,7 +6,7 @@ import type { BumpPackageVersionResult } from '../../../types'; ...@@ -6,7 +6,7 @@ import type { BumpPackageVersionResult } from '../../../types';
export function bumpPackageVersion( export function bumpPackageVersion(
content: string, content: string,
currentValue: string, currentValue: string,
bumpVersion: ReleaseType | string bumpVersion: ReleaseType
): BumpPackageVersionResult { ): BumpPackageVersionResult {
logger.debug( logger.debug(
{ bumpVersion, currentValue }, { bumpVersion, currentValue },
...@@ -29,7 +29,7 @@ export function bumpPackageVersion( ...@@ -29,7 +29,7 @@ export function bumpPackageVersion(
return { bumpedContent }; return { bumpedContent };
} }
} else { } else {
newPjVersion = semver.inc(currentValue, bumpVersion as ReleaseType); newPjVersion = semver.inc(currentValue, bumpVersion);
} }
// TODO: fix types (#7154) // TODO: fix types (#7154)
logger.debug(`newPjVersion: ${newPjVersion!}`); logger.debug(`newPjVersion: ${newPjVersion!}`);
......
...@@ -7,7 +7,7 @@ import type { BumpPackageVersionResult } from '../types'; ...@@ -7,7 +7,7 @@ import type { BumpPackageVersionResult } from '../types';
export function bumpPackageVersion( export function bumpPackageVersion(
content: string, content: string,
currentValue: string | undefined, currentValue: string | undefined,
bumpVersion: ReleaseType | string bumpVersion: ReleaseType
): BumpPackageVersionResult { ): BumpPackageVersionResult {
logger.debug( logger.debug(
{ bumpVersion, currentValue }, { bumpVersion, currentValue },
...@@ -38,7 +38,7 @@ export function bumpPackageVersion( ...@@ -38,7 +38,7 @@ export function bumpPackageVersion(
startTagPosition startTagPosition
); );
const newProjVersion = semver.inc(currentValue, bumpVersion as ReleaseType); const newProjVersion = semver.inc(currentValue, bumpVersion);
if (!newProjVersion) { if (!newProjVersion) {
throw new Error('semver inc failed'); throw new Error('semver inc failed');
} }
......
...@@ -6,14 +6,14 @@ import type { BumpPackageVersionResult } from '../types'; ...@@ -6,14 +6,14 @@ import type { BumpPackageVersionResult } from '../types';
export function bumpPackageVersion( export function bumpPackageVersion(
content: string, content: string,
currentValue: string, currentValue: string,
bumpVersion: ReleaseType | string bumpVersion: ReleaseType
): BumpPackageVersionResult { ): BumpPackageVersionResult {
logger.debug( logger.debug(
{ bumpVersion, currentValue }, { bumpVersion, currentValue },
'Checking if we should bump build.sbt version' 'Checking if we should bump build.sbt version'
); );
let bumpedContent = content; let bumpedContent = content;
const bumpedVersion = semver.inc(currentValue, bumpVersion as ReleaseType); const bumpedVersion = semver.inc(currentValue, bumpVersion);
if (!bumpedVersion) { if (!bumpedVersion) {
logger.warn('Version incremental failed'); logger.warn('Version incremental failed');
return { bumpedContent }; return { bumpedContent };
......
...@@ -117,7 +117,7 @@ export interface PackageDependency<T = Record<string, any>> ...@@ -117,7 +117,7 @@ export interface PackageDependency<T = Record<string, any>>
versioning?: string; versioning?: string;
dataType?: string; dataType?: string;
enabled?: boolean; enabled?: boolean;
bumpVersion?: ReleaseType | string; bumpVersion?: ReleaseType;
npmPackageAlias?: boolean; npmPackageAlias?: boolean;
packageFileVersion?: string; packageFileVersion?: string;
gitRef?: boolean; gitRef?: boolean;
...@@ -238,7 +238,7 @@ export interface ManagerApi extends ModuleApi { ...@@ -238,7 +238,7 @@ export interface ManagerApi extends ModuleApi {
bumpPackageVersion?( bumpPackageVersion?(
content: string, content: string,
currentValue: string, currentValue: string,
bumpVersion: ReleaseType | string bumpVersion: ReleaseType
): Result<BumpPackageVersionResult>; ): Result<BumpPackageVersionResult>;
detectGlobalConfig?(): Result<GlobalManagerConfig>; detectGlobalConfig?(): Result<GlobalManagerConfig>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment