Skip to content

chore: upgrade-zod-4#470

Merged
sergiojoker11 merged 6 commits into
mainfrom
chore/upgrade-zod-4
Aug 2, 2025
Merged

chore: upgrade-zod-4#470
sergiojoker11 merged 6 commits into
mainfrom
chore/upgrade-zod-4

Conversation

@sergiojoker11
Copy link
Copy Markdown
Member

No description provided.

Comment thread src/schemas/util.ts
}
}) as z.ZodEffects<z.ZodNullable<T>, z.infer<T>>;
};
): z.ZodType<z.infer<typeof schema>, z.infer<typeof schema> | null> {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ZodType<output type, input type> cause why would they do it the natural way> Twats!

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In fact, it might make some sense cause I guess it is more frequent modifying/adding the first parameter?

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const tryItOutSchema = () =>
z.object({
const tryItOutSchema = function (): z.ZodObject<{ hasSentTestReminder: z.ZodBoolean }, z.core.$strip> {
Copy link
Copy Markdown
Member Author

@sergiojoker11 sergiojoker11 Aug 1, 2025

Choose a reason for hiding this comment

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

can be avoided we we prefer the eslint exception

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.

Nah, this is fine now the return type isn't a complex mess. Probably not worth doing everywhere else though

Comment thread package.json Outdated
"@mantine/core": "8.2.2",
"@mantine/hooks": "8.2.2",
"@notifycal/shared": "5.1.0",
"@notifycal/shared": "file:../shared/notifycal-shared-5.1.0.tgz",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/schemas/util.ts
}
return;
})
.transform((v) => v!) as z.ZodType<z.infer<typeof schema>, z.infer<typeof schema> | null>;
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.

What does the transform do? return true/false?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

subcategory: nullableInputSchema(
z.string({ message: t('businessDetails.formIndustrySubcategoryField.isRequired') })
z.string({ message: t('businessDetails.formIndustrySubcategoryField.isRequired') }),
t('businessDetails.formIndustrySubcategoryField.isRequired')
Copy link
Copy Markdown
Member

@dsiguero dsiguero Aug 2, 2025

Choose a reason for hiding this comment

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

Is the 2nd parameter required? Or it was a bug? If it was a bug, maybe we can drop the message from z.string to avoid having the same thing in 2 places?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I had to be a bug although I didn't bother checking.
I assumed the translation was needed in both places judging by nullable category equivalent.

Copy link
Copy Markdown
Member

@dsiguero dsiguero left a comment

Choose a reason for hiding this comment

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

Remember to use fix or feat to ensure we get a release off this

@sergiojoker11
Copy link
Copy Markdown
Member Author

Remember to use fix or feat to ensure we get a release off this

ah good point. I will make it fix although it is really a chore.

dsiguero
dsiguero previously approved these changes Aug 2, 2025
@sergiojoker11 sergiojoker11 marked this pull request as ready for review August 2, 2025 10:53
@sergiojoker11 sergiojoker11 enabled auto-merge (squash) August 2, 2025 10:58
@sergiojoker11 sergiojoker11 merged commit 572a057 into main Aug 2, 2025
4 checks passed
@sergiojoker11 sergiojoker11 deleted the chore/upgrade-zod-4 branch August 2, 2025 11:00
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.

2 participants