Add default feature type information to backstage metadata

Signed-off-by: Harrison Hogg <hhogg@spotify.com>
This commit is contained in:
Harrison Hogg
2025-01-31 14:28:16 +00:00
parent 72f9a9d1ff
commit f54eed0a7a
8 changed files with 61 additions and 20 deletions
@@ -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;
+2
View File
@@ -16,10 +16,12 @@
export { isMonoRepo } from './isMonoRepo';
export {
packageFeatureType,
PackageGraph,
type PackageGraphNode,
type BackstagePackage,
type BackstagePackageJson,
type BackstagePackageFeatureType,
} from './PackageGraph';
export {
Lockfile,