Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/migrate-to-vite-plus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"socialify": patch
---

Migrated the dev toolchain to Vite+: Vitest replaces Jest for unit tests, and Oxlint/Oxfmt replace Biome for linting and formatting
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ARG VARIANT="24-bookworm"
ARG VARIANT="26-bookworm"

FROM mcr.microsoft.com/devcontainers/typescript-node:${VARIANT}
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"PNPM_STORE_DIR": "/home/node/.local/share/.pnpm-store"
},

"postCreateCommand": "corepack install",
"postCreateCommand": "pnpm -v",

"postStartCommand": ".devcontainer/post-start.sh",

"customizations": {
"vscode": {
"extensions": [
"GitHub.copilot",
"biomejs.biome",
"VoidZero.vite-plus-extension-pack",
"ms-playwright.playwright"
]
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
node-version-file: .node-version
cache: 'pnpm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
node-version-file: .node-version
cache: 'pnpm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
node-version-file: .node-version
cache: 'pnpm'

- name: Install Dependencies
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@
/public/*.wasm
.worktrees
.claude/*.local.*
.vitest
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

1 change: 1 addition & 0 deletions .playwright/imageAPIEndpoints.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, type Page, test } from '@playwright/test'

// Test data for comprehensive parameter coverage
import { Font, Pattern, Theme } from '../common/types/configType'

Expand Down
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"editor.defaultFormatter": "biomejs.biome",
"editor.defaultFormatter": "oxc.oxc-vscode",
"[javascript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
"[javascriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
"[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
"[typescriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
"oxc.disableNestedConfig": true,
"oxc.fmt.disableNestedConfig": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.tabSize": 2,
"files.insertFinalNewline": true
}
13 changes: 7 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This file provides context for AI agents working with the Socialify codebase.
- Required commit message format (gitmoji-style)
- Changeset requirements (every PR needs one, generate summary/description without user input)
- Testing requirements (`pnpm verify` before committing)
- Code style (Biome linter/formatter)
- Code style (Vite+ `vp check`: Oxlint + Oxfmt)

**Failure to follow CONTRIBUTING.md will result in rejected PRs.**

Expand All @@ -21,7 +21,7 @@ This file provides context for AI agents working with the Socialify codebase.
- **Tech Stack**: Next.js 16, React 19, TypeScript, Tailwind CSS, daisyUI
- **Image Generation**: Satori (SVG) + resvg-wasm (PNG/JPEG/WebP)
- **Package Manager**: pnpm
- **Node Version**: 24 (see `.nvmrc`)
- **Node Version**: 26 (see `.node-version`)

## Project Structure

Expand Down Expand Up @@ -73,9 +73,9 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) for full details.
pnpm install # Install dependencies
pnpm dev # Start development server
pnpm build # Production build
pnpm lint # Run Biome linter
pnpm lint # Run vp check (format, lint, type check)
pnpm lint:fix # Auto-fix lint issues
pnpm test:unit # Run Jest unit tests
pnpm test:unit # Run Vitest unit tests (vp test)
pnpm test:e2e # Run Playwright e2e tests
pnpm changeset # Create a changeset for PR
pnpm verify # Run all checks (lint, tests, build)
Expand All @@ -92,7 +92,8 @@ Copy `.env.example` to `.env` and configure:
## Development Guidelines

### Code Style
- **Linter/Formatter**: Biome (not ESLint/Prettier)
- **Toolchain**: Vite+ (`vp` CLI). Oxlint + Oxfmt via `vp check`, Vitest via `vp test`, all configured in `vite.config.ts`
- **Test imports**: Import test APIs from `vite-plus/test`, not `vitest`
- **Import Aliases**: Use `@/` for imports (e.g., `@/components/...`)
- **Styling**: Tailwind CSS with daisyUI components

Expand All @@ -103,7 +104,7 @@ Copy `.env.example` to `.env` and configure:
- `/.github/skills/upgrade-simple-icons/` - Upgrade the simple-icons dependency and preserve icons that are no longer available via custom mappings.

### Testing
- **Unit Tests**: Jest with React Testing Library
- **Unit Tests**: Vitest (`vp test`, jsdom) with React Testing Library
- **E2E Tests**: Playwright (Chromium)
- Update snapshots: `pnpm test:unit:update-snapshots` / `pnpm test:e2e:update-snapshots`

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Please read and agree to our [Code of Conduct](./CODE_OF_CONDUCT.md) before cont

### Prerequisites

- Node.js 24 (see `.nvmrc`)
- Node.js 26 (see `.node-version`)
- pnpm package manager

### Getting Started
Expand Down Expand Up @@ -46,19 +46,19 @@ If you have VS Code and Docker installed, you can [open in Dev Container](https:

## Code Style

Socialify uses [Biome](https://biomejs.dev/) for linting and formatting.
Socialify uses [Vite+](https://viteplus.dev/) (`vp check`: Oxfmt formatting, Oxlint linting, and type checks), configured in `vite.config.ts`.

```bash
# Check for lint errors
# Check formatting, lint, and types
pnpm lint

# Auto-fix lint errors
# Auto-fix formatting and lint errors
pnpm lint:fix
```

## Testing

### Unit Tests (Jest)
### Unit Tests (Vitest via `vp test`)

```bash
pnpm test:unit # Run tests
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Stage 1: Base image with Node.js and pnpm setup
FROM node:24-alpine AS base
FROM node:26-alpine AS base

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV NODE_ENV=production
ENV CI=true

RUN corepack enable
RUN npm install -g corepack@0.36.0 && corepack enable

WORKDIR /app

Expand All @@ -30,7 +30,7 @@ COPY . .
RUN pnpm postinstall && pnpm build

# Stage 4: Production image using distroless
FROM gcr.io/distroless/nodejs24-debian12 AS runner
FROM gcr.io/distroless/nodejs26-debian13 AS runner

ENV PROJECT_URL=http://localhost:3000
# ENV GITHUB_TOKEN=
Expand Down
1 change: 1 addition & 0 deletions app/api/stats/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'server-only'
import { type NextRequest, NextResponse } from 'next/server'

import { GITHUB_API_ENDPOINT } from '@/common/constants'

export const runtime = 'edge'
Expand Down
145 changes: 0 additions & 145 deletions biome.json

This file was deleted.

3 changes: 2 additions & 1 deletion common/font.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/**
* @jest-environment node
* @vitest-environment node
*/

import type { SatoriOptions } from 'satori'
import { describe, expect, test } from 'vite-plus/test'

import { getFont } from '@/common/renderCard'
import { Font } from '@/common/types/configType'
Expand Down
4 changes: 3 additions & 1 deletion common/helpers.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/**
* @jest-environment node
* @vitest-environment node
*/

import { describe, expect, test } from 'vite-plus/test'

import { getHeroPattern } from '@/common/helpers'
import { Pattern, Theme } from '@/common/types/configType'

Expand Down
1 change: 1 addition & 0 deletions common/icons/iconUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Theme } from '@/common/types/configType'

import { LANGUAGE_ICON_MAPPING } from './languageMapping'

export const getSimpleIconsImageURI = function (
Expand Down
1 change: 1 addition & 0 deletions common/renderPNG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as resvg from '@resvg/resvg-wasm'

import renderCardSVG from '@/common/renderSVG'
import type QueryType from '@/common/types/queryType'

// @ts-ignore: Not a typical module, using import alias will cause an error.
import resvgWasm from '../public/resvg_bg.wasm?module'

Expand Down
Loading
Loading