Skip to content

Enable sitemap host and copy sitemap to build output#2093

Merged
ComputelessComputer merged 1 commit intomainfrom
enable-sitemap-host-copy
Dec 3, 2025
Merged

Enable sitemap host and copy sitemap to build output#2093
ComputelessComputer merged 1 commit intomainfrom
enable-sitemap-host-copy

Conversation

@ComputelessComputer
Copy link
Collaborator

Set the sitemap host for TanStack's prerender to "https://hyprnote.com" so sitemap generation is enabled and avoids the typecheck hint about missing sitemap.host. Also copy the prebuilt public/sitemap.xml into the Vite build output (dist/client) before running pagefind so the sitemap is present at /sitemap.xml and not 404. This resolves the collision between TanStack's sitemap handling and the existing apps/web sitemap file; it preserves using apps/web/content-collections.ts for content sources.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 3, 2025

📝 Walkthrough

Walkthrough

Added sitemap handling to the web build: the build script now copies public/sitemap.xml into dist/client before running pagefind, and the TanStack Start Vite plugin was configured with sitemap.host = "https://hyprnote.com".

Changes

Cohort / File(s) Summary
Sitemap build & Vite plugin
apps/web/package.json, apps/web/vite.config.ts
In package.json build script, run cp public/sitemap.xml dist/client/sitemap.xml after vite build and before pagefind; in vite.config.ts, add sitemap: { host: "https://hyprnote.com" } to the tanstackStart plugin options.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Focus review on: correct copy path and platform portability of cp (shell compatibility), accurate placement of sitemap in dist/client, and ensuring tanstackStart plugin accepts the new sitemap.host option.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Enable sitemap host and copy sitemap to build output' accurately reflects the two main changes: setting the sitemap host in vite.config.ts and adding a copy step in package.json.
Description check ✅ Passed The description is directly related to the changeset, providing specific context about why the sitemap host is being set and how it resolves the collision with the existing sitemap file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enable-sitemap-host-copy

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d05cb6 and 77b4a61.

📒 Files selected for processing (2)
  • apps/web/package.json (1 hunks)
  • apps/web/vite.config.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/web/vite.config.ts
  • apps/web/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: fmt
  • GitHub Check: ci
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 77b4a61
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/692ffd7b2e26a600087a8d5b
😎 Deploy Preview https://deploy-preview-2093--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit 77b4a61
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/692ffd7bdd869e0008f9de38
😎 Deploy Preview https://deploy-preview-2093--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/web/vite.config.ts (1)

18-20: Confirm sitemap host is the intended canonical domain for all builds

Adding sitemap.host should fix the type hint and produce correct absolute URLs; just confirm https://hyprnote.com is the canonical host you want for all environments (including Netlify previews). If you ever need environment-specific hosts, consider wiring this through an env var instead of hard-coding.

apps/web/package.json (1)

7-7: Build script behavior and portability

The updated build pipeline correctly ensures sitemap.xml is in dist/client before pagefind runs, which should fix the 404. Note that using bare cp makes this script POSIX-only and will fail if public/sitemap.xml is ever missing; if Windows dev environments or softer failure modes matter, you could swap this for a small Node copy script or a cross‑platform CLI.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 867201e and 5d05cb6.

📒 Files selected for processing (2)
  • apps/web/package.json (1 hunks)
  • apps/web/vite.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Agent implementations should use TypeScript and follow the established architectural patterns defined in the agent framework
Agent communication should use defined message protocols and interfaces

Files:

  • apps/web/vite.config.ts
**/*.config.{ts,json}

📄 CodeRabbit inference engine (CLAUDE.md)

Agent configuration should be centralized and externalized from implementation logic

Files:

  • apps/web/vite.config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, use cn (import from @hypr/utils). It is similar to clsx. Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/web/vite.config.ts
🧠 Learnings (1)
📚 Learning: 2025-11-24T16:32:24.348Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: apps/desktop-e2e/AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:24.348Z
Learning: Applies to apps/desktop-e2e/**/*.{test,spec}.{js,ts,tsx} : Refer to `scripts/setup-desktop-e2e.sh` for end-to-end test environment setup if setup is missing

Applied to files:

  • apps/web/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Redirect rules - hyprnote-storybook
  • GitHub Check: Header rules - hyprnote-storybook
  • GitHub Check: Pages changed - hyprnote-storybook
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
  • GitHub Check: fmt
  • GitHub Check: ci

Set the sitemap host for TanStack's prerender to "https://hyprnote.com" so sitemap generation is enabled and avoids the typecheck hint about missing sitemap.host. Also copy the prebuilt public/sitemap.xml into the Vite build output (dist/client) before running pagefind so the sitemap is present at /sitemap.xml and not 404. This resolves the collision between TanStack's sitemap handling and the existing apps/web sitemap file; it preserves using apps/web/content-collections.ts for content sources.
@ComputelessComputer ComputelessComputer merged commit f2c614f into main Dec 3, 2025
13 checks passed
@ComputelessComputer ComputelessComputer deleted the enable-sitemap-host-copy branch December 3, 2025 09:09
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

Comments