Skip to content

Commit 153adcf

Browse files
committed
refactor: reset website to minimal Askr SSG
1 parent 3547f3d commit 153adcf

187 files changed

Lines changed: 323 additions & 10032 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
1-
name: Deploy
1+
name: Pages
22

33
on:
44
push:
55
branches: [main]
6+
pull_request:
7+
branches: [main]
68
workflow_dispatch:
79

8-
concurrency:
9-
group: github-pages
10-
cancel-in-progress: true
11-
12-
permissions:
13-
contents: read
14-
pages: write
15-
id-token: write
16-
1710
jobs:
1811
build:
1912
runs-on: ubuntu-latest
2013
timeout-minutes: 20
14+
permissions:
15+
contents: read
2116
steps:
2217
- name: Checkout
2318
uses: actions/checkout@v7
@@ -30,26 +25,32 @@ jobs:
3025
cache-dependency-path: package-lock.json
3126

3227
- name: Configure GitHub Pages
28+
if: github.event_name != 'pull_request'
3329
uses: actions/configure-pages@v6
3430

3531
- name: Install dependencies
3632
run: npm ci
3733

38-
- name: Build
39-
run: npm run build
40-
41-
- name: Verify static output
42-
run: npm run verify:static
34+
- name: Check
35+
run: npm run check
4336

4437
- name: Upload artifact
38+
if: github.event_name != 'pull_request'
4539
uses: actions/upload-pages-artifact@v5
4640
with:
4741
path: ./dist
4842

4943
deploy:
5044
needs: build
45+
if: github.event_name != 'pull_request'
5146
runs-on: ubuntu-latest
5247
timeout-minutes: 20
48+
permissions:
49+
pages: write
50+
id-token: write
51+
concurrency:
52+
group: github-pages
53+
cancel-in-progress: true
5354
environment:
5455
name: github-pages
5556
url: ${{ steps.deployment.outputs.page_url }}

.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,46 @@
11
# Askr website
22

3-
Static website for the Askr ecosystem, generated with Vite Plus and the Askr CLI, then deployed to GitHub Pages.
3+
Minimal hydrated Askr static site, generated with Vite Plus and the Askr CLI,
4+
then deployed to GitHub Pages.
45

56
The website consumes published `@askrjs/*` packages from npm. Local builds and
67
CI therefore validate the same package boundary used by GitHub Pages.
78

89
## Commands
910

10-
- `npm run build` - full static build into `dist/`
11-
- `npm run generate` - run the Askr static-site generator using the built client template
12-
- `npm run build:incremental` - incremental static generation build
13-
- `npm run verify:static` - validate generated document output
14-
- `npm run preview` - run a local production preview
15-
- `npm run typecheck` - TypeScript validation
16-
- `npm run lint` - lint project files
17-
- `npm run fmt` - format project files
18-
- `npm run check` - lint + typecheck + structure + build + static output verification
11+
- `npm run dev` starts the Vite development server.
12+
- `npm run build` builds the client and runs `askr ssg` into `dist/`.
13+
- `npm run verify:static` validates the generated route, markup, and assets using
14+
only Node.js built-ins.
15+
- `npm run preview` serves `dist/` with `vp preview --outDir dist`.
16+
- `npm run check` runs lint, typecheck, build, and static verification.
1917

2018
## Architecture
2119

