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

Allow Composer Dependencies to be scoped #309

Open
srtfisher opened this issue Jan 8, 2024 · 0 comments
Open

Allow Composer Dependencies to be scoped #309

srtfisher opened this issue Jan 8, 2024 · 0 comments
Assignees
Labels
ci/cd PR checks, deploys, automation enhancement New feature or request php Requires understanding PHP

Comments

@srtfisher
Copy link
Member

Description

I would like to see our plugins not conflict with code in a project and act more isolated. When requiring a create-wordpress-plugin-based plugin, you're also including all the Composer dependencies that come with the plugin (especially if you require it with Composer!). This shouldn't be the case (and won't work if you're pushing to WordPress.org).

Plugins that are scaffolded from create-wordpress-plugin should have the option of a build step that will scope the plugin's dependencies and prune any dependencies from composer.json (we don't want to have them added back when you require the plugin). When a plugin is installed, the plugin will use the scoped plugin dependencies instead (My_Plugin_Vendor\Symfony\Console vs Symfony\Console).

h2. Acceptance Criteria

  1. Plugins can be scaffolded and include php-scoper that will automatically scope the plugin's vendor files for release.
  2. A plugin's src files should not be modified, only changed to reference and use the newly scoped classes (we don't want to scope the plugin's file, only vendor).
  3. A developer can opt to not scope their plugin during the configuration step.
  4. When a project is scoping its code, a test should be performed against pull requests that scope the project's code and then test against the plugin using the scoped-code.

Some prior art:

Use Case

When a user scaffolds a plugin they can optionally scope their vendor files to prevent any potential conflicts.

@srtfisher srtfisher added the enhancement New feature or request label Jan 8, 2024
@srtfisher srtfisher self-assigned this Jan 8, 2024
@kevinfodness kevinfodness added php Requires understanding PHP ci/cd PR checks, deploys, automation labels Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd PR checks, deploys, automation enhancement New feature or request php Requires understanding PHP
Projects
None yet
Development

No branches or pull requests

2 participants