Add default feature type information to backstage metadata
Signed-off-by: Harrison Hogg <hhogg@spotify.com>
This commit is contained in:
@@ -12,6 +12,9 @@ export type BackstagePackage = {
|
||||
packageJson: BackstagePackageJson;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export type BackstagePackageFeatureType = (typeof packageFeatureType)[number];
|
||||
|
||||
// @public
|
||||
export interface BackstagePackageJson {
|
||||
// (undocumented)
|
||||
@@ -22,6 +25,7 @@ export interface BackstagePackageJson {
|
||||
pluginId?: string | null;
|
||||
pluginPackage?: string;
|
||||
pluginPackages?: string[];
|
||||
features?: Record<string, BackstagePackageFeatureType>;
|
||||
};
|
||||
// (undocumented)
|
||||
bundled?: boolean;
|
||||
@@ -112,6 +116,14 @@ export type LockfileDiffEntry = {
|
||||
range: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export const packageFeatureType: readonly [
|
||||
'@backstage/BackendFeature',
|
||||
'@backstage/BackstagePlugin',
|
||||
'@backstage/FrontendPlugin',
|
||||
'@backstage/FrontendModule',
|
||||
];
|
||||
|
||||
// @public
|
||||
export class PackageGraph extends Map<string, PackageGraphNode> {
|
||||
collectPackageNames(
|
||||
|
||||
@@ -22,6 +22,24 @@ import { GitUtils } from '../git';
|
||||
import { Lockfile } from './Lockfile';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
|
||||
/**
|
||||
* A list of the feature types we want to extract from the project
|
||||
* and include in the metadata
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const packageFeatureType = [
|
||||
'@backstage/BackendFeature',
|
||||
'@backstage/BackstagePlugin',
|
||||
'@backstage/FrontendPlugin',
|
||||
'@backstage/FrontendModule',
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type BackstagePackageFeatureType = (typeof packageFeatureType)[number];
|
||||
|
||||
/**
|
||||
* Known fields in Backstage package.json files.
|
||||
*
|
||||
@@ -72,6 +90,11 @@ export interface BackstagePackageJson {
|
||||
* All packages that are part of the plugin. Must always and only be set for plugin packages and plugin library packages.
|
||||
*/
|
||||
pluginPackages?: string[];
|
||||
|
||||
/**
|
||||
* The feature types exported from the package, indexed by path.
|
||||
*/
|
||||
features?: Record<string, BackstagePackageFeatureType>;
|
||||
};
|
||||
|
||||
exports?: JsonValue;
|
||||
|
||||
@@ -16,10 +16,12 @@
|
||||
|
||||
export { isMonoRepo } from './isMonoRepo';
|
||||
export {
|
||||
packageFeatureType,
|
||||
PackageGraph,
|
||||
type PackageGraphNode,
|
||||
type BackstagePackage,
|
||||
type BackstagePackageJson,
|
||||
type BackstagePackageFeatureType,
|
||||
} from './PackageGraph';
|
||||
export {
|
||||
Lockfile,
|
||||
|
||||
Reference in New Issue
Block a user