Skip to content

Commit

Permalink
Update VSCode settings, add Tailwind CSS association, and configure T…
Browse files Browse the repository at this point in the history
…ypeScript SDK
  • Loading branch information
iceship committed Sep 18, 2024
1 parent 4e08d30 commit c50bb1a
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 161 deletions.
12 changes: 11 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "always"
"source.fixAll": "always",
"source.organizeImports": "always"
},
"files.associations": {
"*.css": "tailwindcss"
},
"typescript.tsdk": "node_modules\\typescript\\lib",
"workbench.editor.customLabels.patterns": {
"**/src/app/**/page.tsx": "${dirname} - Page",
"**/src/app/**/layout.tsx": "${dirname} - Layout",
"**/src/components/**/index.tsx": "${dirname} - Component"
}
}
6 changes: 5 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
experimental: {
typedRoutes: true,
},
};

export default nextConfig;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev -p 30001",
"build": "next build",
"start": "next start",
"lint": "next lint",
Expand Down
Binary file removed src/app/favicon.ico
Binary file not shown.
Binary file removed src/app/fonts/GeistMonoVF.woff
Binary file not shown.
Binary file removed src/app/fonts/GeistVF.woff
Binary file not shown.
24 changes: 0 additions & 24 deletions src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--background: #ffffff;
--foreground: #171717;
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}
43 changes: 12 additions & 31 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
import type { Metadata } from "next";
import localFont from "next/font/local";

import Example from "@/components/example";
import { Suspense } from "react";

import "./globals.css";

[].forEach((item) => {
console.log(item);
});

const firstName = "cj";
const lastName = "patoilo";
const fullName = `${firstName} ${lastName}`;
console.log(fullName);

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
});

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "Next.js Starter App",
description: "A basic starter for next.js",
};

export default function RootLayout({
Expand All @@ -36,12 +14,15 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
<Example />
<html lang="en" suppressHydrationWarning>
<head>
<link
rel="icon"
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>📦</text></svg>"
/>
</head>
<body>
<Suspense>{children}</Suspense>
</body>
</html>
);
Expand Down
102 changes: 2 additions & 100 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,101 +1,3 @@
import Image from "next/image";

export default function Home() {
return (
<div className="grid min-h-screen grid-rows-[20px_1fr_20px] items-center justify-items-center gap-16 p-8 pb-20 font-[family-name:var(--font-geist-sans)] sm:p-20">
<main className="row-start-2 flex flex-col items-center gap-8 sm:items-start">
<Image
className="dark:invert"
src="https://nextjs.org/icons/next.svg"
alt="Next.js logo"
width={180}
height={38}
priority
/>
<ol className="list-inside list-decimal text-center font-[family-name:var(--font-geist-mono)] text-sm sm:text-left">
<li className="mb-2">
Get started by editing{" "}
<code className="rounded bg-black/[.05] px-1 py-0.5 font-semibold dark:bg-white/[.06]">
src/app/page.tsx
</code>
.
</li>
<li>Save and see your changes instantly.</li>
</ol>

<div className="flex flex-col items-center gap-4 sm:flex-row">
<a
className="flex h-10 items-center justify-center gap-2 rounded-full border border-solid border-transparent bg-foreground px-4 text-sm text-background transition-colors hover:bg-[#383838] sm:h-12 sm:px-5 sm:text-base dark:hover:bg-[#ccc]"
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className="dark:invert"
src="https://nextjs.org/icons/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
/>
Deploy now
</a>
<a
className="flex h-10 items-center justify-center rounded-full border border-solid border-black/[.08] px-4 text-sm transition-colors hover:border-transparent hover:bg-[#f2f2f2] sm:h-12 sm:min-w-44 sm:px-5 sm:text-base dark:border-white/[.145] dark:hover:bg-[#1a1a1a]"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Read our docs
</a>
</div>
</main>
<footer className="row-start-3 flex flex-wrap items-center justify-center gap-6">
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/file.svg"
alt="File icon"
width={16}
height={16}
/>
Learn
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org →
</a>
</footer>
</div>
);
export default async function Home() {
return <p className="text-xl">A simple starter for Next.js</p>;
}
3 changes: 0 additions & 3 deletions src/components/ExampleThing.tsx

This file was deleted.

0 comments on commit c50bb1a

Please sign in to comment.