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
39 changes: 39 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Public site

on:
pull_request:
paths:
- 'site/**'
- '.github/workflows/site.yml'
- '.github/workflows/pages.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
site:
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: site
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 11.9.0
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: site/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm exec playwright install --with-deps chromium
- run: pnpm test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: site-test-results
path: site/test-results
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# General
.DS_Store
node_modules/
.pnpm-store/
site/.ssr/
site/test-results/
# Screenshots, briefs and scratch output (never committed).
tmp/
# Per-worktree ports, written by scripts/bootstrap.sh.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Srcly is an interactive codebase treemap and metrics viewer. It combines [Lizard

Project background and screenshots: [Srcly project page](https://byroni.us/projects/srcly).

[Website and user guides](https://byronwall.github.io/srcly/) · [Get started](https://byronwall.github.io/srcly/docs/get-started/) · [CLI reference](https://byronwall.github.io/srcly/docs/cli/)

To try it in your current folder, run:

```
Expand Down
8 changes: 8 additions & 0 deletions docs/CODE_MAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ Browser

## Features

### Public site

| Feature | Where |
| --- | --- |
| Landing page, interactive treemap example, shared navigation | `site/src/App.tsx`, `site/src/Landing.tsx`, `site/src/site.css` |
| User guides, search, table of contents | `site/src/App.tsx`, `site/src/docs/` |
| Static HTML, page metadata, sitemap, and GitHub Pages base path | `site/src/server.tsx`, `site/scripts/prerender.mjs`, `site/vite.config.ts` |

### CLI and process lifecycle

| Feature | Where |
Expand Down
13 changes: 13 additions & 0 deletions site/DEPLOY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Deploy

Build the static site, then deploy it from the repository checkout:

```sh
cd site
pnpm build
node scripts/deploy.mjs
```

The script publishes `dist/` to the `gh-pages` branch and adds `.nojekyll`.
It uses a temporary clone, keeps existing branch history, and pushes without force.
The commit author and committer are Byron Wall (`byron@byroni.us`).
20 changes: 20 additions & 0 deletions site/DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Public site

The public site extends Srcly's light application palette and Draftably's demonstration-first structure.
It serves developers who want to inspect a local codebase or generate a report for an agent.

The landing page pairs a direct setup command with an interactive, labeled example.
The example explains tile area, metric color, and file selection before the longer product copy.
Guides use grouped navigation, content search, section links, and previous/next links.

## Tokens

- Canvas: `#f8fafc`; paper: `#fff`; ink: `#17212e`.
- Body detail: `#526273`; rules: `#dce3ea`.
- Links and actions: `#1769aa`; hover: `#0e548d`.
- Type: Inter for text; IBM Plex Mono for code and measurements.
- Page width: 1160px; hero type: 42–68px; body: 15px.
- Controls have visible focus outlines. Motion respects reduced-motion settings.

The treemap and terminal output are illustrations. Keep that labeling visible.
Do not imply the public site scans files or that missing measurements equal zero.
35 changes: 35 additions & 0 deletions site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Srcly public site

The landing page and user guides deploy to [GitHub Pages](https://byronwall.github.io/srcly/).
The analysis app still runs locally through `uvx srcly`.

```sh
cd site
pnpm install --frozen-lockfile
pnpm dev
pnpm build
pnpm test
```

Open the printed development URL with `/srcly/` appended.
The build writes `site/dist/`. Each guide has a complete HTML page, with page metadata and a canonical URL.
The browser adds the interactive example, guide search, and copy buttons.

Edit user guides in `src/docs/pages/`. Keep command examples in sync with `server/app/run.py`.
Add new pages to the navigation in `src/App.tsx` when required.
The build reads page titles and introductions from Markdown for search metadata.

The site uses its own dependencies and build. It does not ship inside the Python wheel.
Pull requests build the site and run its browser checks. See [DEPLOY.md](DEPLOY.md) to publish the build to GitHub Pages.

## Reference and design

Draftably's public site supplied the structure: an interactive product example, direct setup actions, and searchable task guides.
Srcly keeps its light surfaces, blue links, Inter type, and IBM Plex Mono commands.
The treemap uses clearly labeled example data. It does not scan visitor files.

## Verification

`pnpm test` runs a browser against the built site under `/srcly/`.
It checks direct guide links, rendered content, navigation, search, the example controls, and narrow screens.
Keep screenshot evidence under the repository's ignored `tmp/` directory.
15 changes: 15 additions & 0 deletions site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#f8fafc" />
<link rel="icon" type="image/svg+xml" href="%BASE_URL%favicon.svg" />
<title>Srcly — See where your code needs attention</title>
<!-- page-meta -->
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions site/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "srcly-site",
"private": true,
"version": "0.0.0",
"type": "module",
"packageManager": "pnpm@11.9.0",
"scripts": {
"dev": "vite --host 127.0.0.1",
"typecheck": "tsc --noEmit",
"build": "pnpm typecheck && vite build && vite build --ssr src/server.tsx --outDir .ssr && node scripts/prerender.mjs",
"preview": "vite preview --host 127.0.0.1",
"test": "playwright test"
},
"dependencies": {
"@fontsource-variable/inter": "^5.3.0",
"@fontsource/ibm-plex-mono": "^5.3.0",
"lucide-solid": "^1.49.0",
"marked": "^17.0.6",
"solid-js": "^1.9.18"
},
"devDependencies": {
"@playwright/test": "1.62.0",
"@types/node": "^24.19.2",
"typescript": "~5.9.3",
"vite": "^7.3.7",
"vite-plugin-solid": "^2.11.15"
}
}
19 changes: 19 additions & 0 deletions site/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig, devices } from "@playwright/test";

export default defineConfig({
testDir: "./tests",
fullyParallel: false,
workers: 1,
retries: process.env.CI ? 1 : 0,
reporter: "list",
use: {
baseURL: "http://127.0.0.1:18588/srcly/",
trace: "retain-on-failure",
},
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"], viewport: { width: 1440, height: 1000 } } }],
webServer: {
command: "pnpm preview --port 18588 --strictPort",
url: "http://127.0.0.1:18588/srcly/",
reuseExistingServer: !process.env.CI,
},
});
Loading
Loading