Skip to content

feat(site): Next.js showcase site under site/ — audited + buildable#123

Merged
DemchaAV merged 6 commits into
developfrom
feat/nextjs-showcase-site
Jun 1, 2026
Merged

feat(site): Next.js showcase site under site/ — audited + buildable#123
DemchaAV merged 6 commits into
developfrom
feat/nextjs-showcase-site

Conversation

@DemchaAV
Copy link
Copy Markdown
Owner

@DemchaAV DemchaAV commented Jun 1, 2026

Summary

Adds a Next.js + TypeScript + Tailwind showcase site under
the new site/ top-level folder. Fully static — next build
emits ./out, deployable to GitHub Pages / Vercel / any static
host. Headline-companion for v1.6.8.

Two commits

  1. Vanilla import — copy the user-provided draft from
    ~/Downloads/GraphCompose/nextjs verbatim so subsequent
    diffs are clean.
  2. Audit pass — fixes the import / API / URL drift identified
    in the senior review of the draft.

What got fixed in the audit pass

Lane Before (draft) After (real API)
Package io.github.demchaav.graphcompose.* com.demcha.compose.*
Session type PdfRenderingSession.create() DocumentSession via GraphCompose.document().create()
Terminal .compose(session).writeTo(Path) session.buildPdf()
Section DSL .addSection(s -> ...) .addSection("Name", s -> ...)
Soft panel s.softPanel() no args s.softPanel(color, radius, padding)
Accent s.accentStrip() s.accentLeft(color, width)
Theme factory BusinessTheme.create() BusinessTheme.modern() / .classic() / .cinematic() / .nordic() etc.
CvDocument builder .name().title().summary().experience(...).skills(...) .identity(CvIdentity.builder().name(...).jobTitle(...).build()).section(new ParagraphSection / EntriesSection / CvEntry)
Gallery count 14 sketched names 16 real cv/v2 presets, 15 paired letters
Repo URL github.com/demchaav/graph-compose github.com/DemchaAV/GraphCompose
Install version 1.6.6 1.6.8
Mini changelog v1.6.6 cover-letter spacing only v1.6.8 markdown links / themes / CVE; v1.6.7 dep cleanup; v1.6.6 Central debut
pdf.js worker new URL("pdfjs-dist/build/pdf.worker.min.mjs", import.meta.url) CDN URL string (Next.js webpack pipeline cannot Terser-minify ESM worker; CDN bypasses bundling)

Build verification

> next build
✓ Compiled successfully
✓ Generating static pages (4/4)

Route (app)                              Size     First Load JS
┌ ○ /                                    12.4 kB        99.7 kB
└ ○ /_not-found                          871 B          88.2 kB
+ First Load JS shared by all            87.3 kB

Static export ready. ./out is gitignored — deploy job
materialises it.

What this PR does NOT add

  • Real PDF previewssite/public/previews/{hello,invoice,cv}.{pdf,png}.
    The site falls back to CSS paper renders (PaperHello / PaperInvoice / PaperCv components) until those land. The
    fallback already works visually.
  • GitHub Pages deploy workflowsite/.github/workflows/ deploy.yml exists in the draft but its checkout / build /
    upload-pages-artifact wiring is unverified. Follow-up PR.
  • Replacing the legacy docs/index.html showcase — both
    coexist during the v1.6.8 cycle. The migration cut will be
    staged once we've validated the Next.js variant against the
    existing showcase pipeline.

CHANGELOG

A new ### Web subsection under v1.6.8 — Planned documents
the site addition explicitly.

Test plan

  • cd site && npm install && npx next build — exits 0,
    ./out static export generated, 4 static pages.
  • Three Playground code samples (hello / invoice / cv)
    use real GraphCompose API: README hello-world mirror,
    InvoiceFileExample pattern, ModernProfessional preset +
    CvDocument.builder.
  • Gallery enumerates the 16 real cv/v2 presets with their
    paired-letter status; CSS fallback (PaperCv / PaperLetter)
    renders for each.
  • All github.com/ URLs use the correct DemchaAV/GraphCompose
    capitalisation.
  • Install snippets pin 1.6.8.

Sequencing with #122

This PR and #122
(release-prep) both touch CHANGELOG.md in the v1.6.8 section.
Merge order:

  1. Merge this PR first.
  2. Rebase docs(release): prep v1.6.8 — feature summary + migration table (PR-1.6.8) #122 on the new develop; the only conflict will be
    the section ordering inside v1.6.8 — Planned, easy resolve.
  3. Then cut.

DemchaAV added 6 commits June 1, 2026 18:20
…dit)

Imports the Next.js + TypeScript + Tailwind showcase site draft
provided by the user (originally authored under
C:\Users\Demch\Downloads\GraphCompose\nextjs) verbatim into the
repo as a new top-level `site/` folder. No code changes yet —
this commit is the baseline against which subsequent audit
commits diff cleanly.

Structure:
  site/app/                Next.js App Router entry (layout, page,
                            globals.css)
  site/components/         13 React components (TopBar, Hero,
                            Playground, PdfPreview, Pipeline,
                            Gallery, Positioning, Engineering,
                            Cta, Footer, etc.)
  site/lib/                presets.tsx (3 playground code samples),
                            gallery.ts (14 CV preset cards),
                            deps.ts (Maven/Gradle snippets),
                            highlight.ts (tiny Java highlighter)
  site/public/previews/    placeholder for real PDFs
  site/.github/workflows/  deploy.yml (static export → Pages)

Build pipeline: Next.js 14 App Router, static export via
`next build` → `./out`. Deployable to GitHub Pages.

Known issues this baseline does NOT yet address (will be fixed
in subsequent commits on this branch):

1. `lib/presets.tsx` — all 3 code samples (hello / invoice / cv)
   use API that does not match the actual GraphCompose surface:
   - `import io.github.demchaav.graphcompose.*` should be
     `com.demcha.compose.*` (groupId vs package mismatch)
   - `PdfRenderingSession.create()` does not exist; real entry is
     `DocumentSession` via `GraphCompose.document().create()`
   - `.compose(session).writeTo(Path.of(...))` not chainable;
     real terminals are `session.buildPdf()` / `toPdfBytes()` /
     `render(backend)`
   - `addSection(s -> s.addParagraph(...))` should be
     `module(...)`
   - `s.softPanel()` / `s.accentStrip()` require explicit args
   - `CvDocument.builder().name(...).title(...).summary(...)`
     has a different shape — real CvDocument is a record
     `(CvIdentity, List<Placement>)` whose builder mirrors that
2. `lib/gallery.ts` — 14 entries; the actual cv/v2 lineup has
   16 presets (boxed_sections, minimal_underlined,
   modern_professional, nordic_clean, centered_headline,
   blue_banner, editorial_blue, classic_serif, compact_mono,
   executive, panel, timeline_minimal, engineering_resume,
   monogram_sidebar, sidebar_portrait, mint_editorial).
3. `lib/deps.ts` — Maven/Gradle snippets need to pin
   `io.github.demchaav:graph-compose:1.6.8` (the hyphenated
   artifactId from the v1.6.6 cut).
4. `next build` not yet verified — first audit pass will run it.

Tracked in the v1.6.8 readiness taskboard as Site-1..Site-6.
Bundles the audit changes for the Next.js showcase draft committed
in the previous commit. After this pass the site builds cleanly
(`next build` exits 0, 4 static pages, 99.7 kB first-load JS) and
every code snippet maps to real GraphCompose API.

Site-2 (code samples — lib/presets.tsx):
  - Hello → README hello-world snippet (real API: GraphCompose.
    document(Path), .pageSize(A4), DocumentSession lifecycle,
    .addSection(name, lambda), .softPanel(color, radius, padding),
    .accentLeft(color, width), .addParagraph(p -> p.text(..).
    textStyle(theme.text().h1())), doc.buildPdf()).
  - Invoice → custom DSL composition mirroring
    examples/.../InvoiceFileExample patterns (header + softPanel +
    table.header/row + total).
  - CV → CvDocument.builder().identity(CvIdentity.builder().name
    .jobTitle.build()).section(new ParagraphSection / EntriesSection
    / CvEntry).build() + ModernProfessional.create().compose(doc, cv).
  - `lines: { soft, accent, theme }` arrays recalculated for the
    new line numbers so the DSL feature chips still highlight the
    right ranges.
  - Hero teaser code in components/Hero.tsx rewritten to mirror
    the same canonical surface (compact 10-line variant).
  - components/Playground.tsx chip tokens updated to real
    `.softPanel(color, radius, padding)` / `.accentLeft(color,
    width)` / `BusinessTheme.modern()` signatures.

