Skip to content

refactor(schemas): centralize regex constants (@byseif21, @fehmer)#7710

Open
byseif21 wants to merge 8 commits intomonkeytypegame:masterfrom
byseif21:refactor/unify-name-regex
Open

refactor(schemas): centralize regex constants (@byseif21, @fehmer)#7710
byseif21 wants to merge 8 commits intomonkeytypegame:masterfrom
byseif21:refactor/unify-name-regex

Conversation

@byseif21
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 23, 2026 18:46
@monkeytypegeorge monkeytypegeorge added frontend User interface or web stuff packages Changes in local packages labels Mar 23, 2026
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Mar 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Centralizes commonly used regex patterns in @monkeytype/schemas and updates schema/frontend validators to reference shared constants instead of duplicating inline regexes.

Changes:

  • Add shared NAME_REGEX / SLUG_REGEX constants in packages/schemas/src/util.ts.
  • Replace multiple inline .regex(/.../) usages across schema files with the centralized constants.
  • Update frontend username validation to use SLUG_REGEX from schemas.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/schemas/src/util.ts Introduces shared regex constants.
packages/schemas/src/users.ts Swaps multiple validators to use shared regex constants.
packages/schemas/src/presets.ts Uses shared regex for preset name validation.
packages/schemas/src/ape-keys.ts Uses shared slug regex for ApeKey names.
frontend/src/ts/utils/misc.ts Reuses shared slug regex for username validity check.

@github-actions
Copy link
Contributor

Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes.

@github-actions github-actions bot added waiting for update Pull requests or issues that require changes/comments before continuing and removed waiting for review Pull requests that require a review before continuing labels Mar 23, 2026
@github-actions github-actions bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Mar 23, 2026
@byseif21 byseif21 changed the title refactor(schemas): centralize regex constants (@byseif21) refactor(schemas): centralize regex constants (@byseif21), (@fehmer) Mar 23, 2026
@byseif21 byseif21 changed the title refactor(schemas): centralize regex constants (@byseif21), (@fehmer) refactor(schemas): centralize regex constants (@byseif21, @fehmer) Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff packages Changes in local packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants