Skip to content

feat: add lowercase validation action#1511

Open
ER-28 wants to merge 2 commits into
open-circle:mainfrom
ER-28:feat-lowercase-action
Open

feat: add lowercase validation action#1511
ER-28 wants to merge 2 commits into
open-circle:mainfrom
ER-28:feat-lowercase-action

Conversation

@ER-28

@ER-28 ER-28 commented Jun 17, 2026

Copy link
Copy Markdown

Summary

Add a lowercase validation action that validates a string contains no uppercase ASCII characters. This complements the existing toLowerCase transform action.

const Schema = v.pipe(v.string(), v.lowercase('Must be lowercase'));

Changes

Library

  • library/src/regex.ts — Added LOWERCASE_REGEX (/^[^A-Z]*$/u)
  • library/src/actions/lowercase/lowercase.ts — New lowercase action implementation
  • library/src/actions/lowercase/index.ts — Barrel export
  • library/src/actions/lowercase/lowercase.test.ts — 11 unit tests
  • library/src/actions/lowercase/lowercase.test-d.ts — 6 type tests
  • library/src/actions/index.ts — Added export line

Website

  • (actions)/lowercase/ — New API reference page for the action
  • (types)/LowercaseAction/ — New type documentation page
  • (types)/LowercaseIssue/ — New issue type documentation page
  • menu.md — Added menu entries

Testing

  • 11 unit tests + 6 type tests pass
  • ESLint: no errors
  • TypeScript: no type errors

Checklist

  • Implementation follows existing patterns (digits, emoji, finite)
  • Unit tests cover valid/invalid/untyped inputs
  • Type tests verify input/output/issue inference
  • Website API docs added with example
  • Menu entries added (alphabetically correct)
  • Code formatted with Prettier
  • No lint or type errors

Summary by cubic

Add a lowercase validation action that fails when a string includes any uppercase ASCII letters. Complements the existing toLowerCase transform and includes docs, tests, and menu updates.

  • New Features
    • Added lowercase(message?) validation using LOWERCASE_REGEX (/^[^A-Z]*$/u), issuing LowercaseIssue on failure.
    • Exported from library/src/actions/index.ts; new types LowercaseAction and LowercaseIssue.
    • Added API docs for the action and types (with examples), and updated the website menu. Included unit and type tests.

Written for commit 0c68dd4. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Open Circle Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 90fe199a-bfd5-4301-811c-6bc87553a7b5

📥 Commits

Reviewing files that changed from the base of the PR and between ece7663 and 0c68dd4.

📒 Files selected for processing (1)
  • website/src/routes/api/(actions)/lowercase/index.mdx
✅ Files skipped from review due to trivial changes (1)
  • website/src/routes/api/(actions)/lowercase/index.mdx

Walkthrough

A new lowercase validation action is added to the library. A LOWERCASE_REGEX constant (Unicode regex matching strings with no uppercase ASCII letters) is added to regex.ts. The lowercase module exports LowercaseIssue and LowercaseAction interfaces and a lowercase factory function with typed overloads; its ~run method tests the input against the regex when the dataset is typed and calls _addIssue on failure. The module is exposed through barrel exports at lowercase/index.ts and actions/index.ts. Runtime and type-level Vitest tests are added, along with website API documentation pages for the action, LowercaseAction, and LowercaseIssue, and corresponding menu entries.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'feat: add lowercase validation action' clearly and concisely describes the main change—adding a new validation action to the library.
Description check ✅ Passed The pull request description is directly related to the changeset, providing a comprehensive summary of the changes, testing coverage, and implementation details for the lowercase validation action.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
website/src/routes/api/(actions)/lowercase/index.mdx (1)

29-31: ⚡ Quick win

Clarify the validation behavior in the explanation.

The current wording "If the string does not contain only lowercase characters" could be misinterpreted. According to the PR summary, the validation uses /^[^A-Z]*$/u which checks for the absence of uppercase ASCII characters, not the presence of only lowercase letters. This means numbers, special characters, and non-ASCII characters are permitted.

Consider rewording to: "With lowercase you can validate that a string contains no uppercase characters. If the input contains uppercase characters, you can use message to customize the error message."

🤖 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 `@website/src/routes/api/`(actions)/lowercase/index.mdx around lines 29 - 31,
Update the explanation section in the documentation to clarify the actual
validation behavior. Replace the phrase "If the string does not contain only
lowercase characters" with wording that accurately describes the validation
pattern's behavior: that it validates a string contains no uppercase ASCII
characters. The clarification should convey that numbers, special characters,
and non-ASCII characters are permitted by the validation, not rejected as the
current wording implies.
🤖 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.

Nitpick comments:
In `@website/src/routes/api/`(actions)/lowercase/index.mdx:
- Around line 29-31: Update the explanation section in the documentation to
clarify the actual validation behavior. Replace the phrase "If the string does
not contain only lowercase characters" with wording that accurately describes
the validation pattern's behavior: that it validates a string contains no
uppercase ASCII characters. The clarification should convey that numbers,
special characters, and non-ASCII characters are permitted by the validation,
not rejected as the current wording implies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8c1ed8b7-e757-4991-b57e-0b9dadade3a1

📥 Commits

Reviewing files that changed from the base of the PR and between 9bb6617 and ece7663.

📒 Files selected for processing (13)
  • library/src/actions/index.ts
  • library/src/actions/lowercase/index.ts
  • library/src/actions/lowercase/lowercase.test-d.ts
  • library/src/actions/lowercase/lowercase.test.ts
  • library/src/actions/lowercase/lowercase.ts
  • library/src/regex.ts
  • website/src/routes/api/(actions)/lowercase/index.mdx
  • website/src/routes/api/(actions)/lowercase/properties.ts
  • website/src/routes/api/(types)/LowercaseAction/index.mdx
  • website/src/routes/api/(types)/LowercaseAction/properties.ts
  • website/src/routes/api/(types)/LowercaseIssue/index.mdx
  • website/src/routes/api/(types)/LowercaseIssue/properties.ts
  • website/src/routes/api/menu.md

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 13 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="website/src/routes/api/(actions)/lowercase/index.mdx">

<violation number="1" location="website/src/routes/api/(actions)/lowercase/index.mdx:31">
P2: Documentation overstates `lowercase` validation behavior by describing it as checking that a string 'is lowercase' / contains 'only lowercase characters', but the actual regex `/^[^A-Z]*$/u` only excludes ASCII uppercase letters A-Z. Unicode uppercase characters like `Ä` would still pass validation, creating a semantic mismatch.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread website/src/routes/api/(actions)/lowercase/index.mdx Outdated
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant