Skip to content

Find the main plugin file by its header, as WordPress does - #59

Merged
ahegyes merged 3 commits into
trunkfrom
feat/remove-archive-entry-file
Oct 30, 2026
Merged

ahegyes merged 3 commits into
trunkfrom
feat/remove-archive-entry-file

Conversation

@ahegyes

@ahegyes ahegyes commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

The release takes the main plugin file to be the one PHP file at the project root whose first 8 KB carry a Plugin Name header, as WordPress does, so the entry-file and archive-entry-file inputs go.

Type of change

  • PHP source (Composer scripts, php-scoper config)
  • Reusable workflow (.github/workflows/reusable-*.yml)
  • PHPCS / PHPStan ruleset (php/quality-assurance/)
  • Node config (eslint, stylelint, playwright, tsconfig)
  • Documentation
  • Other

Checklist

  • Tests added or updated (PHPUnit suites under tests/Unit/)
  • composer test passes locally
  • If this changes a reusable workflow's inputs/outputs, docs/workflows.md is updated to reflect the new contract
  • If this changes a ruleset, downstream consumer behavior is considered (this repo ships to dev-trunk consumers immediately)

Breaking changes for downstream consumers

reusable-release.yml no longer declares entry-file or archive-entry-file, so a caller passing either fails at startup. No caller passes them: the plugin template, the only consumer, pins the previous trunk and passes neither, and its pin moves together with the removal of its recipe step that named archive-entry-file.

A release now fails when the project root holds no PHP file with a Plugin Name header in its first 8 KB, or more than one, including one that .distignore leaves out of the archive.

The branch also refreshes the Composer lock; the npm lock is unchanged.

The Composer lock trailed the latest releases. It moves to PHPStan
2.3.4, composer/composer 2.11.0, php-code-coverage 14.5.0,
roave/security-advisories and Symfony patch releases;
theseer/tokenizer drops out, as no package requires it any more.
symfony/filesystem and symfony/finder stay on 7.4, which
humbug/php-scoper 0.18 caps.

The npm lock stays as it is: under the host's seven-day release-age
cooldown, npm update would move 38 packages down, such as
@typescript-eslint 8.72.1 to 8.72.0, and none up.

No code change was needed.

Assisted-by: Claude Code:claude-opus-5-5
The release learns the main plugin file from an entry-file input that
defaults to <plugin-slug>.php, and can rename it in the archive through
archive-entry-file. No caller passes either input. WordPress needs
neither: it reads the first 8 KB of each PHP file at the plugin's root
and takes the one with a Plugin Name header.

Rows cover a build step that finds the file the same way: one header
file, named after the slug or not, is exported as ENTRY_FILE; none, two,
one only in a subfolder or one past the first 8 KB fail and name what
was found. The required-files rows keep the entry file under its own
name, and the rows for both inputs' validation and the rename step go.

Assisted-by: Claude Code:claude-opus-5-5
The release took the main plugin file from an entry-file input that
defaulted to <plugin-slug>.php, and could ship it under another name
through archive-entry-file. Both inputs asked the caller for something
the project already says: WordPress takes a plugin's main file to be
the PHP file at its root whose first 8 KB carry a Plugin Name header.
No caller passes either input, so dropping them now breaks no one.

A build step before the version check reads the root's PHP files the
same way and exports the one it finds as ENTRY_FILE, which the header,
floor and required-files checks read as before; none or several fail
the release and name what was found. The inputs, their validation, the
rename step and its fallback in the required-files check go, and
docs/workflows.md and docs/scripts-contract.md describe the main plugin
file as WordPress finds it. The required-files rows take neutral names.

Assisted-by: Claude Code:claude-opus-5-5
@ahegyes ahegyes changed the title Feat/remove archive entry file Find the main plugin file by its header, as WordPress does Oct 30, 2026
@ahegyes
ahegyes merged commit 8d53efd into trunk Oct 30, 2026
28 checks passed
@ahegyes
ahegyes deleted the feat/remove-archive-entry-file branch October 30, 2026 11:34
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