@@ -481,21 +481,25 @@ private function removeSecureEnvironmentValue(string $name): void
481481 }
482482
483483 /**
484- * Resolve wildcard theme codes (e.g., Vendor/* to all underlying vendor themes)
484+ * Resolve vendor theme codes (e.g., Vendor to all underlying vendor themes)
485485 *
486486 * @param array<string> $themeCodes
487487 * @param ThemeList $themeList
488488 * @return array<string>
489489 */
490- protected function resolveWildcardThemes (
490+ protected function resolveVendorThemes (
491491 array $ themeCodes ,
492492 ThemeList $ themeList
493493 ): array {
494494 $ resolved = [];
495495 $ availableThemes = null ;
496496
497497 foreach ($ themeCodes as $ code ) {
498- if (\str_ends_with ($ code , '/* ' )) {
498+ // Check if it's explicitly a wildcard OR just a vendor name without a slash
499+ $ isExplicitWildcard = \str_ends_with ($ code , '/* ' );
500+ $ isVendorOnly = !\str_contains ($ code , '/ ' );
501+
502+ if ($ isExplicitWildcard || $ isVendorOnly ) {
499503 // Lazy-load themes only when needed
500504 if ($ availableThemes === null ) {
501505 $ availableThemes = array_map (
@@ -504,25 +508,37 @@ protected function resolveWildcardThemes(
504508 );
505509 }
506510
507- $ prefix = substr ($ code , 0 , -1 ); // Keeps the trailing slash, e.g. "Vendor/"
508-
511+ if ($ isExplicitWildcard ) {
512+ $ prefix = substr ($ code , 0 , -1 ); // Keeps the trailing slash, e.g. "Vendor/"
513+ } else {
514+ $ prefix = $ code . '/ ' ; // e.g. "Vendor" -> "Vendor/"
515+ }
516+
509517 $ matched = array_filter (
510518 $ availableThemes ,
511519 fn (string $ availableCode ) => \str_starts_with ($ availableCode , $ prefix )
512520 );
513521
514522 if (empty ($ matched )) {
515- $ this ->io ->warning (sprintf ("No themes found for prefix '%s' " , $ prefix ));
523+ $ this ->io ->warning (sprintf ("No themes found for vendor/prefix '%s' " , $ prefix ));
524+
525+ // If they typed just a word and it wasn't a vendor,
526+ // we still add it so standard Magento validation kicks in later.
527+ if ($ isVendorOnly ) {
528+ $ resolved [] = $ code ;
529+ }
516530 } else {
517531 $ this ->io ->note (sprintf (
518- "Resolved '%s' to %d theme(s): %s " ,
532+ "Resolved vendor '%s' to %d theme(s): %s " ,
519533 $ code ,
520534 count ($ matched ),
521535 implode (', ' , $ matched )
522536 ));
523- }
524537
525- array_push ($ resolved , ...$ matched );
538+ foreach ($ matched as $ match ) {
539+ $ resolved [] = $ match ;
540+ }
541+ }
526542 } else {
527543 $ resolved [] = $ code ;
528544 }
0 commit comments