From fe0faf6b7a0bb325994b9c2be8a76323595544b7 Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Wed, 21 Apr 2021 18:20:01 +0200 Subject: [PATCH] Create VERSIONING_STRATEGIES constant Signed-off-by: Erik Engervall --- plugins/github-release-manager/src/constants/constants.ts | 8 ++++++++ .../github-release-manager/src/contexts/ProjectContext.ts | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/github-release-manager/src/constants/constants.ts b/plugins/github-release-manager/src/constants/constants.ts index c60cc117cf..195a4b80af 100644 --- a/plugins/github-release-manager/src/constants/constants.ts +++ b/plugins/github-release-manager/src/constants/constants.ts @@ -29,3 +29,11 @@ export const DISABLE_CACHE = { 'If-None-Match': '', }, } as const; + +export const VERSIONING_STRATEGIES: { + semver: 'semver'; + calver: 'calver'; +} = { + semver: 'semver', + calver: 'calver', +} as const; diff --git a/plugins/github-release-manager/src/contexts/ProjectContext.ts b/plugins/github-release-manager/src/contexts/ProjectContext.ts index 75bf6db28d..d115c469fa 100644 --- a/plugins/github-release-manager/src/contexts/ProjectContext.ts +++ b/plugins/github-release-manager/src/contexts/ProjectContext.ts @@ -16,6 +16,7 @@ import { createContext, useContext } from 'react'; +import { VERSIONING_STRATEGIES } from '../constants/constants'; import { GitHubReleaseManagerError } from '../errors/GitHubReleaseManagerError'; export interface Project { @@ -39,7 +40,7 @@ export interface Project { * * Default: false */ - versioningStrategy: 'calver' | 'semver'; + versioningStrategy: keyof typeof VERSIONING_STRATEGIES; /** * Project props was provided via props *