Skip to content

@cacheable/benchmark - fix: upgrade @faker-js/faker to 10.4.0 (breaking)#1632

Merged
jaredwray merged 2 commits intomainfrom
dep-upgrade/benchmark-faker
May 7, 2026
Merged

@cacheable/benchmark - fix: upgrade @faker-js/faker to 10.4.0 (breaking)#1632
jaredwray merged 2 commits intomainfrom
dep-upgrade/benchmark-faker

Conversation

@jaredwray
Copy link
Copy Markdown
Owner

Summary

  • Upgrade @faker-js/faker from 9.8.0 to 10.4.0 in @cacheable/benchmark to align with the workspace root.

Notes

  • Faker 10 dropped CommonJS support and requires Node 20+; the benchmark package is private and only uses the modern ESM API, so call sites are unaffected.

Test plan

  • pnpm install succeeds
  • pnpm --filter @cacheable/benchmark test passes (lint only — package has no tests)

🤖 Generated with Claude Code

Upgrade @faker-js/faker dependency from 9.8.0 to 10.4.0 to align with the
workspace root which is already on 10.4.0.

Faker 10 dropped CommonJS support and requires Node.js >= 20. The benchmark
package is private (not published) and only consumes the modern API, so this
should be a no-op at the call sites.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades the @faker-js/faker dependency from version 9.8.0 to 10.4.0 in the benchmark package. While the change appears straightforward in the package manifest, the reviewer pointed out that this major version update introduces breaking changes. Specifically, the method faker.helpers.rangeToNumber has been removed in v10 and is still being called within packages/benchmark/src/object-generator.ts. These calls must be migrated to faker.number.int to prevent runtime errors.

Comment thread packages/benchmark/package.json
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c53ebbd) to head (e3f2e26).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1632   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines         2496      2496           
  Branches       554       554           
=========================================
  Hits          2496      2496           

☔ View full report in Codecov by Sentry.
📢 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.

@jaredwray
Copy link
Copy Markdown
Owner Author

Re: gemini-code-assist's review — faker.helpers.rangeToNumber was not removed in faker v10. It's still in the public API of @faker-js/faker@10.4.0 (added in 8.0.0, still present in v10 as documented in dist/airline-eVQV6kbz.d.ts).

Verified at runtime against the installed 10.4.0 build:

faker version: 10.4.0
rangeToNumber type: function
result: 5

Also smoke-tested ObjectGenerator end-to-end:

user: true
product: true
order: true productIds count: 3
review: 4

No code changes needed.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Thank you for the clarification and for performing the runtime verification. Since faker.helpers.rangeToNumber remains available in the public API of @faker-js/faker@10.4.0 and your smoke tests confirm that ObjectGenerator is functioning as expected, the upgrade is safe to proceed. I appreciate you taking the time to verify this.

@jaredwray jaredwray merged commit 752eeff into main May 7, 2026
10 checks passed
@jaredwray jaredwray deleted the dep-upgrade/benchmark-faker branch May 7, 2026 01:57
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.

1 participant