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
20 changes: 10 additions & 10 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ We pledge to act and interact in ways that contribute to an open, welcoming, div

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and unwelcome sexual attention or advances
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery, and unwelcome sexual attention or advances
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Expand Down
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
## Description

Please include a summary of the change and which issue is fixed.

## Change Type

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update

## Testing Steps

Please describe the tests that you ran to verify your changes.

## Screenshots (if applicable)

## Related Issues

Fixes #

## Checklist

- [ ] `pnpm typecheck` passes
- [ ] `pnpm lint` passes
- [ ] `pnpm test` (Vitest) passes
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
description: "Environment to deploy to"
required: true
default: 'preview'
default: "preview"
type: choice
options:
- production
- preview
provider:
description: 'Deployment provider'
description: "Deployment provider"
required: true
default: 'vercel'
default: "vercel"
type: choice
options:
- vercel
Expand Down
10 changes: 8 additions & 2 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pnpm = "latest"
m = "mise run"
i = "mise run install"
l = "mise run lint"
f = "mise run format"
t = "mise run test"
b = "mise run build"
d = "mise run dev"
Expand All @@ -15,10 +16,10 @@ v = "mise run verify"
g = "git"
gs = "git status"
gb = "git branch"
gt = "git checkout"
gco = "git checkout"
gl = "git log"
ga = "git add"
gc = "git commit -a -m"
gc = "git commit"
gp = "git push"
gr = "git rebase --merge"

Expand Down Expand Up @@ -47,6 +48,11 @@ description = "Run linting"
run = "pnpm run lint"
alias = "l"

[tasks.format]
description = "Run formatting"
run = "pnpm run format"
alias = "f"

[tasks.typecheck]
description = "Run typechecking"
run = "pnpm run typecheck"
Expand Down
32 changes: 24 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,83 @@
# Agents.md

## 1. Project Overview

cur8d is a production-ready Next.js starter optimized for data integration and scalability.

## 2. Tech Stack

- Next.js 16.2.6: App Router, Server Components.
- HeroUI v3.0.5: Compound components with dot notation.
- Tailwind CSS v4: CSS-first configuration.
- Vitest 4.1.6 & Playwright 1.59.1: Testing.
- Supabase & Vercel Blob: Data and storage stubs.

## 3. Directory Structure
- `src/app`: Routes and layouts.
- `src/components`: Reusable components.
- `src/lib`: Logic and data layer.

- `app`: Routes, layouts, components (`app/components`), hooks (`app/hooks`), data (`app/data`), and types (`app/types`).
- `tests`: Unit tests (`tests/unit`) and E2E tests (`tests/e2e`).
- `docs`: Nextra v4 documentation.

## 4. Toolchain Management

Managed via `mise`. Update `.mise.toml` to change Node.js or pnpm versions.

## 5. TypeScript Rules

- Strict mode enabled.
- No `any` types allowed.
- Explicit interfaces for all component props.

## 6. Coding Conventions

- Named imports for icons.
- Barrel exports (`index.ts`) in component folders.
- Server Components by default.

## 7. How to add a new page
Add directory to `src/app/` with `page.tsx`.

Add directory to `app/` with `page.tsx`.

## 8. How to add a new component
Create folder in `src/components/` with `index.tsx`, types, and tests.

Create folder in `app/components/` with `index.tsx` and types, and add test in `tests/unit/components/`.

## 9. How to add a keyboard shortcut
Register in `src/config/shortcuts.ts`, use `useShortcuts` hook, add UI hint.

Register in `app/config/shortcuts.ts`, use `useShortcuts` hook, add UI hint.

## 10. Testing Guide

- Unit: `pnpm test`
- E2E: `pnpm test:e2e`
- 80% coverage required.

## 11. Environment Variables
Validated via Zod in `src/lib/env.ts`.

Validate via Zod in `app/lib/env.ts` when required.

## 12. Local Development Commands

- `pnpm dev`: Start dev server.
- `pnpm build`: Production build.
- `pnpm lint`: Run linting.

## 13. Deployment

Vercel for SSR, GitHub Pages for static export.

## 14. HeroUI v3 usage

Use compound component pattern (e.g., `<Table.Header>`).

## 15. Dark mode

Wiring via `next-themes` and Tailwind v4 variables.

## 16. Icon usage

`lucide-react` named imports with Tailwind `size-*` utilities.

## 17. Data layer
Mock data in `src/lib/data/mock.ts`, migration path to Supabase documented in `src/lib/data/README.md`.

Mock data in `app/data/templates.ts`, migration path to Supabase documented in `app/data/README.md`.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.0.1]

### Added

- Initial cur8d.dev implementation.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# Contributing to cur8d

## Setup

1. Fork the repository.
2. `mise install && pnpm install`.

## Branching

- `feat/`: New features.
- `fix/`: Bug fixes.
- `chore/`: Maintenance.

## Conventional Commits

We follow the Conventional Commits specification for all commit messages.

## Development

- Add tests for new components.
- Update documentation in `docs/` if applicable.
- Architecture changes require an ADR in `docs/content/adr/`.
60 changes: 60 additions & 0 deletions app/components/CodeBlock/CopyButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"use client";

import { useState } from "react";
import { Button, Tooltip } from "@heroui/react";
import { Copy, Check } from "lucide-react";

export function CodeBlockCopyButton({
code,
className,
}: {
code: string;
className?: string;
}) {
const [copied, setCopied] = useState(false);

const copyToClipboard = async () => {
try {
await navigator.clipboard.writeText(code);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch (err) {
console.error("Failed to copy: ", err);
}
};

return (
<Tooltip>
<Tooltip.Trigger
render={(triggerProps) => {
const buttonProps = triggerProps as unknown as React.ComponentProps<
typeof Button
>;
return (
<Button
{...buttonProps}
isIconOnly
size="sm"
variant="ghost"
className={`code-block__copy-button ${className || ""}`}
onClick={(e) => {
buttonProps.onClick?.(e);
copyToClipboard();
}}
aria-label="Copy to clipboard"
>
{copied ? (
<Check className="text-success h-4 w-4" />
) : (
<Copy className="h-4 w-4" />
)}
</Button>
);
}}
/>
<Tooltip.Content>
{copied ? "Copied!" : "Copy to clipboard"}
</Tooltip.Content>
</Tooltip>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ interface CodeBlockProps {
}

function CodeBlockRoot({ children, className }: CodeBlockProps) {
return (
<div className={`code-block ${className || ""}`}>
{children}
</div>
);
return <div className={`code-block ${className || ""}`}>{children}</div>;
}

interface CodeBlockHeaderProps {
Expand All @@ -21,22 +17,30 @@ interface CodeBlockHeaderProps {

function CodeBlockHeader({ children, className }: CodeBlockHeaderProps) {
return (
<div className={`code-block__header ${className || ""}`}>
{children}
</div>
<div className={`code-block__header ${className || ""}`}>{children}</div>
);
}

interface CodeBlockCodeProps {
code: string;
language?: string;
className?: string;
showPrompt?: boolean;
showCursor?: boolean;
}

function CodeBlockCode({ code, language, className }: CodeBlockCodeProps) {
function CodeBlockCode({
code,
language,
className,
showPrompt = false,
showCursor = false,
}: CodeBlockCodeProps) {
return (
<pre className={`code-block__code ${className || ""}`}>
{showPrompt && <span className="code-block__prompt">$ </span>}
<code className={language ? `language-${language}` : ""}>{code}</code>
{showCursor && <span className="code-block__cursor" aria-hidden="true" />}
</pre>
);
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function Providers({ children }: ProvidersProps) {

return (
<RouterProvider navigate={router.push}>
<NextThemesProvider attribute="class" defaultTheme="system" enableSystem>
<NextThemesProvider attribute="class" defaultTheme="dark" enableSystem>
{children}
</NextThemesProvider>
</RouterProvider>
Expand Down
Loading