Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add option to use Geist Sans instead of Inter #1821

Merged
merged 11 commits into from
May 7, 2024
Prev Previous commit
Next Next commit
feat: set Geist Sans as default font, remove Inter option
  • Loading branch information
kakenbutter committed Apr 25, 2024
commit 33b3fd2dee0831c371f8bf4cd241a410e47783e5
5 changes: 4 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,8 @@
"type-fest": "^3.7.0",
"typescript": "^5.4.2",
"zod": "^3.23.3"
}
},
"trustedDependencies": [
"es5-ext"
kakenbutter marked this conversation as resolved.
Show resolved Hide resolved
]
}
1 change: 1 addition & 0 deletions cli/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ export const runCli = async (): Promise<CliResults> => {
if (project.authentication === "next-auth") packages.push("nextAuth");
if (project.database === "prisma") packages.push("prisma");
if (project.database === "drizzle") packages.push("drizzle");
packages.push("geist");
kakenbutter marked this conversation as resolved.
Show resolved Hide resolved

return {
appName: project.name ?? cliResults.appName,
Expand Down
3 changes: 3 additions & 0 deletions cli/src/installers/dependencyVersionMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ export const dependencyVersionMap = {
"@tanstack/react-query": "^5.25.0",
superjson: "^2.2.1",
"server-only": "^0.0.1",

// Geist
geist: "^1.3.0",
kakenbutter marked this conversation as resolved.
Show resolved Hide resolved
} as const;
export type AvailableDependencies = keyof typeof dependencyVersionMap;
10 changes: 10 additions & 0 deletions cli/src/installers/geist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { type Installer } from "~/installers/index.js";
import { addPackageDependency } from "~/utils/addPackageDependency.js";

export const geistInstaller: Installer = ({ projectDir }) => {
kakenbutter marked this conversation as resolved.
Show resolved Hide resolved
addPackageDependency({
projectDir,
dependencies: ["geist"],
devMode: true,
});
};
10 changes: 8 additions & 2 deletions cli/src/installers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { envVariablesInstaller } from "~/installers/envVars.js";
import { geistInstaller } from "~/installers/geist.js";
import { nextAuthInstaller } from "~/installers/nextAuth.js";
import { prismaInstaller } from "~/installers/prisma.js";
import { tailwindInstaller } from "~/installers/tailwind.js";
Expand All @@ -8,14 +9,15 @@ import { dbContainerInstaller } from "./dbContainer.js";
import { drizzleInstaller } from "./drizzle.js";
import { dynamicEslintInstaller } from "./eslint.js";

// Turning this into a const allows the list to be iterated over for programatically creating prompt options
// Should increase extensability in the future
// Turning this into a const allows the list to be iterated over for programmatically creating prompt options
// Should increase extensibility in the future
export const availablePackages = [
"nextAuth",
"prisma",
"drizzle",
"tailwind",
"trpc",
"geist",
"envVariables",
"eslint",
"dbContainer",
Expand Down Expand Up @@ -74,6 +76,10 @@ export const buildPkgInstallerMap = (
inUse: packages.includes("trpc"),
installer: trpcInstaller,
},
geist: {
inUse: packages.includes("geist"),
installer: geistInstaller,
},
dbContainer: {
inUse: ["mysql", "postgres"].includes(databaseProvider),
installer: dbContainerInstaller,
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/app/layout/base.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import "~/styles/globals.css";

import { Inter } from "next/font/google";

const inter = Inter({
subsets: ["latin"],
});
import { GeistSans } from "geist/font/sans";

export const metadata = {
title: "Create T3 App",
Expand All @@ -19,7 +15,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={GeistSans.className}>{children}</body>
</html>
);
}
9 changes: 2 additions & 7 deletions cli/template/extras/src/app/layout/with-trpc-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import "~/styles/globals.css";

import { Inter } from "next/font/google";
import { GeistSans } from "geist/font/sans";

import { TRPCReactProvider } from "~/trpc/react";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});

export const metadata = {
title: "Create T3 App",
description: "Generated by create-t3-app",
Expand All @@ -22,7 +17,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={`font-sans ${inter.variable}`}>
<body className={`${GeistSans.variable}`}>
<TRPCReactProvider>{children}</TRPCReactProvider>
</body>
</html>
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/app/layout/with-trpc.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import "~/styles/globals.css";

import { Inter } from "next/font/google";
import { GeistSans } from "geist/font/sans";

import { TRPCReactProvider } from "~/trpc/react";

const inter = Inter({
subsets: ["latin"],
});

export const metadata = {
title: "Create T3 App",
description: "Generated by create-t3-app",
Expand All @@ -21,7 +17,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={inter.className}>
<body className={GeistSans.className}>
<TRPCReactProvider>{children}</TRPCReactProvider>
</body>
</html>
Expand Down
9 changes: 2 additions & 7 deletions cli/template/extras/src/app/layout/with-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import "~/styles/globals.css";

import { Inter } from "next/font/google";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});
import { GeistSans } from "geist/font/sans";

export const metadata = {
title: "Create T3 App",
Expand All @@ -20,7 +15,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={`font-sans ${inter.variable}`}>{children}</body>
<body className={`${GeistSans.variable}`}>{children}</body>
</html>
);
}
8 changes: 2 additions & 6 deletions cli/template/extras/src/pages/_app/base.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { GeistSans } from "geist/font/sans";
import { type AppType } from "next/dist/shared/lib/utils";
import { Inter } from "next/font/google";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
});

