Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
fix: pass prerelease option to versioning strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Aug 31, 2022
1 parent f7adcde commit 0e524f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/factories/versioning-strategy-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface VersioningStrategyFactoryOptions {
type?: VersioningStrategyType;
bumpMinorPreMajor?: boolean;
bumpPatchForMinorPreMajor?: boolean;
prerelease?: boolean;
github: GitHub;
}

Expand Down
1 change: 1 addition & 0 deletions src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export async function buildStrategy(
type: options.versioning,
bumpMinorPreMajor: options.bumpMinorPreMajor,
bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
prerelease: options.prerelease,
});
const changelogNotes = buildChangelogNotes({
type: options.changelogType || 'default',
Expand Down
3 changes: 3 additions & 0 deletions src/versioning-strategies/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {logger as defaultLogger, Logger} from '../util/logger';
interface DefaultVersioningStrategyOptions {
bumpMinorPreMajor?: boolean;
bumpPatchForMinorPreMajor?: boolean;
prerelease?: boolean;
logger?: Logger;
}

Expand All @@ -38,6 +39,7 @@ interface DefaultVersioningStrategyOptions {
export class DefaultVersioningStrategy implements VersioningStrategy {
readonly bumpMinorPreMajor: boolean;
readonly bumpPatchForMinorPreMajor: boolean;
readonly prerelease: boolean;
protected logger: Logger;
/**
* Create a new DefaultVersioningStrategy
Expand All @@ -50,6 +52,7 @@ export class DefaultVersioningStrategy implements VersioningStrategy {
constructor(options: DefaultVersioningStrategyOptions = {}) {
this.bumpMinorPreMajor = options.bumpMinorPreMajor === true;
this.bumpPatchForMinorPreMajor = options.bumpPatchForMinorPreMajor === true;
this.prerelease = options.prerelease === true;
this.logger = options.logger ?? defaultLogger;
}

Expand Down

0 comments on commit 0e524f8

Please sign in to comment.