mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
WIP
This commit is contained in:
Generated
+88
-42
@@ -3697,13 +3697,14 @@
|
||||
}
|
||||
},
|
||||
"babel-plugin-relay": {
|
||||
"version": "github:coralproject/patched#80c179a21ece1a43e4782c776f3041fe5ab14a4a",
|
||||
"from": "github:coralproject/patched#babel-plugin-relay",
|
||||
"version": "1.7.0-rc.1",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-relay/-/babel-plugin-relay-1.7.0-rc.1.tgz",
|
||||
"integrity": "sha512-VklvYrB0kSZeDHGtwJNtDtoQNVrI+ZclURnsCBwWU5oIX4f21//cYeQ9oooJDIvXcCApFKhaozP5tfWgk+Fo5g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-plugin-macros": "^2.0.0",
|
||||
"babel-runtime": "^6.23.0",
|
||||
"babel-types": "^6.24.1",
|
||||
"graphql": "^0.13.0"
|
||||
"babel-types": "^6.24.1"
|
||||
}
|
||||
},
|
||||
"babel-plugin-syntax-class-properties": {
|
||||
@@ -4043,9 +4044,9 @@
|
||||
}
|
||||
},
|
||||
"babel-preset-fbjs": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-fbjs/-/babel-preset-fbjs-2.1.4.tgz",
|
||||
"integrity": "sha512-6XVQwlO26V5/0P9s2Eje8Epqkv/ihaMJ798+W98ktOA8fCn2IFM6wEi7CDW3fTbKFZ/8fDGvGZH01B6GSuNiWA==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-fbjs/-/babel-preset-fbjs-2.2.0.tgz",
|
||||
"integrity": "sha512-jj0KFJDioYZMtPtZf77dQuU+Ad/1BtN0UnAYlHDa8J8f4tGXr3YrPoJImD5MdueaOPeN/jUdrCgu330EfXr0XQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-plugin-check-es2015-constants": "^6.8.0",
|
||||
@@ -5157,12 +5158,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"babylon": {
|
||||
"version": "7.0.0-beta.31",
|
||||
"resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.31.tgz",
|
||||
"integrity": "sha512-6lm2mV3S51yEnKmQQNnswoABL1U1H1KHoCCVwdwI3hvIv+W7ya4ki7Aw4o4KxtUHjNKkK5WpZb22rrMMOcJXJQ==",
|
||||
"dev": true
|
||||
},
|
||||
"bach": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz",
|
||||
@@ -11095,6 +11090,32 @@
|
||||
"iterall": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"graphql-compiler": {
|
||||
"version": "1.7.0-rc.1",
|
||||
"resolved": "https://registry.npmjs.org/graphql-compiler/-/graphql-compiler-1.7.0-rc.1.tgz",
|
||||
"integrity": "sha512-wu1HMcI39I2Ion1N+nrn9ELGMFGi6lFDz+dJuJwnlO3BdXTrSVvYnnusxNaim4/Gkmf9tM/ErYSbpvRzBWPk3g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^1.1.1",
|
||||
"fb-watchman": "^2.0.0",
|
||||
"immutable": "~3.7.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^2.2.1",
|
||||
"escape-string-regexp": "^1.0.2",
|
||||
"has-ansi": "^2.0.0",
|
||||
"strip-ansi": "^3.0.0",
|
||||
"supports-color": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"graphql-config": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/graphql-config/-/graphql-config-2.0.1.tgz",
|
||||
@@ -20889,13 +20910,15 @@
|
||||
}
|
||||
},
|
||||
"react-relay": {
|
||||
"version": "github:coralproject/patched#aad037f8cbcd9c14d5f6fd96cfafb24c39eab937",
|
||||
"from": "github:coralproject/patched#react-relay",
|
||||
"version": "1.7.0-rc.1",
|
||||
"resolved": "https://registry.npmjs.org/react-relay/-/react-relay-1.7.0-rc.1.tgz",
|
||||
"integrity": "sha512-5BcnFr++zkfq5AVoCjcqr8eotuJwVN+57+BnhJZuw3EoY8Yi+avV/AqZ7Tz9F6r9p5xZkCoYZw3kRTtpK9lPSQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-runtime": "^6.23.0",
|
||||
"fbjs": "^0.8.14",
|
||||
"prop-types": "^15.5.8"
|
||||
"fbjs": "0.8.17",
|
||||
"prop-types": "^15.5.8",
|
||||
"relay-runtime": "1.7.0-rc.1"
|
||||
}
|
||||
},
|
||||
"react-responsive": {
|
||||
@@ -21332,27 +21355,59 @@
|
||||
"dev": true
|
||||
},
|
||||
"relay-compiler": {
|
||||
"version": "github:coralproject/patched#652bdfa85cf35ed3e8dc4e26cf26e9d1744873cb",
|
||||
"from": "github:coralproject/patched#relay-compiler",
|
||||
"version": "1.7.0-rc.1",
|
||||
"resolved": "https://registry.npmjs.org/relay-compiler/-/relay-compiler-1.7.0-rc.1.tgz",
|
||||
"integrity": "sha512-NCbrAWG692dp0on3sefX0pZ+1/eWDPOnme/i0vAbH38ejfRW5vPS9pznHYS7A0y7OC5lABMZT+DCyEYeHFpflA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-generator": "^6.26.0",
|
||||
"@babel/generator": "7.0.0-beta.56",
|
||||
"@babel/parser": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56",
|
||||
"babel-polyfill": "^6.20.0",
|
||||
"babel-preset-fbjs": "^2.1.4",
|
||||
"babel-preset-fbjs": "2.2.0",
|
||||
"babel-runtime": "^6.23.0",
|
||||
"babel-traverse": "^6.26.0",
|
||||
"babel-types": "^6.24.1",
|
||||
"babylon": "^7.0.0-beta",
|
||||
"chalk": "^1.1.1",
|
||||
"fast-glob": "^2.0.0",
|
||||
"fast-glob": "^2.2.2",
|
||||
"fb-watchman": "^2.0.0",
|
||||
"fbjs": "^0.8.14",
|
||||
"graphql": "^0.13.0",
|
||||
"fbjs": "0.8.17",
|
||||
"graphql-compiler": "1.7.0-rc.1",
|
||||
"immutable": "~3.7.6",
|
||||
"relay-runtime": "1.7.0-rc.1",
|
||||
"signedsource": "^1.0.0",
|
||||
"yargs": "^9.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/generator": {
|
||||
"version": "7.0.0-beta.56",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.56.tgz",
|
||||
"integrity": "sha512-d+Ls/Vr5OU5FBDYQToXSqAluI3r2UaSoNZ41zD3sxdoVoaT8K5Bdh4So4eG4o//INGM7actValXGfb+5J1+r8w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "7.0.0-beta.56",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.17.10",
|
||||
"source-map": "^0.5.0",
|
||||
"trim-right": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"@babel/parser": {
|
||||
"version": "7.0.0-beta.56",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.0.0-beta.56.tgz",
|
||||
"integrity": "sha512-JM0ughhbo+sPXw2Z+SUyowfYrAOhjanzjMshcLswBdXVelJCOeEKe/FqMqPWGVPQr7wByongXIn+MKdCpY7DBw==",
|
||||
"dev": true
|
||||
},
|
||||
"@babel/types": {
|
||||
"version": "7.0.0-beta.56",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.56.tgz",
|
||||
"integrity": "sha512-fRIBeHtKxAD3D1E7hYSpG4MnLt0AfzHHs5gfVclOB0NlfLu3qiWU/IqdbK2ixTK61424iEkV1P/VAzndx6ungA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esutils": "^2.0.2",
|
||||
"lodash": "^4.17.10",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"babel-polyfill": {
|
||||
"version": "6.26.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz",
|
||||
@@ -21535,8 +21590,9 @@
|
||||
}
|
||||
},
|
||||
"relay-compiler-language-typescript": {
|
||||
"version": "github:coralproject/patched#0da4835cf006e905c154d1e41aa978f81ace54f3",
|
||||
"from": "github:coralproject/patched#relay-compiler-language-typescript",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/relay-compiler-language-typescript/-/relay-compiler-language-typescript-1.1.0.tgz",
|
||||
"integrity": "sha512-HDWTEsSsNuphmNrjbc1Tf1ljVjbi2CSA7zArsFFYCYHfVU/O7oS3qv/u5E+LrHdYSM80AjpUVjdcFGsqkgOmNw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"immutable": "^3.7.6",
|
||||
@@ -21550,23 +21606,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"relay-runtime": {
|
||||
"version": "github:coralproject/patched#9dda7718393cb3aa6647bd3badf574c025f79d12",
|
||||
"from": "github:coralproject/patched#relay-runtime",
|
||||
"version": "1.7.0-rc.1",
|
||||
"resolved": "https://registry.npmjs.org/relay-runtime/-/relay-runtime-1.7.0-rc.1.tgz",
|
||||
"integrity": "sha512-gdhtIKojPA0FJPc4hPGAbxZBAR2xpnCvCuoL4/wu3ffHxwUFvSSlBIptW3GSxTRM2F55vl7I1IeehCS9IAfQPA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-runtime": "^6.23.0",
|
||||
"fbjs": "^0.8.14"
|
||||
}
|
||||
},
|
||||
"relay-test-utils": {
|
||||
"version": "github:coralproject/patched#eee4232d3996db88c4ae9030023adcf1f3674615",
|
||||
"from": "github:coralproject/patched#relay-test-utils",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-runtime": "^6.23.0",
|
||||
"fbjs": "^0.8.14",
|
||||
"graphql": "^0.13.0",
|
||||
"prop-types": "^15.5.8"
|
||||
"fbjs": "0.8.17"
|
||||
}
|
||||
},
|
||||
"remark": {
|
||||
|
||||
+5
-6
@@ -134,7 +134,7 @@
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"babel-loader": "^8.0.0-beta",
|
||||
"babel-plugin-module-resolver": "^3.1.1",
|
||||
"babel-plugin-relay": "github:coralproject/patched#babel-plugin-relay",
|
||||
"babel-plugin-relay": "^1.7.0-rc.1",
|
||||
"babel-preset-react-optimize": "^1.0.1",
|
||||
"case-sensitive-paths-webpack-plugin": "^2.1.2",
|
||||
"chalk": "^2.4.1",
|
||||
@@ -194,17 +194,16 @@
|
||||
"react-dom": "^16.4.0",
|
||||
"react-final-form": "^3.6.4",
|
||||
"react-popper": "^1.0.0",
|
||||
"react-relay": "github:coralproject/patched#react-relay",
|
||||
"react-relay": "^1.7.0-rc.1",
|
||||
"react-responsive": "^5.0.0",
|
||||
"react-test-renderer": "^16.4.2",
|
||||
"react-timeago": "^4.1.9",
|
||||
"react-with-state-props": "^2.0.4",
|
||||
"recompose": "^0.27.1",
|
||||
"relay-compiler": "github:coralproject/patched#relay-compiler",
|
||||
"relay-compiler-language-typescript": "github:coralproject/patched#relay-compiler-language-typescript",
|
||||
"relay-compiler": "^1.7.0-rc.1",
|
||||
"relay-compiler-language-typescript": "^1.1.0",
|
||||
"relay-local-schema": "^0.7.0",
|
||||
"relay-runtime": "github:coralproject/patched#relay-runtime",
|
||||
"relay-test-utils": "github:coralproject/patched#relay-test-utils",
|
||||
"relay-runtime": "^1.7.0-rc.1",
|
||||
"sane": "^2.5.2",
|
||||
"simulant": "^0.2.2",
|
||||
"sinon": "^6.1.3",
|
||||
|
||||
@@ -2,5 +2,8 @@ export {
|
||||
default as createRelayEnvironment,
|
||||
CreateRelayEnvironmentParams,
|
||||
} from "./createRelayEnvironment";
|
||||
|
||||
export { default as createFluentBundle } from "./createFluentBundle";
|
||||
export {
|
||||
default as removeFragmentRefs,
|
||||
NoFragmentRefs,
|
||||
} from "./removeFragmentRefs";
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { ComponentType } from "react";
|
||||
|
||||
/** Remove all traces of `$fragmentRefs` and `$refType` from type recursively */
|
||||
export type NoFragmentRefs<T> = T extends object
|
||||
? {
|
||||
[P in Exclude<keyof T, " $fragmentRefs" | " $refType">]: NoFragmentRefs<
|
||||
T[P]
|
||||
>
|
||||
}
|
||||
: T;
|
||||
|
||||
export default function removeFragmentRefs<T>(
|
||||
component: ComponentType<T>
|
||||
): ComponentType<NoFragmentRefs<T>> {
|
||||
return component as any;
|
||||
}
|
||||
@@ -1,12 +1,16 @@
|
||||
import { shallow } from "enzyme";
|
||||
import React from "react";
|
||||
|
||||
import { removeFragmentRefs } from "talk-framework/testHelpers";
|
||||
import { PropTypesOf } from "talk-framework/types";
|
||||
|
||||
import { CommentContainer } from "./CommentContainer";
|
||||
|
||||
// Remove relay refs so we can stub the props.
|
||||
const CommentContainerN = removeFragmentRefs(CommentContainer);
|
||||
|
||||
it("renders username and body", () => {
|
||||
const props: PropTypesOf<typeof CommentContainer> = {
|
||||
const props: PropTypesOf<typeof CommentContainerN> = {
|
||||
data: {
|
||||
id: "comment-id",
|
||||
author: {
|
||||
@@ -17,12 +21,12 @@ it("renders username and body", () => {
|
||||
},
|
||||
};
|
||||
|
||||
const wrapper = shallow(<CommentContainer {...props} />);
|
||||
const wrapper = shallow(<CommentContainerN {...props} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("renders body only", () => {
|
||||
const props: PropTypesOf<typeof CommentContainer> = {
|
||||
const props: PropTypesOf<typeof CommentContainerN> = {
|
||||
data: {
|
||||
id: "comment-id",
|
||||
author: {
|
||||
@@ -33,6 +37,6 @@ it("renders body only", () => {
|
||||
},
|
||||
};
|
||||
|
||||
const wrapper = shallow(<CommentContainer {...props} />);
|
||||
const wrapper = shallow(<CommentContainerN {...props} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -2,13 +2,17 @@ import { shallow, ShallowWrapper } from "enzyme";
|
||||
import { noop } from "lodash";
|
||||
import React from "react";
|
||||
|
||||
import { removeFragmentRefs } from "talk-framework/testHelpers";
|
||||
import { PropTypesOf } from "talk-framework/types";
|
||||
|
||||
import ReplyList from "../components/ReplyList";
|
||||
import { ReplyListContainer } from "./ReplyListContainer";
|
||||
|
||||
// Remove relay refs so we can stub the props.
|
||||
const ReplyListContainerN = removeFragmentRefs(ReplyListContainer);
|
||||
|
||||
it("renders correctly", () => {
|
||||
const props: PropTypesOf<typeof ReplyListContainer> = {
|
||||
const props: PropTypesOf<typeof ReplyListContainerN> = {
|
||||
comment: {
|
||||
id: "comment-id",
|
||||
replies: {
|
||||
@@ -20,12 +24,12 @@ it("renders correctly", () => {
|
||||
isLoading: noop,
|
||||
} as any,
|
||||
};
|
||||
const wrapper = shallow(<ReplyListContainer {...props} />);
|
||||
const wrapper = shallow(<ReplyListContainerN {...props} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("renders correctly when replies are null", () => {
|
||||
const props: PropTypesOf<typeof ReplyListContainer> = {
|
||||
const props: PropTypesOf<typeof ReplyListContainerN> = {
|
||||
comment: {
|
||||
id: "comment-id",
|
||||
replies: null,
|
||||
@@ -35,13 +39,13 @@ it("renders correctly when replies are null", () => {
|
||||
isLoading: noop,
|
||||
} as any,
|
||||
};
|
||||
const wrapper = shallow(<ReplyListContainer {...props} />);
|
||||
const wrapper = shallow(<ReplyListContainerN {...props} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when has more replies", () => {
|
||||
let finishLoading: ((error?: Error) => void) | null = null;
|
||||
const props: PropTypesOf<ReplyListContainer> = {
|
||||
const props: PropTypesOf<typeof ReplyListContainerN> = {
|
||||
comment: {
|
||||
id: "comment-id",
|
||||
replies: {
|
||||
@@ -57,7 +61,7 @@ describe("when has more replies", () => {
|
||||
|
||||
let wrapper: ShallowWrapper;
|
||||
|
||||
beforeAll(() => (wrapper = shallow(<ReplyListContainer {...props} />)));
|
||||
beforeAll(() => (wrapper = shallow(<ReplyListContainerN {...props} />)));
|
||||
|
||||
it("renders hasMore", () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
@@ -23,7 +23,7 @@ export class ReplyListContainer extends React.Component<InnerProps> {
|
||||
|
||||
public render() {
|
||||
if (
|
||||
this.props.comment.replies === null ||
|
||||
!this.props.comment.replies == null ||
|
||||
this.props.comment.replies.edges.length === 0
|
||||
) {
|
||||
return null;
|
||||
|
||||
@@ -2,13 +2,17 @@ import { shallow, ShallowWrapper } from "enzyme";
|
||||
import { noop } from "lodash";
|
||||
import React from "react";
|
||||
|
||||
import { removeFragmentRefs } from "talk-framework/testHelpers";
|
||||
import { PropTypesOf } from "talk-framework/types";
|
||||
|
||||
import Stream from "../components/Stream";
|
||||
import { StreamContainer } from "./StreamContainer";
|
||||
|
||||
// Remove relay refs so we can stub the props.
|
||||
const StreamContainerN = removeFragmentRefs(StreamContainer);
|
||||
|
||||
it("renders correctly", () => {
|
||||
const props: PropTypesOf<StreamContainer> = {
|
||||
const props: PropTypesOf<typeof StreamContainerN> = {
|
||||
asset: {
|
||||
id: "asset-id",
|
||||
isClosed: false,
|
||||
@@ -21,13 +25,13 @@ it("renders correctly", () => {
|
||||
isLoading: noop,
|
||||
} as any,
|
||||
};
|
||||
const wrapper = shallow(<StreamContainer {...props} />);
|
||||
const wrapper = shallow(<StreamContainerN {...props} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when has more comments", () => {
|
||||
let finishLoading: ((error?: Error) => void) | null = null;
|
||||
const props: PropTypesOf<StreamContainer> = {
|
||||
const props: PropTypesOf<typeof StreamContainerN> = {
|
||||
asset: {
|
||||
id: "asset-id",
|
||||
isClosed: false,
|
||||
@@ -44,7 +48,7 @@ describe("when has more comments", () => {
|
||||
|
||||
let wrapper: ShallowWrapper;
|
||||
|
||||
beforeAll(() => (wrapper = shallow(<StreamContainer {...props} />)));
|
||||
beforeAll(() => (wrapper = shallow(<StreamContainerN {...props} />)));
|
||||
|
||||
it("renders hasMore", () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import { shallow } from "enzyme";
|
||||
import React from "react";
|
||||
|
||||
import { removeFragmentRefs } from "talk-framework/testHelpers";
|
||||
import { PropTypesOf } from "talk-framework/types";
|
||||
|
||||
import { UserBoxContainer } from "./UserBoxContainer";
|
||||
|
||||
// Remove relay refs so we can stub the props.
|
||||
const UserBoxContainerN = removeFragmentRefs(UserBoxContainer);
|
||||
|
||||
it("renders correctly", () => {
|
||||
const props: PropTypesOf<UserBoxContainer> = {
|
||||
const props: PropTypesOf<typeof UserBoxContainerN> = {
|
||||
local: {
|
||||
authPopup: {
|
||||
open: false,
|
||||
@@ -22,6 +26,6 @@ it("renders correctly", () => {
|
||||
// tslint:disable-next-line:no-empty
|
||||
signOut: async () => {},
|
||||
};
|
||||
const wrapper = shallow(<UserBoxContainer {...props} />);
|
||||
const wrapper = shallow(<UserBoxContainerN {...props} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user