Skip to content

Commit

Permalink
[wordpress] ⚡ add config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoluisi committed Jun 14, 2022
1 parent a564f4f commit 11efed7
Show file tree
Hide file tree
Showing 7 changed files with 477 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ indent_size = 2
[*.{yml,yaml}]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
line_wrap_mode = soft wrap
2 changes: 2 additions & 0 deletions app/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
"@backstage/plugin-scaffolder": "^1.2.0",
"@backstage/plugin-search": "^0.8.1",
"@backstage/plugin-search-react": "^0.2.0",
"@backstage/plugin-sonarqube": "^0.3.6",
"@backstage/plugin-tech-radar": "^0.5.12",
"@backstage/plugin-techdocs": "^1.1.1",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.0.0",
"@backstage/plugin-techdocs-react": "^1.0.0",
"@backstage/plugin-todo": "^0.2.8",
"@backstage/plugin-user-settings": "^0.4.4",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.12.2",
Expand Down
6 changes: 6 additions & 0 deletions app/packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ import { EntityGithubPullRequestsContent } from '@roadiehq/backstage-plugin-gith
import { EntitySecurityInsightsContent } from '@roadiehq/backstage-plugin-security-insights';
import { EntityKubernetesContent } from '@backstage/plugin-kubernetes';
import { EntitySonarQubeCard } from '@backstage/plugin-sonarqube';
import { EntityTodoContent } from '@backstage/plugin-todo';


import {
EntityArgoCDOverviewCard,
Expand Down Expand Up @@ -211,6 +213,10 @@ const serviceEntityPage = (
</Grid>
</EntityLayout.Route>

<EntityLayout.Route path="/todo" title="Todo">
<EntityTodoContent />
</EntityLayout.Route>

<EntityLayout.Route path="/docs" title="Docs">
<EntityTechdocsContent />
</EntityLayout.Route>
Expand Down
1 change: 1 addition & 0 deletions app/packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@backstage/plugin-search-backend-module-pg": "^0.3.3",
"@backstage/plugin-search-backend-node": "^0.6.1",
"@backstage/plugin-techdocs-backend": "^1.1.1",
"@backstage/plugin-todo-backend": "^0.1.30",
"app": "link:../app",
"dockerode": "^3.3.1",
"express": "^4.17.1",
Expand Down
3 changes: 3 additions & 0 deletions app/packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import search from './plugins/search';
import { PluginEnvironment } from './types';
import { ServerPermissionClient } from '@backstage/plugin-permission-node';
import kubernetes from './plugins/kubernetes';
import todo from './plugins/todo';


function makeCreateEnv(config: Config) {
Expand Down Expand Up @@ -83,6 +84,7 @@ async function main() {
const searchEnv = useHotMemoize(module, () => createEnv('search'));
const appEnv = useHotMemoize(module, () => createEnv('app'));
const kubernetesEnv = useHotMemoize(module, () => createEnv('kubernetes'));
const todoEnv = useHotMemoize(module, () => createEnv('todo'));

const apiRouter = Router();
apiRouter.use('/catalog', await catalog(catalogEnv));
Expand All @@ -92,6 +94,7 @@ async function main() {
apiRouter.use('/proxy', await proxy(proxyEnv));
apiRouter.use('/search', await search(searchEnv));
apiRouter.use('/kubernetes', await kubernetes(kubernetesEnv));
apiRouter.use('/todo', await todo(todoEnv));

// Add backends ABOVE this line; this 404 handler is the catch-all fallback
apiRouter.use(notFoundHandler());
Expand Down
28 changes: 28 additions & 0 deletions app/packages/backend/src/plugins/todo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Router } from 'express';
import { CatalogClient } from '@backstage/catalog-client';
import {
createRouter,
TodoReaderService,
TodoScmReader,
} from '@backstage/plugin-todo-backend';
import { PluginEnvironment } from '../types';

export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
const todoReader = TodoScmReader.fromConfig(env.config, {
logger: env.logger,
reader: env.reader,
});

const catalogClient = new CatalogClient({
discoveryApi: env.discovery,
});

const todoService = new TodoReaderService({
todoReader,
catalogClient,
});

return await createRouter({ todoService });
}
Loading

0 comments on commit 11efed7

Please sign in to comment.