Expose GRM constants, helpers and components via an 'internal' variable
Signed-off-by: Erik Engervall <erik.engervall@gmail.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2021 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { Differ } from './Differ';
|
||||
export { Divider } from './Divider';
|
||||
export { InfoCardPlus } from './InfoCardPlus';
|
||||
export { LinearProgressWithLabel } from './ResponseStepDialog/LinearProgressWithLabel';
|
||||
export { NoLatestRelease } from './NoLatestRelease';
|
||||
export { ResponseStepDialog } from './ResponseStepDialog/ResponseStepDialog';
|
||||
export { ResponseStepList } from './ResponseStepDialog/ResponseStepList';
|
||||
export { ResponseStepListItem } from './ResponseStepDialog/ResponseStepListItem';
|
||||
@@ -21,6 +21,14 @@ import { Project } from '../contexts/ProjectContext';
|
||||
import { SEMVER_PARTS } from '../constants/constants';
|
||||
import { SemverTagParts } from './tagParts/getSemverTagParts';
|
||||
|
||||
/**
|
||||
* Calculates the next version for the project
|
||||
*
|
||||
* For calendar versioning this means a bump in patch
|
||||
*
|
||||
* For semantic versioning this means either a minor or a patch bump
|
||||
* depending on the value of `bumpLevel`
|
||||
*/
|
||||
export function getBumpedTag({
|
||||
project,
|
||||
tag,
|
||||
@@ -74,6 +82,10 @@ function getBumpedSemverTag(
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the next semantic version, taking into account
|
||||
* whether or not it's a minor or patch
|
||||
*/
|
||||
export function getBumpedSemverTagParts(
|
||||
tagParts: SemverTagParts,
|
||||
semverBumpLevel: keyof typeof SEMVER_PARTS,
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2021 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { calverRegexp, getCalverTagParts } from './tagParts/getCalverTagParts';
|
||||
export { getBumpedSemverTagParts, getBumpedTag } from './getBumpedTag';
|
||||
export { getSemverTagParts, semverRegexp } from './tagParts/getSemverTagParts';
|
||||
export { getShortCommitHash } from './getShortCommitHash';
|
||||
export { getTagParts } from './tagParts/getTagParts';
|
||||
export { isCalverTagParts } from './isCalverTagParts';
|
||||
export { isProjectValid } from './isProjectValid';
|
||||
export { validateTagName } from './tagParts/validateTagName';
|
||||
@@ -18,6 +18,10 @@ import { getCalverTagParts } from './getCalverTagParts';
|
||||
import { getSemverTagParts } from './getSemverTagParts';
|
||||
import { Project } from '../../contexts/ProjectContext';
|
||||
|
||||
/**
|
||||
* Tag parts are the individual parts of a version, e.g. <major>.<minor>.<patch>
|
||||
* are the parts of a semantic version
|
||||
*/
|
||||
export function getTagParts({
|
||||
project,
|
||||
tag,
|
||||
|
||||
@@ -18,4 +18,5 @@ export {
|
||||
gitReleaseManagerPlugin,
|
||||
GitReleaseManagerPage,
|
||||
gitReleaseManagerApiRef,
|
||||
internals,
|
||||
} from './plugin';
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { gitReleaseManagerApiRef } from './api/serviceApiRef';
|
||||
|
||||
import { GitReleaseClient } from './api/GitReleaseClient';
|
||||
import { rootRouteRef } from './routes';
|
||||
import {
|
||||
configApiRef,
|
||||
createPlugin,
|
||||
@@ -26,7 +22,19 @@ import {
|
||||
createRoutableExtension,
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
import { GitReleaseClient } from './api/GitReleaseClient';
|
||||
import { gitReleaseManagerApiRef } from './api/serviceApiRef';
|
||||
import { rootRouteRef } from './routes';
|
||||
import * as constants from './constants/constants';
|
||||
import * as helpers from './helpers';
|
||||
import * as components from './components';
|
||||
|
||||
export { gitReleaseManagerApiRef };
|
||||
export const internals = {
|
||||
constants,
|
||||
helpers,
|
||||
components,
|
||||
};
|
||||
|
||||
export const gitReleaseManagerPlugin = createPlugin({
|
||||
id: 'git-release-manager',
|
||||
|
||||
Reference in New Issue
Block a user