Skip to content

chore: use smooth path utility from vue-data-ui#2647

Merged
shuuji3 merged 2 commits intomainfrom
og-use-createSmoothPath-from-vue-data-ui
Apr 28, 2026
Merged

chore: use smooth path utility from vue-data-ui#2647
shuuji3 merged 2 commits intomainfrom
og-use-createSmoothPath-from-vue-data-ui

Conversation

@graphieros
Copy link
Copy Markdown
Contributor

Follow up to #2292

This replaces the smooth path creation function used for og images with the available utility in vue-data-ui.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 28, 2026 6:41am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Apr 28, 2026 6:41am
npmx-lunaria Ignored Ignored Apr 28, 2026 6:41am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 487e4735-f0f3-415a-879b-fb8e0fd3fbf0

📥 Commits

Reviewing files that changed from the base of the PR and between 7541441 and 0637f45.

📒 Files selected for processing (1)
  • app/components/OgImage/Package.takumi.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/components/OgImage/Package.takumi.vue

📝 Walkthrough

Summary by CodeRabbit

  • Refactor

    • Consolidated chart sparkline path generation into a shared utility and removed the duplicate spline logic from an internal composable.
    • Adjusted internal imports and slimmed redundant code to improve organisation.
  • Tests

    • Updated component test mocks to reflect the structural change.

No user-facing changes in this release.

Walkthrough

The smoothPath implementation was removed from app/composables/useCharts.ts and the component app/components/OgImage/Package.takumi.vue now imports createSmoothPath from vue-data-ui/utils. Tests were adjusted to remove smoothPath from the useCharts mock.

Changes

Cohort / File(s) Summary
Component update
app/components/OgImage/Package.takumi.vue
Replaced local smoothPath usage with createSmoothPath imported from vue-data-ui/utils; useCharts still used for data fetching.
Composable cleanup
app/composables/useCharts.ts
Removed smoothPath export and the roundToHundredths helper; retained chart data fetching/transformation functions.
Tests
test/nuxt/components/OgImagePackage.spec.ts
Updated mock for ~/composables/useCharts to remove smoothPath from the mocked return value.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: use smooth path utility from vue-data-ui' accurately reflects the main change of replacing the smoothPath function with createSmoothPath from vue-data-ui.
Description check ✅ Passed The description is related to the changeset, explaining that it replaces the smooth path creation function with a utility from vue-data-ui, which aligns with the actual code changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch og-use-createSmoothPath-from-vue-data-ui

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 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!

@graphieros graphieros added the needs review This PR is waiting for a review from a maintainer label Apr 28, 2026
@graphieros graphieros requested a review from alexdln April 28, 2026 04:25
Copy link
Copy Markdown
Member

@shuuji3 shuuji3 left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

I put one suggestion for small refactoring.

import { joinURL } from 'ufo'
import { smoothPath, useCharts } from '~/composables/useCharts'
import { useCharts } from '~/composables/useCharts'
import { createSmoothPath as smoothPath } from 'vue-data-ui/utils'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
import { createSmoothPath as smoothPath } from 'vue-data-ui/utils'
import { createSmoothPath } from 'vue-data-ui/utils'

nit: It seems that the usage of this fuction is only here in the project (https://github.com/npmx-dev/npmx.dev/pull/2647/changes#diff-989803a8350f5b506a5bdea17a1237c410d7eee66b2e7015b0bd46378a78e097R243)
Maybe we could refactor to use the original exported name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@shuuji3 thank you :) It is cleaner indeed

@shuuji3 shuuji3 added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit 17ea220 Apr 28, 2026
25 checks passed
@shuuji3 shuuji3 deleted the og-use-createSmoothPath-from-vue-data-ui branch April 28, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review This PR is waiting for a review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants