Closed marble closed 3 years ago
How did you install TYPO3 and the extension inside ddev?
If the whole installation is set up with composer, you've to install the extension with composer too and are able to regenerate autoloading with composer dumpautoload
.
I've the impression that you just enabled the new extension in the Extension Manager while having a composer setup for the instance.
composer_version: "2"
in .ddev/config.yaml
ddev composer dumpautoload
Still no success, but the following situation:
dummy
extension with the extension-builder v10 branch in a DDEV v10 installationdummy
extension with the extension-builder v9.10.3 in a DDEV v9 installation, if I do a ddev composer require nikic/php-parser:4.3.0
Yes, initially I had forgotten to include the extension's TypoScript in the setup. However, with the Non-Docker installations I got this message which was immediately meaningful to me:
the point is this:
if you've an extension that has no public repository you've to put it in a folder like packages
and tell composer to load it with version @dev
.
Till now this step is missing in your descriptions, so I doubt if you did it.
In composer.yaml it's looking like this then:
"require": {
"lumstuff/dummy": "@dev"
},
"repositories": {
"sitepackage": {
"type": "path",
"url": "packages/*"
}
},
In the folder public/typo3conf/ext
will be a symlink to the extension in packages/dummy
I think this has something to do with the fact that an extension generated in composer-based installation, is not cleanly installed, if it is not required via composer.
I'm actually not even convinced that this a thing we should actually support. Because in composer-installations the content of the typo3conf/ext
folder should be completely managed by composer, hence extension_builder should not fiddle around there.
In the folder public/typo3conf/ext will be a symlink to the extension in packages/dummy
correct, only that extension_builder does not know about the packages
folder and does/can not manipulate the root composer file.
@liayn correct, if autoloading has to be involved, it's a source for many potential errors
@marble Thanks a lot for testing this so thoroughly.
Core v9 ... php-parser:4.3.0
This topic is solved and merged in master.
@marble if the setup is like I described related to composer, the extension can be manipulated by extension_builder again to add or change things.
btw. I had a look at all code and never found faults in namespaces, so I think it's related to the autoloading process and composer-setup.
v10: I followed Davids advice, moved the extension to packages/dummy
and added the composer lines suggested by David. With this it is working. Thank you very much.
typo3conf/ext/
manually. But why then is that the default setting of the extension_builder
? It saves the generated extensions there by default. This should not happen and violates the "composer ideas".extension_builder
generally save generated extensions to a neutral path instead of typo3conf/ext
? Should that be a configuration value to be managed by "install tool extension settings"?ddev composer require "lumstuff/dummy:…"
(I'll probably be able to find that out myself, but still, … Is a tool existing that rewrites a composer.json
file as list of commands?) → Answer is on this page..ddev/config.yaml
file needs to be edited manually to set composer_version: "2"
. Can that be an issue here as well?
glad that it worked :)
As far as I know it is best practice but I'd be happy getting a confirmation about it - or a better way :)
The basic challenges are:
extension_builder
never knows about the composer setup, so many possible setups of TYPO3 can't be considered - even the fact only how the folder for local repositories is called.The command ddev composer require "lumstuff/dummy:…"
is correct.
2. like @liayn pointed out
extension_builder
never knows about the composer setup, so many possible setups of TYPO3 can't be considered - even the fact only how the folder for local repositories is called.
Therefore IMHO it shouldn't save to typo3conf/ext/
by default.
BUT, cool, I just noticed that once I have an extension in ./packages I can save the next one there too:
And then extension_builder
is helpful:
To answer your points a bit @marble
I'm not experienced with Composer. I did look at the Composer docs but probably would not have found the solution alone.
We are aware of this and we are trying to make this more pleasing.
I did not know that, in a fully composer based installation, I should not touch typo3conf/ext/manually.
I am aware of this as well. The extension_builder can detect that it runs within a composer-based installation and must not write to typo3conf/ext
of course. This is a bug!
The extension manager in the backend tells me that the installation is fully composer controlled. But why then does it allow to install extensions that are not known to composer?
Shouldn't there be an ALARM in the TYPO3 backend, if extensions are found that Composer doesn't know of?
The extension manager only enumerates the content of typo3conf/ext
and allows for enable/disable an ext. But it does not know how the ext got there. Hence, when composer is stearing things, it can only assume that composer autoloading information is present.
Is David's solution for including dev-extensions best practice?
Yes, it is! There is no other way than "local repositories" besides maintaining an extension totally separated within its own git repository and its own packagist-registration.
it is stated that the .ddev/config.yaml file needs to be edited manually to set composer_version: "2". Can that be an issue here as well?
This probably isn't an issue, but is of course highly recommended to do. Composer 2 is simply way better/faster.
I suggest to extend the documentation:
And show a warning in composer mode if no local path repsoitory is configured:
@ohader what do you think? You implemented the composer path detection and have some experience with people using the extension builder for the first time...
I like this idea (extend documentation) very much. I didn't know extension_builder picked the path from composer.json!
Minor improvement: https://github.com/FriendsOfTYPO3/extension_builder/pull/346
Hi folks, what am I supposed to do - what is the specific question (I did read the previous comments, but don't see a clear/dedicated task, yet).
@ohader I think we already had a lot of improvements here, which are not explicitly mentioned here. Maybe we can even already close this one @marble?
Yes, let's close this, at least for now. I'm not continuously using the extension builder, but I noticed that you had done something to this, as in a later use I got a warning about what do do in composer mode. Only thing was, afair, that I wasn't actually in composer mode. But it didn't crash, and having this extra warning didn't hurt. But I bookmarked "keep an eye on this" but haven't used it since then. And it would probably another ticket, so let's close this. The main thing is that I got it working. And others can too.
From Slack https://typo3.slack.com/archives/C0CEB3BMY/p1612365935024400
ddev composer require friendsoftypo3/extension-builder:dev-v10-compatibility
dummy
with modelHobby
and frontend plugincrud
dummy.tar.gz