Skip to content
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

Should type "library" be "project" in composer.json ? #2017

Open
BernhardBaumrock opened this issue Jan 6, 2025 · 5 comments
Open

Should type "library" be "project" in composer.json ? #2017

BernhardBaumrock opened this issue Jan 6, 2025 · 5 comments

Comments

@BernhardBaumrock
Copy link

I have added a PR to add ProcessWire to the list of CMS on the DDEV docs: ddev/ddev#6879

One user suggested to use composer to install PW. I tried it and got the following warning: ddev/ddev#6879 (comment)

Another user suggested to change the composer type from "library" to "project" to prevent this warning from showing up: ddev/ddev#6879 (comment)

I have no experience with using/installing ProcessWire from composer, so please use caution with this issue report as it might be nonsense! I think @teppokoivula is using composer to install PW?

@BernhardBaumrock BernhardBaumrock changed the title type "library" should be "project" in composer.json Should type "library" be "project" in composer.json ? Jan 6, 2025
@elabx
Copy link

elabx commented Jan 7, 2025

@BernhardBaumrock you mention:

I have tried your suggested version and it works. The warning mentioned above is not nice to see though. Is that something PW has to change or is that on ddev side?

I think this could be completely ignored? At least until ProcessWire is updated? I believe it's completely composer related and the fix to removing the warning would be what you suggest, so 👍 on this proposal.

Although, from the looks of composer documentation, updating this to project seems to be appropriate.

I wonder if this would affect the composer installer @teppokoivula ?

@BernhardBaumrock
Copy link
Author

Hi @elabx I'm afraid I don't understand what you say?! First you mention you think it can be ignored, then you mention you support it and the docs sound like "project" would be the right thing to choose.

Thx for the link to the docs, which supports this request :)

@elabx
Copy link

elabx commented Jan 7, 2025

First you mention you think it can be ignored, then you mention you support it and the docs sound like "project" would be the right thing to choose.

I propose that it can be ignored in the sense that it's not an error but a warning, and won't stop the project creation.

@BernhardBaumrock
Copy link
Author

Every warning is a potential bug. If not now then maybe in the future. So I think if possible it's good to not ignore warnings :) But yes, at the moment it works without issues with the warning.

@teppokoivula
Copy link

I have no experience with using/installing ProcessWire from composer, so please use caution with this issue report as it might be nonsense! I think @teppokoivula is using composer to install PW?

Yes, but in our case ProcessWire is a dependency — e.g. composer require processwire/processwire. Since ProcessWire requires some files under wire to be publicly accessible, we also use Composer scripts (post-install-cmd and post-update-cmd) that duplicate the wire directory to a public path.

That's probably not very helpful to you, though, as it sounds like you are doing something completely different: trying to set up a new project using ProcessWire as the base.

For our purpose "library" makes sense, since that's the way we use ProcessWire; as a library that is installed via Composer. That being said, I don't think that the type param really matters for our use case. Composer docs state that library "will copy the files to vendor", but at least based on very limited testing "project" seems to do the same by default.

If it didn't, that would be a major breaking change.

I wonder if this would affect the composer installer @teppokoivula ?

It shouldn't: wireframe-framework/processwire-composer-installer is only relevant for package types "pw-module" and "pw-site-profile".

TL;DR here is that 1) while I'm not aware of issues caused by changing type from "library" to "project", 2) for my specific use case "library" works well and may be what makes most sense, but it also seems that 3) for Bernhard's use case it seems that "project" would be the technically correct choice 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants