feat: add machine-readable metadata endpoints humans.txt and security.txt#37
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis pull request centralizes project metadata into ChangesMachine-readable metadata endpoints with centralized project configuration
Sequence Diagram(s)sequenceDiagram
participant Client
participant SecurityTxtHandler
participant ProjectConfig
Client->>SecurityTxtHandler: GET /.well-known/security.txt
SecurityTxtHandler->>ProjectConfig: Read siteUrl, contact, languages, policyUrl
SecurityTxtHandler->>SecurityTxtHandler: create expires + build content
SecurityTxtHandler->>Client: HTTP 200 text/plain response
sequenceDiagram
participant Client
participant HumansTxtHandler
participant ProjectConfig
participant RuntimeConfig
Client->>HumansTxtHandler: GET /humans.txt
HumansTxtHandler->>ProjectConfig: Read author, project, repo, legal paths
HumansTxtHandler->>RuntimeConfig: Read build.releaseLabel
HumansTxtHandler->>Client: HTTP 200 text/plain response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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: 1
🧹 Nitpick comments (2)
server/routes/.well-known/security.txt.get.ts (1)
12-26: ⚡ Quick winAdd brief JSDoc for the helper functions.
Both helpers are missing function docs, which this repo requires.
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 `@server/routes/.well-known/security.txt.get.ts` around lines 12 - 26, Add brief JSDoc comments for the helper functions createSecurityTxtExpires and buildSecurityTxtContent: describe each function's purpose, annotate parameters (now: Date, lifetimeDays: number for createSecurityTxtExpires; options: SecurityTxtContentOptions, now: Date for buildSecurityTxtContent), note default values where applicable (e.g., defaultSecurityTxtLifetimeDays and new Date()), and specify the return type (string, ISO timestamp or content string). Place the JSDoc immediately above each function declaration and keep the comments short and focused per repository guidelines.server/routes/humans.txt.get.ts (1)
3-35: ⚡ Quick winAdd a brief JSDoc for the route handler.
The new handler is undocumented; this repo expects short function 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 `@server/routes/humans.txt.get.ts` around lines 3 - 35, Add a brief JSDoc comment above the exported route handler (the export default defineEventHandler(...) function) describing the route purpose (returns humans.txt-style plain text), listing the parameters/context (event: H3 event or runtime config access via useRuntimeConfig) and the return type (string response), and mention any side effects (sets Content-Type via setResponseHeader); keep it short (one or two lines) and reference projectConfig, useRuntimeConfig, and setResponseHeader so future readers know what the handler uses.
🤖 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 `@nuxt.config.ts`:
- Line 109: Replace the current use of projectConfig.author.name for the
site.name metadata with the project name to keep SEO identity consistent: update
the metadata assignment where site.name is set (currently "name:
projectConfig.author.name") to use projectConfig.projectName instead so it
matches the application-name value already using projectConfig.projectName.
---
Nitpick comments:
In `@server/routes/.well-known/security.txt.get.ts`:
- Around line 12-26: Add brief JSDoc comments for the helper functions
createSecurityTxtExpires and buildSecurityTxtContent: describe each function's
purpose, annotate parameters (now: Date, lifetimeDays: number for
createSecurityTxtExpires; options: SecurityTxtContentOptions, now: Date for
buildSecurityTxtContent), note default values where applicable (e.g.,
defaultSecurityTxtLifetimeDays and new Date()), and specify the return type
(string, ISO timestamp or content string). Place the JSDoc immediately above
each function declaration and keep the comments short and focused per repository
guidelines.
In `@server/routes/humans.txt.get.ts`:
- Around line 3-35: Add a brief JSDoc comment above the exported route handler
(the export default defineEventHandler(...) function) describing the route
purpose (returns humans.txt-style plain text), listing the parameters/context
(event: H3 event or runtime config access via useRuntimeConfig) and the return
type (string response), and mention any side effects (sets Content-Type via
setResponseHeader); keep it short (one or two lines) and reference
projectConfig, useRuntimeConfig, and setResponseHeader so future readers know
what the handler uses.
🪄 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: 09848e46-b59e-49a8-a83f-65827e381520
📒 Files selected for processing (5)
nuxt.config.tsproject.config.jsonpublic/_redirectsserver/routes/.well-known/security.txt.get.tsserver/routes/humans.txt.get.ts
Summary by CodeRabbit
New Features
Chores