Skip to content

Add composer build command to package plugin zip - #22

Merged
adamsilverstein merged 1 commit into
mainfrom
add/build-zip-command
Jul 16, 2026
Merged

adamsilverstein merged 1 commit into
mainfrom
add/build-zip-command

Conversation

@adamsilverstein

Copy link
Copy Markdown
Owner

Fixes #21

What

Adds a single command to build a distributable zip for the WordPress.org plugin repository:

composer build

This produces dist/client-side-media-experiments.zip.

How

  • bin/build-zip.sh: copies runtime files via rsync --exclude-from=.distignore into a single top-level client-side-media-experiments/ directory (as required by WordPress.org) and zips it into dist/.
  • composer.json: adds a build script pointing at the shell script.
  • .distignore: extended to also exclude .claude, .wordpress-org, bin, dist, and README.md (the WordPress.org repo uses readme.txt). Since the release deploy workflow (10up/action-wordpress-plugin-deploy) uses the same .distignore, local builds and SVN deploys now share one exclusion list.
  • .gitignore: ignores dist/.
  • README.md: documents the command under a new Development section.

Verification

Ran composer build twice (idempotent). Zip contents:

client-side-media-experiments/
client-side-media-experiments/client-side-media-experiments.php
client-side-media-experiments/js/cross-origin-isolation-coep.js
client-side-media-experiments/js/heic-support.js
client-side-media-experiments/includes/heic-support.php
client-side-media-experiments/includes/settings.php
client-side-media-experiments/includes/cross-origin-isolation.php
client-side-media-experiments/readme.txt

No development files included; single top-level plugin directory.

Add bin/build-zip.sh, wired to 'composer build', which packages the
plugin into dist/client-side-media-experiments.zip using the .distignore
exclusion list so local builds match the release deploy workflow. Extend
.distignore to also exclude .claude, .wordpress-org, bin, dist, and
README.md, and document the command in README.md.

Fixes #21
@adamsilverstein
adamsilverstein merged commit 9fd6128 into main Jul 16, 2026
7 checks passed
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add/build-zip-command

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Add a build command to bundle the plugin into a distributable zip

1 participant