const MyApp: AppType = ({ Component, pageProps }) => {
return (
<main className={inter.className}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
);
Expand Down
9 changes: 2 additions & 7 deletions cli/template/extras/src/pages/_app/with-auth-trpc-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
import { GeistSans } from "geist/font/sans";
import { type Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import { api } from "~/utils/api";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});

const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
return (
<SessionProvider session={session}>
<main className={`font-sans ${inter.variable}`}>
<main className={`${GeistSans.variable}`}>
<Component {...pageProps} />
</main>
</SessionProvider>
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/pages/_app/with-auth-trpc.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import { GeistSans } from "geist/font/sans";
import { type Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import { api } from "~/utils/api";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
});

const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
return (
<SessionProvider session={session}>
<main className={inter.className}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
</SessionProvider>
Expand Down
9 changes: 2 additions & 7 deletions cli/template/extras/src/pages/_app/with-auth-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import { GeistSans } from "geist/font/sans";
import { type Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});

const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
return (
<SessionProvider session={session}>
<main className={`font-sans ${inter.variable}`}>
<main className={`${GeistSans.variable}`}>
<Component {...pageProps} />
</main>
</SessionProvider>
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/pages/_app/with-auth.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import { GeistSans } from "geist/font/sans";
import { type Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
});

const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
return (
<SessionProvider session={session}>
<main className={inter.className}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
</SessionProvider>
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/pages/_app/with-trpc-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { GeistSans } from "geist/font/sans";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import { api } from "~/utils/api";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});
const MyApp: AppType = ({ Component, pageProps }) => {
return (
<main className={`font-sans ${inter.variable}`}>
<main className={`${GeistSans.variable}`}>
<Component {...pageProps} />
</main>
);
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/pages/_app/with-trpc.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { GeistSans } from "geist/font/sans";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import { api } from "~/utils/api";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
});

const MyApp: AppType = ({ Component, pageProps }) => {
return (
<main className={inter.className}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
);
Expand Down
9 changes: 2 additions & 7 deletions cli/template/extras/src/pages/_app/with-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { GeistSans } from "geist/font/sans";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});

const MyApp: AppType = ({ Component, pageProps }) => {
return (
<main className={`font-sans ${inter.variable}`}>
<main className={`${GeistSans.variable}`}>
<Component {...pageProps} />
</main>
);
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@
},
"dependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@changesets/cli": "^2.27.1",
"@manypkg/cli": "^0.20.0",
"@total-typescript/ts-reset": "^0.3.7",
"@types/eslint": "^8.56.2",
"@types/node": "^20.11.20",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@types/eslint": "^8.56.10",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-isaacscript": "^2.6.7",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.1",
"prettier": "^3.2.5",
"turbo": "1.13.3-canary.3",
"typescript": "^5.4.2"
"typescript": "^5.4.5"
}
}
Loading