-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(marketplace): prepare usage as dynamic plugin (add app-config.dy…
…namic.yaml examples and export icon and content) (#167) * feat(marketplace): prepare usage as dynamic plugin (add app-config.dynamic.yaml examples and export icon and content) Signed-off-by: Christoph Jerolimov <[email protected]> * fix(marketplace): add mui v5 workaround so that it looks correct when loaded as dynamic plugin Signed-off-by: Christoph Jerolimov <[email protected]> --------- Signed-off-by: Christoph Jerolimov <[email protected]>
- Loading branch information
1 parent
0f319d7
commit c3ff204
Showing
13 changed files
with
170 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
workspace=marketplace | ||
|
||
# This variables defines the showcase and dynamic-plugins-root paths. | ||
# | ||
# The default expects that you have this redhat-developer/rhdh-plugins | ||
# repo and janus-idp/backstage-showcase repo side by side incl. the | ||
# org structure. | ||
# | ||
# If you don't have the org structure locally you can override this | ||
# with make arguments like this: | ||
# | ||
# make showcase=../../../backstage-showcase <command like copy> | ||
# | ||
# Or use an absolute path: | ||
# | ||
# make showcase=~/git/backstage-showcase <command like copy> | ||
showcase=../../../../janus-idp/backstage-showcase | ||
|
||
# The dynamic-plugins-root has two more ../.. because it's relative | ||
# to the plugins/* folders | ||
dproot=../../${showcase}/dynamic-plugins-root | ||
|
||
clean=true | ||
|
||
dev=true | ||
|
||
fix: | ||
@echo | ||
@echo fix and format ${workspace} workspace | ||
@echo | ||
yarn tsc:full | ||
yarn build:api-reports:only | ||
|
||
add-to-showcase: add-frontend-to-showcase add-backend-to-showcase add-catalog-modules-to-showcase copy-config-to-showcase | ||
|
||
add-frontend-to-showcase: | ||
@echo | ||
@echo Will build and install ${workspace} frontend into ${showcase} | ||
@echo | ||
cd plugins/marketplace && npx --yes @janus-idp/cli package export-dynamic-plugin --dynamic-plugins-root "${dproot}" --clean "${clean}" --dev "${dev}" | ||
|
||
add-backend-to-showcase: | ||
@echo | ||
@echo Will build and install ${workspace} backend into ${showcase} | ||
@echo | ||
cd plugins/marketplace-backend && npx --yes @janus-idp/cli package export-dynamic-plugin --dynamic-plugins-root "${dproot}" --clean "${clean}" --dev "${dev}" | ||
|
||
add-catalog-modules-to-showcase: | ||
@echo | ||
@echo Will build and install catalog modules into ${showcase} | ||
@echo | ||
cd plugins/catalog-backend-module-marketplace && npx --yes @janus-idp/cli package export-dynamic-plugin --dynamic-plugins-root "${dproot}" --clean "${clean}" --dev "${dev}" --embed-package "@red-hat-developer-hub/backstage-plugin-marketplace-common" | ||
|
||
copy-config-to-showcase: | ||
@echo | ||
@echo Copy app-config.dynamic.yaml into ${showcase} | ||
@echo | ||
cp app-config.dynamic.yaml "${showcase}/app-config-marketplace.local.yaml" | ||
@echo | ||
@echo You can start your showcase now with | ||
@echo | ||
@echo yarn dev | ||
@echo | ||
|
||
remove-from-showcase: | ||
@echo | ||
@echo Remove packages from ${showcase} | ||
@echo | ||
rm -rf "${dproot}/red-hat-developer-hub-backstage-plugin-marketplace" | ||
rm -rf "${dproot}/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic" | ||
rm -rf "${dproot}/red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace-dynamic" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
catalog: | ||
locations: | ||
# Examples from https://github.com/redhat-developer/rhdh-plugins/tree/main/workspaces/marketplace/examples | ||
- type: url | ||
target: https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/marketplace/examples/all-orgs.yaml | ||
rules: | ||
- allow: [Group] | ||
- type: url | ||
target: https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/marketplace/examples/all-plugins.yaml | ||
rules: | ||
- allow: [Plugin] | ||
- type: url | ||
target: https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/marketplace/examples/all-pluginlists.yaml | ||
rules: | ||
- allow: [PluginList] | ||
|
||
dynamicPlugins: | ||
frontend: | ||
red-hat-developer-hub.backstage-plugin-marketplace: | ||
appIcons: | ||
- name: marketplace | ||
importName: MarketplaceIcon | ||
dynamicRoutes: | ||
- path: /marketplace | ||
importName: MarketplacePage | ||
menuItem: | ||
icon: marketplace | ||
text: Marketplace | ||
mountPoints: | ||
- mountPoint: admin.page.plugins/cards | ||
importName: MarketplaceCatalogContent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
workspaces/marketplace/plugins/marketplace-backend/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
workspaces/marketplace/plugins/marketplace/app-config.dynamic.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
dynamicPlugins: | ||
frontend: | ||
red-hat-developer-hub.backstage-plugin-marketplace: | ||
appIcons: | ||
- name: marketplace | ||
importName: MarketplaceIcon | ||
dynamicRoutes: | ||
- path: /marketplace | ||
importName: MarketplacePage | ||
menuItem: | ||
icon: marketplace | ||
text: Marketplace | ||
mountPoints: | ||
- mountPoint: admin.page.plugins/cards | ||
importName: MarketplaceCatalogContent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters