Skip to content

fix(web): make the demo link open the demo - #21

Merged
joshchen-dev merged 1 commit into
mainfrom
claude/great-shannon-b4y5vi
Oct 24, 2026
Merged

joshchen-dev merged 1 commit into
mainfrom
claude/great-shannon-b4y5vi

Conversation

@joshchen-dev

@joshchen-dev joshchen-dev commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Problem

On the product page, "Try the demo" didn't open the demo locally. Each click added another /demo/ to the URL (/demo/demo/demo/…).

The link was relative to the current page, and npm run dev:product had no demo to serve. Vite's single-page fallback therefore answered /demo/ with the product page again.

Fix

  • npm run dev:product starts the demo as well (web/scripts/dev-site.mjs) and serves it at /demo/. The product server uses appType: "mpa", so an unknown path is a 404 rather than the product page. The script runs vite directly, so stopping it stops both servers.
  • The built site uses relative paths (base: "./" for both builds). It now also works under joshchen-dev.github.io/raidy/ before a custom domain is set. The demo's "About Raidy" link and Sign out go back to the product page (productURL in web/src/lib/paths.ts).
  • Each Vite config and mode keeps its own dependency cache. The app, demo and product servers shared node_modules/.vite, so each one invalidated the others' dependencies on start-up. That made first loads fail when they ran together.

Release v0.0.19.

Tests

  • A new Playwright regression test clicks "Try the demo", checks the demo opens at /demo/, then clicks "About Raidy" and checks it returns to /. The CI product server now runs the same dev-site script as npm run dev:product.
  • I also checked the built site served under a /raidy/ prefix. "Try the demo", "About Raidy" and "Open in Raidy" each land on the right page.
  • npm run check, format:check, screenshots, build:pages, and the full Playwright suite (32 passed) all pass locally.

On the product page, "Try the demo" was relative to the current page,
and `npm run dev:product` answered every path with the product page. So
/demo/ showed the product page again and each click added another /demo/.

- `npm run dev:product` now starts the demo too and serves it at /demo/;
  the product server no longer falls back to the product page.
- The built site uses relative paths, so it also works under
  joshchen-dev.github.io/raidy/ before a custom domain is set. The demo's
  "About Raidy" link and Sign out go back to the product page.
- Each Vite config and mode keeps its own dependency cache, so the dev
  servers stop re-optimizing each other's dependencies mid-load.

Release v0.0.19.
@joshchen-dev
joshchen-dev merged commit 773790c into main Oct 24, 2026
1 check passed
@joshchen-dev
joshchen-dev deleted the claude/great-shannon-b4y5vi branch October 24, 2026 03:43
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