Skip to content

Commit b40cc6d

Browse files
committed
cleanup of old code
1 parent 62ac76a commit b40cc6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1455
-3139
lines changed

.github/copilot-instructions.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
applyTo: '**'
3+
---
4+
Provide project context and coding guidelines that AI should follow when generating code, answering questions, or reviewing changes.
5+
6+
Whenever you want to build the packages to test if they work you should run `pnpm run build` from the root of the repository.
7+
8+
If you want to run tests you can run `pnpm run test` from the root of the repository.
9+
10+
If you want to check if the examples work you need to go to `test-apps/<example-name>` and run `pnpm run dev`.
11+
12+
When writing code, please follow these guidelines:
13+
- Use TypeScript for all new code.
14+
- Ensure all new code is covered by tests.
15+
- Do not use `any` type; prefer specific types or generics.
16+
- Follow existing code style and conventions.
17+
18+
If you get an error "address already in use :::42069 you should kill the process using that port.
19+
20+
If we add a new functionality add a section about it in the `docs/content` folder explaining how to use it and update the `README.md` file to mention it.
21+
22+
Write tests for any new functionality.
23+
24+
When defining new types, first check if the types exist somewhere and re-use them, do not create new types that are similar to existing ones.
25+
26+
When modifying existing functionality, ensure backward compatibility unless there's a strong reason to introduce breaking changes. If breaking changes are necessary, document them clearly in the relevant documentation files.

docs/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@content-collections/remix-vite": "0.2.2",
3737
"@epic-web/client-hints": "1.3.5",
3838
"@forge42/seo-tools": "1.3.0",
39-
"@react-router/node": "^7.5.3",
39+
"@react-router/node": "7.9.3",
4040
"@tsparticles/engine": "^3.3.0",
4141
"@tsparticles/react": "^3.0.0",
4242
"@tsparticles/slim": "^3.3.0",
@@ -51,7 +51,7 @@
5151
"react": "^19.1.0",
5252
"react-dom": "^19.1.0",
5353
"react-i18next": "15.4.0",
54-
"react-router": "^7.5.3",
54+
"react-router": "^7.9.3",
5555
"react-router-hono-server": "2.10.0",
5656
"rehype-slug": "6.0.0",
5757
"remix-hono": "0.0.18",
@@ -64,7 +64,7 @@
6464
"devDependencies": {
6565
"@babel/preset-typescript": "7.26.0",
6666
"@dotenvx/dotenvx": "1.34.0",
67-
"@react-router/dev": "^7.5.3",
67+
"@react-router/dev": "7.9.3",
6868
"@tailwindcss/typography": "0.5.16",
6969
"@tailwindcss/vite": "^4.1.4",
7070
"@testing-library/react": "16.2.0",
@@ -102,4 +102,4 @@
102102
"node": ">=22.17.0",
103103
"pnpm": ">=10.18.0"
104104
}
105-
}
105+
}

