Skip to content

Commit

Permalink
delete stuff, delete stuff, delete stuff
Browse files Browse the repository at this point in the history
C'mon, louder, I can't hear you
  • Loading branch information
xHomu committed Aug 21, 2023
1 parent 0e94d16 commit 6010a8d
Show file tree
Hide file tree
Showing 27 changed files with 5 additions and 1,318 deletions.
79 changes: 0 additions & 79 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,85 +57,6 @@ jobs:
- name: 🔎 Type check
run: npm run typecheck --if-present

vitest:
name: ⚡ Vitest
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: 📥 Download deps
uses: bahmutov/npm-install@v1

- name: 🏄 Copy test env vars
run: cp .env.example .env

- name: 🖼 Build icons
run: npm run build:icons

- name: ⚡ Run vitest
run: npm run test -- --coverage

playwright:
name: 🎭 Playwright
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: 🏄 Copy test env vars
run: cp .env.example .env

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: 📥 Download deps
uses: bahmutov/npm-install@v1

- name: 📥 Install Playwright Browsers
run: npm run test:e2e:install

- name: 🛠 Setup Database
run: npx prisma migrate deploy

- name: 🏦 Cache Database
id: db-cache
uses: actions/cache@v3
with:
path: prisma/data.db
key:
db-cache-schema_${{ hashFiles('./prisma/schema.prisma')
}}-migrations_${{ hashFiles('./prisma/migrations/*/migration.sql')
}}

- name: 🌱 Seed Database
if: steps.db-cache.outputs.cache-hit != 'true'
run: npx prisma db seed
env:
MINIMAL_SEED: true

- name: 🏗 Build
run: npm run build

- name: 🎭 Playwright tests
run: npx playwright test

- name: 📊 Upload report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

deploy:
name: 🚀 Deploy
runs-on: ubuntu-latest
Expand Down
86 changes: 5 additions & 81 deletions app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
type V2_MetaFunction,
} from '@remix-run/node'
import {
Form,
Link,
Links,
LiveReload,
Expand All @@ -20,25 +19,13 @@ import {
useFetcher,
useFetchers,
useLoaderData,
useMatches,
useSubmit,
} from '@remix-run/react'
import { withSentry } from '@sentry/remix'
import { useRef } from 'react'
import { z } from 'zod'
import { Confetti } from './components/confetti.tsx'
import { GeneralErrorBoundary } from './components/error-boundary.tsx'
import { ErrorList } from './components/forms.tsx'
import { SearchBar } from './components/search-bar.tsx'
import { EpicToaster } from './components/toaster.tsx'
import { Button } from './components/ui/button.tsx'
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuPortal,
DropdownMenuTrigger,
} from './components/ui/dropdown-menu.tsx'
import { Icon, href as iconsHref } from './components/ui/icon.tsx'
import fontStylestylesheetUrl from './styles/font.css'
import tailwindStylesheetUrl from './styles/tailwind.css'
Expand All @@ -50,14 +37,12 @@ import { getEnv } from './utils/env.server.ts'
import {
combineHeaders,
getDomainUrl,
getUserImgSrc,
invariantResponse,
} from './utils/misc.tsx'
import { useNonce } from './utils/nonce-provider.ts'
import { type Theme, setTheme, getTheme } from './utils/theme.server.ts'
import { makeTimings, time } from './utils/timing.server.ts'
import { getToast } from './utils/toast.server.ts'
import { useOptionalUser, useUser } from './utils/user.ts'

export const links: LinksFunction = () => {
return [
Expand Down Expand Up @@ -236,15 +221,15 @@ function Document({
function App() {
const data = useLoaderData<typeof loader>()
const nonce = useNonce()
const user = useOptionalUser()
// const user = useOptionalUser()
const theme = useTheme()
const matches = useMatches()
const isOnSearchPage = matches.find(m => m.id === 'routes/users+/index')
// const matches = useMatches()
// const isOnSearchPage = matches.find(m => m.id === 'routes/users+/index')

return (
<Document nonce={nonce} theme={theme} env={data.ENV}>
<div className="flex h-screen flex-col justify-between">
<header className="container py-6">
{/* <header className="container py-6">
<nav className="flex items-center justify-between">
<Link to="/">
<div className="font-light">epic</div>
Expand All @@ -265,7 +250,7 @@ function App() {
)}
</div>
</nav>
</header>
</header> */}

<div className="flex-1">
<Outlet />
Expand All @@ -286,67 +271,6 @@ function App() {
}
export default withSentry(App)

function UserDropdown() {
const user = useUser()
const submit = useSubmit()
const formRef = useRef<HTMLFormElement>(null)
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button asChild variant="secondary">
<Link
to={`/users/${user.username}`}
// this is for progressive enhancement
onClick={e => e.preventDefault()}
className="flex items-center gap-2"
>
<img
className="h-8 w-8 rounded-full object-cover"
alt={user.name ?? user.username}
src={getUserImgSrc(user.image?.id)}
/>
<span className="text-body-sm font-bold">
{user.name ?? user.username}
</span>
</Link>
</Button>
</DropdownMenuTrigger>
<DropdownMenuPortal>
<DropdownMenuContent sideOffset={8} align="start">
<DropdownMenuItem asChild>
<Link prefetch="intent" to={`/users/${user.username}`}>
<Icon className="text-body-md" name="avatar">
Profile
</Icon>
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link prefetch="intent" to={`/users/${user.username}/notes`}>
<Icon className="text-body-md" name="pencil-2">
Notes
</Icon>
</Link>
</DropdownMenuItem>
<DropdownMenuItem
asChild
// this prevents the menu from closing before the form submission is completed
onSelect={event => {
event.preventDefault()
submit(formRef.current)
}}
>
<Form action="/logout" method="POST" ref={formRef}>
<Icon className="text-body-md" name="exit">
<button type="submit">Logout</button>
</Icon>
</Form>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenuPortal>
</DropdownMenu>
)
}

function useTheme() {
const data = useLoaderData<typeof loader>()
const fetchers = useFetchers()
Expand Down
File renamed without changes.
Binary file removed app/routes/_marketing+/logos/docker.png
Binary file not shown.
17 changes: 0 additions & 17 deletions app/routes/_marketing+/logos/eslint.svg

This file was deleted.

Loading

0 comments on commit 6010a8d

Please sign in to comment.