-
Notifications
You must be signed in to change notification settings - Fork 78
fix(docs): register missing pageRef component #2169
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
apps/docs/.vitepress/theme/index.ts
Outdated
| { | ||
| enhanceApp({ app }: { app: App }) { | ||
| // app.component("AI", AI); | ||
| app.component("PageRef", PageRef); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bojanrajh can we register this component also locally? I guess you overwrite it anyway in developer portal right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, wdyt about having a redirection from frontends.shopware.com -> https://developer.shopware.com/frontends/ ?
we have only one note: missing overview page, replaced by welcome page with a really nice graphics ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep it for now, separate domain is nice when you want to browse only frontends specific stuff, otherwise global search is fine but it's not for everyone and could be overwhelming for someone who just wants to have pretty shop ;)
apps/docs/.vitepress/theme/index.ts
Outdated
| export default Object.assign( | ||
| { | ||
| ...SWAGTheme(), | ||
| }, | ||
| { | ||
| enhanceApp({ app }: { app: App }) { | ||
| // app.component("AI", AI); | ||
| app.component("PageRef", PageRef); | ||
| // app.provide('some-injection-key-if-needed', VALUE) | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, your theme overrides the whole enhanceApp() from the base theme. This should fix it.
| export default SWAGTheme() |
You can then enhance the app by passing the enhanceApp as a config:
export default SWAGTheme({
enhanceApp({ app }: { app: App }) {
// app.component("PageRef", PageRef);
}
})There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for mentioning it! unfortunately, the last change that makes PageRef links relative (by adding a dot ".") breaks our internal docs navigation.
it takes wrong current dir as a context to relative link. so now the PageRef creates a link 57d179d#diff-1097c28b29e09dfb83f3fd2058a9c06e54c2ee81c47ebf312517019a281f9f0fR69 but relatively from "templates" dir, not the base docs path. that leads to 404... @bojanrajh does it work in developer portal context or we need to provide some fix for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after that change the problem should be gone.
| "scripts": { | ||
| "dev": "vitepress", | ||
| "build": "vitepress build", | ||
| "build:devhub": "VITEPRESS_BASE=/frontends/ vitepress build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bojanrajh I added the usage of withBase() function of vitepress to enable you and us to control the prefix in URL. since now on we can continue to provide an absolute path for PageRefs globally.
that fixes the problem in both environments - dev portal and our standalone docs.
cc: @patzick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure? How does developer-portal know when to apply the /frontends base? The PageRef component from this repo is never registered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, there is no other way to reconcile two environments I guess... so my suggestion would be to provide awareness of baseUrl the docs are deployed under.
Description
adds missing PageRef component, responsible for displaying internal links with description.
Type of change
Bug fix (non-breaking change that fixes an issue)