Site-3 (gallery — lib/gallery.ts + components/Gallery.tsx):
  - Replaced the 14 sketched entries with the full 16-preset
    cv/v2 lineup (BlueBanner, BoxedSections, CenteredHeadline,
    ClassicSerif, CompactMono, EditorialBlue, EngineeringResume,
    Executive, MinimalUnderlined, MintEditorial, ModernProfessional,
    MonogramSidebar, NordicClean, Panel, SidebarPortrait,
    TimelineMinimal). 15 paired with a `…Letter` preset;
    MinimalUnderlined ships unpaired by design.
  - `pair` field now nullable; Gallery card + modal handle the
    "no letter" case explicitly.
  - Gallery heading text and lead-in updated to 16 / 15 counts.

Site-4 (deps — lib/deps.ts):
  - Maven + Gradle install snippets pinned to
    `io.github.demchaav:graph-compose:1.6.8` (was 1.6.6 in the
    draft). Comment notes the cut-release.ps1 does not touch this
    file so the next release must bump it manually.

Site-5 (build):
  - Repository URL refs corrected everywhere from
    `github.com/demchaav/graph-compose` (lowercase) to
    `github.com/DemchaAV/GraphCompose` (real org/repo). Hero
    button, Cta links, Footer links, TopBar nav.
  - Engineering mini-changelog reflects the actual recent
    release notes (v1.6.8 markdown links / 4 themes / CVE fix;
    v1.6.7 dep cleanup; v1.6.6 Maven Central debut).
  - components/PdfPreview.tsx — switched the pdf.js worker to a
    CDN URL string instead of `new URL("pdfjs-dist/build/pdf.
    worker.min.mjs", import.meta.url)`. Next.js's webpack pipeline
    pushed the ESM worker through Terser, which choked on the
    bare top-level `import` / `export`. CDN-loaded worker bypasses
    bundling entirely. cmaps / standard_fonts already loaded from
    the same CDN, so no new origin added.
  - public/previews/README.md — generation snippet rewritten to
    real DocumentSession lifecycle.

CHANGELOG:
  - New ### Web subsection under v1.6.8 — Planned documents the
    site addition explicitly. Live for the v1.6.8 cut.

What this commit does NOT add:
  - Real `public/previews/*.pdf` files. Site falls back to CSS
    paper renders until those land — that fallback already works
    (PaperHello / PaperInvoice / PaperCv components).
  - GitHub Pages deploy workflow wiring. `site/.github/workflows/
    deploy.yml` exists in the draft but its checkout / build
    targets are unverified; will be its own follow-up.
…v1.6.8)

Promotes the site/ folder added in the previous commits to the
canonical GitHub Pages deploy target.

