Skip to content

Commit

Permalink
Merge pull request #7 from alexonaci/feature/small-dx-improvement-ent…
Browse files Browse the repository at this point in the history
…ity-transformation

Small DX improvements for entityTransformation
  • Loading branch information
Charlesthebird authored Nov 5, 2024
2 parents 3db65f6 + 794575a commit ccaa3a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import {
} from '@backstage/backend-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { GlooPlatformPortalProvider } from '@solo.io/platform-portal-backstage-plugin-backend';
import { API, ApiVersion, GlooPlatformPortalProvider } from '@solo.io/platform-portal-backstage-plugin-backend';

// Entities can be transformed using this function.
// The entity that is returned here will be added to the catalog.
const entityTransformation = async (entity: Entity, api: any) => {
const entityTransformation = async (entity: Entity, api: ApiVersion | API) => {
// The following commented out lines would add an "example-" prefix to your Entities.
// entity = {
// return {
// ...entity,
// metadata: {
// ...entity.metadata,
Expand Down
6 changes: 3 additions & 3 deletions plugins/platform-portal-backstage-plugin-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ import {
} from '@backstage/backend-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { GlooPlatformPortalProvider } from '@solo.io/platform-portal-backstage-plugin-backend';
import { API, ApiVersion, GlooPlatformPortalProvider } from '@solo.io/platform-portal-backstage-plugin-backend';

// -> 2. Optionally define an `entityTransformation`.
// Entities can be transformed using this function.
// The entity that is returned here will be added to the catalog.
const entityTransformation = async (entity: Entity, api: any) => {
const entityTransformation = async (entity: Entity, api: ApiVersion | API) => {
// The following commented out lines would add an "example-" prefix to your Entities.
// entity = {
// return {
// ...entity,
// metadata: {
// ...entity.metadata,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './provider/GlooPlatformPortalProvider';
export type { API, ApiVersion } from './provider/api-types';

0 comments on commit ccaa3a7

Please sign in to comment.