[codex] Expand domain command params#294
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (53)
📝 WalkthroughWalkthroughThis PR aligns Faker-backed domain keyword parameter metadata with generated help docs, adds comparison tooling and tests, introduces BigInt bounds validation, and updates lorem/word parameter shapes and related expectations. ChangesDomain command parameter parity with Faker
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d304d32ae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR addresses #286 by expanding/aligning domain keyword parameter metadata (especially for Faker-delegated commands), updating docs and tests accordingly, and adding an automated Domain-vs-Faker options-parameter comparison report plus a script to generate/check it.
Changes:
- Added a script + generated markdown report to compare Faker
options?: { ... }top-level keys against domainhelp.args. - Expanded multiple Faker-backed domain keyword definitions to include option parameters (with
argTransform: 'optionsFromHelpArgs') and added/updated related unit/UI tests. - Removed domain-only parameters that Faker doesn’t implement (e.g., legacy
word.*(max=...),lorem.word(min/max=...)) and updated docs/tests.
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/compare-domain-faker-params.mjs | New script to extract Faker option-param keys from .d.ts and compare vs domain keyword metadata (JSON/Markdown + optional check). |
| packages/core/src/tests/data_generation/unit/domain/domainKeywords.test.js | Updates sample-value helpers to handle bigint type tokens in test scaffolding. |
| packages/core/src/tests/data_generation/unit/domain/domain-param-invocation-coverage.test-helper.js | Updates type sampling and adds per-arg sample overrides for new option params. |
| packages/core/src/tests/data_generation/unit/domain/domain-keyword-parser.test.js | Updates parser expectations for Faker-unsupported lorem.word(min/max=...). |
| packages/core/src/tests/data_generation/unit/domain/domain-keyword-params-usage.test.js | Updates sampling for bigint and adds overrides/skip logic for specific params (e.g. zipCode state). |
| packages/core/src/tests/data_generation/unit/domain/domain-faker-param-comparison.test.js | New Jest coverage asserting no missing/domain-only params vs Faker options, plus a focused check for number.bigInt. |
| packages/core/src/tests/command-help/command-help-examples.test.js | Adjusts usage-example coverage logic to ignore params that are not usage-example supported. |
| packages/core/src/tests/command-help/command-help-examples.test-support.js | Adds isUsageExampleSupportedParam helper and exports it for usage-example tests. |
| packages/core/js/keywords/domain/word/words-keyword-definition.js | Removes unsupported max param/example for word.words. |
| packages/core/js/keywords/domain/word/verb-keyword-definition.js | Removes unsupported max param/example for word.verb. |
| packages/core/js/keywords/domain/word/sample-keyword-definition.js | Removes unsupported max param/example for word.sample. |
| packages/core/js/keywords/domain/word/preposition-keyword-definition.js | Removes unsupported max param/example for word.preposition. |
| packages/core/js/keywords/domain/word/noun-keyword-definition.js | Removes unsupported max param/example for word.noun. |
| packages/core/js/keywords/domain/word/interjection-keyword-definition.js | Removes unsupported max param/example for word.interjection. |
| packages/core/js/keywords/domain/word/conjunction-keyword-definition.js | Removes unsupported max param/example for word.conjunction. |
| packages/core/js/keywords/domain/word/adverb-keyword-definition.js | Removes unsupported max param/example for word.adverb. |
| packages/core/js/keywords/domain/word/adjective-keyword-definition.js | Removes unsupported max param/example for word.adjective. |
| packages/core/js/keywords/domain/system/network-interface-keyword-definition.js | Adds options args + optionsFromHelpArgs and expands usage examples. |
| packages/core/js/keywords/domain/system/file-name-keyword-definition.js | Adds extensionCount arg + optionsFromHelpArgs and updates examples. |
| packages/core/js/keywords/domain/person/sex-type-keyword-definition.js | Expands enum (generic) + adds includeGeneric option + optionsFromHelpArgs. |
| packages/core/js/keywords/domain/person/full-name-keyword-definition.js | Adds firstName/lastName/sex options + optionsFromHelpArgs and examples. |
| packages/core/js/keywords/domain/number/big-int-keyword-definition.js | Reworks params to min/max/multipleOf, adds args validation, and updates examples. |
| packages/core/js/keywords/domain/lorem/word-keyword-definition.js | Removes unsupported min/max params/examples; keeps length/strategy. |
| packages/core/js/keywords/domain/location/zip-code-keyword-definition.js | Adds state/format args + optionsFromHelpArgs; marks state as not usage-example supported. |
| packages/core/js/keywords/domain/internet/http-status-code-keyword-definition.js | Adds types option + optionsFromHelpArgs and updates examples. |
| packages/core/js/keywords/domain/internet/example-email-keyword-definition.js | Adds firstName/lastName/allowSpecialCharacters options + optionsFromHelpArgs. |
| packages/core/js/keywords/domain/internet/display-name-keyword-definition.js | Adds firstName/lastName options + optionsFromHelpArgs. |
| packages/core/js/keywords/domain/image/url-picsum-photos-keyword-definition.js | Adds width/height/grayscale/blur options + optionsFromHelpArgs and examples. |
| packages/core/js/keywords/domain/image/person-portrait-keyword-definition.js | Adds sex/size options + optionsFromHelpArgs and examples. |
| packages/core/js/keywords/domain/image/data-uri-keyword-definition.js | Adds width/height/color/type options + optionsFromHelpArgs and expanded examples. |
| packages/core/js/keywords/domain/git/commit-sha-keyword-definition.js | Adds length option + optionsFromHelpArgs and updates examples. |
| packages/core/js/keywords/domain/git/commit-entry-keyword-definition.js | Adds merge/eol/refDate options + optionsFromHelpArgs and expands examples. |
| packages/core/js/keywords/domain/git/commit-date-keyword-definition.js | Adds refDate option + optionsFromHelpArgs and updates examples. |
| packages/core/js/keywords/domain/airline/record-locator-keyword-definition.js | Adds option args + optionsFromHelpArgs and new examples. |
| packages/core/js/keywords/domain/airline/flight-number-keyword-definition.js | Adds length/addLeadingZeros options + optionsFromHelpArgs and expanded examples. |
| packages/core/js/domain/domain-keywords.js | Adds bigint support to type-matching. |
| packages/core-ui/src/tests/interaction/matrix/schema-interaction-scenario-builder.test.js | Adjusts scenario arg-coverage expectations to exclude location.zipCode.state. |
| docs/domain-faker-param-comparison.md | Generated report documenting current parity between domain args and Faker option keys. |
| docs-src/docs/040-test-data/domain/290-word.md | Updates domain docs to remove unsupported max params/examples for word.*. |
| docs-src/docs/040-test-data/domain/270-system.md | Updates docs for system.fileName/system.networkInterface to include args + () examples. |
| docs-src/docs/040-test-data/domain/230-person.md | Updates docs for person.fullName and person.sexType args + examples. |
| docs-src/docs/040-test-data/domain/220-number.md | Updates number.bigInt docs to min/max/multipleOf examples/args. |
| docs-src/docs/040-test-data/domain/200-lorem.md | Removes lorem.word(min/max) docs/examples. |
| docs-src/docs/040-test-data/domain/190-location.md | Adds args/docs/examples for location.zipCode. |
| docs-src/docs/040-test-data/domain/170-internet.md | Adds args/docs/examples for internet.displayName, internet.exampleEmail, internet.httpStatusCode. |
| docs-src/docs/040-test-data/domain/160-image.md | Adds args/docs/examples for image.dataUri, image.personPortrait, image.urlPicsumPhotos. |
| docs-src/docs/040-test-data/domain/140-git.md | Adds args/docs/examples for git.commitDate, git.commitEntry, git.commitSha. |
| docs-src/docs/040-test-data/domain/020-airline.md | Adds args/docs/examples for airline.flightNumber and airline.recordLocator. |
Greptile SummaryThis PR expands domain command parameter metadata, usage examples, and documentation for Faker-backed keywords across airline, git, image, internet, location, lorem, number, person, system, and word domains. It also introduces a new
Confidence Score: 5/5Safe to merge — changes are additive metadata expansion with no modifications to runtime data generation paths except the corrected bigInt arg mapping. All production changes are keyword metadata (args, examples, argTransform, argsValidator) and the new comparison script/tests. The number.bigInt validator correctly enforces ordered bounds and a positive multipleOf. The usageExampleSupported flag threads cleanly through the catalog builder, the Faker help mapper, and both test coverage assertions. The one latent inconsistency — sampleValueForType returning a JS Number rather than a BigInt — is in a test helper and has no current impact since no keyword param uses bigint as its declared type today. No files require special attention for correctness. The domain-keyword-sample-values.test-helper.js bigint sample value is worth tidying for future-proofing. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Domain keyword definition\nkeyword + delegate + help.args] --> B{argTransform?\noptionsFromHelpArgs}
B -->|yes| C[help.args mapped to\nFaker options object]
B -->|no| D[positional / legacy args]
C --> E[Faker function called\nwith options object]
D --> E
A --> F{argsValidator?}
F -->|number.bigInt| G[validateBigIntBounds\nmin ≤ max, multipleOf > 0]
F -->|internet.httpStatusCode| H[validateHttpStatusCodeTypes\nenum check on types array]
F -->|others| I[no cross-param validation]
G --> J[executeDomainKeyword]
H --> J
I --> J
E --> J
K[compare-domain-faker-params.mjs] --> L[Parse Faker .d.ts\nextract options params]
L --> M[Compare with\nDOMAIN_KEYWORDS help.args]
M --> N{Gaps?}
N -->|missingInDomain or\ndomainOnlyParams| O[Exit 1 / test fail]
N -->|none| P[Pass]
Q[usageExampleSupported: false\ne.g. location.zipCode.state] --> R[Excluded from\nexample-coverage tests]
Q --> S[Excluded from\nruntime param-usage tests]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Domain keyword definition\nkeyword + delegate + help.args] --> B{argTransform?\noptionsFromHelpArgs}
B -->|yes| C[help.args mapped to\nFaker options object]
B -->|no| D[positional / legacy args]
C --> E[Faker function called\nwith options object]
D --> E
A --> F{argsValidator?}
F -->|number.bigInt| G[validateBigIntBounds\nmin ≤ max, multipleOf > 0]
F -->|internet.httpStatusCode| H[validateHttpStatusCodeTypes\nenum check on types array]
F -->|others| I[no cross-param validation]
G --> J[executeDomainKeyword]
H --> J
I --> J
E --> J
K[compare-domain-faker-params.mjs] --> L[Parse Faker .d.ts\nextract options params]
L --> M[Compare with\nDOMAIN_KEYWORDS help.args]
M --> N{Gaps?}
N -->|missingInDomain or\ndomainOnlyParams| O[Exit 1 / test fail]
N -->|none| P[Pass]
Q[usageExampleSupported: false\ne.g. location.zipCode.state] --> R[Excluded from\nexample-coverage tests]
Q --> S[Excluded from\nruntime param-usage tests]
Reviews (4): Last reviewed commit: "Address command param review feedback" | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (6)
scripts/compare-domain-faker-params.mjs (2)
106-136: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffMethod overload collisions silently drop earlier signatures.
methods.set(methodName, ...)(Line 131) overwrites any prior entry for the samemethodNamewithin a module body. Faker frequently declares overloaded methods (e.g., a no-args overload plus an options-object overload); the regex-driven scan will only retain whichever overload the loop encounters last, which may not be the options-bearing one, potentially skewingfakerOptionParamsfor that command.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/compare-domain-faker-params.mjs` around lines 106 - 136, Method overloads in compare-domain-faker-params.mjs are being collapsed because methods.set(methodName, ...) overwrites earlier entries in the body scan. Update the parsing logic around the methods Map and the methodStartRegex loop to preserve overloads for the same methodName, and ensure the options-bearing overload is selected (or merged) rather than replaced by the last-seen signature. Use the existing findMatching, getObjectOptionKeys, and paramsText extraction flow to collect all overload signatures before deciding which signature should drive fakerOptionParams.
68-84: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAvoid string-matching the Faker declaration bundle. This still couples the script to an internal
declare class NumberModuledetail; if it needs to keep working across faker upgrades, switch to a stable declaration path or export-based lookup instead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/compare-domain-faker-params.mjs` around lines 68 - 84, The getFakerDeclarationPath() lookup is still brittle because it scans the dist bundle and matches the internal "declare class NumberModule" text. Replace that string-based bundle search with a stable resolution strategy, such as using the known exported declaration path from `@faker-js/faker/package.json` or another export-based lookup that does not depend on internal declaration contents, while keeping the fallback error in place if resolution fails.packages/core-ui/src/tests/interaction/matrix/schema-interaction-scenario-builder.test.js (1)
19-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winHardcoded exclusion duplicates the definition-level
usageExampleSupportedflag.Same concern as in
command-help-examples.test-support.js:isScenarioArgCoverageRequiredre-encodes thelocation.zipCode/stateexception as a literal string comparison instead of deriving it fromarg.usageExampleSupported(already set tofalseinLOCATION_ZIP_CODE_KEYWORD_DEFINITION). Passing the fullargobject (instead of justargName) would let this check generalize automatically to any future param marked unsupported, rather than requiring another hardcoded exception here.♻️ Proposed simplification
-function isScenarioArgCoverageRequired(command, argName) { - return !(command === 'location.zipCode' && argName === 'state'); -} +function isScenarioArgCoverageRequired(arg) { + return arg?.usageExampleSupported !== false; +}(metadata.args || []) - .filter((arg) => isScenarioArgCoverageRequired(command, arg.name)) + .filter((arg) => isScenarioArgCoverageRequired(arg)) .forEach((arg) => { expect(bucket.coveredArgs.has(arg.name)).toBe(true); });Also applies to: 89-93
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core-ui/src/tests/interaction/matrix/schema-interaction-scenario-builder.test.js` around lines 19 - 22, `isScenarioArgCoverageRequired` is hardcoding the `location.zipCode`/`state` exception instead of using the argument metadata. Update the helper in `schema-interaction-scenario-builder.test.js` to accept the full `arg` object (as in `command-help-examples.test-support.js`) and decide coverage from `arg.usageExampleSupported` rather than string-matching `command` and `argName`. Then update the related call sites and any duplicate logic around the referenced scenario coverage checks so unsupported args are excluded automatically.packages/core/src/tests/command-help/command-help-examples.test-support.js (1)
33-40: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRedundant hardcoded exclusion — already covered by
param.usageExampleSupported.
LOCATION_ZIP_CODE_KEYWORD_DEFINITIONalready setsusageExampleSupported: falseon thestatearg, so the fallbackparam?.usageExampleSupported !== falseon line 38 already excludes it. The explicitentry?.command === 'location.zipCode' && param?.name === 'state'branch is dead code that duplicates the single source of truth and must be manually kept in sync if similar exclusions are ever added elsewhere.♻️ Proposed simplification
function isUsageExampleSupportedParam(entry, param) { - if (entry?.command === 'location.zipCode' && param?.name === 'state') { - return false; - } - return param?.usageExampleSupported !== false; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/src/tests/command-help/command-help-examples.test-support.js` around lines 33 - 40, Remove the hardcoded `entry?.command === 'location.zipCode' && param?.name === 'state'` բացառion from `isUsageExampleSupportedParam`; it duplicates the existing `param?.usageExampleSupported !== false` check and is already covered by `LOCATION_ZIP_CODE_KEYWORD_DEFINITION`. Keep the function relying only on `param.usageExampleSupported` so `isUsageExampleSupportedParam` stays the single source of truth.packages/core/src/tests/data_generation/unit/domain/domain-param-invocation-coverage.test-helper.js (1)
19-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffConsider consolidating triplicated sample-value helpers.
sampleValueForType/sampleValueForKeywordArgare duplicated near-verbatim across this file,domain-keyword-params-usage.test.js, anddomainKeywords.test.js. This PR'sbiginthandling had to be patched in all three, and the implementations already diverged slightly (this file foldsbigintinto the same numeric branch asnumber/integeron line 35, while the other two files add a separateif (allowed.includes('bigint')) return 7;block) — evidence that keeping them in sync manually is fragile.Extracting a single shared test utility module would remove this maintenance burden going forward.
Also applies to: 56-92
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/src/tests/data_generation/unit/domain/domain-param-invocation-coverage.test-helper.js` around lines 19 - 54, The sample-value helpers are duplicated across this test helper and the related domain tests, and the bigint logic is already drifting between copies. Extract the shared logic into a single reusable test utility and have sampleValueForType/sampleValueForKeywordArg in this file and the matching helpers in domain-keyword-params-usage.test.js and domainKeywords.test.js call it, keeping bigint handling centralized in one place.packages/core/js/keywords/domain/internet/http-status-code-keyword-definition.js (1)
8-8: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueArgs added correctly match
faker.internet.httpStatusCodeoptions.Confirmed the
typescategories (informational, success, redirection, clientError, serverError) match faker'sHttpStatusCodeType. No enum-level validation is added fortypesvalues, so an invalid category will surface as whatever error faker itself throws, rather than a domain-level validation message. Given this mirrors the existing pattern for other array-typed args in this cohort, this is a minor nice-to-have rather than a blocker.Also applies to: 18-37
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/js/keywords/domain/internet/http-status-code-keyword-definition.js` at line 8, The `httpStatusCode` keyword definition uses `optionsFromHelpArgs` correctly, but `types` still lacks enum-level validation, so invalid values fall through to faker errors instead of a domain validation message. Update the `http-status-code-keyword-definition` setup to validate `types` against the allowed `HttpStatusCodeType` values in the same pattern used by other array-typed args in this cohort, keeping the existing `argTransform` behavior intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/core/js/keywords/domain/number/big-int-keyword-definition.js`:
- Around line 8-16: The big-int keyword validation is comparing and
range-checking raw values without accounting for the declared
bigint/number/string types, so quoted numeric inputs can be misordered and
non-number multipleOf values bypass validation. Update the validation path in
validateBigIntBounds to normalize min/max before the createOrderedArgsValidator
comparison, and adjust createNumericArgRangeValidator usage so multipleOf is
coerced or validated across bigint/string/number inputs instead of skipping
non-number values. Keep the fix localized to the big-int keyword validators and
preserve the existing argument names and error behavior.
In `@scripts/compare-domain-faker-params.mjs`:
- Around line 220-234: The runCli check logic only fails when rows are missing
in the domain, so it can miss regressions where domainOnlyParams are
reintroduced. Update the --check path in runCli to also inspect the
domainOnlyParams data from getFakerOptionParamComparison() and set
process.exitCode = 1 whenever any row has non-empty domain-only params. Keep the
existing missingRows check, but expand the failure condition so the CLI enforces
both no missing Faker params and no domain-only params.
---
Nitpick comments:
In
`@packages/core-ui/src/tests/interaction/matrix/schema-interaction-scenario-builder.test.js`:
- Around line 19-22: `isScenarioArgCoverageRequired` is hardcoding the
`location.zipCode`/`state` exception instead of using the argument metadata.
Update the helper in `schema-interaction-scenario-builder.test.js` to accept the
full `arg` object (as in `command-help-examples.test-support.js`) and decide
coverage from `arg.usageExampleSupported` rather than string-matching `command`
and `argName`. Then update the related call sites and any duplicate logic around
the referenced scenario coverage checks so unsupported args are excluded
automatically.
In
`@packages/core/js/keywords/domain/internet/http-status-code-keyword-definition.js`:
- Line 8: The `httpStatusCode` keyword definition uses `optionsFromHelpArgs`
correctly, but `types` still lacks enum-level validation, so invalid values fall
through to faker errors instead of a domain validation message. Update the
`http-status-code-keyword-definition` setup to validate `types` against the
allowed `HttpStatusCodeType` values in the same pattern used by other
array-typed args in this cohort, keeping the existing `argTransform` behavior
intact.
In `@packages/core/src/tests/command-help/command-help-examples.test-support.js`:
- Around line 33-40: Remove the hardcoded `entry?.command === 'location.zipCode'
&& param?.name === 'state'` բացառion from `isUsageExampleSupportedParam`; it
duplicates the existing `param?.usageExampleSupported !== false` check and is
already covered by `LOCATION_ZIP_CODE_KEYWORD_DEFINITION`. Keep the function
relying only on `param.usageExampleSupported` so `isUsageExampleSupportedParam`
stays the single source of truth.
In
`@packages/core/src/tests/data_generation/unit/domain/domain-param-invocation-coverage.test-helper.js`:
- Around line 19-54: The sample-value helpers are duplicated across this test
helper and the related domain tests, and the bigint logic is already drifting
between copies. Extract the shared logic into a single reusable test utility and
have sampleValueForType/sampleValueForKeywordArg in this file and the matching
helpers in domain-keyword-params-usage.test.js and domainKeywords.test.js call
it, keeping bigint handling centralized in one place.
In `@scripts/compare-domain-faker-params.mjs`:
- Around line 106-136: Method overloads in compare-domain-faker-params.mjs are
being collapsed because methods.set(methodName, ...) overwrites earlier entries
in the body scan. Update the parsing logic around the methods Map and the
methodStartRegex loop to preserve overloads for the same methodName, and ensure
the options-bearing overload is selected (or merged) rather than replaced by the
last-seen signature. Use the existing findMatching, getObjectOptionKeys, and
paramsText extraction flow to collect all overload signatures before deciding
which signature should drive fakerOptionParams.
- Around line 68-84: The getFakerDeclarationPath() lookup is still brittle
because it scans the dist bundle and matches the internal "declare class
NumberModule" text. Replace that string-based bundle search with a stable
resolution strategy, such as using the known exported declaration path from
`@faker-js/faker/package.json` or another export-based lookup that does not depend
on internal declaration contents, while keeping the fallback error in place if
resolution fails.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6d6abd09-c118-4a9c-ad3b-34adbb8a1cea
📒 Files selected for processing (48)
docs-src/docs/040-test-data/domain/020-airline.mddocs-src/docs/040-test-data/domain/140-git.mddocs-src/docs/040-test-data/domain/160-image.mddocs-src/docs/040-test-data/domain/170-internet.mddocs-src/docs/040-test-data/domain/190-location.mddocs-src/docs/040-test-data/domain/200-lorem.mddocs-src/docs/040-test-data/domain/220-number.mddocs-src/docs/040-test-data/domain/230-person.mddocs-src/docs/040-test-data/domain/270-system.mddocs-src/docs/040-test-data/domain/290-word.mddocs/domain-faker-param-comparison.mdpackages/core-ui/src/tests/interaction/matrix/schema-interaction-scenario-builder.test.jspackages/core/js/domain/domain-keywords.jspackages/core/js/keywords/domain/airline/flight-number-keyword-definition.jspackages/core/js/keywords/domain/airline/record-locator-keyword-definition.jspackages/core/js/keywords/domain/git/commit-date-keyword-definition.jspackages/core/js/keywords/domain/git/commit-entry-keyword-definition.jspackages/core/js/keywords/domain/git/commit-sha-keyword-definition.jspackages/core/js/keywords/domain/image/data-uri-keyword-definition.jspackages/core/js/keywords/domain/image/person-portrait-keyword-definition.jspackages/core/js/keywords/domain/image/url-picsum-photos-keyword-definition.jspackages/core/js/keywords/domain/internet/display-name-keyword-definition.jspackages/core/js/keywords/domain/internet/example-email-keyword-definition.jspackages/core/js/keywords/domain/internet/http-status-code-keyword-definition.jspackages/core/js/keywords/domain/location/zip-code-keyword-definition.jspackages/core/js/keywords/domain/lorem/word-keyword-definition.jspackages/core/js/keywords/domain/number/big-int-keyword-definition.jspackages/core/js/keywords/domain/person/full-name-keyword-definition.jspackages/core/js/keywords/domain/person/sex-type-keyword-definition.jspackages/core/js/keywords/domain/system/file-name-keyword-definition.jspackages/core/js/keywords/domain/system/network-interface-keyword-definition.jspackages/core/js/keywords/domain/word/adjective-keyword-definition.jspackages/core/js/keywords/domain/word/adverb-keyword-definition.jspackages/core/js/keywords/domain/word/conjunction-keyword-definition.jspackages/core/js/keywords/domain/word/interjection-keyword-definition.jspackages/core/js/keywords/domain/word/noun-keyword-definition.jspackages/core/js/keywords/domain/word/preposition-keyword-definition.jspackages/core/js/keywords/domain/word/sample-keyword-definition.jspackages/core/js/keywords/domain/word/verb-keyword-definition.jspackages/core/js/keywords/domain/word/words-keyword-definition.jspackages/core/src/tests/command-help/command-help-examples.test-support.jspackages/core/src/tests/command-help/command-help-examples.test.jspackages/core/src/tests/data_generation/unit/domain/domain-faker-param-comparison.test.jspackages/core/src/tests/data_generation/unit/domain/domain-keyword-params-usage.test.jspackages/core/src/tests/data_generation/unit/domain/domain-keyword-parser.test.jspackages/core/src/tests/data_generation/unit/domain/domain-param-invocation-coverage.test-helper.jspackages/core/src/tests/data_generation/unit/domain/domainKeywords.test.jsscripts/compare-domain-faker-params.mjs
💤 Files with no reviewable changes (12)
- packages/core/js/keywords/domain/word/noun-keyword-definition.js
- packages/core/js/keywords/domain/word/sample-keyword-definition.js
- packages/core/js/keywords/domain/word/words-keyword-definition.js
- packages/core/js/keywords/domain/word/interjection-keyword-definition.js
- docs-src/docs/040-test-data/domain/200-lorem.md
- packages/core/js/keywords/domain/word/adverb-keyword-definition.js
- packages/core/js/keywords/domain/word/verb-keyword-definition.js
- packages/core/js/keywords/domain/word/conjunction-keyword-definition.js
- packages/core/js/keywords/domain/word/adjective-keyword-definition.js
- packages/core/js/keywords/domain/word/preposition-keyword-definition.js
- packages/core/js/keywords/domain/lorem/word-keyword-definition.js
- docs-src/docs/040-test-data/domain/290-word.md
Summary
Closes #286.
word.*(max=...)andlorem.word(min/max=...)casesValidation
pnpm run verify:localpnpm run verify:localsuccessfullySummary by CodeRabbit
Documentation / New Features
lorem.wordandword.*helpers to match current supported options (e.g., removedmax;word.wordsnow documentscount).Bug Fixes
number.bigIntbounds/multiples.internet.httpStatusCode(types)to reject unsupported categories.Tests / Chores