neos-base-distribution
neos-base-distribution copied to clipboard
FEATURE: Do not install demo site and instead offer a choice
This can be tested via:
composer create-project --repository '{"type":"vcs", "url":"[email protected]:kitsunet/neos-base-distribution.git"}' neos/neos-base-distribution neos-dev-dist-demo-installer dev-feature/demo-installer
followup: https://github.com/kitsunet/neos-base-distribution/pull/1 related: https://discuss.neos.io/t/rfc-post-create-project-tasks/5141
looks good so far, wanted to test it locally, but when running composer create-project
(with this PR checkout out ofc) composer starts to run into a endless loop with the message Something's changed, looking at all rules again (pass #305)
(verbose output)
What ist the best way to test the changes locally @kitsunet?
Tried it at home now on a completely different machine, same story (also for composer update
). I think that https://github.com/neos/neos-base-distribution/commit/67a62e29e4051268b6e4a5509a3a91cea7a214ed might have something to do with it, although I can't see what's wrong.
Okay here is a hack:
- Remove all packages except for
neos/neos
- Run composer update
- Add all other packages
Now composer update will succeed. It looks like composer is running into a dependency check endless loop, never seen anything like this before.
This way was at least able to test this PR, but the general issue inside the base distribution has to be addressed. I would have opened an issue, but we don't do issues in the base distribution.
Alright, removed a lot of superfluous stuff from this, actually trying it is rather hard. while working on it I was using a branch in this repo that I then asked for in create-project ( composer create-project neos/neos-base-distribution my-folder dev-mybranch
) . Now I probably could move this PR over to the original repo if you want and it makes testing easier.
Now I probably could move this PR over to the original repo if you want and it makes testing easier.
Naw, I was able to test it in the end after some composer.json back and forth as mentioned above. Afterwards composer create-project
within the folder would trigger the script. But the real troublemaker is that there is an issue in the master branch of the base distro (could you give composer create-project neos/neos-base-distribution . dev-master -vvv
a try? Or should that never work because we have the dev distro for that?)
I can install base-distribution dev-master just fine, but it takes quite a lot of memory and time. Probably composer resolving dependencies. Eventually it could install though.
I can install base-distribution dev-master just fine, but it takes quite a lot of memory and time. Probably composer resolving dependencies. Eventually it could install though.
Thanks for checking, just tried it again:
Something's changed, looking at all rules again (pass #619)
Dependency resolution completed in 492.679 seconds
Analyzed 14727 packages to resolve dependencies
Analyzed 1402061 rules to resolve dependencies
Resolving dependencies through SAT
Looking at all rules.
I guess I wasn't patient enough on the train to wait 8 minutes for composer to just even start downloading packages 🙈
But at least it's working in general and this "issue" (if it is in one at some point), is definitely out of scope for this change. Just brought it up in here, because I noticed it while testing. 😊
FYI this line allows to test this without messing with the composer-configuration:
composer create-project --repository '{"type":"vcs", "url":"[email protected]:kitsunet/neos-base-distribution.git"}' neos/neos-base-distribution neos-dev-dist-demo-installer dev-feature/demo-installer
Interesting for me it installed jusut fine, apparently something changed with some dependency declaration? I can try to test for success, but not sure I get any info about that....
@kitsunet https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Application.php#L194 returns 0 if all went fine and the composer application passes this trough. So this should be simple.
I am suspecting that the neos-base-distribution has a dependency problem on master:
I get Installing neos/flow (4.0.25): Loading from cache
which is a bit oldish and also
Package typo3/neos-nodetypes is abandoned, you should avoid using it. Use neos/nodetypes instead.
Package typo3/kickstart is abandoned, you should avoid using it. Use neos/kickstarter instead.
The reason seems to be that dev-dist(master) requires (neos: @dev) which requires (flow: *).
How should the dependencies look on master?
@kitsunet i think i understand the problem now. The solution here requires neos/demo
without version constraint wich allows composer to make all sorts of decisions.
As solution i suggest to use the "extras" section of the composer manifest as source like this.
{
"extra": {
"neos": {
"create-project-sitePackageOptions": [
{
"composerName": "",
"versionConstraint": "",
"description": "empty Neos"
},
{
"composerName": "neos/demo",
"versionConstraint": "@dev",
"description": "start with the Neos Demo content"
}
]
}
}
}
or more compact
{
"extra": {
"neos": {
"create-project-sitePackageOptions": {
"": "empty Neos",
"neos/demo:@dev": "start with the Neos Demo content"
}
}
}
}
As side effect this will also make the life of release managers easier as they can still adjust all constraints in the composer.json of the base-dist. Also it will be much more intuitive to add more flavors of neos like neos/skeleton
or neos/headless
to the base distribution.
Mmm, yes, that could work, let me think about the syntax, because I have some more ideas in mind about this in the future...
@kitsunet a way to make this even more useful and clean be to move the InstallSitePackage.php to Neos\Flow\Composer\InstallerScripts->PostCreateProjectCmd and use the path extra.neos.create-project-packageOptions
from the main manifest for configuration. That way it would be available for the flow-base-distribution and even custom neos distributions.
Offcourse this would add a composer dependency to flow which we just added in https://github.com/neos/flow-development-collection/pull/1837 anyways.
@kitsunet i played with moving the post create project command to the composer scripts in flow: https://github.com/neos/flow-development-collection/pull/1852 what do you think about this solution.
@mficzel do still request changes or can we merge that feature?
@davidspiola there is an alternate implementation based on flow that I mentioned above that would be a much more generic solution but is also in need of feedback
I suggest to postpone this for now and aim to 5.2 for this feature
So, what's the status on this one?
It seems a bit unelegant to add a special class where all other composer magic is usually done in Neos\Flow\Composer\InstallerScripts .
I would really prefer a configurable solution via the Flow Composer Installer Scripts that can also be used for custom distributions like i sketched in https://github.com/neos/flow-development-collection/pull/1852 . That would reduce this pr to some lines in the composer.json of the neos-base-distribution.
However as the other or did not get any feedback and this is still an improvement we might consider to merge this as it is an intermediate improvement.
FYI: I'll prepare a PR-PR with the suggested changes
=> https://github.com/kitsunet/neos-base-distribution/pull/1
Related discussion: https://discuss.neos.io/t/rfc-post-create-project-tasks/5141/14
this would be a really valuable thing (especially for newcomers, then they wont get confused with uninstalling the demo site etc...)
i have another idea: how about that the Neos.Demo site is 'installed' in the DistributionPackages folder as one is likely to play around with it and this seems the right place. (maybe this could even work for custom git repos...).
I would like to eventually remove the Language Configuration from Neos.Demo ... that way it could coexist with other site packages without problems. In which case it could still be installed by default without doing harm. We could even move it to the neos-dev-collection.
... plus cli-commands to add remove dimensions/dimensionvalues.
as far as i know this is not solved. we only have a ./flow welcome
command to setup neos but we want to hack into pre composer install logic ...
I also think this is not solved yet fully but am not sure we should keep this pr open as we will probably end up with a different solution anyways?