Skip to content

Commit 846f686

Browse files
authored
Fix broken frontend Docker build in GitHub action
The python .gitignore that was added in #1 included the frontend/lib directory which broke the frontend build, but only within GitHub actions (since the lib directory was still on my machine). Fixed here by moving everything into the utils directory and removing libs entirely.
1 parent 8544038 commit 846f686

File tree

12 files changed

+43
-36
lines changed

12 files changed

+43
-36
lines changed

frontend/components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"aliases": {
1414
"components": "~/components",
15-
"utils": "~/lib/utils",
15+
"utils": "~/utils/utils",
1616
"ui": "~/components/ui",
1717
"lib": "~/lib",
1818
"hooks": "~/hooks"

frontend/src/components/LineChart.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
type AvailableChartColorsKeys,
2929
} from "@/lib/chartUtils";
3030
import { useOnWindowResize } from "@/hooks/useOnWindowsResize";
31-
import { cx } from "@/lib/utils";
31+
import { cn } from "@/utils/utils";
3232

3333
//#region Legend
3434

@@ -48,7 +48,7 @@ const LegendItem = ({
4848
const hasOnValueChange = !!onClick;
4949
return (
5050
<li
51-
className={cx(
51+
className={cn(
5252
// base
5353
"group inline-flex flex-nowrap items-center gap-1.5 rounded-sm px-2 py-1 whitespace-nowrap transition",
5454
hasOnValueChange
@@ -61,15 +61,15 @@ const LegendItem = ({
6161
}}
6262
>
6363
<span
64-
className={cx(
64+
className={cn(
6565
"h-[3px] w-3.5 shrink-0 rounded-full",
6666
getColorClassName(color, "bg"),
6767
activeLegend && activeLegend !== name ? "opacity-40" : "opacity-100"
6868
)}
6969
aria-hidden={true}
7070
/>
7171
<p
72-
className={cx(
72+
className={cn(
7373
// base
7474
"truncate text-xs whitespace-nowrap",
7575
// text color
@@ -117,7 +117,7 @@ const ScrollButton = ({ icon, onClick, disabled }: ScrollButtonProps) => {
117117
return (
118118
<button
119119
type="button"
120-
className={cx(
120+
className={cn(
121121
// base
122122
"group inline-flex size-5 items-center truncate rounded-sm transition",
123123
disabled
@@ -254,13 +254,13 @@ const Legend = React.forwardRef<HTMLOListElement, LegendProps>((props, ref) => {
254254
return (
255255
<ol
256256
ref={ref}
257-
className={cx("relative overflow-hidden", className)}
257+
className={cn("relative overflow-hidden", className)}
258258
{...other}
259259
>
260260
<div
261261
ref={scrollableRef}
262262
tabIndex={0}
263-
className={cx(
263+
className={cn(
264264
"flex h-full",
265265
enableLegendSlider
266266
? hasScroll?.right || hasScroll?.left
@@ -282,7 +282,7 @@ const Legend = React.forwardRef<HTMLOListElement, LegendProps>((props, ref) => {
282282
{enableLegendSlider && (hasScroll?.right || hasScroll?.left) ? (
283283
<>
284284
<div
285-
className={cx(
285+
className={cn(
286286
// base
287287
"absolute top-0 right-0 bottom-0 flex h-full items-center justify-center pr-1",
288288
// background color
@@ -341,7 +341,7 @@ const ChartLegend = (
341341
<div
342342
ref={legendRef}
343343
style={{ paddingLeft: paddingLeft }}
344-
className={cx(
344+
className={cn(
345345
"flex items-center",
346346
{ "justify-center": legendPosition === "center" },
347347
{ "justify-start": legendPosition === "left" },
@@ -391,7 +391,7 @@ const ChartTooltip = ({
391391
const legendPayload = payload.filter((item: any) => item.type !== "none");
392392
return (
393393
<div
394-
className={cx(
394+
className={cn(
395395
// base
396396
"rounded-md border text-sm shadow-md",
397397
// border color
@@ -400,9 +400,9 @@ const ChartTooltip = ({
400400
"bg-white dark:bg-gray-950"
401401
)}
402402
>
403-
<div className={cx("border-b border-inherit px-4 py-2")}>
403+
<div className={cn("border-b border-inherit px-4 py-2")}>
404404
<p
405-
className={cx(
405+
className={cn(
406406
// base
407407
"font-medium",
408408
// text color
@@ -412,7 +412,7 @@ const ChartTooltip = ({
412412
{label}
413413
</p>
414414
</div>
415-
<div className={cx("space-y-1 px-4 py-2")}>
415+
<div className={cn("space-y-1 px-4 py-2")}>
416416
{legendPayload.map(({ value, category, color }, index) => (
417417
<div
418418
key={`id-${index}`}
@@ -421,13 +421,13 @@ const ChartTooltip = ({
421421
<div className="flex items-center space-x-2">
422422
<span
423423
aria-hidden="true"
424-
className={cx(
424+
className={cn(
425425
"h-[3px] w-3.5 shrink-0 rounded-full",
426426
getColorClassName(color, "bg")
427427
)}
428428
/>
429429
<p
430-
className={cx(
430+
className={cn(
431431
// base
432432
"text-right whitespace-nowrap",
433433
// text color
@@ -438,7 +438,7 @@ const ChartTooltip = ({
438438
</p>
439439
</div>
440440
<p
441-
className={cx(
441+
className={cn(
442442
// base
443443
"text-right font-medium whitespace-nowrap tabular-nums",
444444
// text color
@@ -600,7 +600,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
600600
return (
601601
<div
602602
ref={ref}
603-
className={cx("h-80 w-full", className)}
603+
className={cn("h-80 w-full", className)}
604604
tremor-id="tremor-raw"
605605
{...other}
606606
>
@@ -625,7 +625,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
625625
>
626626
{showGridLines ? (
627627
<CartesianGrid
628-
className={cx("stroke-gray-200 stroke-1 dark:stroke-gray-800")}
628+
className={cn("stroke-gray-200 stroke-1 dark:stroke-gray-800")}
629629
horizontal={true}
630630
vertical={false}
631631
/>
@@ -643,7 +643,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
643643
}
644644
fill=""
645645
stroke=""
646-
className={cx(
646+
className={cn(
647647
// base
648648
"text-xs",
649649
// text fill
@@ -673,7 +673,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
673673
tick={{ transform: "translate(-3, 0)" }}
674674
fill=""
675675
stroke=""
676-
className={cx(
676+
className={cn(
677677
// base
678678
"text-xs",
679679
// text fill
@@ -767,7 +767,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
767767
) : null}
768768
{categories.map((category) => (
769769
<Line
770-
className={cx(
770+
className={cn(
771771
getColorClassName(
772772
categoryColors.get(category) as AvailableChartColorsKeys,
773773
"stroke"
@@ -790,7 +790,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
790790
} = props;
791791
return (
792792
<Dot
793-
className={cx(
793+
className={cn(
794794
"stroke-white dark:stroke-gray-950",
795795
onValueChange ? "cursor-pointer" : "",
796796
getColorClassName(
@@ -844,7 +844,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
844844
strokeLinecap={strokeLinecap}
845845
strokeLinejoin={strokeLinejoin}
846846
strokeWidth={strokeWidth}
847-
className={cx(
847+
className={cn(
848848
"stroke-white dark:stroke-gray-950",
849849
onValueChange ? "cursor-pointer" : "",
850850
getColorClassName(
@@ -875,7 +875,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
875875
{onValueChange
876876
? categories.map((category) => (
877877
<Line
878-
className={cx("cursor-pointer")}
878+
className={cn("cursor-pointer")}
879879
strokeOpacity={0}
880880
key={category}
881881
name={category}

frontend/src/components/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { MenuIcon, HomeIcon } from "lucide-react";
77
import { Route as ProjectsRoute } from "~/routes/projects.index";
88
import { Route as BlogRoute } from "~/routes/blog.index";
99
import { Route as AboutRoute } from "~/routes/about";
10-
import { cn } from "~/lib/utils";
10+
import { cn } from "~/utils/utils";
1111

1212
export interface NavbarProps {
1313
height: string;

frontend/src/components/ui/Calendar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
PropsBase,
1717
} from "react-day-picker";
1818

19-
import { cn } from "@/lib/utils";
19+
import { cn } from "@/utils/utils";
2020

2121
interface NavigationButtonProps
2222
extends React.HTMLAttributes<HTMLButtonElement> {

frontend/src/components/ui/DateRangePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Time } from "@internationalized/date";
33
import { enUS, Locale } from "date-fns/locale";
44
import React from "react";
55
import * as PopoverPrimitives from "@radix-ui/react-popover";
6-
import { cn } from "~/lib/utils";
6+
import { cn } from "~/utils/utils";
77
import { Button } from "~/components/ui/button";
88
import { Calendar as CalendarPrimitive } from "~/components/ui/Calendar";
99
import {

frontend/src/components/ui/badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from "react";
22
import { Slot } from "@radix-ui/react-slot";
33
import { cva, type VariantProps } from "class-variance-authority";
44

5-
import { cn } from "@/lib/utils";
5+
import { cn } from "@/utils/utils";
66

77
const badgeVariants = cva(
88
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",

frontend/src/components/ui/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from "react"
22
import { Slot } from "@radix-ui/react-slot"
33
import { cva, type VariantProps } from "class-variance-authority"
44

5-
import { cn } from "~/lib/utils"
5+
import { cn } from "~/utils/utils"
66

77
const buttonVariants = cva(
88
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",

frontend/src/components/ui/card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from "react";
22

3-
import { cn } from "@/lib/utils";
3+
import { cn } from "@/utils/utils";
44

55
function Card({ className, ...props }: React.ComponentProps<"div">) {
66
return (

frontend/src/components/ui/popover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from "react";
22
import * as PopoverPrimitive from "@radix-ui/react-popover";
33

4-
import { cn } from "@/lib/utils";
4+
import { cn } from "@/utils/utils";
55

66
function Popover({
77
...props

frontend/src/components/ui/separator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from "react";
22
import * as SeparatorPrimitive from "@radix-ui/react-separator";
33

4-
import { cn } from "@/lib/utils";
4+
import { cn } from "@/utils/utils";
55

66
function Separator({
77
className,

0 commit comments

Comments
 (0)