fix build issues

pull/3542/head
Solid Studio 4 years ago committed by Joseph Izang
parent 6540f0d376
commit 14d130984e
  1. 3
      src/AppContext.tsx
  2. 2
      src/index.tsx
  3. 5
      src/utils/template.ts
  4. 9
      src/utils/utils.ts
  5. 2
      src/views/ErrorView.tsx
  6. 2
      src/views/HomeView.tsx

@ -3,8 +3,7 @@ import {
PluginApi, PluginApi,
IRemixApi, IRemixApi,
Api, Api,
PluginClient, PluginClient
CompilationResult,
} from "@remixproject/plugin"; } from "@remixproject/plugin";
import { ContractName, Documentation, PublishedSite } from "./types"; import { ContractName, Documentation, PublishedSite } from "./types";

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
import ReactDOM from "react-dom"; import ReactDOM from "react-dom";
import App from "./App"; import App from "./App";
import { Routes } from "./routes"; // import { Routes } from "./routes";
ReactDOM.render( ReactDOM.render(
<React.StrictMode> <React.StrictMode>

@ -2,7 +2,6 @@ import {
FunctionDocumentation, FunctionDocumentation,
TemplateDoc, TemplateDoc,
MethodDoc, MethodDoc,
ContractDoc,
ContractDocumentation, ContractDocumentation,
ParameterDocumentation, ParameterDocumentation,
} from "./types"; } from "./types";
@ -104,7 +103,7 @@ export const renderHeader = (
) => ` ) => `
<h3>${name} ${ <h3>${name} ${
contractDoc.title ? `<small>: ${contractDoc.title}</small>` : "" contractDoc.title ? `<small>: ${contractDoc.title}</small>` : ""
}</h3> }</h3>
${contractDoc.notice ? `<p class="lead">${contractDoc.notice}</p>` : ""} ${contractDoc.notice ? `<p class="lead">${contractDoc.notice}</p>` : ""}
@ -147,7 +146,7 @@ export const getMethodDetails = (devMethod?: Partial<MethodDoc>) => {
: Object.keys(devMethod) : Object.keys(devMethod)
.filter((key) => key !== "params") .filter((key) => key !== "params")
.map((key) => { .map((key) => {
(devMethodDocTemplate as any)[key]((devMethod as any)[key]); return (devMethodDocTemplate as any)[key]((devMethod as any)[key]);
}) })
.join("\n"); .join("\n");
}; };

@ -2,16 +2,11 @@ import {
CompilationResult, CompilationResult,
CompiledContract, CompiledContract,
FunctionDescription, FunctionDescription,
ABIDescription,
DevMethodDoc,
UserMethodDoc,
ABIParameter, ABIParameter,
DeveloperDocumentation, ABIDescription
UserDocumentation,
} from "@remixproject/plugin"; } from "@remixproject/plugin";
import { import {
EthDocumentation,
FileName, FileName,
Documentation, Documentation,
ContractName, ContractName,
@ -73,7 +68,7 @@ export const getContractDoc = (name: string, contract: CompiledContract) => {
export const getContractDocumentation = (contract: CompiledContract) => { export const getContractDocumentation = (contract: CompiledContract) => {
const methods: MethodsDocumentation = {}; const methods: MethodsDocumentation = {};
Object.keys(contract.userdoc.methods).map((item) => { Object.keys(contract.userdoc.methods).forEach((item) => {
if (contract.devdoc.methods[item]) { if (contract.devdoc.methods[item]) {
const finalResult = { const finalResult = {
...contract.userdoc.methods[item], ...contract.userdoc.methods[item],

@ -19,7 +19,7 @@ export const ErrorView: React.FC = () => {
<h5>Sorry, something unexpected happened. </h5> <h5>Sorry, something unexpected happened. </h5>
<h5> <h5>
Please raise an issue:{" "} Please raise an issue:{" "}
<a style={{ color: "red" }} href=""> <a style={{ color: "red" }} href="https://github.com/Machinalabs/remix-ethdoc-plugin/issues">
Here Here
</a> </a>
</h5> </h5>

@ -27,7 +27,7 @@ export const HomeView: React.FC = () => {
if (isPublishing) { if (isPublishing) {
publishDocumentation(); publishDocumentation();
} }
}, [isPublishing]); }, [isPublishing, htmlDocumentation]);
const displayDocumentation = ( const displayDocumentation = (
client: any, client: any,

Loading…
Cancel
Save