# |
May 5th 2021, 17:26 |
kevin.pfeifer |
oh wait, i guess >= 3.0.0 in the composer constraints don't work when you have 4.0 |
# |
May 5th 2021, 17:22 |
kevin.pfeifer |
but still I dont understand why this composer/installer plugin should install it in the wrong directory. https://github.com/composer/installers/blob/main/src/Composer/Installers/CakePHPInstaller.php#L38 checks for cakephp version >= 3.0.0 |
# |
May 5th 2021, 17:15 |
admad |
Asking the right questions @kevin.pfeifer :) |
# |
May 5th 2021, 17:02 |
kevin.pfeifer |
hmmm, what is easier: change the whole cakephp 3 and 4 plugin ecosystem or tell you to not use an old library which requires an old composer installer module which causes problems :thinking_face: |
# |
May 5th 2021, 16:56 |
erwane |
maybe plugins writed for cakephp 3 and 4 should change `"type": "cakephp-plugin",` to `"type": "library",` |
# |
May 5th 2021, 16:54 |
admad |
`composer/installers` was need for plugins in Cake 2, which is why it tries to install in `Plugin` dir |
# |
May 5th 2021, 16:51 |
erwane |
yes, i will remove this requirements. But i'm really curious about this behavior. Maybe CakePHP team can answer it |
# |
May 5th 2021, 16:50 |
kevin.pfeifer |
i still stand by the fact, that you should handle JS Library dependencies via npm and not composer but otherwise I can't help you :man-shrugging: |
# |
May 5th 2021, 16:48 |
kevin.pfeifer |
mhmm but you dont have the plugin-installer active here |
# |
May 5th 2021, 16:46 |
kevin.pfeifer |
i guess it clashes with composer/installers |
# |
May 5th 2021, 16:46 |
kevin.pfeifer |
which handles how plugins are being managed inside the vendor folder |
# |
May 5th 2021, 16:45 |
kevin.pfeifer |
https://github.com/cakephp/plugin-installer |
# |
May 5th 2021, 16:45 |
kevin.pfeifer |
there is a separte cakephp plugin-installer module |
# |
May 5th 2021, 16:45 |
erwane |
but the discussion is about why if composer/installers is required, composer install should be ran twice ? |
# |
May 5th 2021, 16:45 |
kevin.pfeifer |
well ok |
# |
May 5th 2021, 16:45 |
kevin.pfeifer |
:) |
# |
May 5th 2021, 16:45 |
erwane |
moment/moment :) |
# |
May 5th 2021, 16:45 |
kevin.pfeifer |
which package requires `composer/installers` ? |
# |
May 5th 2021, 16:44 |
kevin.pfeifer |
and there is a https://github.com/composer/installers/blob/main/src/Composer/Installers/CakePHPInstaller.php |
# |
May 5th 2021, 16:44 |
kevin.pfeifer |
`This is for PHP package authors to require in their composer.json. It will install their package to the correct location based on the specified package type.` |
# |
May 5th 2021, 16:43 |
kevin.pfeifer |
ah, then its probably compsoer/installers |
# |
May 5th 2021, 16:42 |
slackebot |
"spatie/schema-org": "^3.3", "wyrihaximus/minify-html": "^2.0", "composer/installers": "^1.0" },``` No moment, no jquery, same problem. Problem com from composer/installers OR missing configuration in composer.json |
# |
May 5th 2021, 16:42 |
erwane |
``` "require": { "php": "~7.4.0", "ext-intl": "*", "ext-json": "*", "cakephp/cakephp": "^4.2", "cakephp/migrations": "^3.0", "cakephp/authentication": "^2.6", "holt59/cakephp4-bootstrap-helpers": "^4.0", "twbs/bootstrap": "^4.0", "markstory/asset_compress": "^4.0", "linkorb/jsmin-php": "^1.0", "erwane/cakephp-hcaptcha": "^1.0", |
# |
May 5th 2021, 16:40 |
kevin.pfeifer |
why moment/moment causes that I cant tell you |
# |
May 5th 2021, 16:40 |
kevin.pfeifer |
i too have JS libraries which I use but i have a seperate package.json for all the JS libraries |
# |
May 5th 2021, 16:39 |
kevin.pfeifer |
I dont want to be picky here but isn't momentJS 1) deprected and 2) a JS library which should be managed npm and not composer? |
# |
May 5th 2021, 16:38 |
erwane |
and THEN paths are corrects |
# |
May 5th 2021, 16:37 |
slackebot |
(1.0.0): Extracting archive - Installing holt59/cakephp4-bootstrap-helpers (4.0.0): Extracting archive - Installing markstory/asset_compress (4.0.4): Extracting archive - Installing wyrihaximus/minify-html (2.0.0): Extracting archive Package patchwork/jsqueeze is abandoned, you should avoid using it. No replacement was suggested. Generating optimized autoload files``` |
# |
May 5th 2021, 16:37 |
erwane |
If i redo `composer install -o --no-dev` he reload plugins :S ```$ composer install -o --no-dev Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Package operations: 6 installs, 0 updates, 0 removals - Installing cakephp/authentication (2.6.1): Extracting archive - Installing cakephp/migrations (3.0.0): Extracting archive - Installing erwane/cakephp-hcaptcha |
# |
May 5th 2021, 16:36 |
erwane |
adding moment/moment, require the `composer/installers`package and problems starts This package create a "Plugin/" dir and put `cakephp-plugin` in it BUT autoloader path is invalid. |
# |
May 5th 2021, 16:35 |
slackebot |
"markstory/asset_compress": "^4.0", "linkorb/jsmin-php": "^1.0", "erwane/cakephp-hcaptcha": "^1.0", "spatie/schema-org": "^3.3", "components/jquery": "~3.5.0", "wyrihaximus/minify-html": "^2.0" },``` Everythink is OK. No Plugin dir and app is working |
# |
May 5th 2021, 16:35 |
erwane |
done. My process : `rm -rf composer.lock Plugin vendor components andand composer install -o --no-dev` ``` "require": { "php": "~7.4.0", "ext-intl": "*", "ext-json": "*", "cakephp/cakephp": "^4.2", "cakephp/migrations": "^3.0", "cakephp/authentication": "^2.6", "holt59/cakephp4-bootstrap-helpers": "^4.0", "twbs/bootstrap": "^4.0", |
# |
May 5th 2021, 16:32 |
kevin.pfeifer |
i would try to re-create your composer.json from the start (require each package at a time) and see when this behaviour starts to appear |
# |
May 5th 2021, 16:29 |
erwane |
`composer/installers` in fact ... Really don't known why it do that :S |
# |
May 5th 2021, 16:25 |
erwane |
The `moment/moment` package do that ... |
# |
May 5th 2021, 16:06 |
me1367 |
Would be dope to see something like that for CakePHP :O |
# |
May 5th 2021, 16:06 |
erwane |
if if relaunch `composer install -o --no-dev` the Plugin dir is still there BUT in vendor dir too (right place) |
# |
May 5th 2021, 16:06 |
me1367 |
Also that dbdocs makes it nice to see everything a bit more "at a glance" |
# |
May 5th 2021, 16:06 |
me1367 |
yea |
# |
May 5th 2021, 16:06 |
kevin.pfeifer |
and that its code based and therefore can be versioned in git |
# |
May 5th 2021, 16:05 |
kevin.pfeifer |
but i was happy just with the table definitions and the realtions |