Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: v2.2.0 #227

Merged
merged 35 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
39a7d32
chore: adjust progress dialog
joshxfi Jul 18, 2024
0cb8463
feat: implement e2e testing with playwright
joshxfi Jul 19, 2024
37d745e
chore(ci): remove matrix strategy
joshxfi Jul 20, 2024
8483e06
chore: update: test placeholder
joshxfi Jul 20, 2024
ddbc4d2
fix(ci): install deps in e2e workflow
joshxfi Jul 20, 2024
1157b0a
fix(ci): revert matrix strategy
joshxfi Jul 20, 2024
ec3ae1d
chore: add ci command for e2e (#226)
joshxfi Jul 21, 2024
e8fd63a
feat: implement playwright
joshxfi Jul 21, 2024
f514035
chore: upgrade turbo
joshxfi Jul 21, 2024
9a47406
feat(test): add e2e for auth
joshxfi Jul 24, 2024
128ac9e
chore(e2e): enable webServer option
joshxfi Jul 25, 2024
e801be3
chore(e2e): enable tests against mobile viewports
joshxfi Jul 25, 2024
018f62d
chore(e2e): combine auth flow
joshxfi Jul 25, 2024
8218253
chore(e2e): add script for playwright in ui mode
joshxfi Jul 26, 2024
dca13f1
fix(e2e): remove waits on other parts
joshxfi Jul 26, 2024
922824c
chore: remove progress dialog
joshxfi Jul 27, 2024
f413866
feat(e2e): implement fixtures for test suite
joshxfi Jul 28, 2024
f691e91
chore(e2e): update auth test spec
joshxfi Jul 28, 2024
dc12ac6
feat(e2e): add test spec for notes
joshxfi Jul 28, 2024
63ef2b6
feat(actions): setup sharding for playwright tests
joshxfi Jul 28, 2024
c2df5a4
chore(temp): disable playwright ci
joshxfi Jul 28, 2024
133c2b4
chore(temp): disable merge-reports in ci
joshxfi Jul 28, 2024
eedf30f
Merge pull request #228 from omsimos/feat/tests
joshxfi Jul 28, 2024
219d83e
chore: add ad container for lists
joshxfi Jul 28, 2024
929b3f4
chore(temp): skip build for social and e2e
joshxfi Jul 28, 2024
0e8df5c
chore: update dependencies
joshxfi Jul 29, 2024
6ecd76e
chore: update radix deps
joshxfi Jul 29, 2024
8cd86fd
feat(e2e): add message tests
joshxfi Aug 1, 2024
61af0b1
chore: upgrade deps for db
joshxfi Aug 1, 2024
7a6dff2
fix: upgrade typescript to resolve inferred type error
joshxfi Aug 1, 2024
ae3d1a6
chore: upgrade pnpm to latest
joshxfi Aug 2, 2024
44e34dd
fix: add @whatwg-node/server to resolve reference error
joshxfi Aug 2, 2024
2c1af04
chore: add success message on submit
joshxfi Aug 2, 2024
38cc050
fix: add quiet mode icon in note card if enabled
joshxfi Aug 2, 2024
38bd90a
docs: add e2e in core packages
joshxfi Aug 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,25 @@ on:

jobs:
build:
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true

steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v4
with:
version: 9.5.0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
version: 9.6.0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install
run: pnpm install --prefer-offline

- name: Run GraphQL diagnostics
run: pnpm gql:check
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Playwright Tests

on:
push:
branches:
- "**"
pull_request:
branches:
- main

jobs:
e2e:
if: false # Disable this job temporarily
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.6.0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install --prefer-offline

- name: Install Playwright Browsers
run: pnpm dlx playwright install --with-deps

- name: Build project
env:
TURSO_CONNECTION_URL: ${{ secrets.TURSO_CONNECTION_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: pnpm build

- name: Run Playwright tests
env:
TURSO_CONNECTION_URL: ${{ secrets.TURSO_CONNECTION_URL }}
TURSO_AUTH_TOKEN: ${{ secrets.TURSO_AUTH_TOKEN }}
AES_KEY: ${{ secrets.AES_KEY }}
run: pnpm test -- -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}

- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shardIndex }}
path: blob-report
retention-days: 1

