flow-development-collection icon indicating copy to clipboard operation
flow-development-collection copied to clipboard

Apply file structure best practice to Flow Project

Open Stefan-Kosker opened this issue 5 years ago • 7 comments

Description

./flow kickstart and documentation needs an update to fit into best practice folder structure described here:

Neos.io Blogpost

Steps to Reproduce

  1. Read the Blog article written by Christian Müller
  2. Read the docs about creating a new package
  3. 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.

Stefan-Kosker avatar Jul 25 '19 06:07 Stefan-Kosker

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 (or Plugins)

dlubitz avatar Jul 25 '19 07:07 dlubitz

That would indeed be a nice new feature and shouldn't be too hard to implement.

albe avatar Jul 25 '19 08:07 albe

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?

ralfkuehnel avatar Oct 16 '19 16:10 ralfkuehnel

@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)

sorenmalling avatar Mar 21 '20 23:03 sorenmalling

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.

albe avatar Mar 22 '20 15:03 albe

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?

mrimann avatar Jan 28 '22 23:01 mrimann

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?

albe avatar Feb 26 '22 19:02 albe