refactor: centralize project metadata and move legal page data to env vars#38
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughCentralizes project metadata: adds typed contracts and a raw config, provides hydration utilities and a composable, expands legal env/runtime config, and updates pages, components, OG images, vCard builder, footer, and server routes to consume the centralized hydrated metadata. ChangesMetadata System Implementation and Adoption
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
app/utils/buildVCard.ts (1)
58-60: ⚡ Quick winDocument the new
projectMetadataparameter in JSDoc.The function signature changed, but the docblock still starts from
fixed. Add@param projectMetadatafor accurate usage/docs.As per coding guidelines, "Brief JSDoc on all functions."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/utils/buildVCard.ts` around lines 58 - 60, The JSDoc for buildVCard is outdated after the signature change: add a new `@param` projectMetadata entry above the function (in the buildVCard docblock) describing the VCardProjectMetadata parameter and its purpose/expected contents so the docs match the signature; keep the existing `@param` for fixed and ensure the brief JSDoc follows the project's style (one-line description plus `@param` tags).shared/utils/project-metadata.ts (1)
21-39: ⚡ Quick winAdd brief JSDoc to helper utilities.
The helper functions in this block are undocumented; add one-line JSDoc comments for consistency with repository standards.
As per coding guidelines, "Brief JSDoc on all functions."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shared/utils/project-metadata.ts` around lines 21 - 39, Add one-line JSDoc comments to each helper in this block: isMailtoUrl, isPhoneUrl, isProfileUrl, removeMailtoPrefix, and dedupeUrls. For each function add a brief description (one sentence) and document the parameters/return types concisely (e.g., `@param` url string, `@returns` boolean/string/ string[]), and reference the constants MAILTO_PREFIX and TEL_PREFIX in the isMailtoUrl/isPhoneUrl docs where relevant; keep comments short and consistent with existing file style.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/pages/vcard.vue`:
- Around line 122-127: Replace the raw <img> used for the QR with the project's
image component: change the <img v-if="qrDataUrl" ... :src="qrDataUrl"> to a
<NuxtImg> with the same bindings (keep v-if="qrDataUrl", :alt="`QR code encoding
a vCard for ${authorName}`", and use src bound to qrDataUrl) and preserve the
class="h-full w-full rounded-lg"; ensure the component name <NuxtImg> is used
(and imported/available via `@nuxt/image` per project setup) so the QR image
follows the project's image-component rule.
In `@app/utils/buildVCard.ts`:
- Around line 71-72: The N: field currently injects raw components
(projectMetadata.author.lastName and .firstName) which can contain
semicolons/commas/backslashes/newlines; call escapeVCardValue on each name
component (e.g., escapedLast = escapeVCardValue(projectMetadata.author.lastName)
and escapedFirst = escapeVCardValue(projectMetadata.author.firstName)) and then
compose the N: line using those escaped variables (preserving the
semicolon-separated order and trailing empty components); update the code that
builds the `N:` line in buildVCard.ts to use these escaped values.
---
Nitpick comments:
In `@app/utils/buildVCard.ts`:
- Around line 58-60: The JSDoc for buildVCard is outdated after the signature
change: add a new `@param` projectMetadata entry above the function (in the
buildVCard docblock) describing the VCardProjectMetadata parameter and its
purpose/expected contents so the docs match the signature; keep the existing
`@param` for fixed and ensure the brief JSDoc follows the project's style
(one-line description plus `@param` tags).
In `@shared/utils/project-metadata.ts`:
- Around line 21-39: Add one-line JSDoc comments to each helper in this block:
isMailtoUrl, isPhoneUrl, isProfileUrl, removeMailtoPrefix, and dedupeUrls. For
each function add a brief description (one sentence) and document the
parameters/return types concisely (e.g., `@param` url string, `@returns`
boolean/string/ string[]), and reference the constants MAILTO_PREFIX and
TEL_PREFIX in the isMailtoUrl/isPhoneUrl docs where relevant; keep comments
short and consistent with existing file style.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 0784a532-0e03-4cbc-a708-4f2de211f3f7
📒 Files selected for processing (24)
.env.exampleapp/app.vueapp/components/OgImageComponents/OgImageFooter.vueapp/components/OgImageTemplate/OgImageDefault.takumi.vueapp/components/OgImageTemplate/OgImageHome.takumi.vueapp/components/content/LegalAuthorName.vueapp/components/content/LegalContactInfo.vueapp/components/content/LegalOccupation.vueapp/components/content/LegalRepositoryLink.vueapp/components/layout/SiteFooter.vueapp/composables/useProjectMetadata.tsapp/pages/index.vueapp/pages/projects/index.vueapp/pages/talks/index.vueapp/pages/vcard.vueapp/utils/buildVCard.tscontent/pages/legal-notice.mdcontent/pages/privacy-policy.mdnuxt.config.tsproject-metadata.config.tsproject.config.jsonserver/routes/.well-known/security.txt.get.tsserver/routes/humans.txt.get.tsshared/utils/project-metadata.ts
💤 Files with no reviewable changes (1)
- project.config.json
Summary by CodeRabbit
New Features
Refactor