flow-development-collection
flow-development-collection copied to clipboard
Apply file structure best practice to Flow Project
Description
./flow kickstart
and documentation needs an update to fit into best practice folder structure described here:
Steps to Reproduce
- Read the Blog article written by Christian Müller
- Read the docs about creating a new package
- Be confused.
Expected behavior
./flow kickstart
creates your package in DistributionPackages
Documentation about creating a new package should make it clear that you create your packages in DistributionPackages
Actual behavior
./flow kickstart
creates the new package in Packages
.
Affected Versions
Neos: 4.3.3
Flow: 5.3.2
but this is standard afaik, so should be on all versions.
I would expect the kickstart package to ask for the target folder for the newly created package, because there are two different use cases:
- Single git repository for developing multiple packages =>
DistributionPackages
- Each package has it's own git repository =>
Packages
(orPlugins
)
That would indeed be a nice new feature and shouldn't be too hard to implement.
I created two PRs for this, see https://github.com/neos/flow-development-collection/pull/1823 and https://github.com/neos/flow-development-distribution/pull/42
If this is a possible solution i could also create a PR for the documentation?
@albe Can we have this closed, as PR https://github.com/neos/flow-development-distribution/pull/42 was merged (and this ticket was not automatically closed)
That PR only added the DistributionPackages
folder to the installation, but one of the ideas was to make the kickstarter create packages in that folder.
Letting the user choose from a list works and also the new package and it's files get created at the correct place.
But when choosing something different as Packages
as the path, it looks like PackageManager
's $this->rescanPackages();
does not recognize the newly created package and the next line throws the following exception:
Warning: Undefined array key "opsdev/foobar" in /var/www/html/Packages/Framework/Neos.Flow/Classes/Package/PackageManager.php line 418
@albe any idea on how to solve this?
Hmm, not so sure about the PackageManager - @kitsunet knows much more about it.
The line that throws the error is
$this->registerPackageFromStateConfiguration($manifest['name'], $this->packageStatesConfiguration['packages'][$manifest['name']]);
So it looks like the "packageStatesConfiguration" array doesn't contain the package entry after the scan. After a quick look the scan uses FLOW_PATH_PACKAGES
as the root directory to scan, which defaults to define('FLOW_PATH_PACKAGES', FLOW_PATH_ROOT . 'Packages/');
in Bootstrap::defineConstants()
. So I guess that needs to be adjusted as well?