Skip to content

Commit

Permalink
ci(project): add dashboard checks
Browse files Browse the repository at this point in the history
  • Loading branch information
klevente committed Jul 24, 2024
1 parent f5c2b9b commit 370ec69
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 130 deletions.
1 change: 1 addition & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
with:
node-version: 20.x
cache: "npm"
cache-dependency-path: '**/package-lock.json'

- name: Install deps
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml → .github/workflows/ci-bot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CI (Bot)

on:
push:
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/ci-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI (Dashboard)

on:
push:
branches: [ main ]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
typecheck:
name: Typecheck
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dashboard

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
cache-dependency-path: '**/package-lock.json'

- name: Install deps
run: npm ci

- name: Run tsc
run: npm run typecheck

prettier:
name: Prettier
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dashboard

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
cache-dependency-path: '**/package-lock.json'

- name: Install deps
run: npm ci

- name: Run Prettier
run: npm run prettier:check

eslint:
name: ESLint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dashboard

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
cache-dependency-path: '**/package-lock.json'

- name: Install deps
run: npm ci

- name: Run ESLint
run: npm run lint
26 changes: 13 additions & 13 deletions dashboard/app/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";

import { cn } from "~/lib/utils"
import { cn } from "~/lib/utils";

const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
Expand Down Expand Up @@ -30,27 +30,27 @@ const buttonVariants = cva(
variant: "default",
size: "default",
},
}
)
},
);

export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean
asChild?: boolean;
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
)
}
)
Button.displayName = "Button"
);
},
);
Button.displayName = "Button";

export { Button, buttonVariants }
export { Button, buttonVariants };
16 changes: 8 additions & 8 deletions dashboard/app/components/ui/input.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react"
import * as React from "react";

import { cn } from "~/lib/utils"
import { cn } from "~/lib/utils";

export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
Expand All @@ -12,14 +12,14 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className
className,
)}
ref={ref}
{...props}
/>
)
}
)
Input.displayName = "Input"
);
},
);
Input.displayName = "Input";

export { Input }
export { Input };
18 changes: 9 additions & 9 deletions dashboard/app/components/ui/label.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from "react"
import * as LabelPrimitive from "@radix-ui/react-label"
import { cva, type VariantProps } from "class-variance-authority"
import * as React from "react";
import * as LabelPrimitive from "@radix-ui/react-label";
import { cva, type VariantProps } from "class-variance-authority";

import { cn } from "~/lib/utils"
import { cn } from "~/lib/utils";

const labelVariants = cva(
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
)
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
);

const Label = React.forwardRef<
React.ElementRef<typeof LabelPrimitive.Root>,
Expand All @@ -18,7 +18,7 @@ const Label = React.forwardRef<
className={cn(labelVariants(), className)}
{...props}
/>
))
Label.displayName = LabelPrimitive.Root.displayName
));
Label.displayName = LabelPrimitive.Root.displayName;

export { Label }
export { Label };
18 changes: 9 additions & 9 deletions dashboard/app/components/ui/separator.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as React from "react"
import * as SeparatorPrimitive from "@radix-ui/react-separator"
import * as React from "react";
import * as SeparatorPrimitive from "@radix-ui/react-separator";

import { cn } from "~/lib/utils"
import { cn } from "~/lib/utils";

const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
>(
(
{ className, orientation = "horizontal", decorative = true, ...props },

Check failure on line 11 in dashboard/app/components/ui/separator.tsx

View workflow job for this annotation

GitHub Actions / ESLint

'className' is missing in props validation

Check failure on line 11 in dashboard/app/components/ui/separator.tsx

View workflow job for this annotation

GitHub Actions / ESLint

'orientation' is missing in props validation

Check failure on line 11 in dashboard/app/components/ui/separator.tsx

View workflow job for this annotation

GitHub Actions / ESLint

'decorative' is missing in props validation
ref
ref,
) => (
<SeparatorPrimitive.Root
ref={ref}
Expand All @@ -18,12 +18,12 @@ const Separator = React.forwardRef<
className={cn(
"shrink-0 bg-border",
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
className
className,
)}
{...props}
/>
)
)
Separator.displayName = SeparatorPrimitive.Root.displayName
),
);
Separator.displayName = SeparatorPrimitive.Root.displayName;

export { Separator }
export { Separator };
6 changes: 3 additions & 3 deletions dashboard/app/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
return twMerge(clsx(inputs));
}
2 changes: 1 addition & 1 deletion dashboard/app/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
body {
@apply bg-background text-foreground;
}
}
}
2 changes: 1 addition & 1 deletion dashboard/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"components": "~/components",
"utils": "~/lib/utils"
}
}
}
2 changes: 2 additions & 0 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"build": "remix vite:build",
"dev": "remix vite:dev --host",
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
"lint:report": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint --output-file eslint_report.json --format json .",
"typecheck": "tsc",
"prettier:check": "prettier -c .",
"prettier:write": "prettier -w .",
"start": "remix-serve ./build/server/index.js"
},
"dependencies": {
Expand Down
77 changes: 0 additions & 77 deletions dashboard/tailwind.config.js

This file was deleted.

16 changes: 8 additions & 8 deletions dashboard/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Config } from "tailwindcss"
import type { Config } from "tailwindcss";

const config = {
darkMode: ["class"],
content: [
'./pages/**/*.{ts,tsx}',
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
'./src/**/*.{ts,tsx}',
],
"./pages/**/*.{ts,tsx}",
"./components/**/*.{ts,tsx}",
"./app/**/*.{ts,tsx}",
"./src/**/*.{ts,tsx}",
],
prefix: "",
theme: {
container: {
Expand Down Expand Up @@ -75,6 +75,6 @@ const config = {
},
},
plugins: [require("tailwindcss-animate")],
} satisfies Config
} satisfies Config;

export default config
export default config;

0 comments on commit 370ec69

Please sign in to comment.