Skip to content

Commit 2ba152b

Browse files
Update package versions and dependencies
1 parent 8d4309d commit 2ba152b

32 files changed

+14083
-28
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ yarn-error.log
1010
.pnp.js
1111

1212
# Build output
13-
/dist/
13+
dist/
14+
dist-types/
1415
/build/
1516
/out/
1617

packages/postman-backend/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/postman-backend/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@postman-solutions/postman-backstage-backend-plugin",
3-
"version": "1.0.1",
4-
"main": "src/index.ts",
5-
"types": "src/index.ts",
3+
"version": "1.0.3",
4+
"main": "dist/index.cjs.js",
5+
"types": "dist/index.d.ts",
66
"license": "Apache-2.0",
77
"publishConfig": {
88
"access": "public",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "@backstage/cli/config/tsconfig.json",
3+
"include": [
4+
"src"
5+
],
6+
"exclude": ["node_modules"],
7+
"compilerOptions": {
8+
"outDir": "dist-types",
9+
"rootDir": "."
10+
}
11+
}

packages/postman/.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!dist/**/**
3+
!NOTICE
4+
!config.d.ts

packages/postman/globals.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
declare module '*.svg' {
2+
import React = require('react');
3+
export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
4+
const src: string;
5+
export default src;
6+
}
7+
8+
declare module '*.png' {
9+
const value: any;
10+
export = value;
11+
}

packages/postman/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@postman-solutions/backstage-plugin-postman",
3-
"version": "1.0.1",
4-
"main": "src/index.ts",
5-
"types": "src/index.ts",
3+
"version": "1.0.3",
4+
"main": "dist/index.esm.js",
5+
"types": "dist/index.d.ts",
66
"license": "Apache-2.0",
77
"publishConfig": {
88
"access": "public",
@@ -49,7 +49,7 @@
4949
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
5050
},
5151
"devDependencies": {
52-
"@backstage/cli": "^0.25.2",
52+
"@backstage/cli": "^0.26.4",
5353
"@backstage/core-app-api": "^1.12.0",
5454
"@backstage/dev-utils": "^1.0.27",
5555
"@backstage/test-utils": "^1.5.0",
@@ -59,6 +59,7 @@
5959
"msw": "^1.0.0"
6060
},
6161
"files": [
62-
"dist"
62+
"dist",
63+
"globals.d.ts"
6364
]
6465
}
16.9 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
import { MainComponent } from './MainComponent';
3+
import { rest } from 'msw';
4+
import { setupServer } from 'msw/node';
5+
import { screen } from '@testing-library/react';
6+
import {
7+
setupRequestMockHandlers,
8+
renderInTestApp,
9+
} from "@backstage/test-utils";
10+
11+
describe('MainComponent', () => {
12+
const server = setupServer();
13+
// Enable sane handlers for network requests
14+
setupRequestMockHandlers(server);
15+
16+
// setup mock response
17+
beforeEach(() => {
18+
server.use(
19+
rest.get('/*', (_, res, ctx) => res(ctx.status(200), ctx.json({}))),
20+
);
21+
});
22+
23+
it('should render', async () => {
24+
await renderInTestApp(<MainComponent />);
25+
expect(screen.getByText('Welcome to postman!')).toBeInTheDocument();
26+
});
27+
});
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import React from 'react';
2+
import { Grid } from '@material-ui/core';
3+
import {
4+
InfoCard,
5+
Header,
6+
Page,
7+
Content,
8+
ContentHeader,
9+
HeaderLabel,
10+
MarkdownContent,
11+
} from '@backstage/core-components';
12+
13+
import APIView from './../../examples/images/api.png';
14+
import MonitorView from './../../examples/images/monitor.png';
15+
import CollectionView from './../../examples/images/collections.png';
16+
17+
const ReadMe = `
18+
This plugin offers several views which you can use to display published API information stored in Postman, show collections with a *Run In Postman* button and allows you to view your Postman monitor results on the API page.
19+
20+
## API View
21+
22+
Displays your published Postman API data in Backstage, allowing you to access both the API information and the published API collections.
23+
24+
![Postman API View](${APIView})
25+
26+
Refer to the [Postman API Metadata](https://github.com/postman-solutions-eng/backstage-demo/tree/main/plugins/postman#apis) to see the parameters needed to display this view.
27+
28+
## Collections View
29+
30+
Displays the collection(s) of a given API stored in Postman. This view includes a *Run in Postman* button, which is activated based on the collection ID(s) or tag defined in the 'entities.yaml' file.
31+
32+
![Postman Collection View](${CollectionView})
33+
34+
Refer to the [Postman Collections Metadata](https://github.com/postman-solutions-eng/backstage-demo/tree/main/plugins/postman#collections-use-collection-tag-or-ids) to see the parameters needed to display this view.
35+
36+
### Monitor View
37+
38+
Shows the health of your API as determined by the monitor in Postman. The monitor can be displayed using either its 'name' or 'id'.
39+
40+
![Postman Monitor View](${MonitorView})
41+
42+
For more details, refer to [this section](https://github.com/postman-solutions-eng/backstage-demo/tree/main/plugins/postman#monitors-use-monitor-id-or-name).
43+
44+
## Coming soon
45+
46+
A *Governance Checks* view will be added in future versions of this plugin.
47+
`;
48+
49+
export const MainComponent = () => (
50+
<Page themeId="tool">
51+
<Header title="Welcome to the Postman plugin page!" subtitle="A backstage plugin designed to demonstrate how Postman can be integrated in Bacjstage to manage APIs and streamline development workflows.">
52+
<HeaderLabel label="Owner" value="Postman Solutions" />
53+
<HeaderLabel label="Lifecycle" value="Production" />
54+
</Header>
55+
<Content>
56+
<ContentHeader title="Postman" />
57+
<Grid container spacing={3} direction="column">
58+
<Grid item>
59+
<InfoCard title="Plugin Views">
60+
<MarkdownContent content={ReadMe} />
61+
</InfoCard>
62+
</Grid>
63+
</Grid>
64+
</Content>
65+
</Page>
66+
);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { MainComponent } from './MainComponent';

0 commit comments

Comments
 (0)