Skip to content

fix(nuxt): register formatTimeAgo variants for auto-import#5492

Open
ilyaliao wants to merge 2 commits into
vueuse:mainfrom
ilyaliao:fix/nuxt-auto-import-format-time-ago
Open

fix(nuxt): register formatTimeAgo variants for auto-import#5492
ilyaliao wants to merge 2 commits into
vueuse:mainfrom
ilyaliao:fix/nuxt-auto-import-format-time-ago

Conversation

@ilyaliao

@ilyaliao ilyaliao commented Jun 3, 2026

Copy link
Copy Markdown
Member

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.
  • Confirm that this PR is based on your own understanding and review of the project, not solely generated or summarized by AI tools.
⚠️ Slowing down new functions

Warning: Slowing down new functions

As the VueUse audience continues to grow, we have been inundated with an overwhelming number of feature requests and pull requests. As a result, maintaining the project has become increasingly challenging and has stretched our capacity to its limits. As such, in the near future, we may need to slow down our acceptance of new features and prioritize the stability and quality of existing functions. Please note that new features for VueUse may not be accepted at this time. If you have any new ideas, we suggest that you first incorporate them into your own codebase, iterate on them to suit your needs, and assess their generalizability. If you strongly believe that your ideas are beneficial to the community, you may submit a pull request along with your use cases, and we would be happy to review and discuss them. Thank you for your understanding.


Description

This PR registers formatTimeAgo and formatTimeAgoIntl as composable variants in the useTimeAgo and useTimeAgoIntl frontmatter so @vueuse/nuxt includes them in metadata-driven auto-imports.

Resolves #5488

Co-authored-by: Cursor <cursoragent@cursor.com>
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. documentation Improvements or additions to documentation labels Jun 3, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vueuse/components

pnpm add https://pkg.pr.new/@vueuse/components@5492
npm i https://pkg.pr.new/@vueuse/components@5492
yarn add https://pkg.pr.new/@vueuse/components@5492.tgz

@vueuse/core

pnpm add https://pkg.pr.new/@vueuse/core@5492
npm i https://pkg.pr.new/@vueuse/core@5492
yarn add https://pkg.pr.new/@vueuse/core@5492.tgz

@vueuse/electron

pnpm add https://pkg.pr.new/@vueuse/electron@5492
npm i https://pkg.pr.new/@vueuse/electron@5492
yarn add https://pkg.pr.new/@vueuse/electron@5492.tgz

@vueuse/firebase

pnpm add https://pkg.pr.new/@vueuse/firebase@5492
npm i https://pkg.pr.new/@vueuse/firebase@5492
yarn add https://pkg.pr.new/@vueuse/firebase@5492.tgz

@vueuse/integrations

pnpm add https://pkg.pr.new/@vueuse/integrations@5492
npm i https://pkg.pr.new/@vueuse/integrations@5492
yarn add https://pkg.pr.new/@vueuse/integrations@5492.tgz

@vueuse/math

pnpm add https://pkg.pr.new/@vueuse/math@5492
npm i https://pkg.pr.new/@vueuse/math@5492
yarn add https://pkg.pr.new/@vueuse/math@5492.tgz

@vueuse/metadata

pnpm add https://pkg.pr.new/@vueuse/metadata@5492
npm i https://pkg.pr.new/@vueuse/metadata@5492
yarn add https://pkg.pr.new/@vueuse/metadata@5492.tgz

@vueuse/nuxt

pnpm add https://pkg.pr.new/@vueuse/nuxt@5492
npm i https://pkg.pr.new/@vueuse/nuxt@5492
yarn add https://pkg.pr.new/@vueuse/nuxt@5492.tgz

@vueuse/router

pnpm add https://pkg.pr.new/@vueuse/router@5492
npm i https://pkg.pr.new/@vueuse/router@5492
yarn add https://pkg.pr.new/@vueuse/router@5492.tgz

@vueuse/rxjs

pnpm add https://pkg.pr.new/@vueuse/rxjs@5492
npm i https://pkg.pr.new/@vueuse/rxjs@5492
yarn add https://pkg.pr.new/@vueuse/rxjs@5492.tgz

@vueuse/shared

pnpm add https://pkg.pr.new/@vueuse/shared@5492
npm i https://pkg.pr.new/@vueuse/shared@5492
yarn add https://pkg.pr.new/@vueuse/shared@5492.tgz

@vueuse/skills

pnpm add https://pkg.pr.new/@vueuse/skills@5492
npm i https://pkg.pr.new/@vueuse/skills@5492
yarn add https://pkg.pr.new/@vueuse/skills@5492.tgz

commit: 7c151a7

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.91%. Comparing base (4aa1803) to head (7c151a7).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5492      +/-   ##
==========================================
+ Coverage   66.45%   66.91%   +0.45%     
==========================================
  Files         346      346              
  Lines        8217     8224       +7     
  Branches     2531     2526       -5     
==========================================
+ Hits         5461     5503      +42     
+ Misses       2246     2219      -27     
+ Partials      510      502       -8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@9romise 9romise left a comment

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.

I think variants is not quite appropriate here. formatTimeAgo isn't really a variant of useTimeAgo, it's just a standalone utility.

What if we add utils support instead?

@OrbisK

OrbisK commented Jun 4, 2026

Copy link
Copy Markdown
Member

I think variants is not quite appropriate here. formatTimeAgo isn't really a variant of useTimeAgo, it's just a standalone utility.

What if we add utils support instead?

#5488 (comment) lets discuss this here maybe :)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG | @vueuse/nuxt | many utilities function is not registered for auto-import

3 participants