feat(compass-generative-ai): Update @faker-js/faker from 9.9.0 to 10.4.0 - CLOUDP-381777#8018
feat(compass-generative-ai): Update @faker-js/faker from 9.9.0 to 10.4.0 - CLOUDP-381777#8018
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Compass mock data tooling to align with @faker-js/faker v10.4.0, including method-name updates and prompt/UI guidance so generated schemas and scripts target the correct faker API.
Changes:
- Bump
@faker-js/fakerto^10.4.0in relevant workspaces and refreshpackage-lock.json. - Update method references/docs from
internet.userName→internet.usernameand update the mock-data-generator prompt to reference faker v10.4.0 (includingphone.numberguidance). - Relax some eval expectations for person-name arrays (cast/directors/writers) to accept a broader “generic string” method criterion.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/compass-generative-ai/tests/evals/use-cases/mock-data-schema.ts | Adjusts expected faker-method criteria for certain string-array fields in eval fixtures. |
| packages/compass-generative-ai/tests/evals/types.ts | Updates allowed generic string faker methods (notably internet.username). |
| packages/compass-generative-ai/src/mock-data-generator/prompt.ts | Updates LLM prompt to target faker v10.4.0 and correct method list. |
| packages/compass-generative-ai/package.json | Bumps devDependency @faker-js/faker to ^10.4.0. |
| packages/compass-collection/src/components/mock-data-generator-modal/script-screen.tsx | Updates user-facing install instructions to @faker-js/faker@10. |
| packages/compass-collection/src/components/mock-data-generator-modal/constants.ts | Updates faker v10 docs link + method list (internet.username). |
| packages/compass-collection/package.json | Bumps dependency @faker-js/faker to ^10.4.0. |
| package-lock.json | Locks @faker-js/faker to 10.4.0 in the affected workspaces. |
| > | ||
| npm install @faker-js/faker@9 | ||
| npm install @faker-js/faker@10 | ||
| </Copyable> |
There was a problem hiding this comment.
The generated instructions now tell users to install @faker-js/faker@10, but @faker-js/faker@10.4.0 declares engines node: ^20.19.0 || ^22.13.0 || … and npm: >=10 (see package-lock). Users on older Node/npm will hit install/engine errors. Consider adding a Node/npm minimum-version note in the Prerequisites UI (or choosing a faker major/version that matches the supported user runtime).
| </Copyable> | |
| </Copyable> | |
| <Body className={instructionTextStyle}> | |
| <strong>Note:</strong> <InlineCode>@faker-js/faker@10</InlineCode>{' '} | |
| requires Node.js <InlineCode>20.19.0+</InlineCode> and npm{' '} | |
| <InlineCode>10+</InlineCode>. If you're using an older | |
| runtime, upgrade Node.js and npm before running this install | |
| command. | |
| </Body> |
There was a problem hiding this comment.
Runtime fails on mongosh < 2.5 (pre-Node-20.19). Thoughts on adding a note "Requires mongosh 2.5 or later"?
# Conflicts: # package-lock.json
Description
Bumps @faker-js/faker 9.9.0 → 10.4.0.
internet.userName→internet.username(renamed in the LLM prompt, the type-to-method map, and the eval criterion set).phone.numbersince v10 dropped the positional format-string signature.Drive-by: Relaxed the Mflix
cast[]/directors[]/writers[]expected methods from stricthelpers.arrayElementtoperson.fullName.Eval Run Results:
https://www.braintrust.dev/app/mongodb-education-ai/p/compass-mock-data-generator/experiments/CLOUDP-381777-faker-1776974054?c=CLOUDP-381777-faker-1776973928
Tested and Confirmed Script Succeeds:
Checklist
Motivation and Context
Types of changes