-
Notifications
You must be signed in to change notification settings - Fork 16
Change package type from library to wordpress-plugin #66
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
base: trunk
Are you sure you want to change the base?
Conversation
To use Composer for installing into the plugins folder, the type should be 'wordpress-plugin'.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #66 +/- ##
=========================================
Coverage 84.22% 84.22%
Complexity 96 96
=========================================
Files 8 8
Lines 507 507
=========================================
Hits 427 427
Misses 80 80
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Thanks for this PR @spenserhale🙇
I've shared my thoughts a few times:
AFAIK this change only benefits us and has ZERO downsides.
(Imo it should be part of #51 and added to the PR description for props-bot)
@Jameswlepage / @jeffpaul / @felixarntz - It would be really helpful to know why y'all vetoed this previously so we can either have a transparent conversation about it, or minimally document the decision and its rationale so we have something to point to when this gets brought up by others 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.
@spenserhale Thank you for the PR!
I'm marking this as requesting changes purely to clarify that it shouldn't be merged until a decision is made whether we want to do this - as we previously consciously decided against it.
@justlevine Sharing some of my thoughts:
This is why I believe we should maintain the |
Thanks very much for sharing @felixarntz 🙇
It's even harder to accept this when currently, this repo is not on w.org so this isn't just arbitrarily forcing people to install via a different source, it prevents anyone from using Abilities API as a Composer-managed plugin at all. Doubly when the request is now coming from a person who isnt on the core AI team. This is no longer theoretical, it's actual friction preventing experimentation with the Abilities API. |
Referring to the original post announcing the Abilities API: https://make.wordpress.org/ai/2025/07/17/abilities-api/ AFAIK, it was never the plan to make the Abilities API available as a plugin on WordPress.org, this is what the AI Experiements plugin was supposed to be. So my question here is, at what point was it decided to turn this into an installable plugin? What's the specific use case that we decided it needed to work as a plugin and not be used as a library via Composer? |
There were several discussions related to that, the idea is to have a featured plugin that helps to explore more ideas before they land in WordPress core after 6.9. One example that comes to my mind: |
There were also a handful of discussions as why for pre-6.9 it makes sense to also make this installable as a plugin (though not necessarily submitted to w.org due to the short timeline) . I'm AFK so I cant rly link dive right now, but iirc it boiled down to the following:
|
@gziolo @justlevine thanks for the context. Follow-up question. I only use Composer to manage dependencies for plugins, not install plugins for Composer-managed WordPress site builds. My understanding was that the recommended way to install plugins in a Composer-managed site build requires the use of https://wpackagist.org/, which requires the plugin to be available on WordPress.org. To the best of my knowledge, the only other way to install plugins on composer-managed WordPress sites is to manually configure and install them from the GitHub repository, as described in the original issue description. There's no way to Happy to be corrected here if I am wrong. |
There's a bit more nuance to this. WPackagist mirrors W.org, automatically creating a composer-installable facade so those plugins can
It's recommended inasmuch as W.org is recommended (vs a GitHub tagged release asset) and because it doesn't require the developer to explicitly make their plugin/theme Composer-installable. (It also includes the Installer Paths library
Mostly true. In order for Composer to autoinstall packages into a folder other than
That said, the consumer can still manually ...
"installer-paths": {
... The existing library type mapping
"path/to/wp-content/plugins/{$name}/": [ "wordpress/abilities-api" ]
} But the user would need to be aware that their existing type-based mappings aren't working for abilities-api, that it's not some composer/plugin bug but how our So worst case docs (and now this PR discussion) provides a troubleshooting path forward if we keep using "type:library", (but since docs don't fix bad DX we'd ideally have a practical justification for the unnecessary friction) |
Got it, thanks @justlevine Based on that, would it correct to say that it's posssible to require I understand your POV about DX and making it easier for folks to install and test this out, but I also see the POV that this code is just a library, not what one would consider a fully fledged plugin. It contains no specific functionality other than the underlying API, so I can see how the core AI team reps would want to keep it "tagged" as a library. If we adapt our installation steps to indicate this fact, and include the instructions to correctly installing and using this library as a dependancy of a custom plugin, we acheive both goals. |
@jonathanbossenger not sure I understood, so please correct/redirect me:
I think this is the root of the discrepancy so starting here and going backwards. If I understood this correctly, you're using "library" and "plugin" colloquially (from a user pov), while I (and Composer) are using the technical definition:
Good illustration of the practical difference in definitions, is how Another example of Core prior art is the REST API. Colloquially it's identical to the Abilities API in that it wasn't a "fully fledged plugin" from a user POV, but a So with that in mind:
Abilities API is already a plugin and already used as a plugin. Even the internal Composer setup behaves "as a plugin" (autoinitializing the endpoint and not like a "pure library". #55 is just one of several examples where the decision explicitly and intentionally conflicted with the stated reasons for "type:library", but unlike this PR created actual problems for using Abilities API as a pure Composer library). I'm not sure if the suggestion is that:
IMO either would be worse than the existing status quo, where the friction is only limited to Composer-based WP installations and can be troubleshooted/worked around via docs (and from a "meta" ensuring that we're proceeding consistently when there are practical tradeoffs, which is the real import to finally having this conversation and why I won't shut up abt it 😅) |
Case in point: We need to decide how to handle the built client assets. A "real" library wouldn't be enqueuing assets into WordPress, but since other decisions have already turned this repo into a "library-in-name-only" we need an approach on how to build and bundle these assets if a user wants to The weight of the downsides is exacerbated by our inconsistency which makes it hard to recommend the optimal solution. |
To use Composer for installing into the plugins folder, the type should be 'wordpress-plugin'.
To use Composer as commonly set up for WordPress, and in the mcp-adapter README, the type should be updated.
Docs:
With Composer
Until the plugin is available on Packagist, you will need to add the repository to your
composer.json
file.Then, require the package in your project: