Skip to content

Validate app ID format for Android and iOS#85

Draft
simonhamp wants to merge 1 commit intomainfrom
validate-app-id-format
Draft

Validate app ID format for Android and iOS#85
simonhamp wants to merge 1 commit intomainfrom
validate-app-id-format

Conversation

@simonhamp
Copy link
Copy Markdown
Member

Summary

  • Adds AppIdValidator class with platform-specific validation rules to catch invalid NATIVEPHP_APP_ID values before they cause cryptic build failures (e.g. Android AAPT errors from hyphens in package names)
  • Wires validation into InstallCommand (interactive prompt rejects invalid input), RunCommand, and ValidatesAppConfig trait (both exit with clear error messages)
  • Android rules: segments must match [a-zA-Z][a-zA-Z0-9_]* — no hyphens allowed
  • iOS rules: segments must match [a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])? — hyphens allowed mid-segment

Test plan

  • 37 new tests in AppIdValidatorTest covering valid/invalid IDs for both platforms, cross-platform validation, and prompt validation
  • Verify native:install prompt rejects com.example.my-app interactively
  • Verify native:run exits with clear error when .env contains an invalid app ID
  • Verify native:build (which uses ValidatesAppConfig) also catches invalid IDs

🤖 Generated with Claude Code

Prevent cryptic build failures (e.g. AAPT errors) caused by invalid
characters in NATIVEPHP_APP_ID. Adds centralized AppIdValidator with
platform-specific rules and wires it into InstallCommand, RunCommand,
and ValidatesAppConfig trait.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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