Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"ignorePatterns": [
"routeTree.gen.ts"
]
}
5 changes: 5 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "./tooling/oxlint/node_modules/oxlint/configuration_schema.json",
"extends": ["./tooling/oxlint/base.json"],
"ignorePatterns": ["turbo/generators/**"]
}
3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"expo.vscode-expo-tools",
"esbenp.prettier-vscode",
"oxc.oxc-vscode",
"yoavbls.pretty-ts-errors",
"bradlc.vscode-tailwindcss"
]
Expand Down
17 changes: 6 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.fixAll.oxc": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "oxc.oxc-vscode",
"[typescript,typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"editor.formatOnSave": true,
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"eslint.runtime": "node",
"eslint.workingDirectories": [
{ "pattern": "apps/*/" },
{ "pattern": "packages/*/" },
{ "pattern": "tooling/*/" }
],
"files.associations": {
"*.css": "tailwindcss"
},
Expand All @@ -23,7 +16,9 @@
"files.watcherExclude": {
"**/routeTree.gen.ts": true
},
"prettier.ignorePath": ".gitignore",
"oxc.fmt.experimental": true,
"oxc.unusedDisableDirectives": "deny",
"oxc.typeAware": true,
"tailwindCSS.classFunctions": ["cva", "cx", "cn"],
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.autoImportFileExcludePatterns": [
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ packages
└─ ui
└─ Start of a UI package for the webapp using shadcn-ui
tooling
├─ eslint
│ └─ shared, fine-grained, eslint presets
├─ prettier
│ └─ shared prettier configuration
├─ oxlint
│ └─ shared, fine-grained, oxlint presets
├─ tailwind
│ └─ shared tailwind theme and configuration
└─ typescript
Expand Down
7 changes: 7 additions & 0 deletions apps/expo/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": [
"./node_modules/@acme/oxlint-config/base.json",
"./node_modules/@acme/oxlint-config/react.json"
],
"ignorePatterns": ["*.config.js"]
}
12 changes: 0 additions & 12 deletions apps/expo/eslint.config.mts

This file was deleted.

10 changes: 2 additions & 8 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"dev:ios": "expo start --ios",
"android": "expo run:android",
"ios": "expo run:ios",
"format": "prettier --check . --ignore-path ../../.gitignore --ignore-path .prettierignore",
"lint": "eslint --flag unstable_native_nodejs_ts_config",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down Expand Up @@ -45,15 +43,11 @@
},
"devDependencies": {
"@acme/api": "workspace:*",
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/oxlint-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@types/react": "catalog:react19",
"eslint": "catalog:",
"prettier": "catalog:",
"tailwindcss": "catalog:",
"typescript": "catalog:"
},
"prettier": "@acme/prettier-config"
}
}
26 changes: 17 additions & 9 deletions apps/expo/src/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from "react";
import { useState, useTransition } from "react";
import { Pressable, Text, TextInput, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { Link, Stack } from "expo-router";
Expand Down Expand Up @@ -101,21 +101,29 @@ function CreatePost() {
function MobileAuth() {
const { data: session } = authClient.useSession();

const [isPending, startTransition] = useTransition();
const onPress = () => {
startTransition(async () => {
if (session) {
await authClient.signOut();
} else {
await authClient.signIn.social({
provider: "discord",
callbackURL: "/",
});
}
});
};

return (
<>
<Text className="text-foreground pb-2 text-center text-xl font-semibold">
{session?.user.name ? `Hello, ${session.user.name}` : "Not logged in"}
</Text>
<Pressable
onPress={() =>
session
? authClient.signOut()
: authClient.signIn.social({
provider: "discord",
callbackURL: "/",
})
}
className="bg-primary flex items-center rounded-sm p-2"
disabled={isPending}
onPress={onPress}
>
<Text>{session ? "Sign Out" : "Sign In With Discord"}</Text>
</Pressable>
Expand Down
7 changes: 7 additions & 0 deletions apps/nextjs/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": [
"./node_modules/@acme/oxlint-config/base.json",
"./node_modules/@acme/oxlint-config/react.json",
"./node_modules/@acme/oxlint-config/nextjs.json"
]
}
15 changes: 0 additions & 15 deletions apps/nextjs/eslint.config.ts

This file was deleted.

11 changes: 3 additions & 8 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"build": "pnpm with-env next build",
"clean": "git clean -xdf .cache .next .turbo node_modules",
"dev": "pnpm with-env next dev",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint --flag unstable_native_nodejs_ts_config",

"start": "pnpm with-env next start",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env --"
Expand All @@ -32,19 +31,15 @@
"zod": "catalog:"
},
"devDependencies": {
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/oxlint-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@types/node": "catalog:",
"@types/react": "catalog:react19",
"@types/react-dom": "catalog:react19",
"eslint": "catalog:",
"jiti": "^2.5.1",
"prettier": "catalog:",
"tailwindcss": "catalog:",
"tw-animate-css": "^1.4.0",
"typescript": "catalog:"
},
"prettier": "@acme/prettier-config"
}
}
1 change: 0 additions & 1 deletion apps/nextjs/src/trpc/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,5 @@ export function TRPCReactProvider(props: { children: React.ReactNode }) {
const getBaseUrl = () => {
if (typeof window !== "undefined") return window.location.origin;
if (env.VERCEL_URL) return `https://${env.VERCEL_URL}`;
// eslint-disable-next-line no-restricted-properties
return `http://localhost:${process.env.PORT ?? 3000}`;
};
5 changes: 2 additions & 3 deletions apps/nextjs/src/trpc/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ export function HydrateClient(props: { children: React.ReactNode }) {
</HydrationBoundary>
);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line no-explicit-any
export function prefetch<T extends ReturnType<TRPCQueryOptions<any>>>(
queryOptions: T,
) {
const queryClient = getQueryClient();
if (queryOptions.queryKey[1]?.type === "infinite") {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
void queryClient.prefetchInfiniteQuery(queryOptions as any);
void queryClient.prefetchInfiniteQuery(queryOptions as never);
} else {
void queryClient.prefetchQuery(queryOptions);
}
Expand Down
7 changes: 7 additions & 0 deletions apps/tanstack-start/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": [
"./node_modules/@acme/oxlint-config/base.json",
"./node_modules/@acme/oxlint-config/react.json"
],
"ignorePatterns": ["routeTree.gen.ts"]
}
1 change: 0 additions & 1 deletion apps/tanstack-start/.prettierignore

