Skip to content

fix: prerender issues#2223

Merged
HugoRCD merged 3 commits intomainfrom
chore/fix-build-prerender
Apr 7, 2026
Merged

fix: prerender issues#2223
HugoRCD merged 3 commits intomainfrom
chore/fix-build-prerender

Conversation

@HugoRCD
Copy link
Copy Markdown
Member

@HugoRCD HugoRCD commented Apr 7, 2026

🔗 Linked issue

📚 Description

@HugoRCD HugoRCD self-assigned this Apr 7, 2026
@HugoRCD HugoRCD requested a review from atinux as a code owner April 7, 2026 18:24
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 7, 2026

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

Project Deployment Actions Updated (UTC)
nuxt Ready Ready Preview, Comment Apr 7, 2026 6:37pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

This pull request enhances robustness and internationalization across the application. Changes include: adding localized aria-labels via the useLocale composable in the HeaderToggle component; implementing null-safe property access with optional chaining in the docs page's section title computation; wrapping sponsor API fetching in error handling with fallback empty arrays; adding rate-limit detection with conditional logging levels in npm utilities; and introducing early-exit credential validation in sponsor service functions to prevent unnecessary API calls when required tokens are absent.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description contains only placeholder instructions and a template checklist with no actual details about the changes, rationale, or problems being solved. Replace the template placeholders with meaningful details about the prerender issues being fixed, why they occur, and how the changes solve them.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'fix: prerender issues' is vague and generic, using a broad term ('issues') without specifying which prerender problems are being addressed. Consider a more specific title like 'fix: handle missing API secrets and npm rate limits in prerender' to clearly convey the main changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/fix-build-prerender

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
server/utils/npm.ts (1)

105-110: Avoid the unnecessary trailing delay in scoped-package loop.

The loop currently sleeps after the last package too, which adds avoidable build time.

♻️ Proposed tweak
-    for (const pkg of scopedPackages) {
-      result[pkg] = await this.fetchPackageStats(pkg, period)
-      await new Promise(r => setTimeout(r, 75))
-    }
+    for (const [index, pkg] of scopedPackages.entries()) {
+      result[pkg] = await this.fetchPackageStats(pkg, period)
+      if (index < scopedPackages.length - 1) {
+        await new Promise(r => setTimeout(r, 75))
+      }
+    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@server/utils/npm.ts` around lines 105 - 110, The loop over scopedPackages
currently awaits a delay after every iteration, causing an unnecessary trailing
sleep; update the loop in the function that uses scopedPackages and
fetchPackageStats so the setTimeout is only awaited between iterations (e.g.,
conditionally await the sleep when the current package is not the last or use an
index-based loop), ensuring result[pkg] = await this.fetchPackageStats(pkg,
period) still runs for each pkg but no delay occurs after the final package.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@server/utils/npm.ts`:
- Around line 105-110: The loop over scopedPackages currently awaits a delay
after every iteration, causing an unnecessary trailing sleep; update the loop in
the function that uses scopedPackages and fetchPackageStats so the setTimeout is
only awaited between iterations (e.g., conditionally await the sleep when the
current package is not the last or use an index-based loop), ensuring
result[pkg] = await this.fetchPackageStats(pkg, period) still runs for each pkg
but no delay occurs after the final package.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7ef585c7-1f61-4639-aca3-7991f2ec75ca

📥 Commits

Reviewing files that changed from the base of the PR and between d7a97d4 and 153cb6f.

📒 Files selected for processing (5)
  • app/components/header/HeaderToggle.vue
  • app/pages/docs/[...slug].vue
  • server/api/sponsors/index.get.ts
  • server/utils/npm.ts
  • server/utils/sponsors.ts

@HugoRCD HugoRCD merged commit 840270a into main Apr 7, 2026
11 of 12 checks passed
@HugoRCD HugoRCD deleted the chore/fix-build-prerender branch April 7, 2026 20:46
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.

2 participants