packages/react-router-devtools/package.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@
5959
"require": "./dist/client.css"
6060
}
6161
},
62-
"files": [
63-
"dist"
64-
],
62+
"files": ["dist"],
6563
"repository": {
6664
"type": "git",
6765
"url": "git+https://github.com/forge-42/react-router-devtools.git"
@@ -116,11 +114,9 @@
116114
"@types/babel__core": "^7.20.5",
117115
"@types/babel__generator": "^7.27.0",
118116
"@types/babel__traverse": "^7.28.0",
119-
"@types/beautify": "^0.0.3",
120117
"@types/node": "22.13.1",
121118
"@vitest/coverage-v8": "3.0.5",
122119
"@vitest/ui": "3.0.5",
123-
"autoprefixer": "^10.4.20",
124120
"happy-dom": "16.8.1",
125121
"jest-preview": "^0.3.1",
126122
"npm-run-all": "4.1.5",
@@ -138,25 +134,20 @@
138134
"@babel/traverse": "^7.26.10",
139135
"@babel/types": "^7.26.10",
140136
"@radix-ui/react-accordion": "^1.2.2",
141-
"@radix-ui/react-select": "^2.1.5",
142137
"@tanstack/devtools-event-client": "^0.3.3",
143138
"@tanstack/devtools-vite": "^0.3.11",
144139
"@tanstack/react-devtools": "^0.8.0",
145-
"beautify": "^0.0.8",
146140
"chalk": "5.4.1",
147141
"clsx": "2.1.1",
148-
"date-fns": "^4.1.0",
149142
"framer-motion": "^11.0.8",
150143
"goober": "^2.1.18",
151144
"react-d3-tree": "^3.6.4",
152-
"react-diff-viewer-continued": "^4.0.5",
153145
"react-hotkeys-hook": "^4.6.1",
154-
"react-tooltip": "^5.28.0",
155-
"tailwind-merge": "3.0.1"
146+
"react-tooltip": "^5.28.0"
156147
},
157148
"optionalDependencies": {
158149
"@biomejs/cli-darwin-arm64": "^1.9.4",
159150
"@rollup/rollup-darwin-arm64": "^4.32.1",
160151
"@rollup/rollup-linux-x64-gnu": "^4.32.1"
161152
}
162-
}
153+
}

packages/react-router-devtools/src/client/components/CacheInfo.tsx

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

packages/react-router-devtools/src/client/components/Input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
55
hint?: string
66
}
77

