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
5 changes: 5 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- run: pnpm install --frozen-lockfile
- run: pnpm build:packages
- run: pnpm docs:build
- name: Add the Next.js example as a live demo
run: |
BASE_PATH=/shipdot/demo/next pnpm --filter @shipdot/example-next build
mkdir -p apps/docs/dist/demo
cp -r examples/next/out apps/docs/dist/demo/next
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: apps/docs/dist
Expand Down
1 change: 1 addition & 0 deletions PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,4 @@ Candidates found while reviewing the widget (2026-10-21). Not covered by open Gi
- 2026-10-21 — Popover focus: tabbing out of the popover closes it and leaves focus where it went. Before, it stayed open behind the page and a later Esc pulled focus back to the trigger.
- 2026-10-21 — Feed refresh: a tab that comes back to the foreground 10 minutes or more after the last load fetches `src` again, and every fetch revalidates (`cache: 'no-cache'`), so tabs left open for days pick up new entries. New entries arrive unread.
- 2026-10-21 — Placement and theme sync: a popover opened above the trigger is anchored by its bottom edge and the hotspot tooltip is re-placed when it resizes, so images that load late no longer push them over their anchor. The hotspot layer re-copies the host's theme properties after DOM changes (only writing on a change, so it cannot loop), so an app theme switch reaches the dots and tooltip.
- 2026-10-22 — Next.js demo: `examples/next` is a static export (`output: 'export'`, `basePath` from `BASE_PATH`), and the docs workflow publishes it at `/shipdot/demo/next/` next to the docs, so the example has a live URL.
2 changes: 1 addition & 1 deletion apps/docs/src/content/docs/frameworks/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ The `shipdot` module is safe to import during server rendering: it only register

Run `shipdot build` before `next build` so `public/shipdot.json` exists. With TypeScript, add `import type {} from 'shipdot/react'` once for JSX types.

Full example: [`examples/next`](https://github.com/pipe1os/shipdot/tree/main/examples/next).
Full example: [`examples/next`](https://github.com/pipe1os/shipdot/tree/main/examples/next) ([live demo](https://pipe1os.github.io/shipdot/demo/next/)).
1 change: 1 addition & 0 deletions examples/next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ pnpm --filter @shipdot/example-next dev
- `.shipdot/entries/`: one entry per update. `2026-10-14-export-csv.md` has `target: "#btn-export"`, so the widget puts a hotspot on that button. The `.es.md` file is its Spanish translation.
- `app/whats-new.jsx`: a client component that imports `shipdot` and renders `<ship-dot>`.
- `app/page.jsx`: renders `<WhatsNew />` in the header, which puts the widget there.
- `next.config.mjs`: `output: 'export'`, so `build` writes a static site to `out/`. The docs workflow builds it with `BASE_PATH=/shipdot/demo/next` and publishes it at https://pipe1os.github.io/shipdot/demo/next/.

`first-visit="show-latest"` keeps the newest entry unread on the first visit so you can see the badge and the hotspot right away. Clear the `shipdot:default` key in localStorage to see it again.
2 changes: 1 addition & 1 deletion examples/next/app/whats-new.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
import 'shipdot'

export function WhatsNew() {
return <ship-dot src="/shipdot.json" first-visit="show-latest" />
return <ship-dot src={`${process.env.BASE_PATH}/shipdot.json`} first-visit="show-latest" />
}
9 changes: 8 additions & 1 deletion examples/next/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
// BASE_PATH is set when the docs workflow exports this example to GitHub Pages.
const basePath = process.env.BASE_PATH ?? ''

/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {
output: 'export',
basePath,
env: { BASE_PATH: basePath },
}

export default nextConfig
3 changes: 1 addition & 2 deletions examples/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"type": "module",
"scripts": {
"dev": "shipdot build && NEXT_TELEMETRY_DISABLED=1 next dev",
"build": "shipdot build && NEXT_TELEMETRY_DISABLED=1 next build",
"start": "next start"
"build": "shipdot build && NEXT_TELEMETRY_DISABLED=1 next build"
},
"dependencies": {
"next": "16.4.2",
Expand Down
Loading