Skip to content

Commit a0c132c

Browse files
committed
fix: upgrade meta schema to 1.3.2
1 parent d39cdea commit a0c132c

24 files changed

+99
-122
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ npm install @open-rpc/docs-react @open-rpc/meta-schema --save
4444
import React from 'react';
4545
import ReactDOM from 'react-dom';
4646
import Documentation from "@open-rpc/docs-react";
47-
import { types } from '@open-rpc/meta-schema';
47+
import { OpenRPC } from '@open-rpc/meta-schema';
4848
49-
const schema: types.OpenRPC = {
49+
const schema: OpenRPC = {
5050
openrpc: "1.0.0-rc1",
5151
info: {
5252
"version": "0.0.0-development",

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"dependencies": {
1414
"@material-ui/core": "^3.9.2",
1515
"@material-ui/icons": "^3.0.2",
16-
"@open-rpc/meta-schema": "^1.1.0",
16+
"@open-rpc/examples": "^1.3.0",
17+
"@open-rpc/meta-schema": "^1.3.2",
1718
"hash-color-material": "^1.1.3",
1819
"json-schema": "^0.2.3",
1920
"lodash": "^4.17.11",

src/ContentDescriptor/ContentDescriptor.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import ReactDOM from "react-dom";
33
import ContentDescriptor from "./ContentDescriptor";
4-
import { types } from "@open-rpc/meta-schema";
4+
import { ContentDescriptorObject } from "@open-rpc/meta-schema";
55

66
it("renders without crashing", () => {
77
const div = document.createElement("div");
@@ -18,15 +18,15 @@ it("renders empty with no schema", () => {
1818

1919
it("renders empty with empty schema", () => {
2020
const div = document.createElement("div");
21-
const emptyContentDescriptor = {} as types.ContentDescriptorObject;
21+
const emptyContentDescriptor = {} as ContentDescriptorObject;
2222
ReactDOM.render(<ContentDescriptor contentDescriptor={emptyContentDescriptor}/>, div);
2323
expect(div.innerHTML).toBe("");
2424
ReactDOM.unmountComponentAtNode(div);
2525
});
2626

2727
it("renders a name", () => {
2828
const div = document.createElement("div");
29-
ReactDOM.render(<ContentDescriptor contentDescriptor={{name: "foo"}}/>, div);
29+
ReactDOM.render(<ContentDescriptor contentDescriptor={{name: "foo", schema: {}}}/>, div);
3030
expect(div.innerHTML.includes("foo")).toBe(true);
3131
ReactDOM.unmountComponentAtNode(div);
3232
});

src/ContentDescriptor/ContentDescriptor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import ExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails";
66
import JSONSchema from "../JSONSchema/JSONSchema";
77
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
88
import ReactMarkdown from "react-markdown";
9-
import { types } from "@open-rpc/meta-schema";
9+
import { ContentDescriptorObject } from "@open-rpc/meta-schema";
1010

1111
const styles = (theme: Theme) => ({
1212
heading: {
@@ -22,7 +22,7 @@ const styles = (theme: Theme) => ({
2222
});
2323

2424
interface IProps extends WithStyles<typeof styles> {
25-
contentDescriptor?: types.ContentDescriptorObject;
25+
contentDescriptor?: ContentDescriptorObject;
2626
hideIcon?: boolean;
2727
hideRequired?: boolean;
2828
uiSchema?: any;

src/ContentDescriptors/ContentDescriptors.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import ReactDOM from "react-dom";
33
import ContentDescriptors from "./ContentDescriptors";
4-
import { types } from "@open-rpc/meta-schema";
4+
import { OpenRPC } from "@open-rpc/meta-schema";
55

66
it("renders without crashing", () => {
77
const div = document.createElement("div");
@@ -18,7 +18,7 @@ it("renders empty with no schema", () => {
1818

1919
it("renders empty with empty schema", () => {
2020
const div = document.createElement("div");
21-
const emptySchema = {} as types.OpenRPC;
21+
const emptySchema = {} as OpenRPC;
2222
ReactDOM.render(<ContentDescriptors schema={emptySchema}/>, div);
2323
expect(div.innerHTML).toBe("");
2424
ReactDOM.unmountComponentAtNode(div);

src/ContentDescriptors/ContentDescriptors.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React, { Component } from "react";
22
import ContentDescriptor from "../ContentDescriptor/ContentDescriptor";
33
import { Typography } from "@material-ui/core";
4-
import { types } from "@open-rpc/meta-schema";
5-
import { ContentDescriptorObject } from "@open-rpc/meta-schema/build/src/types";
4+
import { OpenRPC, ContentDescriptorObject } from "@open-rpc/meta-schema";
65

76
interface IProps {
8-
schema?: types.OpenRPC;
7+
schema?: OpenRPC;
98
uiSchema?: any;
109
}
1110

src/Documentation.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import Info from "./Info/Info";
33
import Servers from "./Servers/Servers";
44
import Methods from "./Methods/Methods";
55
import ContentDescriptors from "./ContentDescriptors/ContentDescriptors";
6-
import { types } from "@open-rpc/meta-schema";
6+
import { OpenRPC } from "@open-rpc/meta-schema";
77

88
interface IProps {
9-
schema: types.OpenRPC;
9+
schema: OpenRPC;
1010
uiSchema?: any;
1111
reactJsonOptions?: any;
1212
}
@@ -22,10 +22,10 @@ export default class Documentation extends React.Component<IProps> {
2222
}
2323
return (
2424
<>
25-
<Info schema={schema} />
26-
<Servers servers={schema.servers} reactJsonOptions={reactJsonOptions}/>
27-
<Methods schema={schema} uiSchema={uiSchema} reactJsonOptions={reactJsonOptions}/>
28-
<ContentDescriptors schema={schema} uiSchema={uiSchema}></ContentDescriptors>
25+
<Info schema={schema} />
26+
<Servers servers={schema.servers} reactJsonOptions={reactJsonOptions} />
27+
<Methods schema={schema} uiSchema={uiSchema} reactJsonOptions={reactJsonOptions} />
28+
<ContentDescriptors schema={schema} uiSchema={uiSchema}></ContentDescriptors>
2929
</>
3030
);
3131
}

src/Errors/Errors.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import TableHead from "@material-ui/core/TableHead";
99
import TableRow from "@material-ui/core/TableRow";
1010
import { Typography, Grid } from "@material-ui/core";
1111
import ReactJson from "react-json-view";
12-
import { types } from "@open-rpc/meta-schema";
12+
import { ErrorObject } from "@open-rpc/meta-schema";
1313

1414
const styles = (theme: Theme) => ({
1515
code: {
@@ -18,7 +18,7 @@ const styles = (theme: Theme) => ({
1818
});
1919

2020
interface IProps extends WithStyles<typeof styles> {
21-
errors?: types.ErrorObject[];
21+
errors?: ErrorObject[];
2222
reactJsonOptions?: any;
2323
}
2424

0 commit comments

Comments
 (0)