Skip to content
Merged
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
10 changes: 10 additions & 0 deletions node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
},
"resolutions": {
"@types/react": "^18",
"@types/react-dom": "^18"
"@types/react-dom": "^18",
"knex": "3.2.10",
"tarn": "3.0.2"
},
"prettier": "@backstage/cli/config/prettier-config",
"lint-staged": {
Expand Down
2 changes: 2 additions & 0 deletions src/packages/app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createApp } from '@backstage/frontend-defaults';
import catalogPlugin from '@backstage/plugin-catalog/alpha';
import serverlessOpsCatalogPlugin from '@internal/backstage-plugin-serverlessops-catalog';
import { navModule } from './modules/nav';
import { configApiRef, googleAuthApiRef, useApi } from '@backstage/core-plugin-api';
import { SignInPageBlueprint } from '@backstage/plugin-app-react';
Expand Down Expand Up @@ -47,6 +48,7 @@ export default createApp({
features: [
catalogPlugin,
navModule,
serverlessOpsCatalogPlugin,
createFrontendModule({
pluginId: 'app',
extensions: [signInPage],
Expand Down
15 changes: 5 additions & 10 deletions src/plugins/serverlessops-catalog/dev/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { createDevApp } from '@backstage/dev-utils';
import { soCatalogPlugin, SoTabbedCatalogIndexPage } from '../src/plugin';
import { createDevApp } from '@backstage/frontend-dev-utils'
import serverlessOpsCatalogPlugin from '../src'

createDevApp()
.registerPlugin(soCatalogPlugin)
.addPage({
element: <SoTabbedCatalogIndexPage />,
title: 'Root Page',
path: '/catalog',
})
.render();
createDevApp({
features: [serverlessOpsCatalogPlugin],
})
Comment on lines +4 to +6
9 changes: 6 additions & 3 deletions src/plugins/serverlessops-catalog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"types": "dist/index.d.ts"
},
"backstage": {
"role": "frontend-plugin"
"role": "frontend-plugin",
"pluginId": "serverlessops-catalog"
},
"sideEffects": false,
"scripts": {
Expand All @@ -27,6 +28,7 @@
"@backstage/catalog-model": "backstage:^",
"@backstage/core-components": "backstage:^",
"@backstage/core-plugin-api": "backstage:^",
"@backstage/frontend-plugin-api": "backstage:^",
"@backstage/plugin-api-docs": "backstage:^",
"@backstage/plugin-catalog": "backstage:^",
"@backstage/plugin-catalog-graph": "backstage:^",
Expand All @@ -43,12 +45,13 @@
"react-use": "^17.2.4"
},
"peerDependencies": {
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@backstage/cli": "backstage:^",
"@backstage/core-app-api": "backstage:^",
"@backstage/dev-utils": "backstage:^",
"@backstage/frontend-dev-utils": "backstage:^",
"@backstage/test-utils": "backstage:^",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
Expand Down
7 changes: 3 additions & 4 deletions src/plugins/serverlessops-catalog/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export {
soCatalogPlugin,
SoCatalogIndexPageEntityList,
SoTabbedCatalogIndexPage,
SoTabbedDirectoryIndexPage
SoCatalogTabbedIndexPage,
SoCatalogTabbedDirectoryIndexPage,
serverlessOpsCatalogPlugin as default,
} from './plugin';
18 changes: 9 additions & 9 deletions src/plugins/serverlessops-catalog/src/plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {
SoCatalogIndexPageEntityList,
SoTabbedCatalogIndexPage,
SoTabbedDirectoryIndexPage,
SoCatalogTabbedDirectoryIndexPage,
SoCatalogTabbedIndexPage,
serverlessOpsCatalogPlugin,
} from './plugin';

describe('catalog', () => {
it('should export plugin SoCatalogIndexPageEntityList', () => {
expect(SoCatalogIndexPageEntityList).toBeDefined();
it('should export plugin SoCatalogTabbedDirectoryIndexPage', () => {
expect(SoCatalogTabbedDirectoryIndexPage).toBeDefined();
});
it('should export plugin SoTabbedCatalogIndexPage', () => {
expect(SoTabbedCatalogIndexPage).toBeDefined();
it('should export plugin SoCatalogTabbedIndexPage', () => {
Comment on lines 7 to +11
expect(SoCatalogTabbedIndexPage).toBeDefined();
});
it('should export plugin SoTabbedDirectoryIndexPage', () => {
expect(SoTabbedDirectoryIndexPage).toBeDefined();
it('should export default plugin surface', () => {
expect(serverlessOpsCatalogPlugin).toBeDefined();
});
});
40 changes: 0 additions & 40 deletions src/plugins/serverlessops-catalog/src/plugin.ts

This file was deleted.

51 changes: 51 additions & 0 deletions src/plugins/serverlessops-catalog/src/plugin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { createElement } from 'react'
import {
createFrontendPlugin,
createRouteRef,
PageBlueprint,
} from '@backstage/frontend-plugin-api'

export { TabbedCatalogIndexPage } from './components/TabbedCatalogIndexPage'

const catalogIndexRouteRef = createRouteRef()
const tabbedCatalogRouteRef = createRouteRef()
const tabbedDirectoryRouteRef = createRouteRef()

export const SoCatalogTabbedIndexPage = PageBlueprint.make({
name: 'serverlessops-catalog-tabbed-index',
params: {
path: '/serverlessops-catalog/catalog',
routeRef: tabbedCatalogRouteRef,
loader: () =>
import('./components/TabbedCatalogIndexPage').then(m =>
createElement(m.TabbedCatalogIndexPage)
),
},
})

export const SoCatalogTabbedDirectoryIndexPage = PageBlueprint.make({
name: 'serverlessops-catalog-tabbed-directory-index',
params: {
path: '/serverlessops-catalog/directory',
routeRef: tabbedDirectoryRouteRef,
loader: () =>
import('./components/TabbedDirectoryIndexPage').then(m =>
createElement(m.TabbedDirectoryIndexPage)
),
},
})

const serverlessOpsCatalogPlugin = createFrontendPlugin({
pluginId: 'serverlessops-catalog',
routes: {
catalogIndex: catalogIndexRouteRef,
tabbedCatalog: tabbedCatalogRouteRef,
tabbedDirectory: tabbedDirectoryRouteRef,
},
extensions: [
SoCatalogTabbedIndexPage,
SoCatalogTabbedDirectoryIndexPage,
],
})

export { serverlessOpsCatalogPlugin }
6 changes: 2 additions & 4 deletions src/plugins/serverlessops-catalog/src/routes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { createRouteRef } from '@backstage/core-plugin-api';
import { createRouteRef } from '@backstage/frontend-plugin-api'

export const rootRouteRef = createRouteRef({
id: 'serverlessops-catalog',
});
export const rootRouteRef = createRouteRef()
Comment on lines +1 to +3
Loading
Loading