Skip to content

Commit 7506e2e

Browse files
committed
npm: upgrade to latest versions
1 parent b5213a3 commit 7506e2e

27 files changed

+7625
-7982
lines changed

.eslintrc.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
22
"root": true,
33
"parser": "@typescript-eslint/parser",
4-
"extends": ["next/core-web-vitals", "eslint:recommended", "plugin:@typescript-eslint/recommended"],
4+
"extends": [
5+
"next/core-web-vitals",
6+
"eslint:recommended",
7+
"plugin:@typescript-eslint/recommended",
8+
"plugin:storybook/recommended"
9+
],
510
"plugins": ["@typescript-eslint", "testing-library", "formatjs"],
611
"overrides": [
712
// Only uses Testing Library lint rules in test files

.storybook/main.js

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
module.exports = {
22
stories: ['../**/*.stories.@(js|jsx|ts|tsx|mdx)'],
33
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
4+
5+
framework: {
6+
name: '@storybook/nextjs',
7+
options: {},
8+
},
9+
10+
docs: {
11+
autodocs: true,
12+
},
413
};

__tests__/__snapshots__/snapshot.tsx.snap

+16-17
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ exports[`renders homepage unchanged 1`] = `
2525
/>
2626
</div>
2727
<h1
28-
class="MuiTypography-root MuiTypography-h1 title css-lgx1dj-MuiTypography-root"
28+
class="MuiTypography-root MuiTypography-h1 title css-12qmnqw-MuiTypography-root"
2929
>
3030
Welcome to
3131
<a
32-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-18sjyu7-MuiTypography-root-MuiLink-root"
32+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-nkcouy-MuiTypography-root-MuiLink-root"
3333
href="https://nextjs.org"
3434
>
3535
Next.js
3636
</a>
3737
, with
3838
3939
<a
40-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-18sjyu7-MuiTypography-root-MuiLink-root"
40+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-nkcouy-MuiTypography-root-MuiLink-root"
4141
href="https://github.com/mimecuvalo/all-the-things"
4242
>
4343
All The Things
@@ -58,11 +58,11 @@ exports[`renders homepage unchanged 1`] = `
5858
class="grid"
5959
>
6060
<a
61-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover card css-18sjyu7-MuiTypography-root-MuiLink-root"
61+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover card css-nkcouy-MuiTypography-root-MuiLink-root"
6262
href="https://nextjs.org/docs"
6363
>
6464
<h2
65-
class="MuiTypography-root MuiTypography-h2 css-1icjozd-MuiTypography-root"
65+
class="MuiTypography-root MuiTypography-h2 css-19cg4yg-MuiTypography-root"
6666
>
6767
Documentation →
6868
</h2>
@@ -71,11 +71,11 @@ exports[`renders homepage unchanged 1`] = `
7171
</p>
7272
</a>
7373
<a
74-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover card css-18sjyu7-MuiTypography-root-MuiLink-root"
74+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover card css-nkcouy-MuiTypography-root-MuiLink-root"
7575
href="https://nextjs.org/learn"
7676
>
7777
<h2
78-
class="MuiTypography-root MuiTypography-h2 css-1icjozd-MuiTypography-root"
78+
class="MuiTypography-root MuiTypography-h2 css-19cg4yg-MuiTypography-root"
7979
>
8080
Learn →
8181
</h2>
@@ -84,11 +84,11 @@ exports[`renders homepage unchanged 1`] = `
8484
</p>
8585
</a>
8686
<a
87-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover card css-18sjyu7-MuiTypography-root-MuiLink-root"
87+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover card css-nkcouy-MuiTypography-root-MuiLink-root"
8888
href="https://github.com/vercel/next.js/tree/canary/examples"
8989
>
9090
<h2
91-
class="MuiTypography-root MuiTypography-h2 css-1icjozd-MuiTypography-root"
91+
class="MuiTypography-root MuiTypography-h2 css-19cg4yg-MuiTypography-root"
9292
>
9393
Examples →
9494
</h2>
@@ -97,11 +97,11 @@ exports[`renders homepage unchanged 1`] = `
9797
</p>
9898
</a>
9999
<a
100-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover card css-18sjyu7-MuiTypography-root-MuiLink-root"
100+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover card css-nkcouy-MuiTypography-root-MuiLink-root"
101101
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
102102
>
103103
<h2
104-
class="MuiTypography-root MuiTypography-h2 css-1icjozd-MuiTypography-root"
104+
class="MuiTypography-root MuiTypography-h2 css-19cg4yg-MuiTypography-root"
105105
>
106106
Deploy →
107107
</h2>
@@ -111,7 +111,7 @@ exports[`renders homepage unchanged 1`] = `
111111
</a>
112112
</div>
113113
<h2
114-
class="MuiTypography-root MuiTypography-h2 css-1icjozd-MuiTypography-root"
114+
class="MuiTypography-root MuiTypography-h2 css-19cg4yg-MuiTypography-root"
115115
>
116116
<span
117117
class="i18n-msg"
@@ -125,7 +125,7 @@ exports[`renders homepage unchanged 1`] = `
125125
<span
126126
class="i18n-msg"
127127
>
128-
GraphQL variables test (current url path):
128+
GraphQL variables test (current url path): [loading]
129129
</span>
130130
</p>
131131
<p
@@ -154,7 +154,7 @@ exports[`renders homepage unchanged 1`] = `
154154
>
155155
i18n html test:
156156
<a
157-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover external-link css-18sjyu7-MuiTypography-root-MuiLink-root"
157+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover external-link css-nkcouy-MuiTypography-root-MuiLink-root"
158158
href="https://www.example.com/"
159159
rel="noopener noreferrer"
160160
target="_blank"
@@ -170,7 +170,7 @@ exports[`renders homepage unchanged 1`] = `
170170
<p>
171171
and
172172
<a
173-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-18sjyu7-MuiTypography-root-MuiLink-root"
173+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-nkcouy-MuiTypography-root-MuiLink-root"
174174
href="https://github.com/mimecuvalo/all-the-things"
175175
>
176176
much more
@@ -182,7 +182,7 @@ exports[`renders homepage unchanged 1`] = `
182182
class="footer"
183183
>
184184
<a
185-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover notranslate css-18sjyu7-MuiTypography-root-MuiLink-root"
185+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover notranslate css-nkcouy-MuiTypography-root-MuiLink-root"
186186
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
187187
rel="noopener noreferrer"
188188
target="_blank"
@@ -199,7 +199,6 @@ exports[`renders homepage unchanged 1`] = `
199199
height="16"
200200
loading="lazy"
201201
src="/img/vercel.svg"
202-
srcset="/img/vercel.svg 1x, /img/vercel.svg 2x"
203202
style="color: transparent;"
204203
width="72"
205204
/>

app/authServerSideProps.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { NextApiRequest, NextApiResponse } from 'next';
22

3-
import { getSession } from '@auth0/nextjs-auth0';
3+
import auth0 from 'vendor/auth0';
44
import prisma from 'data/prisma';
55

66
const authServerSideProps =
77
(props: any = {}) =>
88
async ({ req, res }: { req: NextApiRequest; res: NextApiResponse }) => {
9-
const session = getSession(req, res);
9+
const session = await auth0.getSession(req, res);
1010

1111
if (!session) {
1212
return {

app/authentication.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { NextApiRequest, NextApiResponse } from 'next';
22

3-
import { getSession } from '@auth0/nextjs-auth0';
3+
import auth0 from 'vendor/auth0';
44
import prisma from 'data/prisma';
55

66
const authenticate =
77
(handler: (req: NextApiRequest, res: NextApiResponse) => void) =>
88
async (req: NextApiRequest, res: NextApiResponse) => {
9-
const session = getSession(req, res);
9+
const session = await auth0.getSession(req, res);
1010

1111
if (!session) {
1212
return res.status(401).send({ msg: 'Not logged in.' });

codegen.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ generates:
1111
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types */
1212
- typescript
1313
- typescript-operations
14-
- typescript-resolvers
14+
- typescript-resolvers

components/Help.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { $Experiment } from 'app/experiments';
1717
import Cookies from 'js-cookie';
1818
import { Help as HelpIcon } from '@mui/icons-material';
1919
import Link from './Link';
20-
import { UserContext } from '@auth0/nextjs-auth0';
20+
import { UserContext } from '@auth0/nextjs-auth0/client';
2121

2222
const HelpContainer = styled('div')`
2323
display: inline-block;

components/Login.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Button } from '@mui/material';
22
import { F } from 'i18n';
3-
import { useUser } from '@auth0/nextjs-auth0';
3+
import { useUser } from '@auth0/nextjs-auth0/client';
44

