Fix knip config, remove bunch of unused code/CSS

This commit is contained in:
Kalle 2026-03-07 08:05:47 +02:00
parent 6508ded4d6
commit 1d50058b34
27 changed files with 13 additions and 494 deletions

View File

@ -19,11 +19,6 @@
gap: var(--s-1);
}
.privateIcon {
width: 16px;
margin-block-end: var(--s-1);
}
.title {
overflow: hidden;
height: 2.5rem;

View File

@ -169,7 +169,7 @@ function themeInputFromString(str: string): ThemeInput | null {
return parsed.success ? parsed.data : null;
}
export const DEFAULT_THEME_INPUT: ThemeInput = {
const DEFAULT_THEME_INPUT: ThemeInput = {
baseHue: 268,
baseChroma: 0.076,
accentHue: 360,
@ -184,9 +184,7 @@ export const DEFAULT_THEME_INPUT: ThemeInput = {
sizeSpacing: 1,
};
export function themeInputFromCustomTheme(
customTheme: CustomTheme,
): ThemeInput {
function themeInputFromCustomTheme(customTheme: CustomTheme): ThemeInput {
return {
baseHue: customTheme["--_base-h"] ?? DEFAULT_THEME_INPUT.baseHue,
baseChroma:

View File

@ -1,14 +1,3 @@
.containerWithSideNav {
display: flex;
flex-direction: row;
width: 100%;
}
.mainWrapper {
flex: 1;
min-width: 0;
}
.main {
padding: var(--layout-main-padding);
margin-bottom: var(--s-32);

View File

@ -46,12 +46,6 @@
color: var(--color-text-high);
}
.smallIcon {
min-width: 16px;
max-width: 16px;
color: var(--color-text-high);
}
.popover {
padding: var(--s-1);
width: var(--trigger-width);

View File

@ -1,7 +1,3 @@
.container {
position: relative;
}
.popoverContainer {
min-width: 300px;
padding: 0;
@ -47,14 +43,3 @@
.divider {
border-color: var(--color-border);
}
.unseenDot {
background-color: var(--color-text-accent);
border-radius: 100%;
width: 8px;
height: 8px;
position: absolute;
top: 1px;
left: 1px;
outline: 2px solid var(--color-bg);
}

View File

@ -20,31 +20,3 @@
grid-template-columns: 1fr 1fr;
}
}
.button {
display: grid;
place-items: center;
background-color: var(--color-bg);
width: var(--field-size-sm);
height: var(--field-size-sm);
padding: 0.25rem;
border: var(--border-style);
border-radius: 50%;
color: inherit;
cursor: pointer;
}
.button:focus-visible {
outline: var(--focus-ring);
outline-offset: 1px;
}
.buttonIcon {
width: 1.15rem;
}
@media screen and (max-width: 640px) {
.container > .userItem {
display: none;
}
}

View File

@ -6,35 +6,3 @@
.userItem:focus-visible {
outline: var(--focus-ring);
}
.avatar {
width: var(--field-size-sm);
height: var(--field-size-sm);
color: transparent;
}
.logInButton {
display: flex;
height: var(--field-size-sm);
align-items: center;
justify-content: center;
padding: 0.5rem;
border: 2px solid;
border-color: var(--color-text-accent);
border-radius: var(--radius-box);
background-color: transparent;
color: inherit;
cursor: pointer;
font-size: var(--font-xs);
font-weight: var(--weight-bold);
gap: var(--s-2);
text-decoration: none;
}
.logInButton > svg {
width: 1rem;
}
.logInButton:active {
transform: translateY(1px);
}

View File

@ -171,77 +171,6 @@ export async function findAllTags() {
return db.selectFrom("ArtTag").select(["id", "name"]).execute();
}
export async function findShowcaseArtsByTagName(
tagName: string,
limit?: number,
): Promise<ListedArt[]> {
const tagNameVariations = [
tagName,
tagName.replace(/-/g, " "),
tagName.replace(/-/g, "_"),
];
const tags = await db
.selectFrom("ArtTag")
.select("id")
.where("name", "in", tagNameVariations)
.execute();
if (tags.length === 0) return [];
const tagIds = tags.map((t) => t.id);
const arts = await db
.selectFrom("TaggedArt")
.innerJoin("Art", "Art.id", "TaggedArt.artId")
.innerJoin("User", "User.id", "Art.authorId")
.innerJoin("UserSubmittedImage", "UserSubmittedImage.id", "Art.imgId")
.select((eb) => [
"Art.id",
"Art.createdAt",
"Art.isShowcase",
"User.id as userId",
"User.discordId",
"User.username",
"User.discordAvatar",
"User.commissionsOpen",
concatUserSubmittedImagePrefix(eb.ref("UserSubmittedImage.url")).as(
"url",
),
])
.where("TaggedArt.tagId", "in", tagIds)
.orderBy("Art.isShowcase", "desc")
.orderBy("Art.createdAt", "desc")
.execute();
const encounteredUserIds = new Set<number>();
const result = arts
.filter((row) => {
if (encounteredUserIds.has(row.userId)) {
return false;
}
encounteredUserIds.add(row.userId);
return true;
})
.map((a) => ({
id: a.id,
createdAt: a.createdAt,
url: a.url,
isShowcase: Boolean(a.isShowcase),
author: {
commissionsOpen: a.commissionsOpen,
discordAvatar: a.discordAvatar,
discordId: a.discordId,
username: a.username,
},
}));
return limit ? result.slice(0, limit) : result;
}
export async function findArtsByUserId(
userId: number,
{ includeAuthored = true, includeTagged = true } = {},

View File

@ -1,36 +0,0 @@
.tagGroup {
width: 100%;
}
.tagList {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
gap: var(--s-2);
}
.tag {
cursor: pointer;
border: 2px solid var(--tag-color);
border-radius: var(--radius-field);
font-size: var(--font-sm);
font-weight: var(--weight-semi);
display: grid;
place-items: center;
min-width: max-content;
height: var(--field-size-sm);
}
.tag[data-selected] {
background-color: var(--tag-color) !important;
color: var(--color-text-inverse);
}
.tag[data-focus-visible] {
outline: 2px solid var(--tag-color);
outline-offset: 1px;
background-color: var(--color-bg-high);
}
.tag[data-hovered] {
background-color: var(--color-bg-high);
}

View File

@ -297,13 +297,6 @@
font-size: var(--font-sm);
font-weight: var(--weight-semi);
}
.inkTime {
font-size: var(--font-sm);
color: var(--color-text-second);
font-weight: var(--weight-semi);
}
.inkTimeSegment {
display: flex;
align-items: center;

View File

@ -9,8 +9,8 @@ import {
sendFriendRequestBaseSchema,
} from "./friends-schemas";
export const sendFriendRequestSchemaServer =
sendFriendRequestBaseSchema.superRefine(async (data, ctx) => {
const sendFriendRequestSchemaServer = sendFriendRequestBaseSchema.superRefine(
async (data, ctx) => {
const user = requireUser();
if (data.userId === user.id) {
@ -46,7 +46,8 @@ export const sendFriendRequestSchemaServer =
path: ["userId"],
});
}
});
},
);
export const friendsActionSchema = z.union([
sendFriendRequestSchemaServer,

View File

@ -90,22 +90,6 @@
right: 0;
}
.zoomQuickActions {
position: absolute;
z-index: 10;
display: block;
}
.zoomMenu {
position: absolute;
right: 0;
}
.quickActions {
display: flex;
right: 0;
}
.draggableButton {
display: inline-flex;
align-items: center;

View File

@ -72,15 +72,6 @@
display: inline;
}
.modalSelect {
max-width: 6rem;
}
.modalTextarea {
width: 100% !important;
resize: none;
}
.votingContainer {
max-width: 32rem;
margin-inline: auto;

View File

@ -20,15 +20,6 @@
top: 14px;
}
.weaponPoolSelectContainer {
width: 250px;
height: 50px;
}
.starFilled {
fill: var(--color-text-accent);
}
.volumeSliderIcon {
width: 16px;
height: 16px;

View File

@ -2,7 +2,7 @@ import { z } from "zod";
import { customField, select, stringConstant, toggle } from "~/form/fields";
import { themeInputSchema } from "~/utils/zod";
export const customThemeSchema = z.object({
const customThemeSchema = z.object({
_action: stringConstant("UPDATE_CUSTOM_THEME"),
newValue: customField({ initialValue: null }, themeInputSchema.nullable()),
});

View File

@ -23,5 +23,3 @@ export const TEAM_MEMBER_ROLES = [
"COACH",
"CHEERLEADER",
] as const;
export const TEAMS_PER_PAGE = 40;

View File

@ -1,52 +1,3 @@
.searchInput {
height: 40px !important;
font-size: var(--font-lg);
max-width: 240px;
}
.searchIcon {
height: 25px;
margin: auto;
margin-right: 15px;
}
.searchTeam {
display: flex;
color: var(--color-text);
gap: var(--s-3);
align-items: center;
}
.searchTeamName {
font-size: var(--font-xl);
font-weight: var(--weight-bold);
word-break: break-word;
}
.searchTeamMembers {
font-size: var(--font-xs);
color: var(--color-text-high);
}
.searchTeamTag {
font-size: var(--font-xs);
color: var(--color-accent);
padding: var(--s-0-5) var(--s-1);
border-radius: var(--radius-field);
margin-left: var(--s-2);
font-weight: var(--weight-bold);
}
.searchTeamAvatarPlaceholder {
height: 64px;
min-width: 64px;
display: grid;
place-items: center;
font-size: var(--font-xl);
border-radius: var(--radius-avatar);
background-color: var(--color-bg-high);
}
.banner {
background-image:
linear-gradient(

View File

@ -54,10 +54,6 @@
margin-inline-start: 8px;
}
.matchTabs {
padding-inline: var(--s-12);
}
.match {
width: var(--match-width);
min-height: var(--match-height);

View File

@ -273,72 +273,6 @@
align-items: center;
}
.seedsForm {
width: 100%;
display: flex;
align-items: center;
}
.seedsOrderButton {
margin-block-start: var(--s-2);
margin-inline-end: auto;
}
/* TODO: overflow-x scroll */
.seedsTeamsListRow {
display: grid;
width: 100%;
align-items: center;
padding: var(--s-1-5) var(--s-3);
border-radius: var(--radius-box);
column-gap: var(--s-1);
font-size: var(--font-xs);
grid-template-columns: 1.5rem 2rem 8rem 3rem 1fr;
list-style: none;
row-gap: var(--s-1-5);
}
.seedsTeamsListRow.sortable:not(.disabled) {
cursor: grab;
}
.seedsTeamsListRow.active {
cursor: grabbing;
}
.seedsTeamsListRow.sortable:active:not(.disabled) {
cursor: grabbing !important;
}
.seedsTeamsContainerHeader {
font-weight: var(--weight-bold);
}
.seedsTeamName {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.seedsTeamMember {
display: grid;
grid-template-columns: max-content max-content;
grid-column-gap: var(--s-3);
background-color: var(--color-bg-high);
border-radius: var(--radius-box);
padding: var(--s-1) var(--s-3);
place-items: center;
}
.seedsTeamsListRow.active .seedsTeamMember {
background-color: var(--color-bg-higher);
}
.seedsTeamMemberName {
grid-column: 1 / span 2;
font-weight: var(--weight-semi);
}
.streamUserContainer {
font-size: var(--font-xs);
display: flex;

View File

@ -1,11 +0,0 @@
.dl dt {
font-weight: var(--weight-extra);
}
.dl dt:not(:first-child) {
margin-block-start: var(--s-4);
}
.dl dd {
display: inline-block;
}

View File

@ -1,20 +0,0 @@
.container {
display: flex;
width: 100%;
flex-direction: column;
align-items: flex-start;
gap: var(--s-6);
}
.sensSelect {
min-width: 100%;
flex: 1;
}
.weaponPool {
width: 100%;
}
.starFilled {
fill: var(--color-text-accent);
}

View File

@ -140,58 +140,6 @@
list-style: none;
}
.searchContainer {
display: flex;
flex-direction: column;
gap: var(--s-12);
}
.searchUsers {
display: flex;
width: 325px;
flex-direction: column;
padding: 0;
margin: 0 auto;
gap: var(--s-6);
}
.searchUser {
display: flex;
align-items: center;
color: var(--color-text);
font-weight: var(--weight-body);
gap: var(--s-4);
line-height: 1.2rem;
}
.searchIgn {
color: var(--color-text-high);
font-size: var(--font-sm);
font-weight: var(--weight-body);
}
.searchUsers > li {
list-style: none;
}
.searchInput {
height: 40px !important;
margin: 0 auto;
font-size: var(--font-lg);
}
.searchIcon {
height: 25px;
margin: auto;
margin-right: 15px;
}
.searchInfo {
color: var(--color-text-high);
font-size: var(--font-sm);
text-align: center;
}
.weapon {
padding: var(--s-2);
border-radius: 100%;

View File

@ -23,13 +23,6 @@
}
}
/** we should use existing fieldset styles */
.matchFieldset {
border: 1px solid var(--color-border);
border-radius: var(--radius-box);
padding: var(--s-4);
}
.povField {
width: 100%;
}

View File

@ -2,7 +2,6 @@ import { cachified } from "@epic-web/cachified";
import { cache } from "~/utils/cache.server";
import { IS_E2E_TEST_RUN } from "~/utils/e2e";
import { logger } from "~/utils/logger";
import type { Unpacked } from "~/utils/types";
import { type RawStream, type StreamsResponse, streamsSchema } from "./schemas";
import { getToken, purgeCachedToken } from "./token";
import { getTwitchEnvVars } from "./utils";
@ -93,8 +92,6 @@ export async function getStreams() {
}
}
export type MappedStream = Unpacked<ReturnType<typeof mapRawStream>>;
function mapRawStream(stream: RawStream) {
return {
thumbnailUrl: stream.thumbnail_url,

View File

@ -226,7 +226,7 @@ function maximum_chroma_for_lh(L: number, h: number): number {
// These are the lightness values used in vars.css
// Any changes here NEED to be reflected in vars.css as well.
export const BASE_LIGHTNESS_VALUES = [
const BASE_LIGHTNESS_VALUES = [
1.0, // --base-c-0
0.94873, // --base-c-1
0.81397, // --base-c-2
@ -237,7 +237,7 @@ export const BASE_LIGHTNESS_VALUES = [
0.2097, // --base-c-7
] as const;
export const ACCENT_LIGHTNESS_VALUES = [
const ACCENT_LIGHTNESS_VALUES = [
0.25912, // --acc-c-0: dark mode low
0.52262, // --acc-c-1: dark mode mid
0.83419, // --acc-c-2: dark mode high

View File

@ -1,19 +0,0 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"ignoreExportsUsedInFile": {
"interface": true,
"type": true
},
"tags": ["-lintignore"],
"ignoreDependencies": ["babel-plugin-react-compiler"],
"entry": [
"app/features/*/routes/**/*.{ts,tsx}",
"migrations/**/*.js",
"scripts/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}",
"public/sw-2.js",
"ley.config.cjs",
"ley-driver.cjs",
"vitest.browser.config.ts",
"app/browser-test-setup.ts"
]
}

10
knip.ts
View File

@ -4,18 +4,16 @@ const config = {
type: true,
},
tags: ["-lintignore"],
ignoreDependencies: [
"react-compiler-runtime",
"react-router-dom",
"babel-plugin-react-compiler",
],
ignoreDependencies: ["babel-plugin-react-compiler"],
entry: [
"app/routes.ts",
"app/features/*/routes/**/*.{ts,tsx}",
"migrations/**/*.js",
"scripts/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}",
"public/sw-2.js",
"ley.config.cjs",
"ley-driver.cjs",
"vitest.browser.config.ts",
"app/browser-test-setup.ts",
],
compilers: {
css: (text: string, path: string) => {