Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: exported union type of well known relations #28056

Open
2 tasks done
kurtaking opened this issue Dec 9, 2024 · 0 comments
Open
2 tasks done

🚀 Feature: exported union type of well known relations #28056

kurtaking opened this issue Dec 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@kurtaking
Copy link
Contributor

kurtaking commented Dec 9, 2024

🔖 Feature description

Export a union type of well known relations (RELATION_*) coming from @backstage/catalog-model

🎤 Context

I want to type my relation parameter to something more specific than a string. We currently import all relation constants from @backstage/catalog-model, create a union type, and then use that throughout our instance. Can @backstage/catalog-model provide something similar?

✌️ Possible Implementation

Export a new union type of all well known relations defined here.

export type RelationType =
  | typeof RELATION_API_CONSUMED_BY
  | typeof RELATION_API_PROVIDED_BY
  | typeof RELATION_CHILD_OF
  | typeof RELATION_CONSUMES_API
  | typeof RELATION_DEPENDENCY_OF
  | typeof RELATION_DEPENDS_ON
  | typeof RELATION_HAS_MEMBER
  | typeof RELATION_HAS_PART
  | typeof RELATION_MEMBER_OF
  | typeof RELATION_OWNED_BY
  | typeof RELATION_OWNER_OF
  | typeof RELATION_PARENT_OF
  | typeof RELATION_PART_OF
  | typeof RELATION_PROVIDES_API;

👀 Have you spent some time to check if this feature request has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

@kurtaking kurtaking added the enhancement New feature or request label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant