Skip to content

Fix docs routing for forc.pub packages#94

Merged
JoshuaBatty merged 3 commits intomasterfrom
josh/docs.forc.pub
Nov 6, 2025
Merged

Fix docs routing for forc.pub packages#94
JoshuaBatty merged 3 commits intomasterfrom
josh/docs.forc.pub

Conversation

@JoshuaBatty
Copy link
Copy Markdown
Member

Ensure the frontend and docs route target the deployed API, normalize package-name handling, and serve documentation assets from their actual paths. Improves IPFS tarball decoding and logging so future doc publishes validate end-to-end.

@cursor
Copy link
Copy Markdown

cursor bot commented Nov 6, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on November 7.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@vercel
Copy link
Copy Markdown

vercel bot commented Nov 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
forc-pub Ready Ready Preview Comment Nov 6, 2025 1:42am

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves error handling, security validation, and documentation rendering in the application. The changes focus on better byte-code conversion, enhanced package name validation, and improved user experience when viewing documentation links.

  • Refactored byte-code content conversion to use proper TextDecoder for safer UTF-8 decoding
  • Enhanced package name validation with regex pattern and additional security checks
  • Added PackageNotFoundError for better 404 error handling across API calls

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/src/features/docs/lib/utils.ts Improved byte-code conversion with filtering and TextDecoder
app/src/features/docs/lib/security.ts Enhanced package name validation with regex pattern
app/src/features/docs/lib/api.ts Added PackageNotFoundError class and 404 handling in API functions
app/src/features/detail/components/PackageSidebar.tsx Improved docs link display with full URL and better fallback text
app/src/constants.ts Refactored API URL resolution with multiple fallback options
app/src/app/docs/[...path]/route.ts Integrated new error handling, byte-code conversion, and path resolution logic
app/next.config.mjs Enhanced environment variable configuration with VERCEL_URL support
Comments suppressed due to low confidence (1)

app/src/app/docs/[...path]/route.ts:1

  • The template literal uses single quotes instead of backticks, preventing variable interpolation. The packageName variable will not be substituted with its actual value. This line should use backticks for proper template literal interpolation or be constructed differently to access the outer scope variable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JoshuaBatty JoshuaBatty merged commit b266e88 into master Nov 6, 2025
15 of 16 checks passed
@JoshuaBatty JoshuaBatty deleted the josh/docs.forc.pub branch November 6, 2025 02:34
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.

3 participants