-
Notifications
You must be signed in to change notification settings - Fork 52
feat: upgrade to @faker-js/faker v9 #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.gitattributes
Outdated
@@ -0,0 +1,2 @@ | |||
**/*.snap linguist-generated=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a QoL improvement for the snapshots; it's what tells Github to do below "Some generated files are not rendered by default."
More details here. Happy to undo this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that could be interesting if we don't want to review snapshots but I find it useful sometimes to see them
Can you undo it please?
CHANGELOG.md
Outdated
@@ -1,3 +1,24 @@ | |||
# v5.0.0 (Thu Jan 02 2025) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there's a breaking change, I updated the version to v5. Happy to change that though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you update the changelog yourself?
It's auto generated by the PR merge, I would manage the versioning when I merge the PR
d873346
to
7eaaf36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good thank you for your contribution !
I've got few comments before we're able to merge
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "graphql-codegen-typescript-mock-data", | |||
"version": "4.4.0", | |||
"version": "5.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rollback this, it will be handled by our versioning tool
CHANGELOG.md
Outdated
#### 💥 Breaking Change | ||
|
||
- feat: upgrade to @faker-js/faker v9 | ||
|
||
This release upgrades to Faker v9, which introduces several breaking changes: | ||
|
||
- **Node.js v18+ required**: Faker v9 requires Node.js v18 or higher | ||
- **TypeScript v5+ required**: Faker v9 requires TypeScript v5 or higher | ||
- **Different mock values**: Due to Faker v9's improved RNG (53-bit vs 32-bit), generated mock values will be different even with the same seed | ||
- **Removed deprecated code**: Faker v8 had deprecated many methods, [which have now been removed](https://fakerjs.dev/guide/upgrading.html#removals-of-deprecated-code) | ||
|
||
For more details, see the [Faker v9 migration guide](https://fakerjs.dev/guide/upgrading.html). | ||
|
||
#### Authors: 1 | ||
|
||
- Brendan Mulholland ([@bmulholland](https://github.com/bmulholland)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rollback this, it will be handled by our versioning tool
However, could you move all this detail inside the PR description. I will reuse the PR description when merging in order to have this level of detail in the changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know snapshots could be verbose but it's useful so see the difference of what's changed, so please remove the .gitattributes
update
thanks !
7eaaf36
to
00a8695
Compare
Rolled back as requested, and put details in PR description. Let me know if I missed anything? BTW, looks like this project uses yarn, but there's missing files with both Yarn V1 Classic, and latest (Berry), both of which want to be checked into git :). It's fine, I'm just ignoring it, but I accidentally checked in e.g. .yarnrc.yml just now. More an FYI on ease of contributing that anything that's a big deal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good !
package.json
Outdated
@@ -84,5 +88,6 @@ | |||
"dist/**/*", | |||
"LICENSE", | |||
"README.md" | |||
] | |||
], | |||
"packageManager": "[email protected]+sha512.a333bf9c2557d71f5ba87dd1446cde24bb9c35301ec29dd2baba577b3f9d1ab61348b66a1324de9088c40a996c5b9203794da8bf14cab9fae6a6eccc00cb8078" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this, it makes the build crash
You're right that we're using yarn v1. We should probably switch to npm now, but that's a task for another day
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh man, I must have checked for this three times. Kept having to revert changes to yarn config and such, even in yarn v1 mode, and I guess I missed one in the end.
Removed :)
00a8695
to
216c3ec
Compare
The upgrade was pretty much seamless, except the test suite, which hard-codes values in a way that ties them to the seed used.
I opted for a regex approach that would make the broken tests work before and after, and for future seeds. That may not be desirable, though. Let me know if you want me to just update the values to effectively be snapshots.
Closes #186
This release upgrades to Faker v9, which introduces several breaking changes:
For more details, see the Faker v9 migration guide.