Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: Meteor Component Library @ monorepo #198

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/scripts/embed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BRANCH_DOCS_63=v6.3.0
BRANCH_FRONTENDS=DX-devhub
BRANCH_ADMIN_EXTENSION_SDK=DX-223
BRANCH_METEOR_ICON_KIT=main
BRANCH_METEOR_COMPONENT_LIBRARY=DX-231
BRANCH_METEOR_COMPONENT_LIBRARY=dx/devhub-component-library
BRANCH_RELEASE_NOTES=main

# custom orgs
Expand All @@ -20,7 +20,7 @@ ORG_DOCS_63=shopware
ORG_FRONTENDS=shopware
ORG_ADMIN_EXTENSION_SDK=shopware
ORG_METEOR_ICON_KIT=shopware
ORG_METEOR_COMPONENT_LIBRARY=bojanrajh
ORG_METEOR_COMPONENT_LIBRARY=shopware
ORG_RELEASE_NOTES=shopware

if [[ "$PWD" != *"/developer-portal" ]]; then
Expand Down Expand Up @@ -98,13 +98,13 @@ fi
--dst resources/meteor-icon-kit \
--org ${ORG_METEOR_ICON_KIT:-shopware}

#./docs-cli.cjs clone \
# --ci \
# --repository shopware/meteor-component-library \
# --branch ${BRANCH_METEOR_COMPONENT_LIBRARY:-main} \
# --src docs \
# --dst resources/meteor-component-library \
# --org ${ORG_METEOR_COMPONENT_LIBRARY:-shopware}
./docs-cli.cjs clone \
--ci \
--repository shopware/meteor \
--branch ${BRANCH_METEOR_COMPONENT_LIBRARY:-main} \
--src packages/component-library/docs \
--dst resources/meteor-component-library \
--org ${ORG_METEOR_COMPONENT_LIBRARY:-shopware}

./docs-cli.cjs clone \
--ci \
Expand Down
7 changes: 3 additions & 4 deletions .vitepress/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ const navigation = buildSidebarNav('./src/', [
},
{
text: "Meteor Component Library",
// link: "/resources/meteor-component-library/",
link: 'https://shopware.github.io/meteor-component-library/',
repo: 'shopware/meteor-component-library',
link: "/resources/meteor-component-library/",
repo: 'shopware/meteor',
}
]
},
Expand Down Expand Up @@ -96,7 +95,7 @@ const navigation = buildSidebarNav('./src/', [
'/docs/v6.4/',
'/docs/v6.3/',
//'/resources/admin-extension-sdk/',
//'/resources/meteor-component-library/',
'/resources/meteor-component-library/',
'/', // always have root sidebar
'/resources/meteor-icon-kit/',
'/release-notes/',
Expand Down
10 changes: 4 additions & 6 deletions .vitepress/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,17 @@
}
},
{
"name": "shopware/meteor-component-library",
"src": "docs",
"name": "shopware/meteor",
"src": "packages/component-library/docs",
"dst": "resources/meteor-component-library",
"branch": [
"env.BRANCH_METEOR_COMPONENT_LIBRARY",
"DX-231",
"main"
],
"org": [
"env.ORG_METEOR_COMPONENT_LIBRARY",
"bojanrajh"
],
"skip": true
"shopware"
]
},
{
"name": "shopware/release-notes",
Expand Down
20 changes: 20 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ import SwagRadialBg from "../../src/components/SwagRadialBg.vue";
import SwagCopilotMenu from "../../node_modules/vitepress-shopware-docs/src/shopware/components/copilot/SwagCopilotMenu.vue";
import "./style.scss";

const autoDiscoverComponents = (app) => {
const requireComponent = require.context('../../src/resources/meteor-component-library/components/', true, /[A-Z]\w+\.(vue)$/);

requireComponent.keys().forEach(fileName => {
const componentConfig = requireComponent(fileName);
const componentName = fileName
.split('/')
.pop()!
.replace(/\.\w+$/, '');

app.component(
componentName,
componentConfig.default || componentConfig
);
});
}

export default {
...SWAGTheme({
slots: {
Expand All @@ -15,5 +32,8 @@ export default {
SwagCopilotMenu,
]
},
enhanceApp({ app }) {
autoDiscoverComponents(app);
}
}),
}
Loading