99use Neos \Flow \Cli \CommandController ;
1010use Neos \Flow \Core \Bootstrap ;
1111use Neos \Flow \Package \FlowPackageInterface ;
12+ use Neos \Flow \Package \GenericPackage ;
1213use Neos \Flow \Package \PackageManager ;
1314use Neos \Utility \Files ;
1415use Neos \Utility \Unicode \Functions as UnicodeFunctions ;
@@ -92,6 +93,31 @@ public function buildCommand(string $packageKey): void
9293 $ this ->output ->outputLine ($ packageKey . " is not a Flow package " );
9394 $ this ->quit (1 );
9495 }
96+ if (!$ package instanceof GenericPackage) {
97+ $ this ->output ->outputLine ($ packageKey . " is not a Generic package " );
98+ $ this ->quit (1 );
99+ }
100+
101+ /**
102+ * @var array<int, array{namespace:string, classPath:string, mappingType:string}> $autoloadConfigurations
103+ */
104+ $ autoloadConfigurations = $ package ->getFlattenedAutoloadConfiguration ();
105+ $ namespace = null ;
106+ foreach ($ autoloadConfigurations as $ autoloadConfiguration ) {
107+ if (
108+ $ autoloadConfiguration ['mappingType ' ] === 'psr-4 '
109+ && str_ends_with ($ autoloadConfiguration ['namespace ' ], '\\NodeTypes \\' )
110+ && $ autoloadConfiguration ['classPath ' ] === $ package ->getPackagePath () . 'NodeTypes/ '
111+ ) {
112+ $ namespace = $ autoloadConfiguration ['namespace ' ];
113+ break ;
114+ }
115+ }
116+
117+ if ($ namespace === null ) {
118+ $ this ->outputLine ('<error>No PSR4-NodeTypes namespace for the NodeTypes folder is registered via composer</error> ' );
119+ $ this ->quit (1 );
120+ }
95121
96122 $ nodeTypes = $ this ->nodeTypeManager ->getNodeTypes (false );
97123 foreach ($ nodeTypes as $ nodeType ) {
@@ -113,7 +139,7 @@ public function buildCommand(string $packageKey): void
113139 $ nodeTypeObjectFile ->fileContent
114140 );
115141
116- $ this ->outputLine (' - ' . $ specification ->nodeTypeName . '/ ' . $ specification ->className );
142+ $ this ->outputLine (' - ' . $ specification ->nodeTypeName . ' -> ' . $ specification ->className );
117143 }
118144 }
119145}
0 commit comments