55
export default function LoginLogoutButton() {
66
const { user } = useUser();

data/context.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Claims, getSession } from '@auth0/nextjs-auth0';
1+
import { Claims } from '@auth0/nextjs-auth0';
2+
import auth0 from 'vendor/auth0';
23
import { NextApiRequest, NextApiResponse } from 'next';
34

45
import { PrismaClient } from '@prisma/client';
@@ -14,7 +15,7 @@ export async function createContext({ req, res }: { req: NextApiRequest; res: Ne
1415
let session;
1516

1617
try {
17-
session = getSession(req, res);
18+
session = await auth0.getSession(req, res);
1819
} catch (ex) {
1920
// fall through
2021
}

data/graphql-generated.ts

+27-23
Original file line numberDiff line numberDiff line change
@@ -7,60 +7,62 @@ export type InputMaybe<T> = Maybe<T>;
77
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
88
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
99
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
10+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
11+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
1012
export type RequireFields<T, K extends keyof T> = Omit<T, K> & { [P in K]-?: NonNullable<T[P]> };
1113
/** All built-in and custom scalars, mapped to their actual values */
1214
export type Scalars = {
13-
ID: string;
14-
String: string;
15-
Boolean: boolean;
16-
Int: number;
17-
Float: number;
18-
Date: any;
15+
ID: { input: string; output: string; }
16+
String: { input: string; output: string; }
17+
Boolean: { input: boolean; output: boolean; }
18+
Int: { input: number; output: number; }
19+
Float: { input: number; output: number; }
20+
Date: { input: any; output: any; }
1921
};
2022

2123
export type Echo = {
2224
__typename?: 'Echo';
23-
exampleField: Scalars['String'];
25+
exampleField: Scalars['String']['output'];
2426
};
2527

2628
export type Mutation = {
2729
__typename?: 'Mutation';
28-
_?: Maybe<Scalars['Boolean']>;
30+
_?: Maybe<Scalars['Boolean']['output']>;
2931
createUser?: Maybe<User>;
3032
};
3133

3234

3335
export type MutationCreateUserArgs = {
34-
email: Scalars['String'];
35-
username: Scalars['String'];
36+
email: Scalars['String']['input'];
37+
username: Scalars['String']['input'];
3638
};
3739

3840
export type Query = {
3941
__typename?: 'Query';
40-
_?: Maybe<Scalars['Boolean']>;
42+
_?: Maybe<Scalars['Boolean']['output']>;
4143
echoExample?: Maybe<Echo>;
42-
hello?: Maybe<Scalars['String']>;
44+
hello?: Maybe<Scalars['String']['output']>;
4345
users?: Maybe<Array<Maybe<User>>>;
4446
};
4547

4648

4749
export type QueryEchoExampleArgs = {
48-
str: Scalars['String'];
50+
str: Scalars['String']['input'];
4951
};
5052

5153
export type Subscription = {
5254
__typename?: 'Subscription';
53-
_?: Maybe<Scalars['Boolean']>;
55+
_?: Maybe<Scalars['Boolean']['output']>;
5456
};
5557

5658
export type User = {
5759
__typename?: 'User';
58-
email: Scalars['String'];
59-
username: Scalars['String'];
60+
email: Scalars['String']['output'];
61+
username: Scalars['String']['output'];
6062
};
6163

6264
export type HelloAndEchoQueriesQueryVariables = Exact<{
63-
str: Scalars['String'];
65+
str: Scalars['String']['input'];
6466
}>;
6567

6668

@@ -133,26 +135,28 @@ export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs
133135
info: GraphQLResolveInfo
134136
) => TResult | Promise<TResult>;
135137

138+
139+
136140
/** Mapping between all available schema types and the resolvers types */
137141
export type ResolversTypes = {
138-
Boolean: ResolverTypeWrapper<Scalars['Boolean']>;
139-
Date: ResolverTypeWrapper<Scalars['Date']>;
142+
Boolean: ResolverTypeWrapper<Scalars['Boolean']['output']>;
143+
Date: ResolverTypeWrapper<Scalars['Date']['output']>;
140144
Echo: ResolverTypeWrapper<Echo>;
141145
Mutation: ResolverTypeWrapper<{}>;
142146
Query: ResolverTypeWrapper<{}>;
143-
String: ResolverTypeWrapper<Scalars['String']>;
147+
String: ResolverTypeWrapper<Scalars['String']['output']>;
144148
Subscription: ResolverTypeWrapper<{}>;
145149
User: ResolverTypeWrapper<User>;
146150
};
147151

148152
/** Mapping between all available schema types and the resolvers parents */
149153
export type ResolversParentTypes = {
150-
Boolean: Scalars['Boolean'];
151-
Date: Scalars['Date'];
154+
Boolean: Scalars['Boolean']['output'];
155+
Date: Scalars['Date']['output'];
152156
Echo: Echo;
153157
Mutation: {};
154158
Query: {};
155-
String: Scalars['String'];
159+
String: Scalars['String']['output'];
156160
Subscription: {};
157161
User: User;
158162
};

data/resolvers/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { GraphQLScalarType, Kind, ValueNode } from 'graphql';
22

33
import userResolvers from './user';
44

5-
const exampleResolvers = {
5+
const baseResolvers = {
66
Date: new GraphQLScalarType({
77
name: 'Date',
88
description: 'Date custom scalar type',
@@ -31,5 +31,5 @@ const exampleResolvers = {
3131
},
3232
};
3333

34-
const resolvers = [exampleResolvers, userResolvers];
34+
const resolvers = [baseResolvers, userResolvers];
3535
export default resolvers;

i18n/i18n.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import {
2+
FormattedDate as originalFormattedDate,
3+
FormattedNumber as originalFormattedNumber,
24
FormattedMessage,
35
IntlConfig,
46
IntlShape,
@@ -14,6 +16,11 @@ import { ReactNode } from 'react';
1416
// Re-export everything and override below what we want to override.
1517
export * from 'react-intl';
1618

19+
// @ts-ignore ugh, why are the types from react-intl crap right now??
20+
export const FormattedDate: React.FC<any> = originalFormattedDate;
21+
// @ts-ignore ugh, why are the types from react-intl crap right now??
22+
export const FormattedNumber: React.FC<any> = originalFormattedNumber;
23+
1724
const INTERNAL_LOCALES = ['xx-AE', 'xx-LS'];
1825

1926
// This matches the extraction tool pattern:

jest.setup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Used for __tests__/testing-library.js
66
// Learn more: https://github.com/testing-library/jest-dom
7-
import '@testing-library/jest-dom/extend-expect';
7+
import '@testing-library/jest-dom';
88

99
import fetch from 'cross-fetch';
1010

next-env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference types="next/navigation-types/compat/navigation" />
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/basic-features/typescript for more information.

0 commit comments

Comments
 (0)