Skip to content

Commit

Permalink
refactor: strategy is now an interface and not an abstract class (#1144)
Browse files Browse the repository at this point in the history
This is a cleanup PR to make `Strategy` an interface.
  • Loading branch information
chingor13 authored Dec 20, 2021
1 parent 5196d90 commit cb9b772
Show file tree
Hide file tree
Showing 22 changed files with 461 additions and 394 deletions.
5 changes: 3 additions & 2 deletions src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import {Strategy, StrategyOptions} from './strategy';
import {Strategy} from './strategy';
import {Go} from './strategies/go';
import {GoYoshi} from './strategies/go-yoshi';
import {JavaYoshi} from './strategies/java-yoshi';
Expand Down Expand Up @@ -43,6 +43,7 @@ import {CargoWorkspace} from './plugins/cargo-workspace';
import {ChangelogNotes, ChangelogSection} from './changelog-notes';
import {GitHubChangelogNotes} from './changelog-notes/github';
import {DefaultChangelogNotes} from './changelog-notes/default';
import {BaseStrategyOptions} from './strategies/base';

// Factory shared by GitHub Action and CLI for creating Release PRs
// and GitHub Releases:
Expand Down Expand Up @@ -71,7 +72,7 @@ const allReleaseTypes = [
'terraform-module',
] as const;
export type ReleaseType = typeof allReleaseTypes[number];
type ReleaseBuilder = (options: StrategyOptions) => Strategy;
type ReleaseBuilder = (options: BaseStrategyOptions) => Strategy;
type Releasers = Record<string, ReleaseBuilder>;
const releasers: Releasers = {
go: options => new Go(options),
Expand Down
Loading

0 comments on commit cb9b772

Please sign in to comment.