Skip to content

Allow uppercase letters in package names#2718

Merged
bengotow merged 1 commit into
masterfrom
claude/fix-package-name-validation-t4jo6
May 8, 2026
Merged

Allow uppercase letters in package names#2718
bengotow merged 1 commit into
masterfrom
claude/fix-package-name-validation-t4jo6

Conversation

@bengotow
Copy link
Copy Markdown
Collaborator

@bengotow bengotow commented May 8, 2026

Summary

Updated the package name validation regex to accept uppercase letters (A-Z) in addition to lowercase letters, allowing for more flexible package naming conventions.

Changes

  • Modified VALID_PACKAGE_NAME regex pattern from /^[a-z0-9._-]+$/ to /^[a-zA-Z0-9._-]+$/ in app/src/package.ts
  • Updated error messages in app/src/package.ts and app/src/package-manager.ts to reflect the new validation pattern

Details

This change relaxes the package naming constraints to permit camelCase and PascalCase naming conventions, which are common in JavaScript/TypeScript ecosystems. The validation now accepts:

  • Lowercase letters (a-z)
  • Uppercase letters (A-Z)
  • Numbers (0-9)
  • Dots, underscores, and hyphens (._-)

Error messages have been updated to accurately reflect the new validation requirements.

https://claude.ai/code/session_01CeqkQ4HBGw1rYVtx83hcfB

The /^[a-z0-9._-]+$/ pattern rejected theme and plugin package names
containing uppercase letters (e.g. "MyTheme"), breaking previously-installed
packages. Expanded to /^[a-zA-Z0-9._-]+$/ to match the broader naming
convention used in the wild.

https://claude.ai/code/session_01CeqkQ4HBGw1rYVtx83hcfB
@indent-staging
Copy link
Copy Markdown
Contributor

indent-staging Bot commented May 8, 2026

PR Summary

Widens the plugin/theme package.json#name validation regex to also accept uppercase ASCII letters, restoring compatibility with previously-installed packages (e.g. MyTheme) that broke after the path-traversal hardening in #2698. The path-traversal protections are preserved — [a-zA-Z0-9._-] still excludes path separators, whitespace, and ../., and the path.resolve equality check in installPackageFromPath remains intact.

  • app/src/package.ts: VALID_PACKAGE_NAME changed from /^[a-z0-9._-]+$/ to /^[a-zA-Z0-9._-]+$/; InvalidPackageNameError message updated to match.
  • app/src/package-manager.ts: user-facing error message in installPackageFromPath updated to quote the new regex.

Issues

No issues found.

CI Checks

All CI checks passed on commit 518be75.

Custom Rules 3 rules evaluated, 3 passed, 0 failed

Passing This is a longer title to see what happens when they are too long to fit
Passing B
Passing Ben Rule

View all rules

@bengotow bengotow merged commit f9339e8 into master May 8, 2026
2 checks passed
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.

2 participants