This file was deleted.

13 changes: 0 additions & 13 deletions apps/tanstack-start/eslint.config.ts

This file was deleted.

11 changes: 3 additions & 8 deletions apps/tanstack-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"dev": "pnpm with-env vite dev",
"build": "vite build",
"start": "vite start",
"format": "prettier --check . --ignore-path ../../.gitignore --ignore-path .prettierignore",
"lint": "eslint --flag unstable_native_nodejs_ts_config",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env --"
},
Expand Down Expand Up @@ -37,21 +35,18 @@
"zod": "catalog:"
},
"devDependencies": {
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/oxlint-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@tailwindcss/vite": "catalog:",
"@types/node": "catalog:",
"@types/react": "catalog:react19",
"@types/react-dom": "catalog:react19",
"@vitejs/plugin-react": "catalog:",
"eslint": "catalog:",
"prettier": "catalog:",

"tailwindcss": "catalog:",
"typescript": "catalog:",
"vite": "catalog:",
"vite-tsconfig-paths": "^5.1.4"
},
"prettier": "@acme/prettier-config"
}
}
43 changes: 23 additions & 20 deletions apps/tanstack-start/src/component/auth-showcase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@ import { useNavigate } from "@tanstack/react-router";
import { Button } from "@acme/ui/button";

import { authClient } from "~/auth/client";
import { useTransition } from "react";

export function AuthShowcase() {
const { data: session } = authClient.useSession();
const navigate = useNavigate();

const [isPending, startTransition] = useTransition();
const signIn = () => {
startTransition(async () => {
const res = await authClient.signIn.social({
provider: "discord",
callbackURL: "/",
});
if (!res.data?.url) {
throw new Error("No URL returned from signInSocial");
}
await navigate({ href: res.data.url, replace: true });
});
};
const signOut = () => {
startTransition(async () => {
await authClient.signOut();
await navigate({ href: "/", replace: true });
});
};

if (!session) {
return (
<Button
size="lg"
onClick={async () => {
const res = await authClient.signIn.social({
provider: "discord",
callbackURL: "/",
});
if (!res.data?.url) {
throw new Error("No URL returned from signInSocial");
}
await navigate({ href: res.data.url, replace: true });
}}
>
<Button size="lg" onClick={signIn} disabled={isPending}>
Sign in with Discord
</Button>
);
Expand All @@ -34,13 +43,7 @@ export function AuthShowcase() {
<span>Logged in as {session.user.name}</span>
</p>

<Button
size="lg"
onClick={async () => {
await authClient.signOut();
await navigate({ href: "/", replace: true });
}}
>
<Button size="lg" onClick={signOut} disabled={isPending}>
Sign out
</Button>
</div>
Expand Down
1 change: 0 additions & 1 deletion apps/tanstack-start/src/lib/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ export function getBaseUrl() {
return `https://${env.VERCEL_URL}`;
}

// eslint-disable-next-line no-restricted-properties
return `http://localhost:${process.env.PORT ?? 3001}`;
}
Loading
Loading