From 7e23081c2fe32ff419b91c0312b87e75f85c5cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=B1=E3=82=A4=E3=83=A9?= Date: Fri, 22 Aug 2025 09:00:03 -0600 Subject: [PATCH] chore: fix vite types (#19477) --- .../DeploymentBanner/DeploymentBannerView.tsx | 108 ++++++++---------- site/tsconfig.json | 8 +- site/tsconfig.test.json | 5 - 3 files changed, 51 insertions(+), 70 deletions(-) delete mode 100644 site/tsconfig.test.json diff --git a/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.tsx b/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.tsx index 2c0732053f..4f9838e025 100644 --- a/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.tsx +++ b/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.tsx @@ -1,4 +1,3 @@ -import type { CSSInterpolation } from "@emotion/css/dist/declarations/src/create-instance"; import { css, type Interpolation, type Theme, useTheme } from "@emotion/react"; import Button from "@mui/material/Button"; import Link from "@mui/material/Link"; @@ -15,7 +14,6 @@ import { TerminalIcon } from "components/Icons/TerminalIcon"; import { VSCodeIcon } from "components/Icons/VSCodeIcon"; import { Stack } from "components/Stack/Stack"; import dayjs from "dayjs"; -import { type ClassName, useClassName } from "hooks/useClassName"; import { AppWindowIcon, CircleAlertIcon, @@ -53,7 +51,6 @@ export const DeploymentBannerView: FC = ({ fetchStats, }) => { const theme = useTheme(); - const summaryTooltip = useClassName(classNames.summaryTooltip, []); const aggregatedMinutes = useMemo(() => { if (!stats) { @@ -128,7 +125,10 @@ export const DeploymentBannerView: FC = ({ }} > 0 ? ( <> @@ -236,10 +236,10 @@ export const DeploymentBannerView: FC = ({
{typeof stats?.session_count.vscode === "undefined" ? "-" @@ -251,10 +251,10 @@ export const DeploymentBannerView: FC = ({
{typeof stats?.session_count.jetbrains === "undefined" ? "-" @@ -303,20 +303,20 @@ export const DeploymentBannerView: FC = ({ css={[ styles.value, css` - margin: 0; - padding: 0 8px; - height: unset; - min-height: unset; - font-size: unset; - color: unset; - border: 0; - min-width: unset; - font-family: inherit; + margin: 0; + padding: 0 8px; + height: unset; + min-height: unset; + font-size: unset; + color: unset; + border: 0; + min-width: unset; + font-family: inherit; - & svg { - margin-right: 4px; - } - `, + & svg { + margin-right: 4px; + } + `, ]} onClick={() => { if (fetchStats) { @@ -410,41 +410,27 @@ const getHealthErrors = (health: HealthcheckReport) => { return warnings; }; -const classNames = { - summaryTooltip: (css, theme) => css` - ${theme.typography.body2 as CSSInterpolation} - - margin: 0 0 4px 12px; - width: 400px; - padding: 16px; - color: ${theme.palette.text.primary}; - background-color: ${theme.palette.background.paper}; - border: 1px solid ${theme.palette.divider}; - pointer-events: none; - `, -} satisfies Record; - const styles = { statusBadge: (theme) => css` - display: flex; - align-items: center; - justify-content: center; - padding: 0 12px; - height: 100%; - color: ${theme.experimental.l1.text}; + display: flex; + align-items: center; + justify-content: center; + padding: 0 12px; + height: 100%; + color: ${theme.experimental.l1.text}; - & svg { - width: 16px; - height: 16px; - } - `, + & svg { + width: 16px; + height: 16px; + } + `, unhealthy: { backgroundColor: colors.red[700], }, group: css` - display: flex; - align-items: center; - `, + display: flex; + align-items: center; + `, category: (theme) => ({ marginRight: 16, color: theme.palette.text.primary, @@ -455,15 +441,15 @@ const styles = { color: theme.palette.text.secondary, }), value: css` - display: flex; - align-items: center; - gap: 4px; + display: flex; + align-items: center; + gap: 4px; - & svg { - width: 12px; - height: 12px; - } - `, + & svg { + width: 12px; + height: 12px; + } + `, separator: (theme) => ({ color: theme.palette.text.disabled, }), diff --git a/site/tsconfig.json b/site/tsconfig.json index 7e969d18c4..79b406d0f5 100644 --- a/site/tsconfig.json +++ b/site/tsconfig.json @@ -7,8 +7,8 @@ "jsx": "react-jsx", "jsxImportSource": "@emotion/react", "lib": ["dom", "dom.iterable", "esnext"], - "module": "esnext", - "moduleResolution": "node", + "module": "preserve", + "moduleResolution": "bundler", "noEmit": true, "outDir": "build/", "preserveWatchOutput": true, @@ -16,9 +16,9 @@ "skipLibCheck": true, "strict": true, "target": "es2020", + "types": ["jest", "node", "react", "react-dom", "vite/client"], "baseUrl": "src/" }, "include": ["**/*.ts", "**/*.tsx"], - "exclude": ["node_modules/", "_jest"], - "types": ["@emotion/react", "@testing-library/jest-dom", "jest", "node"] + "exclude": ["node_modules/"] } diff --git a/site/tsconfig.test.json b/site/tsconfig.test.json deleted file mode 100644 index c6f5e679af..0000000000 --- a/site/tsconfig.test.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "./tsconfig.json", - "exclude": ["node_modules", "_jest"], - "include": ["**/*.stories.tsx", "**/*.test.tsx", "**/*.d.ts"] -}