Skip to content

Commit 414ab70

Browse files
committed
refactor: simplify tsconfig files in website and examples
1 parent ae001b5 commit 414ab70

File tree

17 files changed

+77
-366
lines changed

17 files changed

+77
-366
lines changed

apps/website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@mdx-js/mdx": "^3.1.0",
4040
"@next/eslint-plugin-next": "^15.1.7",
4141
"@tailwindcss/postcss": "^4.0.8",
42+
"@tsconfig/next": "^2.0.3",
4243
"@tsconfig/node22": "^22.0.0",
4344
"@tsconfig/strictest": "^2.0.5",
4445
"@types/hast": "^3.0.4",

apps/website/tsconfig.json

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
{
22
"extends": [
3-
"@local/configs/tsconfig.base.json",
4-
"@tsconfig/node22/tsconfig.json"
3+
"@tsconfig/strictest/tsconfig.json",
4+
"@tsconfig/node22/tsconfig.json",
5+
"@tsconfig/next/tsconfig.json"
56
],
67
"compilerOptions": {
78
"baseUrl": ".",
89
"target": "ESNext",
9-
"lib": ["dom", "dom.iterable", "esnext"],
10-
"allowJs": true,
11-
"skipLibCheck": true,
12-
"strict": true,
10+
"lib": [
11+
"dom",
12+
"dom.iterable",
13+
"esnext"
14+
],
1315
"erasableSyntaxOnly": true,
14-
"forceConsistentCasingInFileNames": true,
15-
"noEmit": true,
16-
"esModuleInterop": true,
17-
"module": "esnext",
18-
"moduleResolution": "bundler",
19-
"resolveJsonModule": true,
20-
"isolatedModules": true,
21-
"verbatimModuleSyntax": true,
22-
"jsx": "preserve",
23-
"incremental": true,
2416
"paths": {
2517
"#": ["."],
2618
"#/*": ["./*"]

examples/next-app/.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
# dependencies
44
/node_modules
55
/.pnp
6-
.pnp.js
7-
.yarn/install-state.gz
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
812

913
# testing
1014
/coverage
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function HelloWorld() {
2+
return (
3+
<div>
4+
Hello World!
5+
</div>
6+
);
7+
}

examples/next-app/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "../styles/globals.css";
1+
import "./style.css";
22

33
export default function RootLayout({
44
children,

examples/next-app/app/page.tsx

Lines changed: 3 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,9 @@
1-
"use client";
2-
import { useState } from "react";
3-
import { HamburgerMenuIcon, DotFilledIcon, CheckIcon, ChevronRightIcon } from "@radix-ui/react-icons";
4-
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
5-
6-
function RightSlot({ children }) {
7-
return (
8-
<div className="ml-auto pl-4 text-gray-500 group-hover:text-gray-200">
9-
{children}
10-
</div>
11-
);
12-
}
13-
14-
function DropdownMenuItem({ children, ...props }) {
15-
return (
16-
<DropdownMenu.Item
17-
{...props}
18-
className={"group bg-white hover:bg-gray-700 hover:text-gray-200 text-xs rounded flex items-center h-6 px-1 pl-6 relative select-none"
19-
+ (props.disabled ? " text-gray-500" : "")}
20-
>
21-
{children}
22-
</DropdownMenu.Item>
23-
);
24-
}
25-
26-
function DropdownMenuCheckboxItem({ children, ...props }) {
27-
return (
28-
<DropdownMenu.CheckboxItem
29-
{...props}
30-
className="group bg-white hover:bg-gray-700 hover:text-gray-200 text-xs rounded flex items-center h-6 px-1 pl-6 relative select-none"
31-
>
32-
{children}
33-
</DropdownMenu.CheckboxItem>
34-
);
35-
}
36-
37-
function DropdownMenuItemIndicator({ children, ...props }) {
38-
return (
39-
<DropdownMenu.ItemIndicator
40-
{...props}
41-
className="absolute left-0 w-6 inline-flex items-center justify-center"
42-
>
43-
{children}
44-
</DropdownMenu.ItemIndicator>
45-
);
46-
}
47-
48-
function Separator() {
49-
return <DropdownMenu.Separator className="h-[1px] bg-gray-300 m-1" />;
50-
}
51-
52-
function DropdownMenuRadioItem({
53-
children,
54-
...props
55-
}: {
56-
children: React.ReactNode;
57-
value: string;
58-
}) {
59-
return (
60-
<DropdownMenu.RadioItem
61-
{...props}
62-
className="bg-white hover:bg-gray-700 hover:text-gray-200 text-xs rounded flex items-center h-6 px-1 pl-6 relative select-none"
63-
>
64-
{children}
65-
</DropdownMenu.RadioItem>
66-
);
67-
}
1+
import HelloWorld from "./_component/hello-world";
682

693
export default function Home() {
70-
const [bookmarksChecked, setBookmarksChecked] = useState(true);
71-
const [urlsChecked, setUrlsChecked] = useState(false);
72-
const [person, setPerson] = useState("pedro");
734
return (
74-
<div className="h-screen w-full flex flex-col space-y-4 items-center justify-center bg-gradient-to-r from-cyan-500 to-blue-500">
75-
<h1 className="text-6xl text-white font-semibold">
76-
Radix UI + Tailwind CSS
77-
</h1>
78-
<h1 className="text-4xl text-white font-semibold">Click me!</h1>
79-
80-
<DropdownMenu.Root>
81-
<DropdownMenu.Trigger
82-
asChild
83-
className="bg-white text-xs rounded-3xl flex items-center h-8 px-2 relative select-none"
84-
>
85-
<button
86-
type="button"
87-
aria-label="Customize options"
88-
className="h-8 w-8 inline-flex items-center justify-center shadow-lg"
89-
>
90-
<HamburgerMenuIcon />
91-
</button>
92-
</DropdownMenu.Trigger>
93-
94-
<DropdownMenu.Content
95-
sideOffset={5}
96-
className="bg-white rounded p-1 shadow-lg"
97-
>
98-
<DropdownMenuItem>
99-
New Tab <RightSlot>⌘+T</RightSlot>
100-
</DropdownMenuItem>
101-
<DropdownMenuItem>
102-
New Window <RightSlot>⌘+N</RightSlot>
103-
</DropdownMenuItem>
104-
<DropdownMenuItem disabled>
105-
New Private Window <RightSlot>⇧+⌘+N</RightSlot>
106-
</DropdownMenuItem>
107-
<DropdownMenu.Sub>
108-
<DropdownMenu.SubTrigger className="group bg-white hover:bg-gray-700 hover:text-gray-200 hover:border-0 text-xs rounded flex items-center h-6 px-1 pl-6 relative select-none">
109-
More Tools
110-
<RightSlot>
111-
<ChevronRightIcon />
112-
</RightSlot>
113-
</DropdownMenu.SubTrigger>
114-
<DropdownMenu.SubContent
115-
sideOffset={2}
116-
alignOffset={-5}
117-
className="bg-white rounded p-1 shadow-lg"
118-
>
119-
<DropdownMenuItem>
120-
Save Page As… <RightSlot>⌘+S</RightSlot>
121-
</DropdownMenuItem>
122-
<DropdownMenuItem>Create Shortcut…</DropdownMenuItem>
123-
<DropdownMenuItem>Name Window…</DropdownMenuItem>
124-
<Separator />
125-
<DropdownMenuItem>Developer Tools</DropdownMenuItem>
126-
</DropdownMenu.SubContent>
127-
</DropdownMenu.Sub>
128-
<Separator />
129-
<DropdownMenuCheckboxItem
130-
checked={bookmarksChecked}
131-
onCheckedChange={setBookmarksChecked}
132-
>
133-
<DropdownMenuItemIndicator>
134-
<CheckIcon />
135-
</DropdownMenuItemIndicator>
136-
Show Bookmarks <RightSlot>⌘+B</RightSlot>
137-
</DropdownMenuCheckboxItem>
138-
<DropdownMenuCheckboxItem
139-
checked={urlsChecked}
140-
onCheckedChange={setUrlsChecked}
141-
>
142-
<DropdownMenuItemIndicator>
143-
<CheckIcon />
144-
</DropdownMenuItemIndicator>
145-
Show Full URLs
146-
</DropdownMenuCheckboxItem>
147-
<Separator />
148-
<DropdownMenu.Label className="pl-6 leading-6 text-xs text-gray-700">
149-
Contributors
150-
</DropdownMenu.Label>
151-
152-
<DropdownMenu.RadioGroup value={person} onValueChange={setPerson}>
153-
<DropdownMenuRadioItem value="pedro">
154-
<DropdownMenuItemIndicator>
155-
<DotFilledIcon />
156-
</DropdownMenuItemIndicator>
157-
Pedro Sanchez
158-
</DropdownMenuRadioItem>
159-
<DropdownMenuRadioItem value="pablo">
160-
<DropdownMenuItemIndicator>
161-
<DotFilledIcon />
162-
</DropdownMenuItemIndicator>
163-
Pablo Sanchez
164-
</DropdownMenuRadioItem>
165-
</DropdownMenu.RadioGroup>
166-
</DropdownMenu.Content>
167-
</DropdownMenu.Root>
5+
<div className="example">
6+
<HelloWorld />
1687
</div>
1698
);
1709
}

examples/next-app/app/style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:root {
2+
--some-color: red;
3+
}
4+
5+
body {
6+
color: var(--some-color);
7+
}

examples/next-app/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
"start": "next start"
1010
},
1111
"dependencies": {
12-
"@radix-ui/react-dropdown-menu": "2.1.6",
13-
"@radix-ui/react-icons": "1.3.2",
1412
"next": "^15.1.7",
1513
"react": "^19.0.0",
1614
"react-dom": "^19.0.0"
@@ -20,18 +18,16 @@
2018
"@eslint/config-inspector": "^1.0.0",
2119
"@eslint/js": "^9.21.0",
2220
"@next/eslint-plugin-next": "^15.1.7",
23-
"@tailwindcss/postcss": "^4.0.8",
24-
"@types/negotiator": "^0.6.3",
21+
"@tsconfig/next": "^2.0.3",
22+
"@tsconfig/node22": "^22.0.0",
23+
"@tsconfig/strictest": "^2.0.5",
2524
"@types/node": "^22.13.5",
2625
"@types/react": "^19.0.10",
2726
"@types/react-dom": "^19.0.4",
28-
"autoprefixer": "^10.4.20",
2927
"eslint": "^9.21.0",
3028
"eslint-config-flat-gitignore": "^2.1.0",
3129
"eslint-plugin-react-hooks": "^5.1.0",
3230
"eslint-plugin-react-refresh": "^0.4.19",
33-
"postcss": "^8.5.3",
34-
"tailwindcss": "4.0.8",
3531
"typescript": "^5.7.3",
3632
"typescript-eslint": "^8.24.1"
3733
},

examples/next-app/postcss.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/next-app/styles/globals.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)