Skip to content

Conversation

@shamilkotta
Copy link
Contributor

Before
image

After:
image

@vercel
Copy link

vercel bot commented Feb 9, 2026

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

Project Deployment Actions Updated (UTC)
docs.npmx.dev Ready Ready Preview, Comment Feb 9, 2026 10:01pm
npmx.dev Ready Ready Preview, Comment Feb 9, 2026 10:01pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Feb 9, 2026 10:01pm

Request Review

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

The BuildEnvironment component has been refactored to change how the build time is displayed. The locale variable reference from i18n has been removed. A new computed property buildTime has been introduced, extracting the time value from buildInfo. The NuxtTime component has been replaced with a DateTime component, which receives the buildTime along with explicit formatting options for year, month, and day. The template has been updated accordingly to utilise the new DateTime component for the built_at display.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description includes visual before/after screenshots demonstrating the locale-aware build time changes in the footer, directly related to the changeset.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/components/BuildEnvironment.vue (1)

10-21: ⚠️ Potential issue | 🟠 Major

Guard against missing buildInfo/time to avoid runtime crashes.

If both the prop and appConfig.buildInfo are absent (or time is missing), buildInfo.value.time will throw and DateTime may render an invalid date. Add a null-guard and only render when a valid time exists.

Proposed fix
-const buildTime = computed(() => new Date(buildInfo.value.time))
+const buildTime = computed(() => {
+  const time = buildInfo.value?.time
+  return time ? new Date(time) : null
+})
-    <i18n-t keypath="built_at" scope="global">
-      <DateTime :datetime="buildTime" year="numeric" month="short" day="numeric" />
-    </i18n-t>
+    <i18n-t keypath="built_at" scope="global">
+      <DateTime
+        v-if="buildTime"
+        :datetime="buildTime"
+        year="numeric"
+        month="short"
+        day="numeric"
+      />
+    </i18n-t>

As per coding guidelines: “Ensure you write strictly type-safe code, for example by ensuring you always check when accessing an array value by index”.

const { locale } = useI18n()
const appConfig = useAppConfig()
const buildInfo = computed(() => buildInfoProp || appConfig.buildInfo)
const buildTime = computed(() => new Date(buildInfo.value.time))
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is necessary - you should just be able to pass buildInfo.time into <DateTime>

@danielroe danielroe added this pull request to the merge queue Feb 9, 2026
Merged via the queue into npmx-dev:main with commit e4c6642 Feb 9, 2026
17 checks passed
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