Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-autoloader": "^5.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just chiming in here with a thought (not reason to change anything at all, just something to think about): An alternative to trying to only load one version of the dependency would be to prefix the bundled dependencies.

Benefit: More robust, as it prevents conflicts due to minor differences between different versions if one plugin used an API slightly differently.
Drawback: Code will be "unnecessarily" (at least almost unnecessarily) loaded multiple times, and the initial setup is a little more tricky.

It's certainly a tradeoff. But I'd be inclined to eventually document both as reasonable alternative paths for pulling in and loading those dependencies.

"ext-json": "*",
"php": ">=7.4",
"ext-json": "*"
"wordpress/abilities-api": "^0.3.0",
"wordpress/mcp-adapter": "dev-trunk",
"wordpress/wp-ai-client": "dev-trunk"
},
"require-dev": {
"wp-coding-standards/wpcs": "^3.2.0",
Expand All @@ -26,14 +30,24 @@
"WordPress\\AI\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"automattic/jetpack-autoloader": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"php-http/discovery": true
},
"platform": {
"php": "7.4"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/WordPress/wp-ai-client"
}
],
"scripts": {
"format": "phpcbf --standard=phpcs.xml.dist",
"lint": "phpcs --standard=phpcs.xml.dist",
Expand Down
Loading