Changes:

  1. New workflow .github/workflows/deploy-site.yml
     - Triggers on push to main when site/** changes (path-
       filtered) or via workflow_dispatch.
     - Steps: checkout, setup-node 20 with npm cache pinned to
       site/package-lock.json, `npm ci`, `npx next build`,
       upload-pages-artifact from site/out, deploy-pages.
     - The site/.github/workflows/deploy.yml draft from the
       initial import is removed — workflows only fire from the
       repo root .github/workflows/. The draft also used pnpm,
       which mismatches the npm lockfile we generated in the
       audit pass.
     - Concurrency group "pages" with cancel-in-progress keeps
       overlapping pushes from racing.

  2. scripts/cut-release.ps1 — new Update-SiteDepsVersion helper
     - Bumps site/lib/deps.ts <version> + Gradle coords in
       lockstep with the README + 4 poms. Without this the next
       release would silently ship the site with a stale version
       in the install snippet (the pom-bump pipeline never
       touched site/ before).
     - site/lib/deps.ts added to the `git add` list inside
       Step 6 (Commit release).

  3. README "What can I do with this?" table gains a row for
     the showcase site:
       "See the live playground / gallery | Next.js showcase site |
        [Showcase] — source under site/, built with next build and
        deployed via the Pages workflow"
     Link points at the user.github.io/GraphCompose URL the new
     workflow will publish to once Pages source is flipped.

  4. CHANGELOG ### Web subsection upgraded to reflect the
     official-target status: documents the workflow, the manual
     Pages settings flip required to take over from the legacy
     docs/ deploy, and the new cut-release wiring. Notes that
     docs/index.html stays in the tree for one cycle as a
     rollback target before the v1.6.9 cleanup removes it.

Manual step the maintainer takes one time after this lands on
main:

  Settings → Pages → Build and deployment → Source:
      "Deploy from a branch"  →  "GitHub Actions"

After that flip, the workflow above owns publishes. The legacy
docs/index.html stops getting deployed (still in the tree as a
reference) and the new Next.js site goes live at
https://DemchaAV.github.io/GraphCompose/.

Sequencing note: the rebuilt deploy fires only when site/**
changes after this PR lands on main. To force a first deploy,
either use workflow_dispatch from the Actions tab, or merge
this PR + bump anything in site/ (the v1.6.8 cut script will
itself bump site/lib/deps.ts and trigger the deploy).
…1.6.8 site-promotion)

Companion commit to the deploy workflow added in the previous
commit. The artifact changes that workflow needs to render
correctly:

  1. README "What can I do with this?" table gains a row for
     the showcase site (link to the user.github.io/GraphCompose
     URL the new workflow publishes to once Pages source is
     flipped).

  2. CHANGELOG.md ### Web subsection upgraded to official-target
     status: documents the workflow, the manual Pages settings
     flip required to take over from the legacy docs/ deploy,
     the new cut-release wiring, and the docs/index.html rollback
     window through v1.6.9.

  3. scripts/cut-release.ps1 — new Update-SiteDepsVersion helper
     bumps site/lib/deps.ts <version> + Gradle coords in lockstep
     with the README + 4 poms. site/lib/deps.ts added to the
     `git add` list inside Step 6 (Commit release) so the cut
     commit carries the site version too.
…mple (final audit)

A second audit pass after promoting the site to the official
Pages target, addressing inconsistencies the first pass missed:

- components/Pipeline.tsx — the §03 "How it works" §01 step's
  STEP1 source sample still used the legacy
  `flow.addSection(s -> s.addParagraph(...).addTable(rows))` shape
  with no section-name argument. Rewritten to mirror real DSL:
  `page.addSection("Summary", s -> s.addParagraph(p -> p.text(...))
  .addTable(t -> t.header(...).row(...)))`.

- components/Cta.tsx + components/PaperPage.tsx + lib/presets.tsx
  — every CV demo persona was the placeholder name
  "Avetik Demchaav" that drifted into the draft from earlier
  iterations. Canonical author per `pom.xml`, `README`, javadocs
  and the v1.6.6+ Maven Central release metadata is
  **Artem Demchyshyn**. Replaced across the three locations
  (Cta "Work with me" card, PaperCv CSS fallback for all three
  layout variants, Playground CV preset code sample). Matching
  email address pinned to `demchishynartem@gmail.com` — the same
  one the Central artefact's POM developer block carries.

- components/Cta.tsx — "v2 quickstart" link pointed at
  `docs/quickstart.md`, a file that does not exist in the repo
  (a pre-existing dead link in the draft). Redirected to
  `docs/operations/test-your-document.md` — the testing
  quickstart guide that landed in v1.6.8 (#116). Link text
  updated to "Testing quickstart" to match.

Verification: ./out static export still builds clean
(`next build` exits 0, 4 pages, 99.8 kB first-load JS).
…nc (#123)

Pre-cut audit pass on the v1.6.8 Next.js showcase site. Addresses the
issues raised in interactive review and wires the release pipeline so
the site stays in lockstep with future cuts.

== UI / visual ==

* Topbar: replace placeholder mark with the real GraphCompose wordmark
  (54px tall, drop-shadow + contrast for the cream light bg, brightness
  boost for the near-black dark bg). Logo lives at site/public/brand/.

* Page order: Cta (Get started) moved to §02 right after the Hero so
  visitors see the install snippet without scrolling past 6 sections.
  All eyebrow numbers renumbered (Playground §02→§03, Pipeline §03→§04,
  Gallery §04→§05, Positioning §05→§06, Engineering §06→§07).

* Playground Monaco: was mounting at degenerate 5×5 because Reveal
  starts at opacity:0 and Monaco caches its mount-time size. Fix is
  three-pronged: automaticLayout:true (Monaco's own ResizeObserver),
  a 2×requestAnimationFrame deferred editor.layout() in onMount, and
  an IntersectionObserver on #playground that re-layouts when the
  section first scrolls into view.

* Playground PdfPreview: drop the pdf.js canvas swap that overlaid a
  near-identical render on top of the PNG poster — the sub-pixel
  anti-aliasing diff read as a jarring flicker on tab switch. Now
  poster-only; the 840×1188 PNG is high-res enough at the 300px
  display width. Remove key={active} on PdfPreview so the same <img>
  element survives tab switches and the browser cross-fades cached
  posters instead of unmount/mount-ing through the fallback.

== Mobile / responsive (375×812 verified) ==

* .pg-grid > * { min-width: 0 } — lets the Playground editor wrap
  shrink with the grid track on mobile. Monaco's intrinsic 592px
  was busting the 375px viewport.

* Positioning <table.cmp> wrapped in .cmp-scroll (overflow-x:auto,
  -webkit-overflow-scrolling:touch, thin styled scrollbar). Table
  min-width:760px so cells don't crush below readable size — user
  swipes the table horizontally on narrow screens.

== Links ==

* Cta "Testing quickstart" link now points to blob/develop/
  docs/operations/test-your-document.md (file is on develop, lands
  on main with the v1.6.8 cut — post-cut helper restores to main).

== Release pipeline (scripts/cut-release.ps1) ==

Three new bump helpers keep the site in lockstep with the next
release version on every cut:

* Update-SiteHeroVersion    — Hero badge coords on the landing page
* Update-SitePresetsVersion — presets.tsx docstring coords
* Update-SiteExamplesJsonTag — pins /blob/develop → /blob/v\$TAG
  across all 53 source-code links in examples.json

A new Sync-SiteShowcase helper mirrors freshly-regenerated showcase
artefacts so the Next.js site no longer drifts from the legacy
docs/ catalogue:

  docs/showcase/{pdf,screenshots}/**
    → site/public/showcase/**
  docs/examples.json
    → site/public/examples.json
  docs/showcase/screenshots/templates/cv/cv-*-v2.png
    → site/public/previews/cv-v2/
  docs/showcase/screenshots/templates/coverletter/cover-letter-*-v2.png
    → site/public/previews/coverletter-v2/

Wired in after Run-ShowcaseSync (Step 4). Step 6 git-add list extended
with all 4 site-version-bearing files plus the freshly-mirrored
showcase trees and per-preset previews — a single
\`pwsh ./scripts/cut-release.ps1 -Version X.Y.Z\` keeps everything in
one release commit. Dry-run verified for 1.6.9.

== Assets ==

* site/public/brand/graphcompose-logo.png — wordmark for topbar (113 KB).
* site/public/showcase/ — 53 PDFs + 38 PNGs mirrored from docs/ (8.1 MB).
* site/public/previews/{cv-v2,coverletter-v2}/ — 16 + 15 PNG covers.
* site/public/examples.json — 53-entry manifest copy.

Verified: site review against the new layout (links / catalog filters /
light+dark theme); mobile probe (375×812) shows 0 overflow across all
6 content sections; cut-release.ps1 dry-run for 1.6.9 shows all 4
site-files bumped + 5 showcase mirrors copied + Step 6 commit picks
them all up.
@DemchaAV DemchaAV merged commit b8e775f into develop Jun 1, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/nextjs-showcase-site branch June 1, 2026 21:42
DemchaAV added a commit that referenced this pull request Jun 1, 2026
Release-prep documentation pass for v1.6.8. Reformats the in-progress CHANGELOG entry with:

- Feature summary section grouping the public-API changes (markdown links in project titles, 4 new contemporary BusinessTheme presets) and the under-the-hood polish (registry symmetry, negative tests, NodeRegistry @SInCE note)
- Migration table calling out what existing users need to know (zero breaking changes, japicmp clean — semver PATCH)
- New ### Web subsection declaring the Next.js showcase site (introduced in #123) as the official GitHub Pages deploy target from v1.6.8 onward
- Pointer to test-your-document.md guide on develop (lands on main with the cut)

Sets up cut-release.ps1 Step 2 (CHANGELOG date flip) to convert '## v1.6.8 — Planned' to '## v1.6.8 — $(today)' cleanly when the release runs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant