From 84c1a31c5bc1d99d0c030327369a64e3883ace25 Mon Sep 17 00:00:00 2001 From: Nikos Douvlis Date: Fri, 15 Dec 2023 00:19:40 +0200 Subject: [PATCH] chore(repo): Update playground apps --- .../__snapshots__/exports.test.ts.snap | 1 + .../nextjs/app/app-dir/client-component.tsx | 11 ++ playground/nextjs/app/app-dir/page.tsx | 13 +- .../nextjs/pages/session-examples/index.tsx | 26 +--- .../nextjs/pages/user-examples/index.tsx | 35 +---- playground/nextjs12/.eslintrc.json | 4 - playground/nextjs12/.gitignore | 36 ----- playground/nextjs12/README.md | 55 -------- .../nextjs12/app/app-dir/client/page.tsx | 11 -- .../app/app-dir/create-organization/page.tsx | 5 - .../app/app-dir/organization/page.tsx | 10 -- playground/nextjs12/app/app-dir/page.tsx | 43 ------ .../nextjs12/app/app-dir/sign-in/page.tsx | 5 - .../nextjs12/app/app-dir/sign-up/page.tsx | 5 - playground/nextjs12/app/app-dir/user/page.tsx | 5 - playground/nextjs12/app/layout.tsx | 15 -- playground/nextjs12/hooks/useColorScheme.ts | 68 --------- playground/nextjs12/middleware.ts | 23 ---- playground/nextjs12/next-env.d.ts | 5 - playground/nextjs12/next.config.js | 17 --- playground/nextjs12/package.json | 31 ----- playground/nextjs12/pages/_app.tsx | 86 ------------ playground/nextjs12/pages/api/hello-edge.ts | 23 ---- playground/nextjs12/pages/api/hello.ts | 13 -- .../create-organization/[[...index]].tsx | 15 -- playground/nextjs12/pages/index.tsx | 56 -------- .../pages/organization/[[...index]].tsx | 15 -- .../nextjs12/pages/redirect-helpers/index.tsx | 37 ----- .../nextjs12/pages/session-examples/index.tsx | 33 ----- .../nextjs12/pages/sign-in/[[...index]].tsx | 13 -- .../nextjs12/pages/sign-up/[[...index]].tsx | 13 -- .../nextjs12/pages/user-examples/index.tsx | 28 ---- .../nextjs12/pages/user/[[...index]].tsx | 13 -- playground/nextjs12/public/favicon.ico | Bin 25931 -> 0 bytes playground/nextjs12/public/vercel.svg | 4 - playground/nextjs12/styles/Home.module.css | 129 ------------------ playground/nextjs12/styles/globals.css | 33 ----- playground/nextjs12/tsconfig.json | 25 ---- 38 files changed, 16 insertions(+), 944 deletions(-) create mode 100644 playground/nextjs/app/app-dir/client-component.tsx delete mode 100644 playground/nextjs12/.eslintrc.json delete mode 100644 playground/nextjs12/.gitignore delete mode 100644 playground/nextjs12/README.md delete mode 100644 playground/nextjs12/app/app-dir/client/page.tsx delete mode 100644 playground/nextjs12/app/app-dir/create-organization/page.tsx delete mode 100644 playground/nextjs12/app/app-dir/organization/page.tsx delete mode 100644 playground/nextjs12/app/app-dir/page.tsx delete mode 100644 playground/nextjs12/app/app-dir/sign-in/page.tsx delete mode 100644 playground/nextjs12/app/app-dir/sign-up/page.tsx delete mode 100644 playground/nextjs12/app/app-dir/user/page.tsx delete mode 100644 playground/nextjs12/app/layout.tsx delete mode 100644 playground/nextjs12/hooks/useColorScheme.ts delete mode 100644 playground/nextjs12/middleware.ts delete mode 100644 playground/nextjs12/next-env.d.ts delete mode 100644 playground/nextjs12/next.config.js delete mode 100644 playground/nextjs12/package.json delete mode 100644 playground/nextjs12/pages/_app.tsx delete mode 100644 playground/nextjs12/pages/api/hello-edge.ts delete mode 100644 playground/nextjs12/pages/api/hello.ts delete mode 100644 playground/nextjs12/pages/create-organization/[[...index]].tsx delete mode 100644 playground/nextjs12/pages/index.tsx delete mode 100644 playground/nextjs12/pages/organization/[[...index]].tsx delete mode 100644 playground/nextjs12/pages/redirect-helpers/index.tsx delete mode 100644 playground/nextjs12/pages/session-examples/index.tsx delete mode 100644 playground/nextjs12/pages/sign-in/[[...index]].tsx delete mode 100644 playground/nextjs12/pages/sign-up/[[...index]].tsx delete mode 100644 playground/nextjs12/pages/user-examples/index.tsx delete mode 100644 playground/nextjs12/pages/user/[[...index]].tsx delete mode 100644 playground/nextjs12/public/favicon.ico delete mode 100644 playground/nextjs12/public/vercel.svg delete mode 100644 playground/nextjs12/styles/Home.module.css delete mode 100644 playground/nextjs12/styles/globals.css delete mode 100644 playground/nextjs12/tsconfig.json diff --git a/packages/nextjs/src/server/__tests__/__snapshots__/exports.test.ts.snap b/packages/nextjs/src/server/__tests__/__snapshots__/exports.test.ts.snap index f6dbeba59f..17c471ccec 100644 --- a/packages/nextjs/src/server/__tests__/__snapshots__/exports.test.ts.snap +++ b/packages/nextjs/src/server/__tests__/__snapshots__/exports.test.ts.snap @@ -6,6 +6,7 @@ exports[`/server public exports should not include a breaking change 1`] = ` "authMiddleware", "buildClerkProps", "clerkClient", + "createClerkClient", "currentUser", "getAuth", "redirectToSignIn", diff --git a/playground/nextjs/app/app-dir/client-component.tsx b/playground/nextjs/app/app-dir/client-component.tsx new file mode 100644 index 0000000000..cc286b6ebb --- /dev/null +++ b/playground/nextjs/app/app-dir/client-component.tsx @@ -0,0 +1,11 @@ +'use client'; + +import React from 'react'; +import { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/nextjs/errors'; + +export const ClientComponent = () => { + React.useEffect(() => { + console.log({ isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError }); + }); + return
Client Component
; +}; diff --git a/playground/nextjs/app/app-dir/page.tsx b/playground/nextjs/app/app-dir/page.tsx index a3c307286c..208d0ed82f 100644 --- a/playground/nextjs/app/app-dir/page.tsx +++ b/playground/nextjs/app/app-dir/page.tsx @@ -1,20 +1,11 @@ -import { - auth, - clerkClient, - currentUser, - OrganizationSwitcher, - SignedIn, - SignedOut, - SignIn, - UserButton, -} from '@clerk/nextjs'; +import { OrganizationSwitcher, SignedIn, SignedOut, SignIn, UserButton } from '@clerk/nextjs'; +import { auth, clerkClient, currentUser } from '@clerk/nextjs/server'; import Link from 'next/link'; export default async function Page() { const { userId } = auth(); const currentUser_ = await currentUser(); const user = userId ? await clerkClient.users.getUser(userId) : null; - console.log({ userId, currentUser_, user }); return (
diff --git a/playground/nextjs/pages/session-examples/index.tsx b/playground/nextjs/pages/session-examples/index.tsx index ca392b7c9a..09827464c4 100644 --- a/playground/nextjs/pages/session-examples/index.tsx +++ b/playground/nextjs/pages/session-examples/index.tsx @@ -1,4 +1,4 @@ -import { useSession, withSession, WithSession, WithSessionProp } from '@clerk/nextjs'; +import { useSession } from '@clerk/nextjs'; import { PublicUserData } from '@clerk/types'; import type { NextPage } from 'next'; import React from 'react'; @@ -20,36 +20,12 @@ function PublicMetadataWithHook() { return