Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit aef018d

Browse files
authored
Merge pull request #3 from perkinsjr/remove-auth-package
Remove Auth Package, Fix lint and update package names
2 parents d77f35a + 256c531 commit aef018d

12 files changed

+1667
-1639
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# create-t3-turbo-with-clerk
22

3+
[![CI](https://github.com/perkinsjr/t3-turbo-and-clerk/actions/workflows/ci.yml/badge.svg)](https://github.com/perkinsjr/t3-turbo-and-clerk/actions/workflows/ci.yml)
4+
35
## About
46

5-
This takes the original create-t3-turbo and adds clerk allowing you to have one auth package for both Expo and Next.js. You will notice there is no longer an auth package as it is not requried.
7+
This takes the original create-t3-turbo and adds Clerk allowing you to have one auth package for both Expo and Next.js. You will notice there is no longer an auth package as it is not requried.
68

79
It uses [Turborepo](https://turborepo.org/) and contains:
810

apps/expo/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
"dependencies": {
1515
"@acme/api": "*",
1616
"@acme/tailwind-config": "*",
17+
"@clerk/clerk-expo": "0.10.6",
1718
"@shopify/flash-list": "^1.4.0",
1819
"@tanstack/react-query": "^4.16.1",
1920
"@trpc/client": "^10.1.0",
2021
"@trpc/react-query": "^10.1.0",
2122
"@trpc/server": "^10.1.0",
22-
"@clerk/clerk-expo": "0.10.6",
2323
"expo": "~47.0.6",
24-
"expo-status-bar": "~1.4.2",
25-
"nativewind": "^2.0.11",
2624
"expo-auth-session": "^3.7.3",
27-
"expo-secure-store": "^12.0.0",
2825
"expo-random": "^13.0.0",
26+
"expo-secure-store": "^12.0.0",
27+
"expo-status-bar": "~1.4.2",
28+
"nativewind": "^2.0.11",
2929
"react": "18.2.0",
3030
"react-dom": "18.2.0",
3131
"react-native": "0.71.0-rc.0",

apps/nextjs/next.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const config = {
1111
swcMinify: true,
1212
experimental: {
1313
// Enables hot-reload and easy integration for local packages
14-
transpilePackages: ["@acme/api", "@acme/auth", "@acme/db"],
14+
transpilePackages: ["@acme/api", "@acme/db"],
1515
},
1616
// We already do linting on GH actions
1717
eslint: {

apps/nextjs/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
},
1414
"dependencies": {
1515
"@acme/api": "*",
16-
"@acme/auth": "*",
1716
"@acme/db": "*",
1817
"@acme/tailwind-config": "*",
18+
"@clerk/nextjs": "4.6.7",
1919
"@tanstack/react-query": "^4.16.1",
2020
"@trpc/client": "^10.1.0",
2121
"@trpc/next": "^10.1.0",
2222
"@trpc/react-query": "^10.1.0",
2323
"@trpc/server": "^10.1.0",
24-
"@clerk/nextjs": "4.6.7",
2524
"next": "^13.0.5",
2625
"react": "18.2.0",
2726
"react-dom": "18.2.0",

apps/nextjs/src/pages/index.tsx

+17-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Head from "next/head";
33
import { trpc } from "../utils/trpc";
44
import type { inferProcedureOutput } from "@trpc/server";
55
import type { AppRouter } from "@acme/api";
6-
import { useAuth, UserButton, useUser } from "@clerk/nextjs";
6+
import { useAuth, useUser } from "@clerk/nextjs";
77
import Link from "next/link";
88

99
const PostCard: React.FC<{
@@ -68,8 +68,22 @@ const AuthShowcase: React.FC = () => {
6868
{isSignedIn && (
6969
<p className="text-center text-2xl text-white">
7070
{user && <span>Logged in as {user?.fullName}</span>}
71-
{secretMessage && <span> - {secretMessage}</span>}
72-
<button onClick={signOut}>Sign Out</button>
71+
{secretMessage && (
72+
<span>
73+
{" "}
74+
- {secretMessage} <br />{" "}
75+
</span>
76+
)}
77+
{
78+
<>
79+
<br />
80+
{
81+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
82+
//@ts-ignore
83+
<button onClick={signOut}>Sign Out</button>
84+
}
85+
</>
86+
}
7387
</p>
7488
)}
7589
{!isSignedIn && (

apps/nextjs/tsconfig.json

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
{
22
"extends": "../../tsconfig.json",
33
"exclude": [],
4-
"include": [
5-
"next-env.d.ts",
6-
"node_modules/@acme/auth/next-auth.d.ts",
7-
"**/*.ts",
8-
"**/*.tsx",
9-
"**/*.cjs",
10-
"**/*.mjs"
11-
]
4+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.cjs", "**/*.mjs"]
125
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "create-t3-turbo",
2+
"name": "t3-turbo-and-clerk",
33
"private": true,
44
"packageManager": "pnpm@7.13.0",
55
"scripts": {

packages/api/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"type-check": "tsc --noEmit"
1111
},
1212
"dependencies": {
13-
"@acme/auth": "*",
1413
"@acme/db": "*",
1514
"@trpc/client": "^10.1.0",
1615
"@trpc/server": "^10.1.0",

packages/api/src/router/auth.ts

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export const authRouter = router({
55
return ctx.user;
66
}),
77
getSecretMessage: protectedProcedure.query(() => {
8-
// testing type validation of overridden next-auth Session in @acme/auth package
98
return "you can see this secret message!";
109
}),
1110
});

packages/api/tsconfig.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{
22
"extends": "../../tsconfig.json",
3-
"include": [
4-
"src",
5-
"index.ts",
6-
"transformer.ts",
7-
"node_modules/@acme/auth/next-auth.d.ts"
8-
]
3+
"include": ["src", "index.ts", "transformer.ts"]
94
}

0 commit comments

Comments
 (0)