-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move vscode-ally key mapping to
satisfies I18nKey
this allows to remove the runtime implication of calling a functtion that simply returns the provided key
- Loading branch information
Showing
23 changed files
with
61 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { z } from 'zod'; | ||
import { k } from '../utils/i18n'; | ||
import type { I18nKey } from '../utils/i18n'; | ||
|
||
export const PASSWORD_MIN_LENGTH = 4; | ||
|
||
export const passwordSchema = z | ||
.string({ required_error: k('common.errors.validation.required') }) | ||
.min(PASSWORD_MIN_LENGTH, k('common.errors.validation.password.minlength')); | ||
.string({ required_error: 'common.errors.validation.required' satisfies I18nKey }) | ||
.min(PASSWORD_MIN_LENGTH, 'common.errors.validation.password.minlength' satisfies I18nKey); | ||
|
||
export const emailSchema = z | ||
.string({ required_error: k('common.errors.validation.required') }) | ||
.email(k('common.errors.validation.email-schema')); | ||
.string({ required_error: 'common.errors.validation.required' satisfies I18nKey }) | ||
.email('common.errors.validation.email-schema' satisfies I18nKey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
export function k(key: string) { | ||
return key; | ||
} | ||
export type I18nKey = string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,8 @@ | |
"new-email": "Nouveau Courriel" | ||
}, | ||
"roles": { | ||
"admin": "Administrateur" | ||
"admin": "Administrateur", | ||
"chat": "Chat" | ||
}, | ||
"placeholders": { | ||
"email": "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { z } from 'zod'; | ||
import { emailSchema, k, passwordSchema } from '~shared'; | ||
import { emailSchema, passwordSchema, type I18nKey } from '~shared'; | ||
|
||
export const requestPasswordSchema = z.object({ | ||
email: emailSchema, | ||
}); | ||
|
||
export const resetPasswordSchema = z.object({ | ||
password: passwordSchema, | ||
resetToken: z.string({ required_error: k('(auth).forgot_password.reset.action.no-token') }), | ||
resetToken: z.string({ required_error: '(auth).forgot_password.reset.action.no-token' satisfies I18nKey }), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
cbdc413
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 commit is now deployed to Vercel!
fullstacked
https://fullstacked-4wzp2d1id-v-ed.vercel.app