mirror of
https://github.com/jakejarvis/domainstack.io.git
synced 2026-09-11 05:05:34 -04:00
refactor: migrate to Turborepo monorepo structure (#340)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,10 +32,10 @@ jobs:
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install Playwright browsers
|
||||
run: pnpm exec playwright install chromium --with-deps
|
||||
run: pnpm --filter @domainstack/web exec playwright install chromium --with-deps
|
||||
|
||||
- name: Run typechecks
|
||||
run: pnpm typecheck
|
||||
run: pnpm check-types
|
||||
continue-on-error: true
|
||||
|
||||
- name: Run lints
|
||||
|
||||
+31
-26
@@ -1,45 +1,50 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
.pnpm-store/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/versions
|
||||
# Dependencies
|
||||
node_modules
|
||||
.pnp
|
||||
.pnp.js
|
||||
.pnpm-store
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
/__screenshots__
|
||||
**/*/__screenshots__
|
||||
/test-results
|
||||
# Testing
|
||||
coverage
|
||||
__screenshots__
|
||||
test-results
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
# Turbo
|
||||
.turbo
|
||||
|
||||
# production
|
||||
/build
|
||||
# Next.js
|
||||
.next
|
||||
out
|
||||
|
||||
# misc
|
||||
# Production
|
||||
build
|
||||
dist
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
# Debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# env files (can opt-in for committing if needed)
|
||||
.env*.local
|
||||
# Local env files
|
||||
.env
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# vercel
|
||||
# Vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
# TypeScript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
|
||||
# SWC
|
||||
.swc
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
public-hoist-pattern[]=@sparticuz/chromium
|
||||
public-hoist-pattern[]=puppeteer-core
|
||||
@@ -17,8 +17,8 @@ For full workflow details: `bd prime`
|
||||
**CRITICAL:** Before declaring victory on any task and before committing to git, the following three commands must pass with NO WARNINGS:
|
||||
|
||||
1. `pnpm lint` — Must pass with zero warnings
|
||||
2. `pnpm typecheck` — Must pass with zero warnings
|
||||
3. `pnpm test:run` — Must pass with zero warnings
|
||||
2. `pnpm check-types` — Must pass with zero warnings
|
||||
3. `pnpm test` — Must pass with zero warnings
|
||||
|
||||
Do not proceed with commits until all three checks are clean.
|
||||
|
||||
@@ -27,7 +27,7 @@ Do not proceed with commits until all three checks are clean.
|
||||
### Development
|
||||
- `pnpm dev` — Start Next.js dev server at http://localhost:3000
|
||||
- `pnpm build` — Compile production bundle
|
||||
- `pnpm typecheck` — Run `tsc --noEmit` for type diagnostics
|
||||
- `pnpm check-types` — Run `tsc --noEmit` for type diagnostics
|
||||
|
||||
### Linting & Formatting
|
||||
- `pnpm lint` — Run Biome lint (`--write` to auto-fix; add `--unsafe` to sort Tailwind classes, etc)
|
||||
@@ -35,9 +35,9 @@ Do not proceed with commits until all three checks are clean.
|
||||
|
||||
### Testing
|
||||
- `pnpm test` — Run Vitest in watch mode
|
||||
- `pnpm test:run` — Run all tests once
|
||||
- `pnpm test:run path/to/file.test.ts` — Run a single test file
|
||||
- `pnpm test:run -t "test name"` — Run tests matching a pattern
|
||||
- `pnpm test` — Run all tests once
|
||||
- `pnpm test path/to/file.test.ts` — Run a single test file
|
||||
- `pnpm test -t "test name"` — Run tests matching a pattern
|
||||
- `pnpm test:coverage` — Run tests with coverage report
|
||||
|
||||
### Database
|
||||
@@ -329,18 +329,35 @@ describe("myFunction", () => {
|
||||
|
||||
## Project Structure
|
||||
|
||||
- `app/` — Next.js App Router (default to server components)
|
||||
- `components/` — Reusable UI primitives
|
||||
- `hooks/` — Shared React hooks
|
||||
- `lib/` — Domain utilities and shared modules
|
||||
- `lib/db/` — Drizzle schema and repository layer
|
||||
- `lib/domain/` — Core domain lookup implementations
|
||||
- `lib/inngest/` — Background job functions
|
||||
- `lib/workflow/` — Workflow utilities (deduplication, SWR, errors)
|
||||
- `server/routers/` — tRPC router definitions
|
||||
- `workflows/` — Vercel Workflow definitions
|
||||
- `emails/` — React Email templates
|
||||
- `trpc/` — tRPC client setup
|
||||
This is a **Turborepo monorepo** with the following structure:
|
||||
|
||||
```
|
||||
domainstack.io/
|
||||
├── apps/
|
||||
│ └── web/ # Next.js application (@domainstack/web)
|
||||
│ ├── app/ # Next.js App Router
|
||||
│ ├── components/ # Reusable UI primitives
|
||||
│ ├── hooks/ # Shared React hooks
|
||||
│ ├── lib/ # Domain utilities and shared modules
|
||||
│ │ ├── db/ # Drizzle schema and repository layer
|
||||
│ │ ├── inngest/ # Background job functions
|
||||
│ │ └── workflow/ # Workflow utilities (deduplication, SWR, errors)
|
||||
│ ├── server/routers/ # tRPC router definitions
|
||||
│ ├── workflows/ # Vercel Workflow definitions
|
||||
│ ├── emails/ # React Email templates
|
||||
│ ├── trpc/ # tRPC client setup
|
||||
│ ├── package.json # App dependencies
|
||||
│ ├── tsconfig.json # Extends root tsconfig
|
||||
│ └── vercel.json # Vercel deployment config
|
||||
├── packages/ # Shared packages (future extraction)
|
||||
├── turbo.json # Turborepo task configuration
|
||||
├── pnpm-workspace.yaml # pnpm workspace definition
|
||||
├── package.json # Root workspace config
|
||||
├── tsconfig.json # Base TypeScript config
|
||||
└── biome.json # Linting/formatting config
|
||||
```
|
||||
|
||||
All commands run from the **monorepo root** via Turborepo.
|
||||
|
||||
## Key Patterns
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
- [**Logo.dev**](https://www.logo.dev)
|
||||
- [**IPLocate.io**](https://www.iplocate.io/)
|
||||
- **PostHog** (analytics)
|
||||
- **Puppeteer** (screenshots)
|
||||
- **Vitest** + **Playwright**, **Biome**
|
||||
- **Turborepo** (monorepo)
|
||||
- **Vitest** + **Playwright** (testing), **Biome** (linting)
|
||||
|
||||
## Development
|
||||
|
||||
@@ -53,10 +53,10 @@ pnpm install
|
||||
|
||||
### 2. Configure environment variables
|
||||
|
||||
Create `.env.local` and populate [required variables](.env.example):
|
||||
Create `.env.local` in the `apps/web` directory and populate [required variables](apps/web/.env.example):
|
||||
|
||||
```bash
|
||||
cp .env.example .env.local
|
||||
cp apps/web/.env.example apps/web/.env.local
|
||||
```
|
||||
|
||||
At minimum, you'll need `DATABASE_URL` pointing to a Postgres database.
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
.vercel
|
||||
.env*.local
|
||||
|
Before Width: | Height: | Size: 1021 B After Width: | Height: | Size: 1021 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -209,15 +209,6 @@
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
/* Scrollbar hiding utility for horizontal scroll containers */
|
||||
.scrollbar-hide {
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.scrollbar-hide::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Variable-driven accent glow */
|
||||
.accent-glow {
|
||||
background: var(--section-accent-glow, var(--glow-slate));
|
||||
@@ -261,3 +252,73 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@utility no-scrollbar {
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Custom variants: https://github.com/shadcn-ui/ui/blob/main/packages/shadcn/src/tailwind.css */
|
||||
@custom-variant data-open {
|
||||
&:where([data-state="open"]),
|
||||
&:where([data-open]:not([data-open="false"])) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
||||
@custom-variant data-closed {
|
||||
&:where([data-state="closed"]),
|
||||
&:where([data-closed]:not([data-closed="false"])) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
||||
@custom-variant data-checked {
|
||||
&:where([data-state="checked"]),
|
||||
&:where([data-checked]:not([data-checked="false"])) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
||||
@custom-variant data-unchecked {
|
||||
&:where([data-state="unchecked"]),
|
||||
&:where([data-unchecked]:not([data-unchecked="false"])) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
||||
@custom-variant data-selected {
|
||||
&:where([data-selected="true"]) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
||||
@custom-variant data-disabled {
|
||||
&:where([data-disabled="true"]),
|
||||
&:where([data-disabled]:not([data-disabled="false"])) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
||||
@custom-variant data-active {
|
||||
&:where([data-state="active"]),
|
||||
&:where([data-active]:not([data-active="false"])) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
||||
@custom-variant data-horizontal {
|
||||
&:where([data-orientation="horizontal"]) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
||||
@custom-variant data-vertical {
|
||||
&:where([data-orientation="vertical"]) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 625 B |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user