Skip to content

Add scope input for scoped Composer dependencies (#309) - #19

Open
srtfisher wants to merge 1 commit into
developfrom
feature/composer-scoping-support
Open

Add scope input for scoped Composer dependencies (#309)#19
srtfisher wants to merge 1 commit into
developfrom
feature/composer-scoping-support

Conversation

@srtfisher

Copy link
Copy Markdown
Member

Adds release-time support for scoped Composer dependencies, unblocking the require-pruning step that was previously commented out citing alleyinteractive/create-wordpress-plugin#309.

Pairs with alleyinteractive/create-wordpress-plugin#537, which adds the opt-in scoping machinery (.scoper/, composer scope) to the plugin template.

What

New scope input (default false, fully backward compatible). When scope: true:

  1. Composer installs with dev dependencies (so php-scoper is available) instead of --no-dev.
  2. Runs composer scope, which prefixes runtime dependencies into vendor-prefixed/.
  3. Prunes require/require-dev from composer.json so the released artifact doesn't re-resolve (and re-conflict) dependencies when installed.

The prefixed vendor-prefixed/ directory is what ships; the plugin's .deployignore excludes vendor/, so dev dependencies installed in step 1 are never committed to the built branch.

When scope is false (the default), behaviour is unchanged: the existing --no-dev install runs and nothing is pruned.

Usage

A scoped plugin's built-release.yml opts in:

- uses: alleyinteractive/action-release@develop
  with:
    scope: true

Notes

  • YAML validated.
  • Behavioural verification depends on a downstream scoped plugin (create-wordpress-plugin#537); recommend testing together against a scoped fixture before merge.

🤖 Generated with Claude Code

When `scope: true`, install dev dependencies (so php-scoper is available),
run `composer scope`, and prune require/require-dev so the released
artifact ships the prefixed vendor-prefixed/ directory without re-resolving
dependencies. Backward compatible: defaults to false, preserving the
existing --no-dev install path.

Unblocks the previously-disabled require-pruning step.
Relates to alleyinteractive/create-wordpress-plugin#309.
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

Successfully merging this pull request may close these issues.

1 participant