22-
- `ssg.config.ts`: exports the route registry, document renderer, generation settings, and built assets consumed by `askr ssg`
23-
- `scripts/verify-static-output.ts`: verifies generated document shape, metadata, and assets
24-
- `index.html`: canonical document template for dev and generated output
25-
- `src/pages/_routes.ts`: shared route registry and document metadata lookup
26-
- `src/pages/home/`, `src/pages/framework/`, `src/pages/ui/`, `src/pages/themes/`: top-level route groups with page-owned `_routes` files
27-
- `src/pages/docs/_routes.ts`: docs route group backed by docs-local layout and registry modules
28-
- `src/pages/showcase/_routes.ts`: showcase route group, including nested UI component detail routes
29-
- `src/site/shell/`: body-level site chrome shared by pages
30-
- `src/site/primitives/`: reusable site-level building blocks
31-
- `src/pages/docs/`: docs pages and docs-owned private helpers
32-
- `src/pages/showcase/`: showcase pages plus UI registry, demos, and models
33-
- `src/site/navigation.ts`: cross-site navigation contracts and links
34-
- `src/styles.css`: shared site styles
35-
36-
### Build Pipeline Notes
37-
38-
- Dev (`vp dev`) uses `index.html` and mounts `src/app/client.tsx`.
39-
- Client build (`npm run build:client`) builds `index.html`, app JS, CSS, public assets, and the reusable static document template.
40-
- Static generation (`npm run generate`) runs through `askr ssg`, renders shared route handlers, wraps them with the built client template, and atomically publishes routes and assets.
41-
- Incremental generation is available through `npm run generate:incremental`; use `--changed-route`, `--changed-key`, or `--force-full` when the route source supports those signals.
42-
- SSR build (`npm run build:ssr`) compiles `src/app/server/entry-server.tsx`; SSR callers provide the built document template to `renderPage()`.
43-
- Theme boot is centralized in `public/theme-init.js` and loaded by `index.html`.
44-
45-
## Automation
46-
47-
- `.github/workflows/ci.yml` only installs the published dependencies, builds the static site, verifies `dist`, and uploads the build artifact.
48-
- `.github/workflows/deploy.yml` builds and verifies the site on `main`, then publishes `dist` through GitHub Pages.
49-
50-
## Initial Scope
51-
52-
- Home page
53-
- Showcase landing pages for askr, askr-ui, askr-themes, and askr CLI workflows
54-
- Starter docs pages authored directly in this repository
20+
- `src/pages/_layout.tsx` owns the root `<main>` shell.
21+
- `src/pages/_routes.tsx` owns the shared browser/SSG route registry.
22+
- `src/pages/home.tsx` renders the `/` page.
23+
- `src/main.tsx` hydrates generated markup and starts the SPA in development.
24+
- `ssg.config.ts` injects rendered HTML into Vite's built document and publishes
25+
its hashed assets.
26+
27+
The internal route registry is the only interface shared by the browser and
28+
SSG. This package does not expose a public API.
29+
30+
## Build and publish flow
31+
32+
1. `npm run build:client` builds the browser entry and stylesheet into
33+
`.askr/client/` with hashed asset names.
34+
2. `npm run build:ssg` renders `/`, injects it into the built Vite document,
35+
and publishes the result to `dist/`.
36+
3. `npm run verify:static` checks `dist/metadata.json`, pre-rendered content,
37+
and every referenced asset.
38+
39+
`.github/workflows/deploy.yml` is the only workflow. Pull requests run install
40+
and all checks without deploying. Pushes to `main` and manual dispatches run the
41+
same gates, upload `dist/`, and deploy it through the `github-pages`
42+
environment.
43+
44+
The repository does not carry a `CNAME` file. Configure `askrjs.com` in the
45+
repository's Pages settings (or through the Pages API), wait for DNS and the
46+
certificate to become healthy, then enable HTTPS enforcement.

index.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Askr</title>
7-
<meta
8-
name="description"
9-
content="Fine-grained reactive framework, accessible UI primitives, theme tokens, and static site generation for Askr apps."
10-
/>
11-
<link rel="icon" type="image/png" href="/assets/askr-logo.png" />
12-
<link rel="apple-touch-icon" href="/assets/askr-logo.png" />
13-
<script src="/theme-init.js"></script>
14-
<link rel="stylesheet" href="/src/styles.css" />
157
</head>
168
<body>
179
<div id="app"></div>
18-
<script type="module" src="/src/app/client.tsx"></script>
10+
<script type="module" src="/src/main.tsx"></script>
1911
</body>
2012
</html>

0 commit comments

Comments
 (0)