Skip to content

Add app name validation#186

Open
Aditya-vegi wants to merge 2 commits intoRocketChat:masterfrom
Aditya-vegi:add-app-name-validation
Open

Add app name validation#186
Aditya-vegi wants to merge 2 commits intoRocketChat:masterfrom
Aditya-vegi:add-app-name-validation

Conversation

@Aditya-vegi
Copy link

Description

Adds validation to app name input to prevent invalid names from breaking folder creation and app configuration.

Problem

Users could enter invalid app names containing spaces or special characters, which would cause issues with:

  • Folder creation
  • Slug generation
  • App compatibility

Solution

Added input validation that only allows:

  • Letters (a-z, A-Z)
  • Numbers (0-9)
  • Hyphens (-)

Invalid names show a clear error message.

Changes

  • Added regex validation: /^[a-z0-9-]+$/i
  • Validates app name immediately after user input
  • Shows helpful error message for invalid input

Type of Change

  • Bug fix (prevents invalid app names)
  • New feature (validation logic)

Testing

npm run build
rc-apps create

# Test cases:
# 1. Enter "My App" → Should show error
# 2. Enter "@invalid" → Should show error
# 3. Enter "my-app" → Should continue

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.

1 participant