-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: Do not install demo site and instead offer a choice #42
base: 5.2
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally like this but cannot Test on my phone. So only two nitpicks as a start
looks good so far, wanted to test it locally, but when running 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 |
Okay here is a hack:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great 👍 (but there's an general issue within the master branch of neos-base-distribution
, see above).
We could have also gone with a Y/n
dialogue for now, but for me it's good as it is. There's also an unused constant, but that can be easily removed before merging.
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 ( |
Naw, I was able to test it in the end after some composer.json back and forth as mentioned above. Afterwards |
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:
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. 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general it works like a charm with the "empty" option but when choosing "Neos.Demo" i run into the following composer errors:
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for neos/demo ^6.0 -> satisfiable by neos/demo[6.0.0].
- Conclusion: remove neos/neos dev-master
- Conclusion: don't install neos/neos dev-master
- neos/demo 6.0.0 requires neos/neos ^5.0 -> satisfiable by neos/neos[5.0.0, 5.0.1, 5.0.2, 5.0.x-dev].
- Can only install one of: neos/neos[5.0.0, dev-master].
- Can only install one of: neos/neos[5.0.1, dev-master].
- Can only install one of: neos/neos[5.0.2, dev-master].
- Can only install one of: neos/neos[5.0.x-dev, dev-master].
- Installation request for neos/neos (locked at dev-master, required as @dev) -> satisfiable by neos/neos[dev-master].
Installation failed, reverting ./composer.json to its original content.
Your Neos was prepared successfully.
The last line "Neos was installed sucessfully" is a bit misleading, maybe we can check wether the composer command was successfull before writing this. I suggest to not render any message when errors occured so the last output is the composer error so it can be spotted easily.
The fix to underlying dependency problem is to adjust the neos/neos constraints in Neos.Demo to allow dev-master.
FYI this line allows to test this without messing with the composer-configuration:
|
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:
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 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
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 |
Mmm, yes, that could work, let me think about the syntax, because I have some more ideas in mind about this in the future... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart of nitpicks, it looks good. Haven't testes it yet.
@@ -0,0 +1,77 @@ | |||
<?php | |||
namespace Neos\BaseDistribution\Composer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace Neos\BaseDistribution\Composer; | |
declare(strict_types=1); | |
namespace Neos\BaseDistribution\Composer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
if ((int)$selection === 1) { | ||
$io->write('No package will be installed.'); | ||
$io->write($distributionReadyMessagesBase); | ||
$io->write('3. Create your site package "./flow site:create"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$io->write('3. Create your site package "./flow site:create"'); | |
$io->write('3. Create your own site package "./flow site:create"'); |
@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 Offcourse this would add a composer dependency to flow which we just added in neos/flow-development-collection#1837 anyways. |
@kitsunet i played with moving the post create project command to the composer scripts in flow: |
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 neos/flow-development-collection#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. |
Dismissed to avoid blocking as i mainly suggested a more flexible solution but this here is an improvement already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First test works great, I would just suggest to tweak the initial choices slightly (see comment)
|
||
$choices = [ | ||
'start with the Neos Demo content', | ||
'empty Neos' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a mini suggestion:
Wouldn't it make more sense to have empty Neos
the first (i.e. default) option since there will be more example content in the future probably.
Also is "empty Neos" a good name? It installs some packages that are not required per se (like neos/seo
and neos/redirecthandler-*
). I would totally love some kind of "bare bones" installation, too, that only requires the absolutely required packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..I guess it was an intentional decision to keep the current behavior the default, makes sense I guess! But it could be the default and not be the first option, too
use Neos\Splash\DistributionBuilder\Domain\ValueObjects\PackageRequirement; | ||
|
||
/** | ||
* A comopser post-create-project script to allow a choice of adding the demo site (and possible other things in the future) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* A comopser post-create-project script to allow a choice of adding the demo site (and possible other things in the future) | |
* A composer post-create-project script to allow a choice of adding the demo site (and possible other things in the future) |
* Setup the neos distribution | ||
* | ||
* @param Event $event | ||
* @throws \Neos\Utility\Exception\FilesException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @throws \Neos\Utility\Exception\FilesException |
* @throws \Neos\Utility\Exception\FilesException | ||
* @throws \Exception | ||
*/ | ||
public static function setupDistribution(Event $event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static function setupDistribution(Event $event) | |
public static function setupDistribution(Event $event): void |
]; | ||
|
||
$packages = [ | ||
'neos/demo', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we make this a 1:n map we can easily add new distributions
]); | ||
|
||
if (!$io->isInteractive()) { | ||
$io->write('Non-Interacctive installation, installing no additional package(s).'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$io->write('Non-Interacctive installation, installing no additional package(s).'); | |
$io->write('Non-interactive installation, installing no additional package(s).'); |
use Symfony\Component\Console\Output\ConsoleOutput; | ||
use Neos\Splash\DistributionBuilder\Service\PackageService; | ||
use Neos\Splash\DistributionBuilder\Service\JsonFileService; | ||
use Neos\Splash\DistributionBuilder\Domain\ValueObjects\PackageRequirement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are those used at all?
if ((int)$selection === 1) { | ||
$io->write('No package will be installed.'); | ||
$io->write($distributionReadyMessagesBase); | ||
$io->write('3. Create your site package "./flow site:create"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The site:create
command will not kickstart a Site package!
I guess at least a package:create
call is required first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some nitpicks first, but I found some more issues that we should iron out before merging this one
FYI: I'll prepare a PR-PR with the suggested changes |
* Apply cosmetic fixes from neos#42 (typos, unused namespace imports, ...) * Extract installable "distributions" to static method (to make it easier to adjust/extend) * Replace "empty Neos" with a bare bones installation that only contains the necessary packages
=> kitsunet#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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this solved by now and can be closed?
as far as i know this is not solved. we only have a |
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? |
This can be tested via:
followup: kitsunet#1
related: https://discuss.neos.io/t/rfc-post-create-project-tasks/5141