8-
export const Label = ({ className, children, ...props }: React.HTMLProps<HTMLLabelElement>) => {
8+
const Label = ({ className, children, ...props }: React.HTMLProps<HTMLLabelElement>) => {
99
const { styles } = useStyles()
1010
return (
1111
<label htmlFor={props.name} className={cx(styles.input.label, className)} {...props}>
@@ -14,7 +14,7 @@ export const Label = ({ className, children, ...props }: React.HTMLProps<HTMLLab
1414
)
1515
}
1616

17-
export const Hint = ({ children }: React.HTMLProps<HTMLParagraphElement>) => {
17+
const Hint = ({ children }: React.HTMLProps<HTMLParagraphElement>) => {
1818
const { styles } = useStyles()
1919
return <p className={styles.input.hint}>{children}</p>
2020
}
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import type { ReactNode } from "react"
2-
import { useStyles } from "../styles/use-styles.js"
3-
4-
interface RouteSegmentBodyProps {
5-
children: ReactNode
6-
}
7-
8-
const RouteSegmentBody = ({ children }: RouteSegmentBodyProps) => {
9-
const { styles } = useStyles()
10-
11-
return <div className={styles.routeSegmentCard.body}>{children}</div>
12-
}
13-
14-
export { RouteSegmentBody }
1+
import type { ReactNode } from "react"
2+
import { useStyles } from "../styles/use-styles.js"
3+
4+
interface RouteSegmentBodyProps {
5+
children: ReactNode
6+
}
7+
8+
const RouteSegmentBody = ({ children }: RouteSegmentBodyProps) => {
9+
const { styles } = useStyles()
10+
11+
return <div className={styles.routeSegmentCard.body}>{children}</div>
12+
}
13+
14+
export { RouteSegmentBody }
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
import type { ReactNode } from "react"
2-
import { useStyles } from "../styles/use-styles.js"
3-
4-
interface RouteSegmentCardProps {
5-
children: ReactNode
6-
onMouseEnter?: () => void
7-
onMouseLeave?: () => void
8-
"data-testid"?: string
9-
}
10-
11-
const RouteSegmentCard = ({
12-
children,
13-
onMouseEnter,
14-
onMouseLeave,
15-
"data-testid": dataTestId,
16-
}: RouteSegmentCardProps) => {
17-
const { styles } = useStyles()
18-
19-
return (
20-
<li
21-
data-testid={dataTestId}
22-
onMouseEnter={onMouseEnter}
23-
onMouseLeave={onMouseLeave}
24-
className={styles.routeSegmentCard.item}
25-
>
26-
{children}
27-
</li>
28-
)
29-
}
30-
31-
export { RouteSegmentCard }
1+
import type { ReactNode } from "react"
2+
import { useStyles } from "../styles/use-styles.js"
3+
4+
interface RouteSegmentCardProps {
5+
children: ReactNode
6+
onMouseEnter?: () => void
7+
onMouseLeave?: () => void
8+
"data-testid"?: string
9+
}
10+
11+
const RouteSegmentCard = ({
12+
children,
13+
onMouseEnter,
14+
onMouseLeave,
15+
"data-testid": dataTestId,
16+
}: RouteSegmentCardProps) => {
17+
const { styles } = useStyles()
18+
19+
return (
20+
<li
21+
data-testid={dataTestId}
22+
onMouseEnter={onMouseEnter}
23+
onMouseLeave={onMouseLeave}
24+
className={styles.routeSegmentCard.item}
25+
>
26+
{children}
27+
</li>
28+
)
29+
}
30+
31+
export { RouteSegmentCard }
Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
import type { ReactNode } from "react"
2-
import { cx, useStyles } from "../styles/use-styles.js"
3-
import { Icon } from "./icon/Icon.js"
4-
5-
type RouteColor = "green" | "blue" | "teal" | "red" | "purple"
6-
7-
interface RouteSegmentHeaderProps {
8-
icon: "Root" | "Layout" | "CornerDownRight"
9-
color: RouteColor
10-
title: string
11-
subtitle?: string
12-
rightContent?: ReactNode
13-
}
14-
15-
const RouteSegmentHeader = ({ icon, color, title, subtitle, rightContent }: RouteSegmentHeaderProps) => {
16-
const { styles } = useStyles()
17-
18-
return (
19-
<div className={styles.routeSegmentCard.header}>
20-
<div
21-
className={cx(
22-
styles.routeSegmentCard.icon,
23-
styles.routeSegmentCard[
24-
`icon${color.charAt(0).toUpperCase() + color.slice(1)}` as keyof typeof styles.routeSegmentCard
25-
]
26-
)}
27-
>
28-
<Icon name={icon} size="sm" />
29-
</div>
30-
<h2 className={styles.routeSegmentCard.title}>
31-
{title}
32-
{subtitle && <span className={styles.routeSegmentCard.subtitle}> ({subtitle})</span>}
33-
</h2>
34-
{rightContent && <div className={styles.routeSegmentCard.headerActions}>{rightContent}</div>}
35-
</div>
36-
)
37-
}
38-
39-
export { RouteSegmentHeader }
40-
export type { RouteColor }
1+
import type { ReactNode } from "react"
2+
import { cx, useStyles } from "../styles/use-styles.js"
3+
import { Icon } from "./icon/Icon.js"
4+
5+
type RouteColor = "green" | "blue" | "teal" | "red" | "purple"
6+
7+
interface RouteSegmentHeaderProps {
8+
icon: "Root" | "Layout" | "CornerDownRight"
9+
color: RouteColor
10+
title: string
11+
subtitle?: string
12+
rightContent?: ReactNode
13+
}
14+
15+
const RouteSegmentHeader = ({ icon, color, title, subtitle, rightContent }: RouteSegmentHeaderProps) => {
16+
const { styles } = useStyles()
17+
18+
return (
19+
<div className={styles.routeSegmentCard.header}>
20+
<div
21+
className={cx(
22+
styles.routeSegmentCard.icon,
23+
styles.routeSegmentCard[
24+
`icon${color.charAt(0).toUpperCase() + color.slice(1)}` as keyof typeof styles.routeSegmentCard
25+
]
26+
)}
27+
>
28+
<Icon name={icon} size="sm" />
29+
</div>
30+
<h2 className={styles.routeSegmentCard.title}>
31+
{title}
32+
{subtitle && <span className={styles.routeSegmentCard.subtitle}> ({subtitle})</span>}
33+
</h2>
34+
{rightContent && <div className={styles.routeSegmentCard.headerActions}>{rightContent}</div>}
35+
</div>
36+
)
37+
}
38+
39+
export { RouteSegmentHeader }
40+
export type { RouteColor }

0 commit comments

Comments
 (0)