fix errors (#245)

* fix errors

* fixes
This commit is contained in:
Ritesh Kumar authored and GitHub committed 2020-09-29 08:06:37 +05:30
1 parent 6604b2dd0f
commit ea48bf3345
5 files changed
+50 -22

No files matched your search

+4 -6
View File
@@ -405,17 +405,15 @@ export const ShowStoredUser: React.FC<Props> = (props) => {
import { useState, useEffect } from 'react';
export const CounterExample = () => {
export const CounterExample: React.FC<{}> = () => {
const [count, setCount] = useState(0);
useEffect(() => {
document.title = \`You clicked $\{count\} times\`;
});
const handleClick = () => setCount(count + 1)
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
<button onClick={handleClick}>
Click me
</button>
</div>
+2
View File
@@ -7,6 +7,8 @@ export default (req: NextApiRequest, res: NextApiResponse) => {
const result = compiler.compileDefinitionString(req.body);
res.status(200).send(beautify(result));
} catch (e) {
console.log(e);
res.status(500).send(e.message);
}
};
+12 -2
View File
@@ -1,11 +1,20 @@
import { NextApiRequest, NextApiResponse } from "next";
import { Config } from "ts-json-schema-generator/dist/src/Config";
import tempy from "tempy";
import * as tsj from "ts-json-schema-generator";
import os from "os";
import crypto from "crypto";
import path from "path";
import fs from "fs";
const tmpDir = os.tmpdir?.();
export default (req: NextApiRequest, res: NextApiResponse) => {
const filePath =
path.join(tmpDir, crypto.randomBytes(16).toString("hex")) + ".ts";
try {
const filePath = tempy.writeSync(req.body, { extension: "ts" });
fs.writeFileSync(filePath, req.body, {
encoding: "utf-8"
});
const config: Config = {
path: filePath,
expose: "all",
@@ -18,4 +27,5 @@ export default (req: NextApiRequest, res: NextApiResponse) => {
} catch (e) {
res.status(500).send(e.message);
}
fs.unlinkSync(filePath);
};
-13
View File
@@ -1,13 +0,0 @@
diff --git a/node_modules/relay-compiler/lib/core/GraphQLCompilerProfiler.js b/node_modules/relay-compiler/lib/core/GraphQLCompilerProfiler.js
index 443d7f5..90119ec 100644
--- a/node_modules/relay-compiler/lib/core/GraphQLCompilerProfiler.js
+++ b/node_modules/relay-compiler/lib/core/GraphQLCompilerProfiler.js
@@ -189,6 +189,8 @@ function instrumentWait(fn, name) {
return instrumented;
}
+process.hrtime = () => {}
+
var T_ZERO = process.hrtime(); // Return a Uint32 of microtime duration since program start.
function microtime() {
+32 -1
View File
@@ -6359,6 +6359,14 @@ lil-uuid@^0.1.1:
resolved "https://registry.yarnpkg.com/lil-uuid/-/lil-uuid-0.1.1.tgz#f9edcf23f00e42bf43f0f843d98d8b53f3341f16"
integrity sha1-+e3PI/AOQr9D8PhD2Y2LU/M0HxY=
line-column@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/line-column/-/line-column-1.0.2.tgz#d25af2936b6f4849172b312e4792d1d987bc34a2"
integrity sha1-0lryk2tvSEkXKzEuR5LR2Ye8NKI=
dependencies:
isarray "^1.0.0"
isobject "^2.0.0"
lines-and-columns@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00"
@@ -7033,6 +7041,11 @@ nanoid@^2.1.0:
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280"
integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==
nanoid@^3.1.12:
version "3.1.12"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654"
integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==
nanomatch@^1.2.9:
version "1.2.13"
resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
@@ -8054,7 +8067,7 @@ postcss-functions@^3.0.0:
postcss "^6.0.9"
postcss-value-parser "^3.3.0"
postcss-js@^2.0.0, postcss-js@^2.0.3:
postcss-js@^2.0.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-2.0.3.tgz#a96f0f23ff3d08cec7dc5b11bf11c5f8077cdab9"
integrity sha512-zS59pAk3deu6dVHyrGqmC3oDXBdNdajk4k1RyxeVXCrcEDBUBHoIhE4QTsmhxgzXxsaqFDAkUZfmMa5f/N/79w==
@@ -8062,6 +8075,14 @@ postcss-js@^2.0.0, postcss-js@^2.0.3:
camelcase-css "^2.0.1"
postcss "^7.0.18"
postcss-js@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-3.0.1.tgz#e467efdce80ca02e072c60b42e0b35ad2f950a94"
integrity sha512-m1DgECmEbOK9JhGkdctaP9ZRVheJuEnkk2eb/d3K+5uN10C3S004Ng6Hat4Aha7PsLt824x0xwrT7rVwGRVLHg==
dependencies:
camelcase-css "^2.0.1"
postcss "^8.1.0"
postcss-load-config@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-2.1.0.tgz#c84d692b7bb7b41ddced94ee62e8ab31b417b003"
@@ -8414,6 +8435,16 @@ postcss@^6.0.1, postcss@^6.0.23, postcss@^6.0.9:
source-map "^0.6.1"
supports-color "^5.4.0"
postcss@^8.1.0:
version "8.1.1"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.1.1.tgz#c3a287dd10e4f6c84cb3791052b96a5d859c9389"
integrity sha512-9DGLSsjooH3kSNjTZUOt2eIj2ZTW0VI2PZ/3My+8TC7KIbH2OKwUlISfDsf63EP4aiRUt3XkEWMWvyJHvJelEg==
dependencies:
colorette "^1.2.1"
line-column "^1.0.2"
nanoid "^3.1.12"
source-map "^0.6.1"
postinstall-postinstall@^2.0.0, postinstall-postinstall@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3"