Merge branch 'master' of https://github.com/ritz078/transform into ts-json-schema

This commit is contained in:
Ritesh Kumar committed 2020-01-11 00:35:37 +05:30
commit fa4cf48c9e
8 files changed
+96 -34

No files matched your search

+11 -1
View File
@@ -230,7 +230,17 @@
"contributions": [
"code"
]
},
{
"login": "jamesgeorge007",
"name": "James George",
"avatar_url": "https://avatars2.githubusercontent.com/u/25279263?v=4",
"profile": "https://ghuser.io/jamesgeorge007",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7
"contributorsPerLine": 7,
"skipCi": true
}
+30 -25
View File
@@ -13,42 +13,47 @@ MIT @ Ritesh Kumar
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="http://riteshkr.com"><img src="https://avatars3.githubusercontent.com/u/5389035?v=4" width="100px;" alt="Ritesh Kumar"/><br /><sub><b>Ritesh Kumar</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=ritz078" title="Documentation">📖</a> <a href="https://github.com/ritz078/transform/commits?author=ritz078" title="Code">💻</a> <a href="#ideas-ritz078" title="Ideas, Planning, & Feedback">🤔</a> <a href="#review-ritz078" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="http://asquera.de"><img src="https://avatars2.githubusercontent.com/u/47542?v=4" width="100px;" alt="Florian Gilcher"/><br /><sub><b>Florian Gilcher</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=skade" title="Code">💻</a></td>
<td align="center"><a href="http://pascalhertleif.de/"><img src="https://avatars1.githubusercontent.com/u/20063?v=4" width="100px;" alt="Pascal Hertleif"/><br /><sub><b>Pascal Hertleif</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=killercup" title="Code">💻</a></td>
<td align="center"><a href="http://landish.github.io"><img src="https://avatars3.githubusercontent.com/u/534610?v=4" width="100px;" alt="Lado Lomidze"/><br /><sub><b>Lado Lomidze</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=Landish" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/mattiamanzati"><img src="https://avatars1.githubusercontent.com/u/13787614?v=4" width="100px;" alt="Mattia Manzati"/><br /><sub><b>Mattia Manzati</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=mattiamanzati" title="Code">💻</a></td>
<td align="center"><a href="https://tarino.ir"><img src="https://avatars3.githubusercontent.com/u/12202757?v=4" width="100px;" alt="Mohammad Rajabifard"/><br /><sub><b>Mohammad Rajabifard</b></sub></a><br /><a href="#ideas-morajabi" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/ritz078/transform/commits?author=morajabi" title="Code">💻</a></td>
<td align="center"><a href="http://raathigesh.com/"><img src="https://avatars0.githubusercontent.com/u/3108160?v=4" width="100px;" alt="Raathigeshan Kugarajan"/><br /><sub><b>Raathigeshan Kugarajan</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=Raathigesh" title="Code">💻</a></td>
<td align="center"><a href="http://riteshkr.com"><img src="https://avatars3.githubusercontent.com/u/5389035?v=4" width="100px;" alt=""/><br /><sub><b>Ritesh Kumar</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=ritz078" title="Documentation">📖</a> <a href="https://github.com/ritz078/transform/commits?author=ritz078" title="Code">💻</a> <a href="#ideas-ritz078" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/ritz078/transform/pulls?q=is%3Apr+reviewed-by%3Aritz078" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="http://asquera.de"><img src="https://avatars2.githubusercontent.com/u/47542?v=4" width="100px;" alt=""/><br /><sub><b>Florian Gilcher</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=skade" title="Code">💻</a></td>
<td align="center"><a href="http://pascalhertleif.de/"><img src="https://avatars1.githubusercontent.com/u/20063?v=4" width="100px;" alt=""/><br /><sub><b>Pascal Hertleif</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=killercup" title="Code">💻</a></td>
<td align="center"><a href="http://landish.github.io"><img src="https://avatars3.githubusercontent.com/u/534610?v=4" width="100px;" alt=""/><br /><sub><b>Lado Lomidze</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=Landish" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/mattiamanzati"><img src="https://avatars1.githubusercontent.com/u/13787614?v=4" width="100px;" alt=""/><br /><sub><b>Mattia Manzati</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=mattiamanzati" title="Code">💻</a></td>
<td align="center"><a href="https://tarino.ir"><img src="https://avatars3.githubusercontent.com/u/12202757?v=4" width="100px;" alt=""/><br /><sub><b>Mohammad Rajabifard</b></sub></a><br /><a href="#ideas-morajabi" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/ritz078/transform/commits?author=morajabi" title="Code">💻</a></td>
<td align="center"><a href="http://raathigesh.com/"><img src="https://avatars0.githubusercontent.com/u/3108160?v=4" width="100px;" alt=""/><br /><sub><b>Raathigeshan Kugarajan</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=Raathigesh" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://gyandeeps.com"><img src="https://avatars2.githubusercontent.com/u/5554486?v=4" width="100px;" alt="Gyandeep Singh"/><br /><sub><b>Gyandeep Singh</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=gyandeeps" title="Code">💻</a></td>
<td align="center"><a href="https://matt.life"><img src="https://avatars2.githubusercontent.com/u/1128849?v=4" width="100px;" alt="Matt Holt"/><br /><sub><b>Matt Holt</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=mholt" title="Code">💻</a></td>
<td align="center"><a href="https://medium.com/@sreenivas"><img src="https://avatars0.githubusercontent.com/u/2767425?v=4" width="100px;" alt="sreenivas alapati"/><br /><sub><b>sreenivas alapati</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=cg-cnu" title="Code">💻</a></td>
<td align="center"><a href="https://performancejs.com"><img src="https://avatars2.githubusercontent.com/u/1761758?v=4" width="100px;" alt="Boris Cherny"/><br /><sub><b>Boris Cherny</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=bcherny" title="Code">💻</a></td>
<td align="center"><a href="http://www.twitter.com/intabulas"><img src="https://avatars0.githubusercontent.com/u/448?v=4" width="100px;" alt="Mark Lussier"/><br /><sub><b>Mark Lussier</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=intabulas" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/brikou"><img src="https://avatars3.githubusercontent.com/u/383212?v=4" width="100px;" alt="Brice BERNARD"/><br /><sub><b>Brice BERNARD</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=brikou" title="Code">💻</a></td>
<td align="center"><a href="https://twitter.com/@satya164"><img src="https://avatars2.githubusercontent.com/u/1174278?v=4" width="100px;" alt="Satyajit Sahoo"/><br /><sub><b>Satyajit Sahoo</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=satya164" title="Code">💻</a></td>
<td align="center"><a href="https://gyandeeps.com"><img src="https://avatars2.githubusercontent.com/u/5554486?v=4" width="100px;" alt=""/><br /><sub><b>Gyandeep Singh</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=gyandeeps" title="Code">💻</a></td>
<td align="center"><a href="https://matt.life"><img src="https://avatars2.githubusercontent.com/u/1128849?v=4" width="100px;" alt=""/><br /><sub><b>Matt Holt</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=mholt" title="Code">💻</a></td>
<td align="center"><a href="https://medium.com/@sreenivas"><img src="https://avatars0.githubusercontent.com/u/2767425?v=4" width="100px;" alt=""/><br /><sub><b>sreenivas alapati</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=cg-cnu" title="Code">💻</a></td>
<td align="center"><a href="https://performancejs.com"><img src="https://avatars2.githubusercontent.com/u/1761758?v=4" width="100px;" alt=""/><br /><sub><b>Boris Cherny</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=bcherny" title="Code">💻</a></td>
<td align="center"><a href="http://www.twitter.com/intabulas"><img src="https://avatars0.githubusercontent.com/u/448?v=4" width="100px;" alt=""/><br /><sub><b>Mark Lussier</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=intabulas" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/brikou"><img src="https://avatars3.githubusercontent.com/u/383212?v=4" width="100px;" alt=""/><br /><sub><b>Brice BERNARD</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=brikou" title="Code">💻</a></td>
<td align="center"><a href="https://twitter.com/@satya164"><img src="https://avatars2.githubusercontent.com/u/1174278?v=4" width="100px;" alt=""/><br /><sub><b>Satyajit Sahoo</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=satya164" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://medium.com/@shakyShane"><img src="https://avatars3.githubusercontent.com/u/1643522?v=4" width="100px;" alt="Shane Osbourne"/><br /><sub><b>Shane Osbourne</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=shakyShane" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/pd4d10"><img src="https://avatars0.githubusercontent.com/u/9524411?v=4" width="100px;" alt="Rongjian Zhang"/><br /><sub><b>Rongjian Zhang</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=pd4d10" title="Code">💻</a></td>
<td align="center"><a href="http://keshShan.github.io"><img src="https://avatars3.githubusercontent.com/u/12506034?v=4" width="100px;" alt="Keshan Nageswaran"/><br /><sub><b>Keshan Nageswaran</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=KeshShan" title="Code">💻</a></td>
<td align="center"><a href="http://www.codegent.com"><img src="https://avatars1.githubusercontent.com/u/7318?v=4" width="100px;" alt="codegent"/><br /><sub><b>codegent</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=code" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/bastor"><img src="https://avatars3.githubusercontent.com/u/1881814?v=4" width="100px;" alt="Sebastian Maliszczak"/><br /><sub><b>Sebastian Maliszczak</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=bastor" title="Code">💻</a></td>
<td align="center"><a href="https://haroen.me"><img src="https://avatars3.githubusercontent.com/u/6270048?v=4" width="100px;" alt="Haroen Viaene"/><br /><sub><b>Haroen Viaene</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=Haroenv" title="Code">💻</a></td>
<td align="center"><a href="https://timn.tech"><img src="https://avatars2.githubusercontent.com/u/6324199?v=4" width="100px;" alt="Tim Neutkens"/><br /><sub><b>Tim Neutkens</b></sub></a><br /><a href="#plugin-timneutkens" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/ritz078/transform/commits?author=timneutkens" title="Code">💻</a></td>
<td align="center"><a href="https://medium.com/@shakyShane"><img src="https://avatars3.githubusercontent.com/u/1643522?v=4" width="100px;" alt=""/><br /><sub><b>Shane Osbourne</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=shakyShane" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/pd4d10"><img src="https://avatars0.githubusercontent.com/u/9524411?v=4" width="100px;" alt=""/><br /><sub><b>Rongjian Zhang</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=pd4d10" title="Code">💻</a></td>
<td align="center"><a href="http://keshShan.github.io"><img src="https://avatars3.githubusercontent.com/u/12506034?v=4" width="100px;" alt=""/><br /><sub><b>Keshan Nageswaran</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=KeshShan" title="Code">💻</a></td>
<td align="center"><a href="http://www.codegent.com"><img src="https://avatars1.githubusercontent.com/u/7318?v=4" width="100px;" alt=""/><br /><sub><b>codegent</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=code" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/bastor"><img src="https://avatars3.githubusercontent.com/u/1881814?v=4" width="100px;" alt=""/><br /><sub><b>Sebastian Maliszczak</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=bastor" title="Code">💻</a></td>
<td align="center"><a href="https://haroen.me"><img src="https://avatars3.githubusercontent.com/u/6270048?v=4" width="100px;" alt=""/><br /><sub><b>Haroen Viaene</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=Haroenv" title="Code">💻</a></td>
<td align="center"><a href="https://timn.tech"><img src="https://avatars2.githubusercontent.com/u/6324199?v=4" width="100px;" alt=""/><br /><sub><b>Tim Neutkens</b></sub></a><br /><a href="#plugin-timneutkens" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/ritz078/transform/commits?author=timneutkens" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/raminrez"><img src="https://avatars1.githubusercontent.com/u/7345325?v=4" width="100px;" alt="Ramin Rezaie"/><br /><sub><b>Ramin Rezaie</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=raminrez" title="Code">💻</a></td>
<td align="center"><a href="https://guilhermeesteves.com"><img src="https://avatars3.githubusercontent.com/u/2166045?v=4" width="100px;" alt="Guilherme Esteves"/><br /><sub><b>Guilherme Esteves</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=guilhermesteves" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/p-racoon"><img src="https://avatars2.githubusercontent.com/u/13845070?v=4" width="100px;" alt="Prasham Ashesh"/><br /><sub><b>Prasham Ashesh</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=p-racoon" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/raminrez"><img src="https://avatars1.githubusercontent.com/u/7345325?v=4" width="100px;" alt=""/><br /><sub><b>Ramin Rezaie</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=raminrez" title="Code">💻</a></td>
<td align="center"><a href="https://guilhermeesteves.com"><img src="https://avatars3.githubusercontent.com/u/2166045?v=4" width="100px;" alt=""/><br /><sub><b>Guilherme Esteves</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=guilhermesteves" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/p-racoon"><img src="https://avatars2.githubusercontent.com/u/13845070?v=4" width="100px;" alt=""/><br /><sub><b>Prasham Ashesh</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=p-racoon" title="Code">💻</a></td>
<td align="center"><a href="https://ghuser.io/jamesgeorge007"><img src="https://avatars2.githubusercontent.com/u/25279263?v=4" width="100px;" alt=""/><br /><sub><b>James George</b></sub></a><br /><a href="https://github.com/ritz078/transform/commits?author=jamesgeorge007" title="Code">💻</a></td>
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
+2 -2
View File
@@ -5,7 +5,7 @@ function checkIfNeededToAddUndefinedType(obj, objectKey) {
Object.keys(obj).forEach(currentKey => {
// check if it's our Object,
// like awards.editions in awards.editions.outcome
if (~currentKey.indexOf(objectKey) && currentKey !== objectKey) {
if (currentKey.includes(objectKey) && currentKey !== objectKey) {
temporaryObject[currentKey] = obj[currentKey];
}
});
@@ -35,7 +35,7 @@ function keepUniqueTypes(obj, jsonObjects) {
const numberOfJSONDefinitions = jsonObjects.length;
Object.keys(obj).forEach(objectKey => {
if (!~objectKey.indexOf(".")) {
if (!objectKey.includes(".")) {
if (obj[objectKey].length < numberOfJSONDefinitions) {
temporaryObject[objectKey].push("undefined");
}
+23 -3
View File
@@ -19,6 +19,7 @@ import copy from "clipboard-copy";
import { getWorker, Wrapper } from "@utils/workerWrapper";
import Npm from "@assets/svgs/Npm";
import { supportedLanguages } from "@utils/prettier";
import { useDropzone } from "react-dropzone";
export interface EditorPanelProps {
editable?: boolean;
@@ -132,7 +133,8 @@ export default function({
[showSettingsDialogue]
);
const onFilePicked = useCallback((files, close) => {
const onFilePicked = useCallback((files, close = () => {}) => {
if (!(files && files.length)) return;
const file = files[0];
const reader = new FileReader();
reader.readAsText(file, "utf-8");
@@ -143,6 +145,16 @@ export default function({
};
}, []);
const { getRootProps } = useDropzone({
onDrop: files => onFilePicked(files),
disabled: !editable,
accept: acceptFiles,
onDropRejected: () =>
toaster.danger("This file type is not supported.", {
id
})
});
const copyValue = useCallback(() => {
copy(value);
toaster.success("Copied to clipboard.", {
@@ -310,7 +322,15 @@ export default function({
)}
</Pane>
<Pane display="flex" flexDirection="column" flex={1} overflow="hidden">
<div
style={{
display: "flex",
flexDirection: "column",
flex: 1,
overflow: "hidden"
}}
{...getRootProps()}
>
{topNotifications &&
topNotifications({
isSettingsOpen: showSettingsDialogue,
@@ -327,7 +347,7 @@ export default function({
}}
innerRef={editorRef}
/>
</Pane>
</div>
{IN_BROWSER && showPreview && previewElement && (
<Pane display="flex" flex={1} flexDirection="column" overflow="hidden">
+1
View File
@@ -73,6 +73,7 @@
"qrcode.react": "^0.9.3",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-dropzone": "^10.2.1",
"react-ga": "^2.6.0",
"rust-keywords": "^1.1.0",
"sha1": "^1.1.1",
+3 -3
View File
@@ -1,5 +1,5 @@
import React from "react";
import App, { Container } from "next/app";
import App from "next/app";
import { Button, Pane } from "evergreen-ui";
import Navigator from "@components/Navigator";
import "@styles/main.css";
@@ -96,7 +96,7 @@ export default class extends App {
: undefined;
return (
<Container>
<>
<title>
{activeRoute && (activeRoute.title || activeRoute.searchTerm)}
</title>
@@ -148,7 +148,7 @@ export default class extends App {
<Navigator />
<Component {...pageProps} />
</Pane>
</Container>
</>
);
}
}
+8
View File
@@ -56,6 +56,14 @@ declare module "evergreen-ui" {
description?: string;
}
) => void;
danger: (
text: string,
options?: {
id?: string | number;
duration?: number;
description?: string;
}
) => void;
closeAll: () => void;
};
+18
View File
@@ -1688,6 +1688,10 @@ atob@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
attr-accept@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.0.0.tgz#8422fef5ee4a511c207796c888227ab5de03306f"
auto-bind@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-2.0.0.tgz#9a55a461b521f58daf955169203bed1a07a970a9"
@@ -3764,6 +3768,12 @@ file-loader@4.2.0:
loader-utils "^1.2.3"
schema-utils "^2.0.0"
file-selector@^0.1.12:
version "0.1.12"
resolved "https://registry.yarnpkg.com/file-selector/-/file-selector-0.1.12.tgz#fe726547be219a787a9dcc640575a04a032b1fd0"
dependencies:
tslib "^1.9.0"
file-type@5.2.0, file-type@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6"
@@ -7605,6 +7615,14 @@ react-dom@~15.4.1:
loose-envify "^1.1.0"
object-assign "^4.1.0"
react-dropzone@^10.2.1:
version "10.2.1"
resolved "https://registry.yarnpkg.com/react-dropzone/-/react-dropzone-10.2.1.tgz#b7520124c4a3b66f96d49f7879027c7a475eaa20"
dependencies:
attr-accept "^2.0.0"
file-selector "^0.1.12"
prop-types "^15.7.2"
react-error-overlay@5.1.6:
version "5.1.6"
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-5.1.6.tgz#0cd73407c5d141f9638ae1e0c63e7b2bf7e9929d"