mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 00:32:56 +03:00
Merge branch 'ui1' of https://github.com/gyandeeps/transform-www into gyandeeps-ui1
This commit is contained in:
commit
1ce890585b
24 files changed
+532
-267
No files matched your search
@@ -100,6 +100,15 @@
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "bcherny",
|
||||
"name": "Boris Cherny",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/1761758?v=4",
|
||||
"profile": "https://performancejs.com",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -77,7 +77,7 @@ export default class ConversionPanel extends PureComponent {
|
||||
prettifyRightPanel: true,
|
||||
splitLeft: false,
|
||||
showFetchButton: true,
|
||||
fetchButtonText: 'Fetch JSON from URL'
|
||||
fetchButtonText: "Fetch JSON from URL"
|
||||
};
|
||||
|
||||
state = {
|
||||
@@ -91,16 +91,23 @@ export default class ConversionPanel extends PureComponent {
|
||||
componentDidMount() {
|
||||
const { defaultText, splitValue } = this.props;
|
||||
|
||||
this.onChange(defaultText, splitValue)
|
||||
this.onChange(defaultText, splitValue);
|
||||
}
|
||||
|
||||
fetchJSON = async () => {
|
||||
const url = window.prompt('Enter URL to fetch JSON from a remote server.')
|
||||
if (!url) return
|
||||
const res = await unfetch(url)
|
||||
const json = await res.json()
|
||||
this.onChange(JSON.stringify(json, null, 2))
|
||||
}
|
||||
const url = window.prompt("Enter URL to fetch JSON from a remote server.");
|
||||
if (!url) return;
|
||||
try {
|
||||
const res = await unfetch(url);
|
||||
const json = await res.json();
|
||||
this.onChange(JSON.stringify(json, null, 2));
|
||||
} catch (e) {
|
||||
this.setState({
|
||||
info: e.message,
|
||||
infoType: "error"
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onChange = async (newValue, leftSplitValue) => {
|
||||
const nValue = newValue || this.state.value;
|
||||
@@ -133,7 +140,7 @@ export default class ConversionPanel extends PureComponent {
|
||||
const checked = e.currentTarget.checked;
|
||||
if (this.props.onCheckboxChange) {
|
||||
this.props.onCheckboxChange(checked, () => {
|
||||
this.onChange()
|
||||
this.onChange();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -240,12 +247,14 @@ export default class ConversionPanel extends PureComponent {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.section {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
height: calc(100vh - 50px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.right {
|
||||
@@ -294,6 +303,13 @@ export default class ConversionPanel extends PureComponent {
|
||||
color: #666;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.panel {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
`}</style>
|
||||
|
||||
<style global jsx>{`
|
||||
@@ -307,37 +323,37 @@ export default class ConversionPanel extends PureComponent {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.react-codemirror2 {
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.react-codemirror2,
|
||||
.CodeMirror {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 50px);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.CodeMirror {
|
||||
height: calc(100%);
|
||||
}
|
||||
|
||||
.right .CodeMirror-scroll {
|
||||
width: 100%;
|
||||
min-height: 500px;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
width: 100%;
|
||||
min-height: 500px;
|
||||
}
|
||||
|
||||
.split #code,
|
||||
.split .CodeMirror {
|
||||
height: calc(100%);
|
||||
}
|
||||
.split .react-codemirror2 {
|
||||
height: calc(50% - 52px);
|
||||
.right .react-codemirror2 {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.right .CodeMirror {
|
||||
background-color: #fafafa;
|
||||
padding-left: 20px;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.right .ace_scroller {
|
||||
@@ -362,10 +378,15 @@ export default class ConversionPanel extends PureComponent {
|
||||
|
||||
<div className="content-wrapper">
|
||||
<div className={leftClass}>
|
||||
<div style={{ display: "contents" }}>
|
||||
<div className="panel">
|
||||
<div className="header">
|
||||
<h4 className="title">{leftTitle}</h4>
|
||||
{leftMode === 'json' && showFetchButton && <button className="btn" onClick={this.fetchJSON}>{fetchButtonText}</button>}
|
||||
{leftMode === "json" &&
|
||||
showFetchButton && (
|
||||
<button className="btn" onClick={this.fetchJSON}>
|
||||
{fetchButtonText}
|
||||
</button>
|
||||
)}
|
||||
<button className="btn" onClick={this.prettifyCode}>
|
||||
Prettify
|
||||
</button>
|
||||
@@ -383,7 +404,7 @@ export default class ConversionPanel extends PureComponent {
|
||||
</div>
|
||||
{splitLeft &&
|
||||
isBrowser && (
|
||||
<div style={{ display: "contents" }}>
|
||||
<div className="panel">
|
||||
<div className="header">
|
||||
<h4 className="title">{splitTitle}</h4>
|
||||
</div>
|
||||
@@ -400,40 +421,42 @@ export default class ConversionPanel extends PureComponent {
|
||||
)}
|
||||
</div>
|
||||
<div className="section right">
|
||||
<div className="header">
|
||||
<h4 className="title">{rightTitle}</h4>
|
||||
{onCheckboxChange && (
|
||||
<label htmlFor="#text">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="#text"
|
||||
defaultChecked={initialCheckboxValue}
|
||||
onChange={this.toggleCheckbox}
|
||||
/>{" "}
|
||||
{checkboxText}
|
||||
</label>
|
||||
<div className="panel">
|
||||
<div className="header">
|
||||
<h4 className="title">{rightTitle}</h4>
|
||||
{onCheckboxChange && (
|
||||
<label htmlFor="#text">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="#text"
|
||||
defaultChecked={initialCheckboxValue}
|
||||
onChange={this.toggleCheckbox}
|
||||
/>{" "}
|
||||
{checkboxText}
|
||||
</label>
|
||||
)}
|
||||
<button className="btn" onClick={this.copyCode}>
|
||||
Copy
|
||||
</button>
|
||||
</div>
|
||||
{isBrowser && (
|
||||
<CodeMirror
|
||||
value={
|
||||
prettifyRightPanel ? (
|
||||
js_beautify(resultValue, { e4x: true })
|
||||
) : (
|
||||
resultValue
|
||||
)
|
||||
}
|
||||
options={{
|
||||
readOnly: true,
|
||||
mode: modeMapping[rightMode] || rightMode,
|
||||
...codeMirrorOptions,
|
||||
lineNumbers: false
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<button className="btn" onClick={this.copyCode}>
|
||||
Copy
|
||||
</button>
|
||||
</div>
|
||||
{isBrowser && (
|
||||
<CodeMirror
|
||||
value={
|
||||
prettifyRightPanel ? (
|
||||
js_beautify(resultValue, { e4x: true })
|
||||
) : (
|
||||
resultValue
|
||||
)
|
||||
}
|
||||
options={{
|
||||
readOnly: true,
|
||||
mode: modeMapping[rightMode] || rightMode,
|
||||
...codeMirrorOptions,
|
||||
lineNumbers: false
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
|
||||
+20
-15
@@ -88,8 +88,8 @@ export default class Layout extends PureComponent {
|
||||
this.setKey(this.props.pathname);
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
routes.forEach(({path}) => Router.prefetch(path))
|
||||
componentDidMount() {
|
||||
routes.forEach(({ path }) => Router.prefetch(path));
|
||||
}
|
||||
|
||||
componentWillReceiveProps({ pathname }) {
|
||||
@@ -131,19 +131,24 @@ export default class Layout extends PureComponent {
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-mfizz/2.4.1/font-mfizz.min.css"
|
||||
/>
|
||||
<link rel="stylesheet" href="/static/styles.css" />
|
||||
<link rel="manifest" href="/static/manifest.json"/>
|
||||
<meta name="theme-color" content="#2196f3"/>
|
||||
<meta name="mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="application-name" content="Transform"/>
|
||||
<meta name="apple-mobile-web-app-title" content="Transform"/>
|
||||
<meta name="theme-color" content="#2196f3"/>
|
||||
<meta name="msapplication-navbutton-color" content="#2196f3"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
|
||||
<meta name="msapplication-starturl" content="./"/>
|
||||
<meta name="msapplication-TileColor" content="#2196f3"/>
|
||||
<meta name="msapplication-TileImage" content="/static/images/icons/icon-144x144.png"/>
|
||||
|
||||
<link rel="manifest" href="/static/manifest.json" />
|
||||
<meta name="theme-color" content="#2196f3" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="application-name" content="Transform" />
|
||||
<meta name="apple-mobile-web-app-title" content="Transform" />
|
||||
<meta name="theme-color" content="#2196f3" />
|
||||
<meta name="msapplication-navbutton-color" content="#2196f3" />
|
||||
<meta
|
||||
name="apple-mobile-web-app-status-bar-style"
|
||||
content="black-translucent"
|
||||
/>
|
||||
<meta name="msapplication-starturl" content="./" />
|
||||
<meta name="msapplication-TileColor" content="#2196f3" />
|
||||
<meta
|
||||
name="msapplication-TileImage"
|
||||
content="/static/images/icons/icon-144x144.png"
|
||||
/>
|
||||
</Head>
|
||||
<style jsx>{`
|
||||
.sidebar {
|
||||
|
||||
+4
-2
@@ -36,9 +36,11 @@
|
||||
"codemirror-graphql": "^0.6.11",
|
||||
"copy-text-to-clipboard": "^1.0.3",
|
||||
"generate-schema": "^2.5.1",
|
||||
"gofmt.js": "^0.0.2",
|
||||
"is-in-browser": "^1.1.3",
|
||||
"is-svg": "^2.1.0",
|
||||
"js-beautify": "^1.6.14",
|
||||
"json-schema-to-typescript": "^4.6.0",
|
||||
"lodash": "^4.17.4",
|
||||
"next": "^3.2.1",
|
||||
"nprogress": "^0.2.0",
|
||||
@@ -52,8 +54,8 @@
|
||||
"stringify-object": "^3.2.0",
|
||||
"transform-css-to-js": "^0.1.1",
|
||||
"transform-graphql-type-annotations": "^0.1.1",
|
||||
"transform-json-types": "^0.2.1",
|
||||
"transform-svg-to-native": "^0.1.1",
|
||||
"transform-json-types": "^0.2.6",
|
||||
"transform-svg-to-native": "^0.1.3",
|
||||
"unfetch": "^3.0.0",
|
||||
"xml-js": "^1.4.1"
|
||||
},
|
||||
|
||||
+2
-2
@@ -30,8 +30,8 @@ export default class Css2Js extends PureComponent {
|
||||
isRn: false
|
||||
};
|
||||
|
||||
getTransformedValue = (newValue) => {
|
||||
return cssToJS(newValue, this.state.isRn)
|
||||
getTransformedValue = newValue => {
|
||||
return cssToJS(newValue, this.state.isRn);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { PureComponent } from "react";
|
||||
import Layout from "../components/Layout";
|
||||
import ConversionPanel from "../components/ConversionPanel";
|
||||
import { dummySchema, dummyQuery } from "../utils/graphql-schema";
|
||||
import transform from "transform-graphql-type-annotations"
|
||||
import transform from "transform-graphql-type-annotations";
|
||||
|
||||
export default class Json2Ts extends PureComponent {
|
||||
getTransformedValue = (newValue, splitValue) => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { dummySchema, dummyQuery } from "../utils/graphql-schema";
|
||||
|
||||
export default class Json2Ts extends PureComponent {
|
||||
getTransformedValue = (newValue, splitValue) => {
|
||||
return transform(newValue, splitValue, 'typescript');
|
||||
return transform(newValue, splitValue, "typescript");
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
+10
-4
@@ -1,9 +1,9 @@
|
||||
import React, { PureComponent } from "react";
|
||||
import HTMLtoJSX from "@tsuyoshiwada/htmltojsx";
|
||||
import convertSvgString from "transform-svg-to-native"
|
||||
import convertSvgString from "transform-svg-to-native";
|
||||
import Layout from "../components/Layout";
|
||||
import ConversionPanel from "../components/ConversionPanel";
|
||||
import isSvg from "is-svg"
|
||||
import isSvg from "is-svg";
|
||||
|
||||
const converter = new HTMLtoJSX({
|
||||
createClass: false
|
||||
@@ -20,10 +20,16 @@ export default class Css2Js extends PureComponent {
|
||||
|
||||
getTransformedValue = async (newValue: string) => {
|
||||
if (this.state.native && !isSvg(newValue)) {
|
||||
throw new Error('You can only convert an SVG in this mode. Try turning off the react-native-svg checkbox.')
|
||||
throw new Error(
|
||||
"You can only convert an SVG in this mode. Try turning off the react-native-svg checkbox."
|
||||
);
|
||||
}
|
||||
|
||||
return this.state.native ? new Promise(resolve => convertSvgString(newValue, (code) => resolve(code))) : converter.convert(newValue)
|
||||
return this.state.native
|
||||
? new Promise(resolve =>
|
||||
convertSvgString(newValue, code => resolve(code))
|
||||
)
|
||||
: converter.convert(newValue);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
+6
-5
@@ -4,7 +4,7 @@ import immutablePropsPlugin from "../utils/babel-plugin-js-to-immutable-prop-typ
|
||||
import Layout from "../components/Layout";
|
||||
import { transform } from "babel-standalone";
|
||||
import defaultText from "../utils/dummy-json";
|
||||
import merge from "lodash/merge"
|
||||
import merge from "lodash/merge";
|
||||
|
||||
import ConversionPanel from "../components/ConversionPanel";
|
||||
|
||||
@@ -14,17 +14,18 @@ export default class Main extends PureComponent {
|
||||
};
|
||||
|
||||
getTransformedValue = newValue => {
|
||||
let x = JSON.parse(newValue)
|
||||
let x = JSON.parse(newValue);
|
||||
if (typeof x !== "object" || Array.isArray(x)) {
|
||||
x = merge({}, ...x)
|
||||
x = merge({}, ...x);
|
||||
}
|
||||
x = "const propTypes = " + JSON.stringify(x);
|
||||
const plugin = this.state.isImmutable ? immutablePropsPlugin : jsonToProptypes;
|
||||
const plugin = this.state.isImmutable
|
||||
? immutablePropsPlugin
|
||||
: jsonToProptypes;
|
||||
const { code } = transform(x, {
|
||||
plugins: [plugin]
|
||||
});
|
||||
|
||||
|
||||
return `import PropTypes from "prop-types";
|
||||
|
||||
${code}`;
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import React, { PureComponent } from "react";
|
||||
import Layout from "../components/Layout";
|
||||
import stringify from "stringify-object"
|
||||
import stringify from "stringify-object";
|
||||
import ConversionPanel from "../components/ConversionPanel";
|
||||
import text from "../utils/dummy-object-json"
|
||||
import text from "../utils/dummy-object-json";
|
||||
|
||||
const defaultText = stringify(eval(`(${text})`))
|
||||
const defaultText = stringify(eval(`(${text})`));
|
||||
|
||||
export default class Main extends PureComponent {
|
||||
|
||||
getTransformedValue = newValue => {
|
||||
return JSON.stringify(eval('(' + newValue + ')'), null ,2)
|
||||
return JSON.stringify(eval("(" + newValue + ")"), null, 2);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
import React, { PureComponent } from "react";
|
||||
import Layout from "../components/Layout";
|
||||
import ConversionPanel from "../components/ConversionPanel";
|
||||
import { compile } from "json-schema-to-typescript";
|
||||
|
||||
const json = `{
|
||||
title: 'Example Schema',
|
||||
type: 'object',
|
||||
properties: {
|
||||
firstName: {
|
||||
type: 'string'
|
||||
},
|
||||
lastName: {
|
||||
type: 'string'
|
||||
},
|
||||
age: {
|
||||
description: 'Age in years',
|
||||
type: 'integer',
|
||||
minimum: 0
|
||||
},
|
||||
height: {
|
||||
type: 'number'
|
||||
},
|
||||
favoriteFoods: {
|
||||
type: 'array'
|
||||
},
|
||||
likesDogs: {
|
||||
type: 'boolean'
|
||||
}
|
||||
},
|
||||
required: ['firstName', 'lastName']
|
||||
}`;
|
||||
|
||||
export default class Json2Ts extends PureComponent {
|
||||
getTransformedValue = code => compile(eval("(" + code + ")"));
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Layout pathname={this.props.url.pathname}>
|
||||
<ConversionPanel
|
||||
leftTitle="JSON Schema"
|
||||
rightTitle="TypeScript Interface"
|
||||
getTransformedValue={this.getTransformedValue}
|
||||
name={"ts_interface"}
|
||||
defaultText={json}
|
||||
leftMode="javascript"
|
||||
rightMode="typescript"
|
||||
url={this.props.url}
|
||||
prettifyRightPanel={false}
|
||||
/>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@ import dynamic from "next/dynamic";
|
||||
import Layout from "../components/Layout";
|
||||
import ConversionPanel from "../components/ConversionPanel";
|
||||
import defaultText from "../utils/dummy-json";
|
||||
import transform from "transform-json-types"
|
||||
import transform from "transform-json-types";
|
||||
|
||||
export default class Json2Ts extends PureComponent {
|
||||
getTransformedValue = code => transform(code)
|
||||
getTransformedValue = code => transform(code);
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
||||
+4
-3
@@ -3,10 +3,11 @@ import dynamic from "next/dynamic";
|
||||
import Layout from "../components/Layout";
|
||||
import ConversionPanel from "../components/ConversionPanel";
|
||||
import defaultText from "../utils/dummy-json";
|
||||
import json2go from "../utils/json-to-go"
|
||||
import json2go from "../utils/json-to-go";
|
||||
import gofmt from "gofmt.js";
|
||||
|
||||
export default class extends PureComponent {
|
||||
getTransformedValue = code => json2go(code).go
|
||||
getTransformedValue = code => gofmt(json2go(code).go);
|
||||
|
||||
render() {
|
||||
return (
|
||||
@@ -25,4 +26,4 @@ export default class extends PureComponent {
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,12 @@ import React, { PureComponent } from "react";
|
||||
import Layout from "../components/Layout";
|
||||
import ConversionPanel from "../components/ConversionPanel";
|
||||
import defaultText from "../utils/dummy-json";
|
||||
import transform from "transform-json-types"
|
||||
import transform from "transform-json-types";
|
||||
export default class Json2Ts extends PureComponent {
|
||||
getTransformedValue = code => transform(code, {
|
||||
lang: 'rust-serde'
|
||||
})
|
||||
getTransformedValue = code =>
|
||||
transform(code, {
|
||||
lang: "rust-serde"
|
||||
});
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
||||
@@ -2,11 +2,12 @@ import React, { PureComponent } from "react";
|
||||
import Layout from "../components/Layout";
|
||||
import ConversionPanel from "../components/ConversionPanel";
|
||||
import defaultText from "../utils/dummy-json";
|
||||
import transform from "transform-json-types"
|
||||
import transform from "transform-json-types";
|
||||
export default class Json2Ts extends PureComponent {
|
||||
getTransformedValue = code => transform(code, {
|
||||
lang: "scala"
|
||||
})
|
||||
getTransformedValue = code =>
|
||||
transform(code, {
|
||||
lang: "scala"
|
||||
});
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
||||
@@ -3,12 +3,13 @@ import dynamic from "next/dynamic";
|
||||
import Layout from "../components/Layout";
|
||||
import ConversionPanel from "../components/ConversionPanel";
|
||||
import defaultText from "../utils/dummy-json";
|
||||
import transform from "transform-json-types"
|
||||
import transform from "transform-json-types";
|
||||
|
||||
export default class Json2Ts extends PureComponent {
|
||||
getTransformedValue = code => transform(code, {
|
||||
lang: "typescript"
|
||||
})
|
||||
getTransformedValue = code =>
|
||||
transform(code, {
|
||||
lang: "typescript"
|
||||
});
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
||||
@@ -48,7 +48,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
| [<img src="https://avatars3.githubusercontent.com/u/5389035?v=4" width="100px;"/><br /><sub>Ritesh Kumar</sub>](http://riteshkr.com)<br />[📖](https://github.com/ritz078/transform-www/commits?author=ritz078 "Documentation") [💻](https://github.com/ritz078/transform-www/commits?author=ritz078 "Code") [🤔](#ideas-ritz078 "Ideas, Planning, & Feedback") [👀](#review-ritz078 "Reviewed Pull Requests") | [<img src="https://avatars2.githubusercontent.com/u/47542?v=4" width="100px;"/><br /><sub>Florian Gilcher</sub>](http://asquera.de)<br />[💻](https://github.com/ritz078/transform-www/commits?author=skade "Code") | [<img src="https://avatars1.githubusercontent.com/u/20063?v=4" width="100px;"/><br /><sub>Pascal Hertleif</sub>](http://pascalhertleif.de/)<br />[💻](https://github.com/ritz078/transform-www/commits?author=killercup "Code") | [<img src="https://avatars3.githubusercontent.com/u/534610?v=4" width="100px;"/><br /><sub>Lado Lomidze</sub>](http://landish.github.io)<br />[💻](https://github.com/ritz078/transform-www/commits?author=Landish "Code") | [<img src="https://avatars1.githubusercontent.com/u/13787614?v=4" width="100px;"/><br /><sub>Mattia Manzati</sub>](https://github.com/mattiamanzati)<br />[💻](https://github.com/ritz078/transform-www/commits?author=mattiamanzati "Code") | [<img src="https://avatars3.githubusercontent.com/u/12202757?v=4" width="100px;"/><br /><sub>Mohammad Rajabifard</sub>](https://tarino.ir)<br />[🤔](#ideas-morajabi "Ideas, Planning, & Feedback") [💻](https://github.com/ritz078/transform-www/commits?author=morajabi "Code") | [<img src="https://avatars0.githubusercontent.com/u/3108160?v=4" width="100px;"/><br /><sub>Raathigeshan Kugarajan</sub>](http://raathigesh.com/)<br />[💻](https://github.com/ritz078/transform-www/commits?author=Raathigesh "Code") |
|
||||
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
||||
| [<img src="https://avatars2.githubusercontent.com/u/5554486?v=4" width="100px;"/><br /><sub>Gyandeep Singh</sub>](https://gyandeeps.com)<br />[💻](https://github.com/ritz078/transform-www/commits?author=gyandeeps "Code") | [<img src="https://avatars2.githubusercontent.com/u/1128849?v=4" width="100px;"/><br /><sub>Matt Holt</sub>](https://matt.life)<br />[💻](https://github.com/ritz078/transform-www/commits?author=mholt "Code") | [<img src="https://avatars0.githubusercontent.com/u/2767425?v=4" width="100px;"/><br /><sub>sreenivas alapati</sub>](https://medium.com/@sreenivas)<br />[💻](https://github.com/ritz078/transform-www/commits?author=cg-cnu "Code") |
|
||||
| [<img src="https://avatars2.githubusercontent.com/u/5554486?v=4" width="100px;"/><br /><sub>Gyandeep Singh</sub>](https://gyandeeps.com)<br />[💻](https://github.com/ritz078/transform-www/commits?author=gyandeeps "Code") | [<img src="https://avatars2.githubusercontent.com/u/1128849?v=4" width="100px;"/><br /><sub>Matt Holt</sub>](https://matt.life)<br />[💻](https://github.com/ritz078/transform-www/commits?author=mholt "Code") | [<img src="https://avatars0.githubusercontent.com/u/2767425?v=4" width="100px;"/><br /><sub>sreenivas alapati</sub>](https://medium.com/@sreenivas)<br />[💻](https://github.com/ritz078/transform-www/commits?author=cg-cnu "Code") | [<img src="https://avatars2.githubusercontent.com/u/1761758?v=4" width="100px;"/><br /><sub>Boris Cherny</sub>](https://performancejs.com)<br />[💻](https://github.com/ritz078/transform-www/commits?author=bcherny "Code") |
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
|
||||
@@ -207,6 +207,7 @@
|
||||
height: 300px;
|
||||
color: black;
|
||||
direction: ltr;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* PADDING */
|
||||
|
||||
@@ -70,7 +70,9 @@ export default function({ types: t }) {
|
||||
|
||||
VariableDeclaration(path) {
|
||||
path.insertBefore(
|
||||
t.identifier(`import ImmutablePropTypes from 'react-immutable-proptypes'`)
|
||||
t.identifier(
|
||||
`import ImmutablePropTypes from 'react-immutable-proptypes'`
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ const x = `{
|
||||
"hello": [
|
||||
{
|
||||
"_id": "5988946e45e52d60b33a25c7",
|
||||
"latitude": 50.087977,
|
||||
"type": 50.087977,
|
||||
"longitude": 72.167197,
|
||||
"tags": [
|
||||
"nulla",
|
||||
@@ -22,7 +22,7 @@ const x = `{
|
||||
{
|
||||
"optionalField": "hello",
|
||||
"_id": "5988946ef6090217857d7b0f",
|
||||
"latitude": 47.460772,
|
||||
"type": 47.460772,
|
||||
"longitude": 85.95137,
|
||||
"tags": [
|
||||
"aliqua",
|
||||
|
||||
@@ -2184,4 +2184,4 @@ fragment heroFriends on Character {
|
||||
friends {
|
||||
name
|
||||
}
|
||||
}`;
|
||||
}`;
|
||||
+150
-132
@@ -7,209 +7,227 @@
|
||||
A simple utility to translate JSON into a Go type definition.
|
||||
*/
|
||||
|
||||
function jsonToGo (json, typename) {
|
||||
let data
|
||||
let scope
|
||||
let go = ''
|
||||
let tabs = 0
|
||||
function jsonToGo(json, typename) {
|
||||
let data;
|
||||
let scope;
|
||||
let go = "";
|
||||
let tabs = 0;
|
||||
|
||||
try {
|
||||
data = JSON.parse(json.replace(/\.0/g, '.1')) // hack that forces floats to stay as floats
|
||||
scope = data
|
||||
}
|
||||
catch (e) {
|
||||
data = JSON.parse(json.replace(/\.0/g, ".1")); // hack that forces floats to stay as floats
|
||||
scope = data;
|
||||
} catch (e) {
|
||||
return {
|
||||
go: '',
|
||||
go: "",
|
||||
error: e.message
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
typename = format(typename || 'AutoGenerated')
|
||||
append('type ' + typename + ' ')
|
||||
typename = format(typename || "AutoGenerated");
|
||||
append("type " + typename + " ");
|
||||
|
||||
parseScope(scope)
|
||||
parseScope(scope);
|
||||
|
||||
return {go: go}
|
||||
return { go: go };
|
||||
|
||||
function parseScope (scope) {
|
||||
let keyname
|
||||
if (typeof scope === 'object' && scope !== null) {
|
||||
function parseScope(scope) {
|
||||
let keyname;
|
||||
if (typeof scope === "object" && scope !== null) {
|
||||
if (Array.isArray(scope)) {
|
||||
let i
|
||||
let sliceType, scopeLength = scope.length
|
||||
let i;
|
||||
let sliceType,
|
||||
scopeLength = scope.length;
|
||||
|
||||
for (i = 0; i < scopeLength; i++) {
|
||||
const thisType = goType(scope[i])
|
||||
if (!sliceType)
|
||||
sliceType = thisType
|
||||
const thisType = goType(scope[i]);
|
||||
if (!sliceType) sliceType = thisType;
|
||||
else if (sliceType !== thisType) {
|
||||
sliceType = mostSpecificPossibleGoType(thisType, sliceType)
|
||||
if (sliceType === 'interface{}')
|
||||
break
|
||||
sliceType = mostSpecificPossibleGoType(thisType, sliceType);
|
||||
if (sliceType === "interface{}") break;
|
||||
}
|
||||
}
|
||||
|
||||
append('[]')
|
||||
if (sliceType === 'struct') {
|
||||
let k
|
||||
let keys
|
||||
const allFields = {}
|
||||
append("[]");
|
||||
if (sliceType === "struct") {
|
||||
let k;
|
||||
let keys;
|
||||
const allFields = {};
|
||||
|
||||
// for each field counts how many times appears
|
||||
for (i = 0; i < scopeLength; i++) {
|
||||
keys = Object.keys(scope[i])
|
||||
keys = Object.keys(scope[i]);
|
||||
for (k in keys) {
|
||||
keyname = keys[k]
|
||||
keyname = keys[k];
|
||||
if (!(keyname in allFields)) {
|
||||
allFields[keyname] = {
|
||||
value: scope[i][keyname],
|
||||
count: 0
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
allFields[keyname].count++
|
||||
allFields[keyname].count++;
|
||||
}
|
||||
}
|
||||
|
||||
// create a common struct with all fields found in the current array
|
||||
// omitempty dict indicates if a field is optional
|
||||
keys = Object.keys(allFields)
|
||||
let struct = {}, omitempty = {}
|
||||
keys = Object.keys(allFields);
|
||||
let struct = {},
|
||||
omitempty = {};
|
||||
for (k in keys) {
|
||||
keyname = keys[k]
|
||||
let elem = allFields[keyname]
|
||||
keyname = keys[k];
|
||||
let elem = allFields[keyname];
|
||||
|
||||
struct[keyname] = elem.value
|
||||
omitempty[keyname] = elem.count !== scopeLength
|
||||
struct[keyname] = elem.value;
|
||||
omitempty[keyname] = elem.count !== scopeLength;
|
||||
}
|
||||
|
||||
parseStruct(struct, omitempty) // finally parse the struct !!
|
||||
}
|
||||
else if (sliceType === 'slice') {
|
||||
parseScope(scope[0])
|
||||
}
|
||||
else
|
||||
append(sliceType || 'interface{}')
|
||||
parseStruct(struct, omitempty); // finally parse the struct !!
|
||||
} else if (sliceType === "slice") {
|
||||
parseScope(scope[0]);
|
||||
} else append(sliceType || "interface{}");
|
||||
} else {
|
||||
parseStruct(scope);
|
||||
}
|
||||
else {
|
||||
parseStruct(scope)
|
||||
}
|
||||
}
|
||||
else
|
||||
append(goType(scope))
|
||||
} else append(goType(scope));
|
||||
}
|
||||
|
||||
function parseStruct (scope, omitempty) {
|
||||
append('struct {\n')
|
||||
++tabs
|
||||
const keys = Object.keys(scope)
|
||||
function parseStruct(scope, omitempty) {
|
||||
append("struct {\n");
|
||||
++tabs;
|
||||
const keys = Object.keys(scope);
|
||||
for (const i in keys) {
|
||||
const keyname = keys[i]
|
||||
indent(tabs)
|
||||
append(format(keyname) + ' ')
|
||||
parseScope(scope[keyname])
|
||||
const keyname = keys[i];
|
||||
indent(tabs);
|
||||
append(format(keyname) + " ");
|
||||
parseScope(scope[keyname]);
|
||||
|
||||
append(' `json:"' + keyname)
|
||||
append(' `json:"' + keyname);
|
||||
if (omitempty && omitempty[keyname] === true) {
|
||||
append(',omitempty')
|
||||
append(",omitempty");
|
||||
}
|
||||
append('"`\n')
|
||||
append('"`\n');
|
||||
}
|
||||
indent(--tabs)
|
||||
append('}')
|
||||
indent(--tabs);
|
||||
append("}");
|
||||
}
|
||||
|
||||
function indent (tabs) {
|
||||
for (let i = 0; i < tabs; i++)
|
||||
go += '\t';
|
||||
function indent(tabs) {
|
||||
for (let i = 0; i < tabs; i++) go += "\t";
|
||||
}
|
||||
|
||||
function append (str) {
|
||||
go += str
|
||||
function append(str) {
|
||||
go += str;
|
||||
}
|
||||
|
||||
// Sanitizes and formats a string to make an appropriate identifier in Go
|
||||
function format (str) {
|
||||
if (!str)
|
||||
return ''
|
||||
else if (str.match(/^\d+$/))
|
||||
str = 'Num' + str
|
||||
function format(str) {
|
||||
if (!str) return "";
|
||||
else if (str.match(/^\d+$/)) str = "Num" + str;
|
||||
else if (str.charAt(0).match(/\d/)) {
|
||||
const numbers = {
|
||||
'0': 'Zero_', '1': 'One_', '2': 'Two_', '3': 'Three_',
|
||||
'4': 'Four_', '5': 'Five_', '6': 'Six_', '7': 'Seven_',
|
||||
'8': 'Eight_', '9': 'Nine_'
|
||||
}
|
||||
str = numbers[str.charAt(0)] + str.substr(1)
|
||||
"0": "Zero_",
|
||||
"1": "One_",
|
||||
"2": "Two_",
|
||||
"3": "Three_",
|
||||
"4": "Four_",
|
||||
"5": "Five_",
|
||||
"6": "Six_",
|
||||
"7": "Seven_",
|
||||
"8": "Eight_",
|
||||
"9": "Nine_"
|
||||
};
|
||||
str = numbers[str.charAt(0)] + str.substr(1);
|
||||
}
|
||||
return toProperCase(str).replace(/[^a-z0-9]/ig, '') || 'NAMING_FAILED'
|
||||
return toProperCase(str).replace(/[^a-z0-9]/gi, "") || "NAMING_FAILED";
|
||||
}
|
||||
|
||||
// Determines the most appropriate Go type
|
||||
function goType (val) {
|
||||
if (val === null)
|
||||
return 'interface{}'
|
||||
function goType(val) {
|
||||
if (val === null) return "interface{}";
|
||||
|
||||
switch (typeof val) {
|
||||
case 'string':
|
||||
case "string":
|
||||
if (/\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(\+\d\d:\d\d|Z)/.test(val))
|
||||
return 'time.Time'
|
||||
else
|
||||
return 'string'
|
||||
case 'number':
|
||||
return "time.Time";
|
||||
else return "string";
|
||||
case "number":
|
||||
if (val % 1 === 0) {
|
||||
if (val > -2147483648 && val < 2147483647)
|
||||
return 'int'
|
||||
else
|
||||
return 'int64'
|
||||
}
|
||||
else
|
||||
return 'float64'
|
||||
case 'boolean':
|
||||
return 'bool'
|
||||
case 'object':
|
||||
if (Array.isArray(val))
|
||||
return 'slice'
|
||||
return 'struct'
|
||||
if (val > -2147483648 && val < 2147483647) return "int";
|
||||
else return "int64";
|
||||
} else return "float64";
|
||||
case "boolean":
|
||||
return "bool";
|
||||
case "object":
|
||||
if (Array.isArray(val)) return "slice";
|
||||
return "struct";
|
||||
default:
|
||||
return 'interface{}'
|
||||
return "interface{}";
|
||||
}
|
||||
}
|
||||
|
||||
// Given two types, returns the more specific of the two
|
||||
function mostSpecificPossibleGoType (typ1, typ2) {
|
||||
if (typ1.substr(0, 5) === 'float'
|
||||
&& typ2.substr(0, 3) === 'int')
|
||||
return typ1
|
||||
else if (typ1.substr(0, 3) === 'int'
|
||||
&& typ2.substr(0, 5) === 'float')
|
||||
return typ1
|
||||
else
|
||||
return 'interface{}'
|
||||
function mostSpecificPossibleGoType(typ1, typ2) {
|
||||
if (typ1.substr(0, 5) === "float" && typ2.substr(0, 3) === "int")
|
||||
return typ1;
|
||||
else if (typ1.substr(0, 3) === "int" && typ2.substr(0, 5) === "float")
|
||||
return typ1;
|
||||
else return "interface{}";
|
||||
}
|
||||
|
||||
// Proper cases a string according to Go conventions
|
||||
function toProperCase (str) {
|
||||
function toProperCase(str) {
|
||||
// https://github.com/golang/lint/blob/39d15d55e9777df34cdffde4f406ab27fd2e60c0/lint.go#L695-L731
|
||||
const commonInitialisms = [
|
||||
'API', 'ASCII', 'CPU', 'CSS', 'DNS', 'EOF', 'GUID', 'HTML', 'HTTP',
|
||||
'HTTPS', 'ID', 'IP', 'JSON', 'LHS', 'QPS', 'RAM', 'RHS', 'RPC', 'SLA',
|
||||
'SMTP', 'SSH', 'TCP', 'TLS', 'TTL', 'UDP', 'UI', 'UID', 'UUID', 'URI',
|
||||
'URL', 'UTF8', 'VM', 'XML', 'XSRF', 'XSS'
|
||||
]
|
||||
"API",
|
||||
"ASCII",
|
||||
"CPU",
|
||||
"CSS",
|
||||
"DNS",
|
||||
"EOF",
|
||||
"GUID",
|
||||
"HTML",
|
||||
"HTTP",
|
||||
"HTTPS",
|
||||
"ID",
|
||||
"IP",
|
||||
"JSON",
|
||||
"LHS",
|
||||
"QPS",
|
||||
"RAM",
|
||||
"RHS",
|
||||
"RPC",
|
||||
"SLA",
|
||||
"SMTP",
|
||||
"SSH",
|
||||
"TCP",
|
||||
"TLS",
|
||||
"TTL",
|
||||
"UDP",
|
||||
"UI",
|
||||
"UID",
|
||||
"UUID",
|
||||
"URI",
|
||||
"URL",
|
||||
"UTF8",
|
||||
"VM",
|
||||
"XML",
|
||||
"XSRF",
|
||||
"XSS"
|
||||
];
|
||||
|
||||
return str.replace(/(^|[^a-zA-Z])([a-z]+)/g, function (unused, sep, frag) {
|
||||
if (commonInitialisms.indexOf(frag.toUpperCase()) >= 0)
|
||||
return sep + frag.toUpperCase()
|
||||
else
|
||||
return sep + frag[0].toUpperCase() + frag.substr(1).toLowerCase()
|
||||
}).replace(/([A-Z])([a-z]+)/g, function (unused, sep, frag) {
|
||||
if (commonInitialisms.indexOf(sep + frag.toUpperCase()) >= 0)
|
||||
return (sep + frag).toUpperCase()
|
||||
else
|
||||
return sep + frag
|
||||
})
|
||||
return str
|
||||
.replace(/(^|[^a-zA-Z])([a-z]+)/g, function(unused, sep, frag) {
|
||||
if (commonInitialisms.indexOf(frag.toUpperCase()) >= 0)
|
||||
return sep + frag.toUpperCase();
|
||||
else return sep + frag[0].toUpperCase() + frag.substr(1).toLowerCase();
|
||||
})
|
||||
.replace(/([A-Z])([a-z]+)/g, function(unused, sep, frag) {
|
||||
if (commonInitialisms.indexOf(sep + frag.toUpperCase()) >= 0)
|
||||
return (sep + frag).toUpperCase();
|
||||
else return sep + frag;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = jsonToGo
|
||||
module.exports = jsonToGo;
|
||||
+14
-6
@@ -41,7 +41,7 @@ export const categorizedRoutes = [
|
||||
{
|
||||
label: "JSON to React PropTypes",
|
||||
path: "/",
|
||||
title: 'Transform | All important transforms at one place.',
|
||||
title: "Transform | All important transforms at one place.",
|
||||
desc:
|
||||
"An online utility to convert a JSON object to prop-types, Typescript Interface, Rust serde or flow types. It also converts your CSS into JS and HTML into JSX."
|
||||
},
|
||||
@@ -83,6 +83,12 @@ export const categorizedRoutes = [
|
||||
label: "JS Object to JSON",
|
||||
path: "/js-object-to-json",
|
||||
desc: "An online REPL for converting JS Object to JSON."
|
||||
},
|
||||
{
|
||||
label: "JSON Schema to TypeScript",
|
||||
path: "/json-schema-to-ts",
|
||||
desc:
|
||||
"An online REPL for converting JSON Schema to TypeScript Interface."
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -151,11 +157,13 @@ export const categorizedRoutes = [
|
||||
{
|
||||
category: "Go",
|
||||
iconName: "icon-go",
|
||||
content: [{
|
||||
label: "JSON to Go Struct",
|
||||
path: "/json-to-go",
|
||||
desc: "An online REPL to generate Go Struct from JSON."
|
||||
}]
|
||||
content: [
|
||||
{
|
||||
label: "JSON to Go Struct",
|
||||
path: "/json-to-go",
|
||||
desc: "An online REPL to generate Go Struct from JSON."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
category: "XML",
|
||||
|
||||
@@ -96,7 +96,7 @@ ansi-html@0.0.7:
|
||||
version "0.0.7"
|
||||
resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e"
|
||||
|
||||
ansi-regex@^2.0.0:
|
||||
ansi-regex@^2.0.0, ansi-regex@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
||||
|
||||
@@ -1243,6 +1243,10 @@ builtin-status-codes@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
|
||||
|
||||
call-me-maybe@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b"
|
||||
|
||||
camel-case@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73"
|
||||
@@ -1390,6 +1394,17 @@ cli-boxes@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143"
|
||||
|
||||
cli-color@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-1.2.0.tgz#3a5ae74fd76b6267af666e69e2afbbd01def34d1"
|
||||
dependencies:
|
||||
ansi-regex "^2.1.1"
|
||||
d "1"
|
||||
es5-ext "^0.10.12"
|
||||
es6-iterator "2"
|
||||
memoizee "^0.4.3"
|
||||
timers-ext "0.1"
|
||||
|
||||
cli-cursor@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
|
||||
@@ -1487,16 +1502,16 @@ combined-stream@^1.0.5, combined-stream@~1.0.5:
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
commander@^2.7.1, commander@~2.11.0:
|
||||
version "2.11.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563"
|
||||
|
||||
commander@^2.9.0:
|
||||
version "2.9.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
|
||||
dependencies:
|
||||
graceful-readlink ">= 1.0.0"
|
||||
|
||||
commander@~2.11.0:
|
||||
version "2.11.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563"
|
||||
|
||||
commondir@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
|
||||
@@ -1823,6 +1838,12 @@ debug@^2.1.1:
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.0.1.tgz#0564c612b521dc92d9f2988f0549e34f9c98db64"
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||
@@ -2065,6 +2086,13 @@ error-stack-parser@^2.0.0:
|
||||
dependencies:
|
||||
stackframe "^1.0.3"
|
||||
|
||||
es5-ext@^0.10.12, es5-ext@^0.10.30, es5-ext@~0.10.2:
|
||||
version "0.10.30"
|
||||
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.30.tgz#7141a16836697dbabfaaaeee41495ce29f52c939"
|
||||
dependencies:
|
||||
es6-iterator "2"
|
||||
es6-symbol "~3.1"
|
||||
|
||||
es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14:
|
||||
version "0.10.26"
|
||||
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.26.tgz#51b2128a531b70c4f6764093a73cbebb82186372"
|
||||
@@ -2091,7 +2119,7 @@ es6-map@^0.1.3:
|
||||
es6-symbol "~3.1.1"
|
||||
event-emitter "~0.3.5"
|
||||
|
||||
es6-promise@^4.0.5:
|
||||
es6-promise@^4.0.5, es6-promise@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.1.1.tgz#8811e90915d9a0dba36274f0b242dbda78f9c92a"
|
||||
|
||||
@@ -2112,7 +2140,7 @@ es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbo
|
||||
d "1"
|
||||
es5-ext "~0.10.14"
|
||||
|
||||
es6-weak-map@^2.0.1:
|
||||
es6-weak-map@^2.0.1, es6-weak-map@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f"
|
||||
dependencies:
|
||||
@@ -2142,6 +2170,10 @@ esprima@^2.6.0:
|
||||
version "2.7.3"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"
|
||||
|
||||
esprima@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
|
||||
|
||||
esrecurse@^4.1.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163"
|
||||
@@ -2161,7 +2193,7 @@ etag@1.8.0, etag@~1.8.0:
|
||||
version "1.8.0"
|
||||
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.0.tgz#6f631aef336d6c46362b51764044ce216be3c051"
|
||||
|
||||
event-emitter@~0.3.5:
|
||||
event-emitter@^0.3.5, event-emitter@~0.3.5:
|
||||
version "0.3.5"
|
||||
resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39"
|
||||
dependencies:
|
||||
@@ -2383,6 +2415,10 @@ form-data@~2.1.1:
|
||||
combined-stream "^1.0.5"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
format-util@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.3.tgz#032dca4a116262a12c43f4c3ec8566416c5b2d95"
|
||||
|
||||
forwarded@~0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.0.tgz#19ef9874c4ae1c297bcf078fde63a09b66a84363"
|
||||
@@ -2566,6 +2602,10 @@ globby@^6.1.0:
|
||||
pify "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
gofmt.js@^0.0.2:
|
||||
version "0.0.2"
|
||||
resolved "https://registry.yarnpkg.com/gofmt.js/-/gofmt.js-0.0.2.tgz#94818cea0db4f633589db805d0d7cb1b7ac02df8"
|
||||
|
||||
got@^5.0.0:
|
||||
version "5.7.1"
|
||||
resolved "https://registry.yarnpkg.com/got/-/got-5.7.1.tgz#5f81635a61e4a6589f180569ea4e381680a51f35"
|
||||
@@ -3009,7 +3049,7 @@ is-primitive@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575"
|
||||
|
||||
is-promise@^2.1.0:
|
||||
is-promise@^2.1, is-promise@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
|
||||
|
||||
@@ -3103,6 +3143,13 @@ js-tokens@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
|
||||
|
||||
js-yaml@^3.9.1:
|
||||
version "3.9.1"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0"
|
||||
dependencies:
|
||||
argparse "^1.0.7"
|
||||
esprima "^4.0.0"
|
||||
|
||||
js-yaml@~3.7.0:
|
||||
version "3.7.0"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80"
|
||||
@@ -3144,6 +3191,29 @@ json-loader@0.5.4, json-loader@^0.5.4:
|
||||
version "0.5.4"
|
||||
resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.4.tgz#8baa1365a632f58a3c46d20175fc6002c96e37de"
|
||||
|
||||
json-schema-ref-parser@^3.1.2:
|
||||
version "3.3.1"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-3.3.1.tgz#86e751b8099357bf601a7cfe42d10123ee906a32"
|
||||
dependencies:
|
||||
call-me-maybe "^1.0.1"
|
||||
debug "^3.0.0"
|
||||
es6-promise "^4.1.1"
|
||||
js-yaml "^3.9.1"
|
||||
ono "^4.0.2"
|
||||
z-schema "^3.18.2"
|
||||
|
||||
json-schema-to-typescript@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-to-typescript/-/json-schema-to-typescript-4.6.0.tgz#a2455325253e0d17bb4a31d10a51fcb188e48f79"
|
||||
dependencies:
|
||||
cli-color "^1.2.0"
|
||||
json-schema-ref-parser "^3.1.2"
|
||||
json-stringify-safe "^5.0.1"
|
||||
lodash "^4.17.4"
|
||||
minimist "^1.2.0"
|
||||
mz "^2.6.0"
|
||||
stdin "0.0.1"
|
||||
|
||||
json-schema-traverse@^0.3.0:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340"
|
||||
@@ -3158,7 +3228,7 @@ json-stable-stringify@^1.0.1:
|
||||
dependencies:
|
||||
jsonify "~0.0.0"
|
||||
|
||||
json-stringify-safe@~5.0.1:
|
||||
json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
|
||||
@@ -3275,6 +3345,14 @@ lodash.defaults@^4.2.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
|
||||
|
||||
lodash.get@^4.0.0:
|
||||
version "4.4.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
|
||||
|
||||
lodash.isequal@^4.0.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
|
||||
|
||||
lodash.isplainobject@^4.0.6:
|
||||
version "4.0.6"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
|
||||
@@ -3352,6 +3430,12 @@ lru-cache@^4.0.1:
|
||||
pseudomap "^1.0.2"
|
||||
yallist "^2.1.2"
|
||||
|
||||
lru-queue@0.1:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3"
|
||||
dependencies:
|
||||
es5-ext "~0.10.2"
|
||||
|
||||
macaddress@^0.2.8:
|
||||
version "0.2.8"
|
||||
resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12"
|
||||
@@ -3393,6 +3477,19 @@ mem@^1.1.0:
|
||||
dependencies:
|
||||
mimic-fn "^1.0.0"
|
||||
|
||||
memoizee@^0.4.3:
|
||||
version "0.4.9"
|
||||
resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.9.tgz#ea1c005f5c4c31d89a4a10e24db83fbf61cdd4f3"
|
||||
dependencies:
|
||||
d "1"
|
||||
es5-ext "^0.10.30"
|
||||
es6-weak-map "^2.0.2"
|
||||
event-emitter "^0.3.5"
|
||||
is-promise "^2.1"
|
||||
lru-queue "0.1"
|
||||
next-tick "1"
|
||||
timers-ext "^0.1.2"
|
||||
|
||||
memory-fs@^0.4.0, memory-fs@~0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552"
|
||||
@@ -3527,7 +3624,7 @@ mv@2.1.1:
|
||||
ncp "~2.0.0"
|
||||
rimraf "~2.4.0"
|
||||
|
||||
mz@2.6.0:
|
||||
mz@2.6.0, mz@^2.6.0:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/mz/-/mz-2.6.0.tgz#c8b8521d958df0a4f2768025db69c719ee4ef1ce"
|
||||
dependencies:
|
||||
@@ -3547,6 +3644,10 @@ negotiator@0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
|
||||
|
||||
next-tick@1:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
|
||||
|
||||
next@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/next/-/next-3.2.1.tgz#6d694823ac6e74e9be4553117144a6402220490f"
|
||||
@@ -3796,6 +3897,12 @@ onetime@^2.0.0:
|
||||
dependencies:
|
||||
mimic-fn "^1.0.0"
|
||||
|
||||
ono@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/ono/-/ono-4.0.2.tgz#2e18ff7c21b9eac0cab794f7a3082507000d6d36"
|
||||
dependencies:
|
||||
format-util "^1.0.3"
|
||||
|
||||
opener@^1.4.3:
|
||||
version "1.4.3"
|
||||
resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8"
|
||||
@@ -4998,6 +5105,10 @@ stackframe@^1.0.3:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e"
|
||||
|
||||
stdin@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/stdin/-/stdin-0.0.1.tgz#d3041981aaec3dfdbc77a1b38d6372e38f5fb71e"
|
||||
|
||||
stream-browserify@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db"
|
||||
@@ -5252,6 +5363,13 @@ timers-browserify@^2.0.2:
|
||||
global "^4.3.2"
|
||||
setimmediate "^1.0.4"
|
||||
|
||||
timers-ext@0.1, timers-ext@^0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.2.tgz#61cc47a76c1abd3195f14527f978d58ae94c5204"
|
||||
dependencies:
|
||||
es5-ext "~0.10.14"
|
||||
next-tick "1"
|
||||
|
||||
title-case@^2.1.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.1.tgz#3e127216da58d2bc5becf137ab91dae3a7cd8faa"
|
||||
@@ -5300,16 +5418,16 @@ transform-graphql-type-annotations@^0.1.1:
|
||||
apollo-codegen "0.17.0-alpha.1"
|
||||
graphql "^0.10.5"
|
||||
|
||||
transform-json-types@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/transform-json-types/-/transform-json-types-0.2.1.tgz#54251813ba00f0d91689e42d53774393c51c462e"
|
||||
transform-json-types@^0.2.6:
|
||||
version "0.2.6"
|
||||
resolved "https://registry.yarnpkg.com/transform-json-types/-/transform-json-types-0.2.6.tgz#2a41db319022cd0fbc01516fce9ca6aea6797f90"
|
||||
dependencies:
|
||||
lodash "^4.17.4"
|
||||
sha1 "^1.1.1"
|
||||
|
||||
transform-svg-to-native@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/transform-svg-to-native/-/transform-svg-to-native-0.1.1.tgz#6d890603af21b0cca24ebb8e0a3b3f8b5c26a233"
|
||||
transform-svg-to-native@^0.1.3:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/transform-svg-to-native/-/transform-svg-to-native-0.1.3.tgz#53c0b0d57921417b7df6ea4170c6e385c2a39261"
|
||||
dependencies:
|
||||
"@tsuyoshiwada/htmltojsx" "^0.0.4"
|
||||
all-contributors-cli "^4.4.0"
|
||||
@@ -5322,6 +5440,7 @@ transform-svg-to-native@^0.1.1:
|
||||
is-capitalized "^1.0.0"
|
||||
js-beautify "^1.6.14"
|
||||
lodash "^4.17.4"
|
||||
prettier "^1.6.1"
|
||||
prettydiff "^99.0.1"
|
||||
svgo "^0.7.2"
|
||||
|
||||
@@ -5497,6 +5616,10 @@ validate-npm-package-license@^3.0.1:
|
||||
spdx-correct "~1.0.0"
|
||||
spdx-expression-parse "~1.0.0"
|
||||
|
||||
validator@^8.0.0:
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/validator/-/validator-8.1.0.tgz#89cf6b512ff71eba886afd8d10d47f8dc800eac0"
|
||||
|
||||
vary@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.1.tgz#67535ebb694c1d52257457984665323f587e8d37"
|
||||
@@ -5802,3 +5925,13 @@ yargs@~3.10.0:
|
||||
cliui "^2.1.0"
|
||||
decamelize "^1.0.0"
|
||||
window-size "0.1.0"
|
||||
|
||||
z-schema@^3.18.2:
|
||||
version "3.18.3"
|
||||
resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-3.18.3.tgz#45592990891d0342fe20a36823fc44d89ab4d8a2"
|
||||
dependencies:
|
||||
lodash.get "^4.0.0"
|
||||
lodash.isequal "^4.0.0"
|
||||
validator "^8.0.0"
|
||||
optionalDependencies:
|
||||
commander "^2.7.1"
|
||||
Reference in new issue
Block a user