Skip to content

Commit 7a431fd

Browse files
authored
Upgrade dependencies (rubengrill#23)
1 parent 96941dd commit 7a431fd

24 files changed

+11537
-10738
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"plugin:prettier/recommended"
1212
],
1313
"rules": {
14-
"@typescript-eslint/explicit-function-return-type": "off"
14+
"@typescript-eslint/explicit-function-return-type": "off",
15+
"@typescript-eslint/explicit-module-boundary-types": "off"
1516
},
1617
"env": {
1718
"node": true,

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ generates:
4343
typesModule: "@codegen-types"
4444
./src/codegenTypes.d.ts:
4545
plugins:
46-
- add: 'declare module "@codegen-types" {'
46+
- add:
47+
placement: prepend
48+
content: 'declare module "@codegen-types" {'
4749
- add:
4850
placement: append
4951
content: "}"

examples/cra-ts/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SKIP_PREFLIGHT_CHECK=true

examples/cra-ts/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
24+
25+
.eslintcache

examples/cra-ts/codegen.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ generates:
1111
typesModule: "@codegen-types"
1212
./src/codegenTypes.d.ts:
1313
plugins:
14-
- add: 'declare module "@codegen-types" {'
14+
- add:
15+
placement: prepend
16+
content: 'declare module "@codegen-types" {'
1517
- add:
1618
placement: append
1719
content: "}"
1820
- typescript
1921
- typescript-operations
2022
./src/apolloMock.js:
2123
plugins:
22-
- add: "/* eslint-disable */"
24+
- add:
25+
placement: prepend
26+
content: "/* eslint-disable */"
2327
- apollo-typed-documents/lib/codegenApolloMock

examples/cra-ts/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
"dependencies": {
66
"@apollo/react-hooks": "^3.1.5",
77
"@apollo/react-testing": "^3.1.4",
8-
"@testing-library/jest-dom": "^4.2.4",
9-
"@testing-library/react": "^9.3.2",
10-
"@testing-library/user-event": "^7.1.2",
11-
"@types/jest": "^24.0.0",
12-
"@types/node": "^12.0.0",
13-
"@types/react": "^16.9.0",
14-
"@types/react-dom": "^16.9.0",
8+
"@testing-library/jest-dom": "^5.11.6",
9+
"@testing-library/react": "^11.2.2",
10+
"@testing-library/user-event": "^12.6.0",
11+
"@types/jest": "^26.0.19",
12+
"@types/node": "^14.14.14",
13+
"@types/react": "^17.0.0",
14+
"@types/react-dom": "^17.0.0",
1515
"apollo-typed-documents": "link:../..",
1616
"babel-plugin-import-graphql": "^2.7.0",
17-
"customize-cra": "^0.9.1",
18-
"react": "^16.13.1",
19-
"react-app-rewired": "^2.1.5",
20-
"react-dom": "^16.13.1",
21-
"react-scripts": "3.4.1",
22-
"typescript": "~3.7.2"
17+
"customize-cra": "^1.0.0",
18+
"react": "^17.0.1",
19+
"react-app-rewired": "^2.1.8",
20+
"react-dom": "^17.0.1",
21+
"react-scripts": "4.0.1",
22+
"typescript": "~4.1.3"
2323
},
2424
"scripts": {
2525
"start": "react-app-rewired start",

examples/cra-ts/src/App.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { MockedProvider } from "@apollo/react-testing";
2-
import { fireEvent, render, wait } from "@testing-library/react";
2+
import { fireEvent, render, waitFor } from "@testing-library/react";
33
import React from "react";
44

55
import apolloMock from "./apolloMock";
@@ -30,7 +30,7 @@ test("adds author", async () => {
3030

3131
fireEvent.click(getByText("Add"));
3232

33-
await wait(() => {
33+
await waitFor(() => {
3434
expect(getByText("Foo")).toBeInTheDocument();
3535
});
3636
});

examples/cra-ts/src/apolloMock.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable */
2-
32
import { createApolloMock } from 'apollo-typed-documents';
43

54
const operations = {};

examples/cra-ts/src/codegenTypes.d.ts

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
declare module "@codegen-types" {
22
export type Maybe<T> = T | null;
3-
4-
3+
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
4+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
5+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
56
/** All built-in and custom scalars, mapped to their actual values */
67
export type Scalars = {
78
ID: string;
@@ -12,34 +13,39 @@ export type Scalars = {
1213
Date: string;
1314
};
1415

16+
1517
export type Author = {
16-
__typename?: 'Author';
18+
__typename?: 'Author';
1719
id: Scalars['ID'];
1820
createdAt: Scalars['Date'];
1921
name: Scalars['String'];
2022
description?: Maybe<Scalars['String']>;
2123
books: Array<Book>;
2224
};
2325

26+
export type Book = {
27+
__typename?: 'Book';
28+
id: Scalars['ID'];
29+
title: Scalars['String'];
30+
};
31+
2432
export type AuthorInput = {
2533
name: Scalars['String'];
2634
description?: Maybe<Scalars['String']>;
2735
books: Array<BookInput>;
2836
};
2937

30-
export type Book = {
31-
__typename?: 'Book';
32-
id: Scalars['ID'];
33-
title: Scalars['String'];
34-
};
35-
3638
export type BookInput = {
3739
title: Scalars['String'];
3840
};
3941

42+
export type Query = {
43+
__typename?: 'Query';
44+
authors: Array<Author>;
45+
};
4046

4147
export type Mutation = {
42-
__typename?: 'Mutation';
48+
__typename?: 'Mutation';
4349
createAuthor: Author;
4450
};
4551

@@ -48,12 +54,7 @@ export type MutationCreateAuthorArgs = {
4854
input: AuthorInput;
4955
};
5056

51-
export type Query = {
52-
__typename?: 'Query';
53-
authors: Array<Author>;
54-
};
55-
56-
export type AuthorsQueryVariables = {};
57+
export type AuthorsQueryVariables = Exact<{ [key: string]: never; }>;
5758

5859

5960
export type AuthorsQuery = (
@@ -68,9 +69,9 @@ export type AuthorsQuery = (
6869
)> }
6970
);
7071

71-
export type CreateAuthorMutationVariables = {
72+
export type CreateAuthorMutationVariables = Exact<{
7273
input: AuthorInput;
73-
};
74+
}>;
7475

7576

7677
export type CreateAuthorMutation = (

examples/cra-ts/tsconfig.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": ["dom", "dom.iterable", "esnext"],
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
59
"allowJs": true,
610
"skipLibCheck": true,
711
"esModuleInterop": true,
@@ -13,7 +17,11 @@
1317
"resolveJsonModule": true,
1418
"isolatedModules": true,
1519
"noEmit": true,
16-
"jsx": "react"
20+
"jsx": "react-jsx",
21+
"noFallthroughCasesInSwitch": true
1722
},
18-
"include": ["src", "node_modules/apollo-typed-documents/lib/reactHooks.d.ts"]
23+
"include": [
24+
"src",
25+
"node_modules/apollo-typed-documents/lib/reactHooks.d.ts"
26+
]
1927
}

0 commit comments

Comments
 (0)