Add a Prototype for API Documentations#1737
Conversation
|
Rockstars. Thanks a lot! 💯🥳👏🏼 |
Rugvip
left a comment
There was a problem hiding this comment.
Thank you! Stellar stuff 😁 🌟
High quality all around, super happy to merge and work out any specific details later.
There was a problem hiding this comment.
It's silly, but best to return a cancel function here in case we get instantly unmounted :p
There was a problem hiding this comment.
Happy to merge but no promises on keeping this 😅
It does look to me like there's opportunity for creating a pattern for how to define relationships to other entities. Maybe even a separate top-level object and a more list-style approach with room for metadata about the relationship. Or just something more simple like this. Totally not in scope of this PR though
There was a problem hiding this comment.
Yes. Since ADR 005 also intends the "consumes" relation it might be good to have a more general approach in the future. As soon as some kind of versioning is introduced, this simple modeling will also not suffice. But we will see then.
There was a problem hiding this comment.
jest.mock can be placed below the imports as well, so I'm wondering why you place it here? Asking because I'm considering switching to a faster build that doesn't support that hoisting and this would have to be done everywhere 😁
There was a problem hiding this comment.
I copied it from the catalog plugin 😀. But I can change it.
There was a problem hiding this comment.
Dammit, ok 😁
It's fine to leave as is
There was a problem hiding this comment.
This definitely needs a nicer API (in core) imo, but not for this PR 😅
There was a problem hiding this comment.
Tbh I'm not sure why the local isn't the only one. Let's re-evaluate after merging this :>
|
Can't really comment on the TypeScript implementation, but from a modelling/metadata perspective this looks pretty great! As @Rugvip mentioned, we might want to give the |
cf4de4a to
51a23b8
Compare
|
I fixed the issue with the failing build by updating the jest config (see last commit): - '/node_modules/(?!.*\\.(?:esm\\.js|bmp|gif|jpg|jpeg|png|frag|xml|svg)$)',
+ '/node_modules/(?!@kyma-project/asyncapi-react/)(?!.*\\.(?:esm\\.js|bmp|gif|jpg|jpeg|png|frag|xml|svg)$)',The npm package seems to be a bit odd... I am not sure if this is a smart solution, especially since I changed in the cli package :-/. |
There was a problem hiding this comment.
Yeah this is idd unfortunate. The package is using esm modules but really doesn't signal that in any way as far as I can tell. I don't wanna block this PR because of the issue so fine with override for now, but we do need to figure out a long-term solution. It would be possible to add this to .jest.transformIgnorePatterns inside package.json of the api-docs package, but that would have to be kept in sync with updates to this config so it isn't great either.
There was a problem hiding this comment.
@Rugvip I can also try to fix the original package so we don't get an issue here. But tbh, I am not really deep into jest and esm modules. Do you have a clue what might be wrong there? Would you say this issue is specific to the configuration in the backstage repository?
There was a problem hiding this comment.
It's a somewhat common override that's needed when using jest. The package is built in a way that makes it tricky to consume, and could definitely be left as feedback to the package author.
A common way to solve the issue is to build both CommonJS and ESModule outputs, and then point to each using main and module fields in package.json. It's puts more requirements on the build tooling though. For example, we do that here: https://github.com/spotify/backstage/blob/c4b6c1397577b89f117a2f663088315dda75aaa7/packages/catalog-model/package.json#L11
|
Just to let you know: we are still interested, but on vacation right now. We will continue with it next week 😊 |
|
@Fox32 thank you for the update! Many vacations on our side too 😁 |
b642972 to
91b9ece
Compare
|
@dhenneke what is the status of this PR? Excited to get it merged 😃 |
|
The build should work now. Strangely, the "Frontend CI" workflow has not been triggered so the tests weren't executed 😕. I wonder if it is connected to 9d1f531. Apart from that: Are there any blockers before merging this PR? If our changes in the Entity-tab-behavior are conflicting, we will be happy to remove them in favor of the work done in #1835. We could integrate that separately after that has been merged. Just leave a short note on what is missing on the road of getting this merged. |
|
@dhenneke Will have a proper look in a bit, but iirc we're just waiting for conflicts to be resolved and should then be good to merge 👍 Workflows are indeed not triggering correctly, fix in it's way 😅 #1918 Can't comment on the tab implementation, what do you think @hooloovooo ? |
9fe12e7 to
1438d31
Compare
…ed apis per component
…y all implemented apis
1438d31 to
bf76f07
Compare
|
@Rugvip did you have time to have a look? |
Rugvip
left a comment
There was a problem hiding this comment.
!
CI failures are fixed in latest master, so you'll need to trigger a build on top of that
freben
left a comment
There was a problem hiding this comment.
This is really solid work. Thank you!
|
|
||
| ## Links | ||
|
|
||
| - (The Backstage homepage)[https://backstage.io] |
There was a problem hiding this comment.
mixed up the square brackets and parentheses
|
Builds are green 😲 |
|
🥳 |
Here is our first implementation for the API documentation plugin aka api-docs. See here for the initial discussion by @Fox32.
For now API entities can be added to the catalog and referenced from a component. They are then displayed under the API tab in the details view. In addition, a standalone API list is added. See the screenshots for some details:
We ran into some problems that are not solved till now. Probably these are things we can't resolve right now, but should be the next steps:
catalogAPiRef?We know the PR is quite big but we think that it is a good start for discussions on a working prototype. If you are interested, we can split it up a bit more along the commits and contribute the changes in individual PRs.