merge-reports:
# if: ${{ !cancelled() }}
if: false # Disable this job temporarily
needs: [e2e]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.5.0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install --prefer-offline

- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true

- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports

- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ If you like this project, please consider giving it a star! ✨ If you wish to s
| `@umamin/db` | Database schema & migrations using Drizzle ORM |
| `@umamin/gql` | GraphQL schema models and resolvers using Pothos |
| `@umamin/aes` | Encryption algorithm using AES in Galois/Counter Mode (AES-GCM) |
| `@umamin/e2e` | End-to-end testing suite using Playwright |

### Prerequisites
- [`Turso CLI`](https://docs.turso.tech/cli/installation) (for local libSQL server)
Expand Down
41 changes: 21 additions & 20 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@
},
"dependencies": {
"@fingerprintjs/botd": "^1.9.1",
"@graphql-yoga/plugin-csrf-prevention": "^3.6.0",
"@graphql-yoga/plugin-disable-introspection": "^2.6.0",
"@graphql-yoga/plugin-persisted-operations": "^3.6.0",
"@graphql-yoga/plugin-response-cache": "^3.8.0",
"@hookform/resolvers": "^3.3.4",
"@graphql-yoga/plugin-csrf-prevention": "^3.6.2",
"@graphql-yoga/plugin-disable-introspection": "^2.6.2",
"@graphql-yoga/plugin-persisted-operations": "^3.6.2",
"@graphql-yoga/plugin-response-cache": "^3.8.2",
"@hookform/resolvers": "^3.9.0",
"@lucia-auth/adapter-drizzle": "^1.0.7",
"@mdx-js/loader": "^3.0.1",
"@mdx-js/react": "^3.0.1",
"@next/mdx": "^14.2.5",
"@node-rs/argon2": "^1.8.3",
"@sentry/nextjs": "^8",
"@sentry/nextjs": "^8.21.0",
"@types/mdx": "^2.0.13",
"@umamin/aes": "workspace:*",
"@umamin/db": "workspace:*",
"@umamin/gql": "workspace:*",
"@umamin/ui": "workspace:*",
"@urql/core": "^5.0.4",
"@urql/core": "^5.0.5",
"@urql/exchange-graphcache": "^7.1.1",
"@urql/exchange-persisted": "^4.3.0",
"@urql/next": "^1.1.1",
"arctic": "^1.9.1",
"arctic": "^1.9.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"clsx": "^2.1.1",
"date-fns": "^3.6.0",
"firebase": "^10.12.1",
"geist": "^1.3.0",
"gql.tada": "^1.8.2",
"firebase": "^10.12.4",
"geist": "^1.3.1",
"gql.tada": "^1.8.5",
"graphql": "^16.9.0",
"graphql-yoga": "^5.6.0",
"graphql-yoga": "^5.6.2",
"lucia": "^3.2.0",
"lucide-react": "^0.407.0",
"modern-screenshot": "^4.4.39",
Expand All @@ -54,18 +54,19 @@
"oslo": "^1.2.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.51.2",
"react-hook-form": "^7.52.1",
"react-intersection-observer": "^9.10.2",
"remark-gfm": "^4.0.0",
"sonner": "^1.5.0",
"tailwind-merge": "^2.2.2",
"tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7",
"urql": "^4.1.0",
"zod": "^3.22.4",
"zustand": "^4.5.4"
"zustand": "^4.5.4",
"@whatwg-node/server": "^0.9.46"
},
"devDependencies": {
"@0no-co/graphqlsp": "^1.12.11",
"@0no-co/graphqlsp": "^1.12.12",
"@types/node": "^20",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
Expand All @@ -74,8 +75,8 @@
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.2.5",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5.4.5"
"postcss": "^8.4.40",
"tailwindcss": "^3.4.7",
"typescript": "^5.5.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export function ReceivedMessageCard({
</p>
</CardHeader>
<CardContent>
<div className="flex w-full flex-col gap-2 rounded-lg p-5 whitespace-pre-wrap bg-muted break-words min-w-0">
<div
data-testid="received-msg-content"
className="flex w-full flex-col gap-2 rounded-lg p-5 whitespace-pre-wrap bg-muted break-words min-w-0"
>
{msg.content}
</div>
</CardContent>
Expand Down
12 changes: 11 additions & 1 deletion apps/www/src/app/(profile)/inbox/components/received/list.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import { toast } from "sonner";
import dynamic from "next/dynamic";
import { graphql } from "gql.tada";
import { useInView } from "react-intersection-observer";
import { useCallback, useEffect, useState } from "react";
Expand All @@ -12,6 +13,10 @@ import { Skeleton } from "@umamin/ui/components/skeleton";
import { useMessageStore } from "@/store/useMessageStore";
import { ReceivedMessageCard, receivedMessageFragment } from "./card";

const AdContainer = dynamic(() => import("@umamin/ui/ad"), {
ssr: false,
});

const MESSAGES_FROM_CURSOR_QUERY = graphql(
`
query ReceivedMessagesFromCursor($input: MessagesFromCursorInput!) {
Expand Down Expand Up @@ -96,9 +101,14 @@ export function ReceivedMessagesList({

return (
<>
{messages?.map((msg) => (
{messages?.map((msg, i) => (
<div key={msg.id} className="w-full">
<ReceivedMessageCard data={msg} />

{/* v2-received-list */}
{(i + 1) % 5 === 0 && (
<AdContainer className="mt-5" slotId="1546692714" />
)}
</div>
))}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ export function ReplyDialog(props: Props) {
className="focus-visible:ring-transparent flex-1 text-base resize-none min-h-10 max-h-20"
autoComplete="off"
/>
<Button type="submit" size="icon">
<Button
data-testid="msg-send-reply-btn"
type="submit"
size="icon"
>
{loading ? (
<Loader2 className="w-4 h-4 animate-spin" />
) : (
Expand Down
12 changes: 11 additions & 1 deletion apps/www/src/app/(profile)/inbox/components/sent/list.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import { toast } from "sonner";
import dynamic from "next/dynamic";
import { graphql } from "gql.tada";
import { useInView } from "react-intersection-observer";
import { useCallback, useEffect, useState } from "react";
Expand All @@ -12,6 +13,10 @@ import { Skeleton } from "@umamin/ui/components/skeleton";
import { useMessageStore } from "@/store/useMessageStore";
import { sentMessageFragment, SentMessageCard } from "./card";

const AdContainer = dynamic(() => import("@umamin/ui/ad"), {
ssr: false,
});

const MESSAGES_FROM_CURSOR_QUERY = graphql(
`
query SentMessagesFromCursor($input: MessagesFromCursorInput!) {
Expand Down Expand Up @@ -96,9 +101,14 @@ export function SentMessagesList({

return (
<>
{messages?.map((msg) => (
{messages?.map((msg, i) => (
<div key={msg.id} className="w-full">
<SentMessageCard data={msg} />

{/* v2-sent-list */}
{(i + 1) % 5 === 0 && (
<AdContainer className="mt-5" slotId="1355121027" />
)}
</div>
))}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ export function SignOutButton() {
const { pending } = useFormStatus();

return (
<Button type="submit" disabled={pending} variant="outline">
<Button
data-testid="logout-btn"
type="submit"
disabled={pending}
variant="outline"
>
{pending && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
Sign Out
</Button>
Expand Down
Loading